format and adaptation for front
This commit is contained in:
parent
0c222fffc5
commit
1c244aaefa
@ -12,7 +12,6 @@ import jakarta.persistence.ManyToOne;
|
|||||||
import jakarta.persistence.OneToMany;
|
import jakarta.persistence.OneToMany;
|
||||||
import jakarta.persistence.SequenceGenerator;
|
import jakarta.persistence.SequenceGenerator;
|
||||||
import jakarta.persistence.Table;
|
import jakarta.persistence.Table;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@ -35,7 +34,7 @@ public class Ji {
|
|||||||
@ManyToOne
|
@ManyToOne
|
||||||
@JoinColumn(name = "site_id") //@JsonIgnore
|
@JoinColumn(name = "site_id") //@JsonIgnore
|
||||||
public Site site;
|
public Site site;
|
||||||
|
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
@ManyToMany
|
@ManyToMany
|
||||||
@JoinTable(name = "ji_respos", // Table de liaison
|
@JoinTable(name = "ji_respos", // Table de liaison
|
||||||
@ -50,7 +49,9 @@ public class Ji {
|
|||||||
inverseJoinColumns = @JoinColumn(name = "user_id"))
|
inverseJoinColumns = @JoinColumn(name = "user_id"))
|
||||||
public List<User> participants;
|
public List<User> participants;
|
||||||
|
|
||||||
@OneToMany @JoinColumn(name = "instance_id") public List<Instance> instances;
|
@OneToMany
|
||||||
|
@JoinColumn(name = "instance_id")
|
||||||
|
public List<Instance> instances;
|
||||||
|
|
||||||
public Ji(String name, String description, List<User> respos, String date,
|
public Ji(String name, String description, List<User> respos, String date,
|
||||||
Site site) {
|
Site site) {
|
||||||
|
|||||||
@ -30,9 +30,11 @@ public class Endpoints {
|
|||||||
@Authenticated
|
@Authenticated
|
||||||
@Path("dashboard")
|
@Path("dashboard")
|
||||||
public Response getDashboard() {
|
public Response getDashboard() {
|
||||||
User user = userService.getUser(identity.getPrincipal().getName());
|
String username = identity.getPrincipal().getName();
|
||||||
|
User user = userService.getUser(username);
|
||||||
DashboardResponse dashboard = new DashboardResponse();
|
DashboardResponse dashboard = new DashboardResponse();
|
||||||
dashboard.roles = user.getRoles();
|
dashboard.roles = user.getRoles();
|
||||||
|
dashboard.name = username;
|
||||||
|
|
||||||
dashboard.jiRespo = user.jiRespo;
|
dashboard.jiRespo = user.jiRespo;
|
||||||
dashboard.jiParticipant = user.jiParticipant;
|
dashboard.jiParticipant = user.jiParticipant;
|
||||||
|
|||||||
@ -16,7 +16,7 @@ import org.eclipse.microprofile.openapi.annotations.responses.APIResponses;
|
|||||||
@Path("/api/ji")
|
@Path("/api/ji")
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@Consumes(MediaType.APPLICATION_JSON)
|
@Consumes(MediaType.APPLICATION_JSON)
|
||||||
public class JiResource {
|
public class JiEndpoints {
|
||||||
|
|
||||||
@Inject SecurityIdentity identity;
|
@Inject SecurityIdentity identity;
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user