chore(docker): add root Dockerfile pinning ubi8/openjdk-21:1.21 + UID 1001 for lionsctl pipeline
Some checks failed
CI/CD Pipeline / pipeline (push) Failing after 4m2s
Some checks failed
CI/CD Pipeline / pipeline (push) Failing after 4m2s
This commit is contained in:
@@ -1,55 +1,55 @@
|
||||
package dev.lions.unionflow.server.resource;
|
||||
|
||||
import dev.lions.unionflow.server.api.dto.role.response.RoleResponse;
|
||||
import dev.lions.unionflow.server.entity.Role;
|
||||
import dev.lions.unionflow.server.service.RoleService;
|
||||
import jakarta.annotation.security.RolesAllowed;
|
||||
import jakarta.inject.Inject;
|
||||
import jakarta.ws.rs.GET;
|
||||
import jakarta.ws.rs.Path;
|
||||
import jakarta.ws.rs.Produces;
|
||||
import jakarta.ws.rs.core.MediaType;
|
||||
import org.eclipse.microprofile.openapi.annotations.Operation;
|
||||
import org.eclipse.microprofile.openapi.annotations.tags.Tag;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Resource REST pour les rôles.
|
||||
*/
|
||||
@Path("/api/roles")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@RolesAllowed({"ADMIN", "SUPER_ADMIN", "ADMIN_ORGANISATION"})
|
||||
@Tag(name = "Rôles", description = "Gestion des rôles et permissions")
|
||||
public class RoleResource {
|
||||
|
||||
@Inject
|
||||
RoleService roleService;
|
||||
|
||||
@GET
|
||||
@Operation(summary = "Liste tous les rôles actifs")
|
||||
public List<RoleResponse> listerTous() {
|
||||
return roleService.listerTousActifs().stream()
|
||||
.map(this::toDTO)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private RoleResponse toDTO(Role entity) {
|
||||
RoleResponse dto = new RoleResponse();
|
||||
dto.setId(entity.getId());
|
||||
dto.setCode(entity.getCode());
|
||||
dto.setLibelle(entity.getLibelle());
|
||||
dto.setDescription(entity.getDescription());
|
||||
dto.setTypeRole(entity.getTypeRole());
|
||||
dto.setNiveauHierarchique(entity.getNiveauHierarchique());
|
||||
if (entity.getOrganisation() != null) {
|
||||
dto.setOrganisationId(entity.getOrganisation().getId());
|
||||
dto.setNomOrganisation(entity.getOrganisation().getNom());
|
||||
}
|
||||
dto.setActif(entity.getActif());
|
||||
dto.setDateCreation(entity.getDateCreation());
|
||||
dto.setDateModification(entity.getDateModification());
|
||||
return dto;
|
||||
}
|
||||
}
|
||||
package dev.lions.unionflow.server.resource;
|
||||
|
||||
import dev.lions.unionflow.server.api.dto.role.response.RoleResponse;
|
||||
import dev.lions.unionflow.server.entity.Role;
|
||||
import dev.lions.unionflow.server.service.RoleService;
|
||||
import jakarta.annotation.security.RolesAllowed;
|
||||
import jakarta.inject.Inject;
|
||||
import jakarta.ws.rs.GET;
|
||||
import jakarta.ws.rs.Path;
|
||||
import jakarta.ws.rs.Produces;
|
||||
import jakarta.ws.rs.core.MediaType;
|
||||
import org.eclipse.microprofile.openapi.annotations.Operation;
|
||||
import org.eclipse.microprofile.openapi.annotations.tags.Tag;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Resource REST pour les rôles.
|
||||
*/
|
||||
@Path("/api/roles")
|
||||
@Produces(MediaType.APPLICATION_JSON)
|
||||
@RolesAllowed({"ADMIN", "SUPER_ADMIN", "ADMIN_ORGANISATION"})
|
||||
@Tag(name = "Rôles", description = "Gestion des rôles et permissions")
|
||||
public class RoleResource {
|
||||
|
||||
@Inject
|
||||
RoleService roleService;
|
||||
|
||||
@GET
|
||||
@Operation(summary = "Liste tous les rôles actifs")
|
||||
public List<RoleResponse> listerTous() {
|
||||
return roleService.listerTousActifs().stream()
|
||||
.map(this::toDTO)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
private RoleResponse toDTO(Role entity) {
|
||||
RoleResponse dto = new RoleResponse();
|
||||
dto.setId(entity.getId());
|
||||
dto.setCode(entity.getCode());
|
||||
dto.setLibelle(entity.getLibelle());
|
||||
dto.setDescription(entity.getDescription());
|
||||
dto.setTypeRole(entity.getTypeRole());
|
||||
dto.setNiveauHierarchique(entity.getNiveauHierarchique());
|
||||
if (entity.getOrganisation() != null) {
|
||||
dto.setOrganisationId(entity.getOrganisation().getId());
|
||||
dto.setNomOrganisation(entity.getOrganisation().getNom());
|
||||
}
|
||||
dto.setActif(entity.getActif());
|
||||
dto.setDateCreation(entity.getDateCreation());
|
||||
dto.setDateModification(entity.getDateModification());
|
||||
return dto;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user