This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package tech.donau.quarkify.user; | |
import tech.donau.quarkify.data.User; | |
import tech.donau.quarkify.security.TokenService; | |
import javax.inject.Inject; | |
import javax.transaction.Transactional; | |
import javax.ws.rs.*; | |
import javax.ws.rs.core.MediaType; | |
import javax.ws.rs.core.Response; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package tech.donau.quarkify; | |
import tech.donau.quarkify.data.User; | |
import tech.donau.quarkify.security.Roles; | |
import javax.annotation.security.*; | |
import javax.ws.rs.*; | |
import javax.ws.rs.core.*; | |
@Path("/hello") | |
@Produces(MediaType.APPLICATION_JSON) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
entity Region { | |
regionName String | |
} | |
entity Country { | |
countryName String | |
} | |
entity Location { | |
streetAddress String, | |
postalCode String, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Entity | |
public class JobPost extends PanacheEntity { | |
public String title; | |
public String description; | |
@ManyToOne | |
public User user; | |
@OneToMany | |
public List<JobProposal> proposals; | |
} | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.quarkify.posts; | |
import net.quarkify.data.*; | |
import javax.ws.rs.*; | |
import javax.ws.rs.core.MediaType; | |
import java.util.List; | |
import org.eclipse.microprofile.openapi.annotations.Operation; | |
@Path("/posts") | |
@Produces(MediaType.APPLICATION_JSON) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwaggerClient from "swagger-client"; | |
export default class Networking { | |
static client = new SwaggerClient({ | |
url: 'http://localhost:8080/openapi' | |
}); | |
// TODO security | |
static exec = ({endpoint, attributes, data, success, failure = res => console.log('failed on api call: ' + res)}) => { | |
this.client.then( | |
client => endpoint(client)(attributes, data), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {useEffect, useState} from 'react'; | |
import './App.css'; | |
import Networking from "./Networking"; | |
import Job from "./Job"; | |
function App() { | |
const [jobs, setJobs] = useState(null); | |
const [newJobContent, setNewJobContent] = useState(""); | |
const loadJobs = () => { | |
Networking.exec({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {useState} from "react"; | |
import Networking from "./Networking"; | |
export default function Job({job, ...props}) { | |
const [proposals, setProposals] = useState([]); | |
const [expanded, setExpanded] = useState(false); | |
const [newJobOfferContent, setNewJobOfferContent] = useState(""); | |
const expandJob = (jobId) => { | |
if (!expanded) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.quarkify.user; | |
import net.quarkify.data.User; | |
import net.quarkify.security.TokenService; | |
import org.eclipse.microprofile.openapi.annotations.Operation; | |
import javax.annotation.security.PermitAll; | |
import javax.inject.Inject; | |
import javax.transaction.Transactional; | |
import javax.ws.rs.*; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.quarkify; | |
import org.eclipse.microprofile.openapi.annotations.Components; | |
import org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition; | |
import org.eclipse.microprofile.openapi.annotations.enums.SecuritySchemeType; | |
import org.eclipse.microprofile.openapi.annotations.info.Info; | |
import org.eclipse.microprofile.openapi.annotations.security.SecurityRequirement; | |
import org.eclipse.microprofile.openapi.annotations.security.SecurityScheme; | |
import javax.ws.rs.core.Application; |