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 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
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
@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
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
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
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.data; | |
import io.quarkus.hibernate.orm.panache.PanacheEntity; | |
import javax.persistence.Entity; | |
@Entity | |
public class User extends PanacheEntity { | |
public String login; | |
public String email; | |
public String password; // Use e.g Bcrypt to encrypt password, don't store it as plain text :) |
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.security; | |
import org.eclipse.microprofile.jwt.Claims; | |
import org.jboss.logmanager.Logger; | |
import org.jose4j.jwt.JwtClaims; | |
import javax.enterprise.context.RequestScoped; | |
import java.util.Arrays; | |
import java.util.UUID; |
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.security; | |
public final class Roles { | |
private Roles() { } | |
public static final String USER = "User"; | |
public static final String SERVICE = "Service"; | |
public static final String ADMIN = "Admin"; | |
} |