Loading src/main/java/org/etsi/osl/hypo/api/tmf/services/catalog/api/rest/ServiceCandidateResource.java +9 −17 Original line number Diff line number Diff line Loading @@ -4,7 +4,6 @@ import static jakarta.ws.rs.core.MediaType.APPLICATION_JSON; import io.quarkus.security.Authenticated; import jakarta.annotation.security.PermitAll; import jakarta.inject.Inject; import jakarta.validation.Valid; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.DELETE; Loading Loading @@ -42,10 +41,14 @@ public class ServiceCandidateResource { private static final Logger logger = Logger.getLogger(ServiceCandidateResource.class); @Inject ServiceCandidateService serviceCandidateService; private final ServiceCandidateService serviceCandidateService; public static final String SERVICE_CANDIDATE = "serviceCandidate"; public ServiceCandidateResource(ServiceCandidateService serviceCandidateService) { this.serviceCandidateService = serviceCandidateService; } @POST @Path(ApplicationProperties.TMF_URL_VERSION + "/" + SERVICE_CANDIDATE) @Produces(MediaType.APPLICATION_JSON) Loading Loading @@ -79,7 +82,6 @@ public class ServiceCandidateResource { @PermitAll @Path(ApplicationProperties.TMF_URL_VERSION + "/" + SERVICE_CANDIDATE) @Produces(APPLICATION_JSON) @Consumes(APPLICATION_JSON) @Operation( summary = "List or find all ServiceCandidate objects", description = "This operation list or find ServiceCandidate entities.") Loading @@ -101,7 +103,6 @@ public class ServiceCandidateResource { @PermitAll @Path(ApplicationProperties.TMF_URL_VERSION + "/" + SERVICE_CANDIDATE + "/{id}") @Produces(APPLICATION_JSON) @Consumes(APPLICATION_JSON) @Operation( summary = "Retrieves a ServiceCandidate by ID", description = Loading @@ -120,8 +121,7 @@ public class ServiceCandidateResource { @Content( mediaType = APPLICATION_JSON, schema = @Schema(implementation = ErrorMessage.class))) public Response getById(@RestPath String id, @RestQuery String fields, @Context UriInfo uriInfo) throws Exception { public Response getById(@RestPath String id, @RestQuery String fields, @Context UriInfo uriInfo) { logger.info("Get service candidate with id : " + id); Map<String, String> criteriaParams = UtilService.getRequestedCriteriaForFiltering(uriInfo); fields = (fields == null || fields.isEmpty()) ? "" : fields + ",serviceSpecification"; Loading Loading @@ -174,17 +174,10 @@ public class ServiceCandidateResource { @DELETE @Path(ApplicationProperties.TMF_URL_VERSION + "/" + SERVICE_CANDIDATE + "/{id}") @Produces(APPLICATION_JSON) @Consumes(APPLICATION_JSON) @Operation( summary = "Deletes a ServiceCandidate by ID", description = "This operation deletes a ServiceCandidate entity.") @APIResponse( responseCode = "200", description = "Deleted", content = @Content( mediaType = APPLICATION_JSON, schema = @Schema(implementation = ServiceCandidate.class))) @APIResponse(responseCode = "204", description = "Deleted") @APIResponse( responseCode = "404", description = "Not Found", Loading @@ -194,9 +187,8 @@ public class ServiceCandidateResource { schema = @Schema(implementation = ErrorMessage.class))) public Response delete(@RestPath String id) { logger.info("Delete service candidate with id : " + id); ServiceCandidate deletedServiceCandidate = serviceCandidateService.responseFromDeleteRequest(id); logger.info("Successful delete service candidate with id : " + id); return Response.ok(deletedServiceCandidate).build(); return Response.noContent().build(); } } src/main/java/org/etsi/osl/hypo/api/tmf/services/catalog/api/services/ServiceCandidateService.java +2 −4 Original line number Diff line number Diff line Loading @@ -97,10 +97,8 @@ public class ServiceCandidateService { .toList(); } public ServiceCandidate responseFromDeleteRequest(String serviceCandidateId) { ServiceCandidateEntity serviceCandidateEntity = deleteServiceCandidate(serviceCandidateId); return serviceCatalogueApiEntityToResponseMapper.serviceCandidateEntityToResponseDTO( serviceCandidateEntity); public void responseFromDeleteRequest(String serviceCandidateId) { deleteServiceCandidate(serviceCandidateId); } @Transactional Loading Loading
src/main/java/org/etsi/osl/hypo/api/tmf/services/catalog/api/rest/ServiceCandidateResource.java +9 −17 Original line number Diff line number Diff line Loading @@ -4,7 +4,6 @@ import static jakarta.ws.rs.core.MediaType.APPLICATION_JSON; import io.quarkus.security.Authenticated; import jakarta.annotation.security.PermitAll; import jakarta.inject.Inject; import jakarta.validation.Valid; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.DELETE; Loading Loading @@ -42,10 +41,14 @@ public class ServiceCandidateResource { private static final Logger logger = Logger.getLogger(ServiceCandidateResource.class); @Inject ServiceCandidateService serviceCandidateService; private final ServiceCandidateService serviceCandidateService; public static final String SERVICE_CANDIDATE = "serviceCandidate"; public ServiceCandidateResource(ServiceCandidateService serviceCandidateService) { this.serviceCandidateService = serviceCandidateService; } @POST @Path(ApplicationProperties.TMF_URL_VERSION + "/" + SERVICE_CANDIDATE) @Produces(MediaType.APPLICATION_JSON) Loading Loading @@ -79,7 +82,6 @@ public class ServiceCandidateResource { @PermitAll @Path(ApplicationProperties.TMF_URL_VERSION + "/" + SERVICE_CANDIDATE) @Produces(APPLICATION_JSON) @Consumes(APPLICATION_JSON) @Operation( summary = "List or find all ServiceCandidate objects", description = "This operation list or find ServiceCandidate entities.") Loading @@ -101,7 +103,6 @@ public class ServiceCandidateResource { @PermitAll @Path(ApplicationProperties.TMF_URL_VERSION + "/" + SERVICE_CANDIDATE + "/{id}") @Produces(APPLICATION_JSON) @Consumes(APPLICATION_JSON) @Operation( summary = "Retrieves a ServiceCandidate by ID", description = Loading @@ -120,8 +121,7 @@ public class ServiceCandidateResource { @Content( mediaType = APPLICATION_JSON, schema = @Schema(implementation = ErrorMessage.class))) public Response getById(@RestPath String id, @RestQuery String fields, @Context UriInfo uriInfo) throws Exception { public Response getById(@RestPath String id, @RestQuery String fields, @Context UriInfo uriInfo) { logger.info("Get service candidate with id : " + id); Map<String, String> criteriaParams = UtilService.getRequestedCriteriaForFiltering(uriInfo); fields = (fields == null || fields.isEmpty()) ? "" : fields + ",serviceSpecification"; Loading Loading @@ -174,17 +174,10 @@ public class ServiceCandidateResource { @DELETE @Path(ApplicationProperties.TMF_URL_VERSION + "/" + SERVICE_CANDIDATE + "/{id}") @Produces(APPLICATION_JSON) @Consumes(APPLICATION_JSON) @Operation( summary = "Deletes a ServiceCandidate by ID", description = "This operation deletes a ServiceCandidate entity.") @APIResponse( responseCode = "200", description = "Deleted", content = @Content( mediaType = APPLICATION_JSON, schema = @Schema(implementation = ServiceCandidate.class))) @APIResponse(responseCode = "204", description = "Deleted") @APIResponse( responseCode = "404", description = "Not Found", Loading @@ -194,9 +187,8 @@ public class ServiceCandidateResource { schema = @Schema(implementation = ErrorMessage.class))) public Response delete(@RestPath String id) { logger.info("Delete service candidate with id : " + id); ServiceCandidate deletedServiceCandidate = serviceCandidateService.responseFromDeleteRequest(id); logger.info("Successful delete service candidate with id : " + id); return Response.ok(deletedServiceCandidate).build(); return Response.noContent().build(); } }
src/main/java/org/etsi/osl/hypo/api/tmf/services/catalog/api/services/ServiceCandidateService.java +2 −4 Original line number Diff line number Diff line Loading @@ -97,10 +97,8 @@ public class ServiceCandidateService { .toList(); } public ServiceCandidate responseFromDeleteRequest(String serviceCandidateId) { ServiceCandidateEntity serviceCandidateEntity = deleteServiceCandidate(serviceCandidateId); return serviceCatalogueApiEntityToResponseMapper.serviceCandidateEntityToResponseDTO( serviceCandidateEntity); public void responseFromDeleteRequest(String serviceCandidateId) { deleteServiceCandidate(serviceCandidateId); } @Transactional Loading