diff --git a/pom.xml b/pom.xml
index 74a40b4..38b1ab9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
ActivityRecordsManagementREST class.
@@ -63,7 +57,7 @@ */ @Path("timetracker/activityRecordrecordsmgn") @RolesAllowed("users") -@Api(value = "/timetracker", description = "Manage and access ActivityRecord center ActivityRecords") // NOSONAR +@Tag(name = "/timetracker", description = "Manage and access ActivityRecord center ActivityRecords") // NOSONAR public class ActivityRecordsManagementREST implements ResourceContainer { private static final Log LOG = ExoLogger.getLogger(ActivityRecordsManagementREST.class); @@ -100,9 +94,9 @@ public ActivityRecordsManagementREST(ActivityRecordService activityRecordService @Path("activityrecord") @RolesAllowed("users") @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Retrieves all available subresources of current endpoint", httpMethod = "GET", response = Response.class, produces = "application/json") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.OK, message = "Request fulfilled"), - @ApiResponse(code = 500, message = "Internal server error") }) + @Operation(summary = "Retrieves all available subresources of current endpoint", method = "GET") + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Request fulfilled"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) public Response getActivityRecords() { try { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); @@ -143,9 +137,9 @@ public Response getActivityRecords() { @Path("activityrecord/list") @RolesAllowed("users") @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Retrieves all available subresources of current endpoint", httpMethod = "GET", response = Response.class, produces = "application/json") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.OK, message = "Request fulfilled"), - @ApiResponse(code = 500, message = "Internal server error") }) + @Operation(summary = "Retrieves all available subresources of current endpoint", method = "GET") + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Request fulfilled"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) public Response getActivityRecordsList(@Context UriInfo uriInfo, @QueryParam("search") String search, @QueryParam("activity") String activity, @@ -204,9 +198,9 @@ public Response getActivityRecordsList(@Context UriInfo uriInfo, @Path("activityrecord/last") @RolesAllowed("users") @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Retrieves all available subresources of current endpoint", httpMethod = "GET", response = Response.class, produces = "application/json") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.OK, message = "Request fulfilled"), - @ApiResponse(code = 500, message = "Internal server error") }) + @Operation(summary = "Retrieves all available subresources of current endpoint", method = "GET") + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Request fulfilled"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) public Response getActivityRecordsList(@Context UriInfo uriInfo, @QueryParam("userName") String userName) { try { @@ -234,9 +228,9 @@ public Response getActivityRecordsList(@Context UriInfo uriInfo, @Path("activityrecord/{day}") @RolesAllowed("users") @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Retrieves all available subresources of current endpoint", httpMethod = "GET", response = Response.class, produces = "application/json") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.OK, message = "Request fulfilled"), - @ApiResponse(code = 500, message = "Internal server error") }) + @Operation(summary = "Retrieves all available subresources of current endpoint", method = "GET") + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Request fulfilled"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) public Response getActivityRecords(@PathParam("day") String day) { try { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); @@ -260,11 +254,11 @@ public Response getActivityRecords(@PathParam("day") String day) { @Path("activityrecord") @RolesAllowed("users") @Consumes(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Creates a new ActivityRecord", httpMethod = "POST", response = Response.class, notes = "empty response") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"), - @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"), - @ApiResponse(code = 500, message = "Internal server error") }) - public Response createActivityRecord(@ApiParam(value = "ActivityRecord to save", required = true) ActivityRecord activityRecord) { + @Operation(summary = "Creates a new ActivityRecord", method = "POST", description = "empty response") + @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"), + @ApiResponse(responseCode = "401", description = "Unauthorized operation"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) + public Response createActivityRecord(@Parameter(description = "ActivityRecord to save", required = true) ActivityRecord activityRecord) { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); if (sourceIdentity == null) { return Response.status(Response.Status.UNAUTHORIZED).build(); @@ -297,11 +291,11 @@ public Response createActivityRecord(@ApiParam(value = "ActivityRecord to save", @PUT @Path("activityrecord") @RolesAllowed("users") - @ApiOperation(value = "Updates an existing ActivityRecord identified by its id", httpMethod = "PUT", response = Response.class, notes = "empty response") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"), - @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"), - @ApiResponse(code = 500, message = "Internal server error") }) - public Response updateActivityRecord(@ApiParam(value = "ActivityRecord to update", required = true) ActivityRecord activityRecord) { + @Operation(summary = "Updates an existing ActivityRecord identified by its id", method = "PUT", description = "empty response") + @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"), + @ApiResponse(responseCode = "401", description = "Unauthorized operation"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) + public Response updateActivityRecord(@Parameter(description = "ActivityRecord to update", required = true) ActivityRecord activityRecord) { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); if (sourceIdentity == null) { return Response.status(Response.Status.UNAUTHORIZED).build(); @@ -331,11 +325,11 @@ public Response updateActivityRecord(@ApiParam(value = "ActivityRecord to update @DELETE @Path("activityrecord/{activityrecordId}") @RolesAllowed("users") - @ApiOperation(value = "Deletes an existing ActivityRecord identified by its id", httpMethod = "DELETE", response = Response.class, notes = "empty response") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"), - @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"), - @ApiResponse(code = 500, message = "Internal server error") }) - public Response deleteActivityRecord(@ApiParam(value = "ActivityRecord technical id to delete", required = true) @PathParam("activityrecordId") Long activityRecordId) { + @Operation(summary = "Deletes an existing ActivityRecord identified by its id", method = "DELETE", description = "empty response") + @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"), + @ApiResponse(responseCode = "401", description = "Unauthorized operation"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) + public Response deleteActivityRecord(@Parameter(description = "ActivityRecord technical id to delete", required = true) @PathParam("activityrecordId") Long activityRecordId) { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); if (sourceIdentity == null) { return Response.status(Response.Status.UNAUTHORIZED).build(); diff --git a/time-tracker-services/src/main/java/org/exoplatform/timetracker/rest/ClientsManagementREST.java b/time-tracker-services/src/main/java/org/exoplatform/timetracker/rest/ClientsManagementREST.java index 72acb43..f8d47e2 100644 --- a/time-tracker-services/src/main/java/org/exoplatform/timetracker/rest/ClientsManagementREST.java +++ b/time-tracker-services/src/main/java/org/exoplatform/timetracker/rest/ClientsManagementREST.java @@ -34,7 +34,11 @@ import org.exoplatform.timetracker.dto.Client; import org.exoplatform.timetracker.service.ClientService; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; /** *ClientsManagementREST class.
@@ -44,7 +48,7 @@ */ @Path("timetracker/clientsmgn") @RolesAllowed("users") -@Api(value = "/timetracker", description = "Manage and access Clients") // NOSONAR +@Tag(name = "/timetracker", description = "Manage and access Clients") // NOSONAR public class ClientsManagementREST implements ResourceContainer { private static final Log LOG = ExoLogger.getLogger(ClientsManagementREST.class); @@ -72,9 +76,9 @@ public ClientsManagementREST(ClientService clientService, PortalContainer contai @Path("client") @RolesAllowed("users") @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Retrieves all available subresources of current endpoint", httpMethod = "GET", response = Response.class, produces = "application/json") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.OK, message = "Request fulfilled"), - @ApiResponse(code = 500, message = "Internal server error") }) + @Operation(summary = "Retrieves all available subresources of current endpoint", method = "GET") + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Request fulfilled"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) public Response getClients() { try { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); @@ -98,11 +102,11 @@ public Response getClients() { @Path("client") @RolesAllowed("time-tracking-managers") @Consumes(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Creates a new Client", httpMethod = "POST", response = Response.class, notes = "empty response") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"), - @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"), - @ApiResponse(code = 500, message = "Internal server error") }) - public Response createClient(@ApiParam(value = "Client to save", required = true) Client client) { + @Operation(summary = "Creates a new Client", method = "POST", description = "empty response") + @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"), + @ApiResponse(responseCode = "401", description = "Unauthorized operation"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) + public Response createClient(@Parameter(description = "Client to save", required = true) Client client) { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); if (sourceIdentity == null) { return Response.status(Response.Status.UNAUTHORIZED).build(); @@ -129,11 +133,11 @@ public Response createClient(@ApiParam(value = "Client to save", required = true @PUT @Path("client") @RolesAllowed("time-tracking-managers") - @ApiOperation(value = "Updates an existing Client identified by its id", httpMethod = "PUT", response = Response.class, notes = "empty response") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"), - @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"), - @ApiResponse(code = 500, message = "Internal server error") }) - public Response updateClient(@ApiParam(value = "Client to update", required = true) Client client) { + @Operation(summary = "Updates an existing Client identified by its id", method = "PUT", description = "empty response") + @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"), + @ApiResponse(responseCode = "401", description = "Unauthorized operation"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) + public Response updateClient(@Parameter(description = "Client to update", required = true) Client client) { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); if (sourceIdentity == null) { return Response.status(Response.Status.UNAUTHORIZED).build(); @@ -163,11 +167,11 @@ public Response updateClient(@ApiParam(value = "Client to update", required = tr @DELETE @Path("client/{clientId}") @RolesAllowed("time-tracking-managers") - @ApiOperation(value = "Deletes an existing Client identified by its id", httpMethod = "DELETE", response = Response.class, notes = "empty response") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"), - @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"), - @ApiResponse(code = 500, message = "Internal server error") }) - public Response deleteClient(@ApiParam(value = "Client technical id to delete", required = true) @PathParam("clientId") Long clientId) { + @Operation(summary = "Deletes an existing Client identified by its id", method = "DELETE", description = "empty response") + @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"), + @ApiResponse(responseCode = "401", description = "Unauthorized operation"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) + public Response deleteClient(@Parameter(description = "Client technical id to delete", required = true) @PathParam("clientId") Long clientId) { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); if (sourceIdentity == null) { return Response.status(Response.Status.UNAUTHORIZED).build(); diff --git a/time-tracker-services/src/main/java/org/exoplatform/timetracker/rest/CodesManagementREST.java b/time-tracker-services/src/main/java/org/exoplatform/timetracker/rest/CodesManagementREST.java index 18e4819..d7bbccc 100644 --- a/time-tracker-services/src/main/java/org/exoplatform/timetracker/rest/CodesManagementREST.java +++ b/time-tracker-services/src/main/java/org/exoplatform/timetracker/rest/CodesManagementREST.java @@ -16,7 +16,12 @@ */ package org.exoplatform.timetracker.rest; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; + import org.exoplatform.common.http.HTTPStatus; import org.exoplatform.container.PortalContainer; import org.exoplatform.services.log.ExoLogger; @@ -43,7 +48,7 @@ */ @Path("timetracker/codesmgn") @RolesAllowed("users") -@Api(value = "/timetracker", description = "Manage and access Codes") // NOSONAR +@Tag(name = "/timetracker", description = "Manage and access Codes") // NOSONAR public class CodesManagementREST implements ResourceContainer { private static final Log LOG = ExoLogger.getLogger(CodesManagementREST.class); @@ -71,9 +76,9 @@ public CodesManagementREST(CodesService codesService, PortalContainer container) @Path("activityCode") @RolesAllowed("users") @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Retrieves all available subresources of current endpoint", httpMethod = "GET", response = Response.class, produces = "application/json") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.OK, message = "Request fulfilled"), - @ApiResponse(code = 500, message = "Internal server error") }) + @Operation(summary = "Retrieves all available subresources of current endpoint", method = "GET") + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Request fulfilled"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) public Response getActivityCodes() { try { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); @@ -97,11 +102,11 @@ public Response getActivityCodes() { @Path("activityCode") @RolesAllowed("time-tracking-managers") @Consumes(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Creates a new ActivityCode", httpMethod = "POST", response = Response.class, notes = "empty response") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"), - @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"), - @ApiResponse(code = 500, message = "Internal server error") }) - public Response createActivityCode(@ApiParam(value = "ActivityCode to save", required = true) ActivityCode activityCode) { + @Operation(summary = "Creates a new ActivityCode", method = "POST", description = "empty response") + @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"), + @ApiResponse(responseCode = "401", description = "Unauthorized operation"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) + public Response createActivityCode(@Parameter(description = "ActivityCode to save", required = true) ActivityCode activityCode) { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); if (sourceIdentity == null) { return Response.status(Response.Status.UNAUTHORIZED).build(); @@ -128,11 +133,11 @@ public Response createActivityCode(@ApiParam(value = "ActivityCode to save", req @PUT @Path("activityCode") @RolesAllowed("time-tracking-managers") - @ApiOperation(value = "Updates an existing ActivityCode identified by its id", httpMethod = "PUT", response = Response.class, notes = "empty response") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"), - @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"), - @ApiResponse(code = 500, message = "Internal server error") }) - public Response updateActivityCode(@ApiParam(value = "ActivityCode to update", required = true) ActivityCode activityCode) { + @Operation(summary = "Updates an existing ActivityCode identified by its id", method = "PUT", description = "empty response") + @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"), + @ApiResponse(responseCode = "401", description = "Unauthorized operation"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) + public Response updateActivityCode(@Parameter(description = "ActivityCode to update", required = true) ActivityCode activityCode) { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); if (sourceIdentity == null) { return Response.status(Response.Status.UNAUTHORIZED).build(); @@ -162,11 +167,11 @@ public Response updateActivityCode(@ApiParam(value = "ActivityCode to update", r @DELETE @Path("activityCode/{activityCodeId}") @RolesAllowed("time-tracking-managers") - @ApiOperation(value = "Deletes an existing ActivityCode identified by its id", httpMethod = "DELETE", response = Response.class, notes = "empty response") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"), - @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"), - @ApiResponse(code = 500, message = "Internal server error") }) - public Response deleteActivityCode(@ApiParam(value = "ActivityCode technical id to delete", required = true) @PathParam("activityCodeId") Long activityCodeId) { + @Operation(summary = "Deletes an existing ActivityCode identified by its id", method = "DELETE", description = "empty response") + @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"), + @ApiResponse(responseCode = "401", description = "Unauthorized operation"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) + public Response deleteActivityCode(@Parameter(description = "ActivityCode technical id to delete", required = true) @PathParam("activityCodeId") Long activityCodeId) { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); if (sourceIdentity == null) { return Response.status(Response.Status.UNAUTHORIZED).build(); @@ -198,9 +203,9 @@ public Response deleteActivityCode(@ApiParam(value = "ActivityCode technical id @Path("subActivityCode") @RolesAllowed("users") @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Retrieves all available subresources of current endpoint", httpMethod = "GET", response = Response.class, produces = "application/json") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.OK, message = "Request fulfilled"), - @ApiResponse(code = 500, message = "Internal server error") }) + @Operation(summary = "Retrieves all available subresources of current endpoint", method = "GET") + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Request fulfilled"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) public Response getSubActivityCodes() { try { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); @@ -224,11 +229,11 @@ public Response getSubActivityCodes() { @Path("subActivityCode") @RolesAllowed("time-tracking-managers") @Consumes(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Creates a new SubActivityCode", httpMethod = "POST", response = Response.class, notes = "empty response") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"), - @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"), - @ApiResponse(code = 500, message = "Internal server error") }) - public Response createSubActivityCode(@ApiParam(value = "SubActivityCode to save", required = true) SubActivityCode subActivityCode) { + @Operation(summary = "Creates a new SubActivityCode", method = "POST", description = "empty response") + @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"), + @ApiResponse(responseCode = "401", description = "Unauthorized operation"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) + public Response createSubActivityCode(@Parameter(description = "SubActivityCode to save", required = true) SubActivityCode subActivityCode) { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); if (sourceIdentity == null) { return Response.status(Response.Status.UNAUTHORIZED).build(); @@ -255,11 +260,11 @@ public Response createSubActivityCode(@ApiParam(value = "SubActivityCode to save @PUT @Path("subActivityCode") @RolesAllowed("time-tracking-managers") - @ApiOperation(value = "Updates an existing SubActivityCode identified by its id", httpMethod = "PUT", response = Response.class, notes = "empty response") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"), - @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"), - @ApiResponse(code = 500, message = "Internal server error") }) - public Response updateSubActivityCode(@ApiParam(value = "SubActivityCode to update", required = true) SubActivityCode subActivityCode) { + @Operation(summary = "Updates an existing SubActivityCode identified by its id", method = "PUT", description = "empty response") + @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"), + @ApiResponse(responseCode = "401", description = "Unauthorized operation"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) + public Response updateSubActivityCode(@Parameter(description = "SubActivityCode to update", required = true) SubActivityCode subActivityCode) { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); if (sourceIdentity == null) { return Response.status(Response.Status.UNAUTHORIZED).build(); @@ -289,11 +294,11 @@ public Response updateSubActivityCode(@ApiParam(value = "SubActivityCode to upda @DELETE @Path("subActivityCode/{subActivityCodeId}") @RolesAllowed("time-tracking-managers") - @ApiOperation(value = "Deletes an existing SubActivityCode identified by its id", httpMethod = "DELETE", response = Response.class, notes = "empty response") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"), - @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"), - @ApiResponse(code = 500, message = "Internal server error") }) - public Response deleteSubActivityCode(@ApiParam(value = "SubActivityCode technical id to delete", required = true) @PathParam("subActivityCodeId") Long subActivityCodeId) { + @Operation(summary = "Deletes an existing SubActivityCode identified by its id", method = "DELETE", description = "empty response") + @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"), + @ApiResponse(responseCode = "401", description = "Unauthorized operation"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) + public Response deleteSubActivityCode(@Parameter(description = "SubActivityCode technical id to delete", required = true) @PathParam("subActivityCodeId") Long subActivityCodeId) { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); if (sourceIdentity == null) { return Response.status(Response.Status.UNAUTHORIZED).build(); @@ -326,9 +331,9 @@ public Response deleteSubActivityCode(@ApiParam(value = "SubActivityCode technic @Path("type") @RolesAllowed("users") @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Retrieves all available subresources of current endpoint", httpMethod = "GET", response = Response.class, produces = "application/json") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.OK, message = "Request fulfilled"), - @ApiResponse(code = 500, message = "Internal server error") }) + @Operation(summary = "Retrieves all available subresources of current endpoint", method = "GET") + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Request fulfilled"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) public Response getTypes() { try { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); @@ -352,11 +357,11 @@ public Response getTypes() { @Path("type") @RolesAllowed("time-tracking-managers") @Consumes(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Creates a new Type", httpMethod = "POST", response = Response.class, notes = "empty response") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"), - @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"), - @ApiResponse(code = 500, message = "Internal server error") }) - public Response createType(@ApiParam(value = "Type to save", required = true) Type type) { + @Operation(summary = "Creates a new Type", method = "POST", description = "empty response") + @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"), + @ApiResponse(responseCode = "401", description = "Unauthorized operation"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) + public Response createType(@Parameter(description = "Type to save", required = true) Type type) { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); if (sourceIdentity == null) { return Response.status(Response.Status.UNAUTHORIZED).build(); @@ -383,11 +388,11 @@ public Response createType(@ApiParam(value = "Type to save", required = true) Ty @PUT @Path("type") @RolesAllowed("time-tracking-managers") - @ApiOperation(value = "Updates an existing Type identified by its id", httpMethod = "PUT", response = Response.class, notes = "empty response") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"), - @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"), - @ApiResponse(code = 500, message = "Internal server error") }) - public Response updateType(@ApiParam(value = "Type to update", required = true) Type type) { + @Operation(summary = "Updates an existing Type identified by its id", method = "PUT", description = "empty response") + @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"), + @ApiResponse(responseCode = "401", description = "Unauthorized operation"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) + public Response updateType(@Parameter(description = "Type to update", required = true) Type type) { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); if (sourceIdentity == null) { return Response.status(Response.Status.UNAUTHORIZED).build(); @@ -417,11 +422,11 @@ public Response updateType(@ApiParam(value = "Type to update", required = true) @DELETE @Path("type/{typeId}") @RolesAllowed("time-tracking-managers") - @ApiOperation(value = "Deletes an existing Type identified by its id", httpMethod = "DELETE", response = Response.class, notes = "empty response") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"), - @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"), - @ApiResponse(code = 500, message = "Internal server error") }) - public Response deleteType(@ApiParam(value = "Type technical id to delete", required = true) @PathParam("typeId") Long typeId) { + @Operation(summary = "Deletes an existing Type identified by its id", method = "DELETE", description = "empty response") + @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"), + @ApiResponse(responseCode = "401", description = "Unauthorized operation"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) + public Response deleteType(@Parameter(description = "Type technical id to delete", required = true) @PathParam("typeId") Long typeId) { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); if (sourceIdentity == null) { return Response.status(Response.Status.UNAUTHORIZED).build(); @@ -453,9 +458,9 @@ public Response deleteType(@ApiParam(value = "Type technical id to delete", requ @Path("subType") @RolesAllowed("users") @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Retrieves all available subresources of current endpoint", httpMethod = "GET", response = Response.class, produces = "application/json") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.OK, message = "Request fulfilled"), - @ApiResponse(code = 500, message = "Internal server error") }) + @Operation(summary = "Retrieves all available subresources of current endpoint", method = "GET") + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Request fulfilled"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) public Response getSubTypes() { try { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); @@ -479,11 +484,11 @@ public Response getSubTypes() { @Path("subType") @RolesAllowed("time-tracking-managers") @Consumes(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Creates a new SubType", httpMethod = "POST", response = Response.class, notes = "empty response") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"), - @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"), - @ApiResponse(code = 500, message = "Internal server error") }) - public Response createSubType(@ApiParam(value = "SubType to save", required = true) SubType subType) { + @Operation(summary = "Creates a new SubType", method = "POST", description = "empty response") + @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"), + @ApiResponse(responseCode = "401", description = "Unauthorized operation"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) + public Response createSubType(@Parameter(description = "SubType to save", required = true) SubType subType) { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); if (sourceIdentity == null) { return Response.status(Response.Status.UNAUTHORIZED).build(); @@ -511,11 +516,11 @@ public Response createSubType(@ApiParam(value = "SubType to save", required = tr @PUT @Path("subType") @RolesAllowed("time-tracking-managers") - @ApiOperation(value = "Updates an existing SubType identified by its id", httpMethod = "PUT", response = Response.class, notes = "empty response") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"), - @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"), - @ApiResponse(code = 500, message = "Internal server error") }) - public Response updateSubType(@ApiParam(value = "SubType to update", required = true) SubType subType) { + @Operation(summary = "Updates an existing SubType identified by its id", method = "PUT", description = "empty response") + @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"), + @ApiResponse(responseCode = "401", description = "Unauthorized operation"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) + public Response updateSubType(@Parameter(description = "SubType to update", required = true) SubType subType) { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); if (sourceIdentity == null) { return Response.status(Response.Status.UNAUTHORIZED).build(); @@ -545,11 +550,11 @@ public Response updateSubType(@ApiParam(value = "SubType to update", required = @DELETE @Path("subType/{subTypeId}") @RolesAllowed("time-tracking-managers") - @ApiOperation(value = "Deletes an existing SubType identified by its id", httpMethod = "DELETE", response = Response.class, notes = "empty response") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"), - @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"), - @ApiResponse(code = 500, message = "Internal server error") }) - public Response deleteSubType(@ApiParam(value = "SubType technical id to delete", required = true) @PathParam("subTypeId") Long subTypeId) { + @Operation(summary = "Deletes an existing SubType identified by its id", method = "DELETE", description = "empty response") + @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"), + @ApiResponse(responseCode = "401", description = "Unauthorized operation"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) + public Response deleteSubType(@Parameter(description = "SubType technical id to delete", required = true) @PathParam("subTypeId") Long subTypeId) { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); if (sourceIdentity == null) { return Response.status(Response.Status.UNAUTHORIZED).build(); diff --git a/time-tracker-services/src/main/java/org/exoplatform/timetracker/rest/FeaturesManagementREST.java b/time-tracker-services/src/main/java/org/exoplatform/timetracker/rest/FeaturesManagementREST.java index 922346f..ba726ee 100644 --- a/time-tracker-services/src/main/java/org/exoplatform/timetracker/rest/FeaturesManagementREST.java +++ b/time-tracker-services/src/main/java/org/exoplatform/timetracker/rest/FeaturesManagementREST.java @@ -34,7 +34,11 @@ import org.exoplatform.timetracker.dto.Feature; import org.exoplatform.timetracker.service.FeatureService; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; /** *FeaturesManagementREST class.
@@ -44,7 +48,7 @@ */ @Path("timetracker/featuresmgn") @RolesAllowed("users") -@Api(value = "/timetracker", description = "Manage and access Features") // NOSONAR +@Tag(name = "/timetracker", description = "Manage and access Features") // NOSONAR public class FeaturesManagementREST implements ResourceContainer { private static final Log LOG = ExoLogger.getLogger(FeaturesManagementREST.class); @@ -72,9 +76,9 @@ public FeaturesManagementREST(FeatureService featureService, PortalContainer con @Path("feature") @RolesAllowed("users") @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Retrieves all available subresources of current endpoint", httpMethod = "GET", response = Response.class, produces = "application/json") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.OK, message = "Request fulfilled"), - @ApiResponse(code = 500, message = "Internal server error") }) + @Operation(summary = "Retrieves all available subresources of current endpoint", method = "GET") + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Request fulfilled"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) public Response getFeatures() { try { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); @@ -98,11 +102,11 @@ public Response getFeatures() { @Path("feature") @RolesAllowed("time-tracking-managers") @Consumes(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Creates a new Feature", httpMethod = "POST", response = Response.class, notes = "empty response") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"), - @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"), - @ApiResponse(code = 500, message = "Internal server error") }) - public Response createFeature(@ApiParam(value = "Feature to save", required = true) Feature feature) { + @Operation(summary = "Creates a new Feature", method = "POST", description = "empty response") + @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"), + @ApiResponse(responseCode = "401", description = "Unauthorized operation"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) + public Response createFeature(@Parameter(description = "Feature to save", required = true) Feature feature) { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); if (sourceIdentity == null) { return Response.status(Response.Status.UNAUTHORIZED).build(); @@ -129,11 +133,11 @@ public Response createFeature(@ApiParam(value = "Feature to save", required = tr @PUT @Path("feature") @RolesAllowed("time-tracking-managers") - @ApiOperation(value = "Updates an existing Feature identified by its id", httpMethod = "PUT", response = Response.class, notes = "empty response") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"), - @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"), - @ApiResponse(code = 500, message = "Internal server error") }) - public Response updateFeature(@ApiParam(value = "Feature to update", required = true) Feature feature) { + @Operation(summary = "Updates an existing Feature identified by its id", method = "PUT", description = "empty response") + @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"), + @ApiResponse(responseCode = "401", description = "Unauthorized operation"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) + public Response updateFeature(@Parameter(description = "Feature to update", required = true) Feature feature) { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); if (sourceIdentity == null) { return Response.status(Response.Status.UNAUTHORIZED).build(); @@ -163,11 +167,11 @@ public Response updateFeature(@ApiParam(value = "Feature to update", required = @DELETE @Path("feature/{featureId}") @RolesAllowed("time-tracking-managers") - @ApiOperation(value = "Deletes an existing Feature identified by its id", httpMethod = "DELETE", response = Response.class, notes = "empty response") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"), - @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"), - @ApiResponse(code = 500, message = "Internal server error") }) - public Response deleteFeature(@ApiParam(value = "Feature technical id to delete", required = true) @PathParam("featureId") Long featureId) { + @Operation(summary = "Deletes an existing Feature identified by its id", method = "DELETE", description = "empty response") + @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"), + @ApiResponse(responseCode = "401", description = "Unauthorized operation"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) + public Response deleteFeature(@Parameter(description = "Feature technical id to delete", required = true) @PathParam("featureId") Long featureId) { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); if (sourceIdentity == null) { return Response.status(Response.Status.UNAUTHORIZED).build(); diff --git a/time-tracker-services/src/main/java/org/exoplatform/timetracker/rest/FiltersManagementREST.java b/time-tracker-services/src/main/java/org/exoplatform/timetracker/rest/FiltersManagementREST.java index 95af528..540a346 100644 --- a/time-tracker-services/src/main/java/org/exoplatform/timetracker/rest/FiltersManagementREST.java +++ b/time-tracker-services/src/main/java/org/exoplatform/timetracker/rest/FiltersManagementREST.java @@ -16,7 +16,11 @@ */ package org.exoplatform.timetracker.rest; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import org.exoplatform.common.http.HTTPStatus; import org.exoplatform.container.PortalContainer; import org.exoplatform.services.log.ExoLogger; @@ -44,7 +48,7 @@ */ @Path("timetracker/filtersmgn") @RolesAllowed("users") -@Api(value = "/timetracker", description = "Manage and access Filters") // NOSONAR +@Tag(name = "/timetracker", description = "Manage and access Filters") // NOSONAR public class FiltersManagementREST implements ResourceContainer { private static final Log LOG = ExoLogger.getLogger(FiltersManagementREST.class); @@ -72,9 +76,9 @@ public FiltersManagementREST(FilterService filterService, PortalContainer contai @Path("filter") @RolesAllowed("users") @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Retrieves all available subresources of current endpoint", httpMethod = "GET", response = Response.class, produces = "application/json") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.OK, message = "Request fulfilled"), - @ApiResponse(code = 500, message = "Internal server error") }) + @Operation(summary = "Retrieves all available subresources of current endpoint", method = "GET") + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Request fulfilled"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) public Response getFilters() { try { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); @@ -98,11 +102,11 @@ public Response getFilters() { @Path("filter") @RolesAllowed("users") @Consumes(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Creates a new Filter", httpMethod = "POST", response = Response.class, notes = "empty response") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"), - @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"), - @ApiResponse(code = 500, message = "Internal server error") }) - public Response createFilter(@ApiParam(value = "Filter to save", required = true) FilterModel filter) { + @Operation(summary = "Creates a new Filter", method = "POST", description = "empty response") + @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"), + @ApiResponse(responseCode = "401", description = "Unauthorized operation"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) + public Response createFilter(@Parameter(description = "Filter to save", required = true) FilterModel filter) { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); if (sourceIdentity == null) { return Response.status(Response.Status.UNAUTHORIZED).build(); @@ -131,11 +135,11 @@ public Response createFilter(@ApiParam(value = "Filter to save", required = true @DELETE @Path("filter/{filterId}") @RolesAllowed("users") - @ApiOperation(value = "Deletes an existing Filter identified by its id", httpMethod = "DELETE", response = Response.class, notes = "empty response") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"), - @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"), - @ApiResponse(code = 500, message = "Internal server error") }) - public Response deleteFilter(@ApiParam(value = "Filter technical id to delete", required = true) @PathParam("filterId") Long filterId) { + @Operation(summary = "Deletes an existing Filter identified by its id", method = "DELETE", description = "empty response") + @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"), + @ApiResponse(responseCode = "401", description = "Unauthorized operation"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) + public Response deleteFilter(@Parameter(description = "Filter technical id to delete", required = true) @PathParam("filterId") Long filterId) { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); if (sourceIdentity == null) { return Response.status(Response.Status.UNAUTHORIZED).build(); diff --git a/time-tracker-services/src/main/java/org/exoplatform/timetracker/rest/ProjectsManagementREST.java b/time-tracker-services/src/main/java/org/exoplatform/timetracker/rest/ProjectsManagementREST.java index 40121be..d4224cd 100644 --- a/time-tracker-services/src/main/java/org/exoplatform/timetracker/rest/ProjectsManagementREST.java +++ b/time-tracker-services/src/main/java/org/exoplatform/timetracker/rest/ProjectsManagementREST.java @@ -34,7 +34,11 @@ import org.exoplatform.timetracker.dto.Project; import org.exoplatform.timetracker.service.ProjectService; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; /** *ProjectsManagementREST class.
@@ -44,7 +48,7 @@ */ @Path("timetracker/projectsmgn") @RolesAllowed("users") -@Api(value = "/timetracker", description = "Manage and access Projects") // NOSONAR +@Tag(name = "/timetracker", description = "Manage and access Projects") // NOSONAR public class ProjectsManagementREST implements ResourceContainer { private static final Log LOG = ExoLogger.getLogger(ProjectsManagementREST.class); @@ -72,9 +76,9 @@ public ProjectsManagementREST(ProjectService projectService, PortalContainer con @Path("project") @RolesAllowed("users") @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Retrieves all available subresources of current endpoint", httpMethod = "GET", response = Response.class, produces = "application/json") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.OK, message = "Request fulfilled"), - @ApiResponse(code = 500, message = "Internal server error") }) + @Operation(summary = "Retrieves all available subresources of current endpoint", method = "GET") + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Request fulfilled"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) public Response getProjects() { try { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); @@ -98,11 +102,11 @@ public Response getProjects() { @Path("project") @RolesAllowed("time-tracking-managers") @Consumes(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Creates a new Project", httpMethod = "POST", response = Response.class, notes = "empty response") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"), - @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"), - @ApiResponse(code = 500, message = "Internal server error") }) - public Response createProject(@ApiParam(value = "Project to save", required = true) Project project) { + @Operation(summary = "Creates a new Project", method = "POST", description = "empty response") + @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"), + @ApiResponse(responseCode = "401", description = "Unauthorized operation"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) + public Response createProject(@Parameter(description = "Project to save", required = true) Project project) { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); if (sourceIdentity == null) { return Response.status(Response.Status.UNAUTHORIZED).build(); @@ -129,11 +133,11 @@ public Response createProject(@ApiParam(value = "Project to save", required = tr @PUT @Path("project") @RolesAllowed("time-tracking-managers") - @ApiOperation(value = "Updates an existing Project identified by its id", httpMethod = "PUT", response = Response.class, notes = "empty response") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"), - @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"), - @ApiResponse(code = 500, message = "Internal server error") }) - public Response updateProject(@ApiParam(value = "Project to update", required = true) Project project) { + @Operation(summary = "Updates an existing Project identified by its id", method = "PUT", description = "empty response") + @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"), + @ApiResponse(responseCode = "401", description = "Unauthorized operation"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) + public Response updateProject(@Parameter(description = "Project to update", required = true) Project project) { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); if (sourceIdentity == null) { return Response.status(Response.Status.UNAUTHORIZED).build(); @@ -163,11 +167,11 @@ public Response updateProject(@ApiParam(value = "Project to update", required = @DELETE @Path("project/{projectId}") @RolesAllowed("time-tracking-managers") - @ApiOperation(value = "Deletes an existing Project identified by its id", httpMethod = "DELETE", response = Response.class, notes = "empty response") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"), - @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"), - @ApiResponse(code = 500, message = "Internal server error") }) - public Response deleteProject(@ApiParam(value = "Project technical id to delete", required = true) @PathParam("projectId") Long projectId) { + @Operation(summary = "Deletes an existing Project identified by its id", method = "DELETE", description = "empty response") + @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"), + @ApiResponse(responseCode = "401", description = "Unauthorized operation"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) + public Response deleteProject(@Parameter(description = "Project technical id to delete", required = true) @PathParam("projectId") Long projectId) { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); if (sourceIdentity == null) { return Response.status(Response.Status.UNAUTHORIZED).build(); diff --git a/time-tracker-services/src/main/java/org/exoplatform/timetracker/rest/SalesOrdersManagementREST.java b/time-tracker-services/src/main/java/org/exoplatform/timetracker/rest/SalesOrdersManagementREST.java index c1df56c..dceb200 100644 --- a/time-tracker-services/src/main/java/org/exoplatform/timetracker/rest/SalesOrdersManagementREST.java +++ b/time-tracker-services/src/main/java/org/exoplatform/timetracker/rest/SalesOrdersManagementREST.java @@ -34,7 +34,11 @@ import org.exoplatform.timetracker.dto.SalesOrder; import org.exoplatform.timetracker.service.SalesOrderService; -import io.swagger.annotations.*; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; /** *SalesOrdersManagementREST class.
@@ -44,7 +48,7 @@ */ @Path("timetracker/salesOrdersmgn") @RolesAllowed("users") -@Api(value = "/timetracker", description = "Manage and access SalesOrders") // NOSONAR +@Tag(name = "/timetracker", description = "Manage and access SalesOrders") // NOSONAR public class SalesOrdersManagementREST implements ResourceContainer { private static final Log LOG = ExoLogger.getLogger(SalesOrdersManagementREST.class); @@ -72,9 +76,9 @@ public SalesOrdersManagementREST(SalesOrderService salesOrderService, PortalCont @Path("salesOrder") @RolesAllowed("users") @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Retrieves all available subresources of current endpoint", httpMethod = "GET", response = Response.class, produces = "application/json") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.OK, message = "Request fulfilled"), - @ApiResponse(code = 500, message = "Internal server error") }) + @Operation(summary = "Retrieves all available subresources of current endpoint", method = "GET") + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Request fulfilled"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) public Response getSalesOrders() { try { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); @@ -96,10 +100,10 @@ public Response getSalesOrders() { @Path("salesOrder/{clientId}") @RolesAllowed("users") @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Retrieves all available subresources of current endpoint", httpMethod = "GET", response = Response.class, produces = "application/json") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.OK, message = "Request fulfilled"), - @ApiResponse(code = 500, message = "Internal server error") }) - public Response getSalesOrders(@ApiParam(value = "SalesOrder technical id to delete", required = true) @PathParam("clientId") Long clientId){ + @Operation(summary = "Retrieves all available subresources of current endpoint", method = "GET") + @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Request fulfilled"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) + public Response getSalesOrders(@Parameter(description = "SalesOrder technical id to delete", required = true) @PathParam("clientId") Long clientId){ try { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); if (sourceIdentity == null) { @@ -122,11 +126,11 @@ public Response getSalesOrders(@ApiParam(value = "SalesOrder technical id to del @Path("salesOrder") @RolesAllowed("time-tracking-managers") @Consumes(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Creates a new SalesOrder", httpMethod = "POST", response = Response.class, notes = "empty response") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"), - @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"), - @ApiResponse(code = 500, message = "Internal server error") }) - public Response createSalesOrder(@ApiParam(value = "SalesOrder to save", required = true) SalesOrder salesOrder) { + @Operation(summary = "Creates a new SalesOrder", method = "POST", description = "empty response") + @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"), + @ApiResponse(responseCode = "401", description = "Unauthorized operation"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) + public Response createSalesOrder(@Parameter(description = "SalesOrder to save", required = true) SalesOrder salesOrder) { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); if (sourceIdentity == null) { return Response.status(Response.Status.UNAUTHORIZED).build(); @@ -153,11 +157,11 @@ public Response createSalesOrder(@ApiParam(value = "SalesOrder to save", require @PUT @Path("salesOrder") @RolesAllowed("time-tracking-managers") - @ApiOperation(value = "Updates an existing SalesOrder identified by its id", httpMethod = "PUT", response = Response.class, notes = "empty response") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"), - @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"), - @ApiResponse(code = 500, message = "Internal server error") }) - public Response updateSalesOrder(@ApiParam(value = "SalesOrder to update", required = true) SalesOrder salesOrder) { + @Operation(summary = "Updates an existing SalesOrder identified by its id", method = "PUT", description = "empty response") + @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"), + @ApiResponse(responseCode = "401", description = "Unauthorized operation"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) + public Response updateSalesOrder(@Parameter(description = "SalesOrder to update", required = true) SalesOrder salesOrder) { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); if (sourceIdentity == null) { return Response.status(Response.Status.UNAUTHORIZED).build(); @@ -187,11 +191,11 @@ public Response updateSalesOrder(@ApiParam(value = "SalesOrder to update", requi @DELETE @Path("salesOrder/{salesOrderId}") @RolesAllowed("time-tracking-managers") - @ApiOperation(value = "Deletes an existing SalesOrder identified by its id", httpMethod = "DELETE", response = Response.class, notes = "empty response") - @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"), - @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"), - @ApiResponse(code = 500, message = "Internal server error") }) - public Response deleteSalesOrder(@ApiParam(value = "SalesOrder technical id to delete", required = true) @PathParam("salesOrderId") Long salesOrderId) { + @Operation(summary = "Deletes an existing SalesOrder identified by its id", method = "DELETE", description = "empty response") + @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"), + @ApiResponse(responseCode = "401", description = "Unauthorized operation"), + @ApiResponse(responseCode = "500", description = "Internal server error") }) + public Response deleteSalesOrder(@Parameter(description = "SalesOrder technical id to delete", required = true) @PathParam("salesOrderId") Long salesOrderId) { Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName); if (sourceIdentity == null) { return Response.status(Response.Status.UNAUTHORIZED).build(); diff --git a/time-tracker-services/src/main/java/org/exoplatform/timetracker/rest/SettingsManagementREST.java b/time-tracker-services/src/main/java/org/exoplatform/timetracker/rest/SettingsManagementREST.java index dd70cc4..0876a92 100644 --- a/time-tracker-services/src/main/java/org/exoplatform/timetracker/rest/SettingsManagementREST.java +++ b/time-tracker-services/src/main/java/org/exoplatform/timetracker/rest/SettingsManagementREST.java @@ -23,7 +23,7 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -import io.swagger.jaxrs.PATCH; +import org.exoplatform.services.rest.http.PATCH; import org.apache.commons.lang.StringUtils; import org.exoplatform.common.http.HTTPStatus; import org.exoplatform.container.PortalContainer; @@ -39,11 +39,12 @@ import org.exoplatform.timetracker.dto.WorkTime; import org.exoplatform.timetracker.service.TimeTrackerSettingsService; -import io.swagger.annotations.*; - +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.tags.Tag; import java.text.SimpleDateFormat; -import java.time.LocalDate; -import java.time.format.DateTimeFormatter; /** *
@@ -55,7 +56,7 @@
*/
@Path("timetracker/settings")
@RolesAllowed("users")
-@Api(value = "/timetracker", description = "Manage and access Codes") // NOSONAR
+@Tag(name = "/timetracker", description = "Manage and access Codes") // NOSONAR
public class SettingsManagementREST implements ResourceContainer {
private static final Log LOG = ExoLogger.getLogger(SettingsManagementREST.class);
@@ -91,9 +92,9 @@ public SettingsManagementREST(TimeTrackerSettingsService timeTrackerSettingsServ
@Path("worktime")
@RolesAllowed("users")
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Retrieves all available subresources of current endpoint", httpMethod = "GET", response = Response.class, produces = "application/json")
- @ApiResponses(value = { @ApiResponse(code = HTTPStatus.OK, message = "Request fulfilled"),
- @ApiResponse(code = 500, message = "Internal server error") })
+ @Operation(summary = "Retrieves all available subresources of current endpoint", method = "GET")
+ @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Request fulfilled"),
+ @ApiResponse(responseCode = "500", description = "Internal server error") })
public Response getWorkTimes() {
try {
Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName);
@@ -119,11 +120,11 @@ public Response getWorkTimes() {
@Path("worktime")
@RolesAllowed("time-tracking-managers")
@Consumes(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Creates a new WorkTime", httpMethod = "POST", response = Response.class, notes = "empty response")
- @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"),
- @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"),
- @ApiResponse(code = 500, message = "Internal server error") })
- public Response createWorkTime(@ApiParam(value = "WorkTime to save", required = true) WorkTime workTime) {
+ @Operation(summary = "Creates a new WorkTime", method = "POST", description = "empty response")
+ @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"),
+ @ApiResponse(responseCode = "401", description = "Unauthorized operation"),
+ @ApiResponse(responseCode = "500", description = "Internal server error") })
+ public Response createWorkTime(@Parameter(description = "WorkTime to save", required = true) WorkTime workTime) {
Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName);
if (sourceIdentity == null) {
return Response.status(Response.Status.UNAUTHORIZED).build();
@@ -162,11 +163,11 @@ public Response createWorkTime(@ApiParam(value = "WorkTime to save", required =
@PUT
@Path("worktime")
@RolesAllowed("time-tracking-managers")
- @ApiOperation(value = "Updates an existing WorkTime identified by its id", httpMethod = "PUT", response = Response.class, notes = "empty response")
- @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"),
- @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"),
- @ApiResponse(code = 500, message = "Internal server error") })
- public Response updateWorkTime(@ApiParam(value = "WorkTime to update", required = true) WorkTime workTime) {
+ @Operation(summary = "Updates an existing WorkTime identified by its id", method = "PUT", description = "empty response")
+ @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"),
+ @ApiResponse(responseCode = "401", description = "Unauthorized operation"),
+ @ApiResponse(responseCode = "500", description = "Internal server error") })
+ public Response updateWorkTime(@Parameter(description = "WorkTime to update", required = true) WorkTime workTime) {
Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName);
if (sourceIdentity == null) {
return Response.status(Response.Status.UNAUTHORIZED).build();
@@ -198,11 +199,11 @@ public Response updateWorkTime(@ApiParam(value = "WorkTime to update", required
@DELETE
@Path("workTime/{workTimeId}")
@RolesAllowed("time-tracking-managers")
- @ApiOperation(value = "Deletes an existing WorkTime identified by its id", httpMethod = "DELETE", response = Response.class, notes = "empty response")
- @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"),
- @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"),
- @ApiResponse(code = 500, message = "Internal server error") })
- public Response deleteWorkTime(@ApiParam(value = "WorkTime technical id to delete", required = true) @PathParam("workTimeId") Long workTimeId) {
+ @Operation(summary = "Deletes an existing WorkTime identified by its id", method = "DELETE", description = "empty response")
+ @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"),
+ @ApiResponse(responseCode = "401", description = "Unauthorized operation"),
+ @ApiResponse(responseCode = "500", description = "Internal server error") })
+ public Response deleteWorkTime(@Parameter(description = "WorkTime technical id to delete", required = true) @PathParam("workTimeId") Long workTimeId) {
Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName);
if (sourceIdentity == null) {
return Response.status(Response.Status.UNAUTHORIZED).build();
@@ -234,9 +235,9 @@ public Response deleteWorkTime(@ApiParam(value = "WorkTime technical id to delet
@Path("location")
@RolesAllowed("users")
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Retrieves all available subresources of current endpoint", httpMethod = "GET", response = Response.class, produces = "application/json")
- @ApiResponses(value = { @ApiResponse(code = HTTPStatus.OK, message = "Request fulfilled"),
- @ApiResponse(code = 500, message = "Internal server error") })
+ @Operation(summary = "Retrieves all available subresources of current endpoint", method = "GET")
+ @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Request fulfilled"),
+ @ApiResponse(responseCode = "500", description = "Internal server error") })
public Response getLocations() {
try {
Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName);
@@ -262,11 +263,11 @@ public Response getLocations() {
@Path("location")
@RolesAllowed("time-tracking-managers")
@Consumes(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Creates a new Location", httpMethod = "POST", response = Response.class, notes = "empty response")
- @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"),
- @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"),
- @ApiResponse(code = 500, message = "Internal server error") })
- public Response createLocation(@ApiParam(value = "Location to save", required = true) Location location) {
+ @Operation(summary = "Creates a new Location", method = "POST", description = "empty response")
+ @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"),
+ @ApiResponse(responseCode = "401", description = "Unauthorized operation"),
+ @ApiResponse(responseCode = "500", description = "Internal server error") })
+ public Response createLocation(@Parameter(description = "Location to save", required = true) Location location) {
Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName);
if (sourceIdentity == null) {
return Response.status(Response.Status.UNAUTHORIZED).build();
@@ -295,11 +296,11 @@ public Response createLocation(@ApiParam(value = "Location to save", required =
@PUT
@Path("location")
@RolesAllowed("time-tracking-managers")
- @ApiOperation(value = "Updates an existing Location identified by its id", httpMethod = "PUT", response = Response.class, notes = "empty response")
- @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"),
- @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"),
- @ApiResponse(code = 500, message = "Internal server error") })
- public Response updateLocation(@ApiParam(value = "Location to update", required = true) Location location) {
+ @Operation(summary = "Updates an existing Location identified by its id", method = "PUT", description = "empty response")
+ @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"),
+ @ApiResponse(responseCode = "401", description = "Unauthorized operation"),
+ @ApiResponse(responseCode = "500", description = "Internal server error") })
+ public Response updateLocation(@Parameter(description = "Location to update", required = true) Location location) {
Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName);
if (sourceIdentity == null) {
return Response.status(Response.Status.UNAUTHORIZED).build();
@@ -331,11 +332,11 @@ public Response updateLocation(@ApiParam(value = "Location to update", required
@DELETE
@Path("location/{code}")
@RolesAllowed("time-tracking-managers")
- @ApiOperation(value = "Deletes an existing Location identified by its id", httpMethod = "DELETE", response = Response.class, notes = "empty response")
- @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"),
- @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"),
- @ApiResponse(code = 500, message = "Internal server error") })
- public Response deleteLocation(@ApiParam(value = "Location technical id to delete", required = true) @PathParam("code") String code) {
+ @Operation(summary = "Deletes an existing Location identified by its id", method = "DELETE", description = "empty response")
+ @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"),
+ @ApiResponse(responseCode = "401", description = "Unauthorized operation"),
+ @ApiResponse(responseCode = "500", description = "Internal server error") })
+ public Response deleteLocation(@Parameter(description = "Location technical id to delete", required = true) @PathParam("code") String code) {
Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName);
if (sourceIdentity == null) {
return Response.status(Response.Status.UNAUTHORIZED).build();
@@ -367,9 +368,9 @@ public Response deleteLocation(@ApiParam(value = "Location technical id to delet
@Path("office")
@RolesAllowed("users")
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Retrieves all available subresources of current endpoint", httpMethod = "GET", response = Response.class, produces = "application/json")
- @ApiResponses(value = { @ApiResponse(code = HTTPStatus.OK, message = "Request fulfilled"),
- @ApiResponse(code = 500, message = "Internal server error") })
+ @Operation(summary = "Retrieves all available subresources of current endpoint", method = "GET")
+ @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Request fulfilled"),
+ @ApiResponse(responseCode = "500", description = "Internal server error") })
public Response getOffices() {
try {
Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName);
@@ -395,11 +396,11 @@ public Response getOffices() {
@Path("office")
@RolesAllowed("time-tracking-managers")
@Consumes(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Creates a new Office", httpMethod = "POST", response = Response.class, notes = "empty response")
- @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"),
- @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"),
- @ApiResponse(code = 500, message = "Internal server error") })
- public Response createOffice(@ApiParam(value = "Office to save", required = true) Office office) {
+ @Operation(summary = "Creates a new Office", method = "POST", description = "empty response")
+ @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"),
+ @ApiResponse(responseCode = "401", description = "Unauthorized operation"),
+ @ApiResponse(responseCode = "500", description = "Internal server error") })
+ public Response createOffice(@Parameter(description = "Office to save", required = true) Office office) {
Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName);
if (sourceIdentity == null) {
return Response.status(Response.Status.UNAUTHORIZED).build();
@@ -428,11 +429,11 @@ public Response createOffice(@ApiParam(value = "Office to save", required = true
@PUT
@Path("office")
@RolesAllowed("time-tracking-managers")
- @ApiOperation(value = "Updates an existing Office identified by its id", httpMethod = "PUT", response = Response.class, notes = "empty response")
- @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"),
- @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"),
- @ApiResponse(code = 500, message = "Internal server error") })
- public Response updateOffice(@ApiParam(value = "Office to update", required = true) Office office) {
+ @Operation(summary = "Updates an existing Office identified by its id", method = "PUT", description = "empty response")
+ @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"),
+ @ApiResponse(responseCode = "401", description = "Unauthorized operation"),
+ @ApiResponse(responseCode = "500", description = "Internal server error") })
+ public Response updateOffice(@Parameter(description = "Office to update", required = true) Office office) {
Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName);
if (sourceIdentity == null) {
return Response.status(Response.Status.UNAUTHORIZED).build();
@@ -464,11 +465,11 @@ public Response updateOffice(@ApiParam(value = "Office to update", required = tr
@DELETE
@Path("office/{code}")
@RolesAllowed("time-tracking-managers")
- @ApiOperation(value = "Deletes an existing Office identified by its id", httpMethod = "DELETE", response = Response.class, notes = "empty response")
- @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"),
- @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"),
- @ApiResponse(code = 500, message = "Internal server error") })
- public Response deleteOffice(@ApiParam(value = "Office technical id to delete", required = true) @PathParam("code") String code) {
+ @Operation(summary = "Deletes an existing Office identified by its id", method = "DELETE", description = "empty response")
+ @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"),
+ @ApiResponse(responseCode = "401", description = "Unauthorized operation"),
+ @ApiResponse(responseCode = "500", description = "Internal server error") })
+ public Response deleteOffice(@Parameter(description = "Office technical id to delete", required = true) @PathParam("code") String code) {
Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName);
if (sourceIdentity == null) {
return Response.status(Response.Status.UNAUTHORIZED).build();
@@ -500,9 +501,9 @@ public Response deleteOffice(@ApiParam(value = "Office technical id to delete",
@Path("other")
@RolesAllowed("users")
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Retrieves all available resources of current endpoint", httpMethod = "GET", response = Response.class, produces = "application/json")
- @ApiResponses(value = { @ApiResponse(code = HTTPStatus.OK, message = "Request fulfilled"),
- @ApiResponse(code = 500, message = "Internal server error") })
+ @Operation(summary = "Retrieves all available resources of current endpoint", method = "GET")
+ @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Request fulfilled"),
+ @ApiResponse(responseCode = "500", description = "Internal server error") })
public Response getOtherSettings() {
try {
Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName);
@@ -528,11 +529,11 @@ public Response getOtherSettings() {
@Path("others")
@RolesAllowed("time-tracking-managers")
@Consumes(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "update settings", httpMethod = "POST", response = Response.class, notes = "empty response")
- @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"),
- @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"),
- @ApiResponse(code = 500, message = "Internal server error") })
- public Response saveSettings(@ApiParam(value = "WorkTime to save", required = true) TimeTrackerSetting ttSettings) {
+ @Operation(summary = "update settings", method = "POST", description = "empty response")
+ @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"),
+ @ApiResponse(responseCode = "401", description = "Unauthorized operation"),
+ @ApiResponse(responseCode = "500", description = "Internal server error") })
+ public Response saveSettings(@Parameter(description = "WorkTime to save", required = true) TimeTrackerSetting ttSettings) {
Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName);
if (sourceIdentity == null) {
return Response.status(Response.Status.UNAUTHORIZED).build();
diff --git a/time-tracker-services/src/main/java/org/exoplatform/timetracker/rest/TeamManagementREST.java b/time-tracker-services/src/main/java/org/exoplatform/timetracker/rest/TeamManagementREST.java
index 654acac..8426b86 100644
--- a/time-tracker-services/src/main/java/org/exoplatform/timetracker/rest/TeamManagementREST.java
+++ b/time-tracker-services/src/main/java/org/exoplatform/timetracker/rest/TeamManagementREST.java
@@ -16,7 +16,12 @@
*/
package org.exoplatform.timetracker.rest;
-import io.swagger.annotations.*;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.responses.ApiResponse;
+import io.swagger.v3.oas.annotations.responses.ApiResponses;
+import io.swagger.v3.oas.annotations.tags.Tag;
+
import org.exoplatform.common.http.HTTPStatus;
import org.exoplatform.container.PortalContainer;
import org.exoplatform.services.log.ExoLogger;
@@ -46,7 +51,7 @@
*/
@Path("timetracker/teamsmgn")
@RolesAllowed("users")
-@Api(value = "/timetracker", description = "Manage and access Teams") // NOSONAR
+@Tag(name = "/timetracker", description = "Manage and access Teams") // NOSONAR
public class TeamManagementREST implements ResourceContainer {
private static final Log LOG = ExoLogger.getLogger(TeamManagementREST.class);
@@ -74,9 +79,9 @@ public TeamManagementREST(TeamService teamService, PortalContainer container) {
@Path("team")
@RolesAllowed("users")
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Retrieves all available subresources of current endpoint", httpMethod = "GET", response = Response.class, produces = "application/json")
- @ApiResponses(value = { @ApiResponse(code = HTTPStatus.OK, message = "Request fulfilled"),
- @ApiResponse(code = 500, message = "Internal server error") })
+ @Operation(summary = "Retrieves all available subresources of current endpoint", method = "GET")
+ @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Request fulfilled"),
+ @ApiResponse(responseCode = "500", description = "Internal server error") })
public Response getTeams() {
try {
Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName);
@@ -99,9 +104,9 @@ public Response getTeams() {
@Path("team/all")
@RolesAllowed("users")
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Retrieves all available subresources of current endpoint", httpMethod = "GET", response = Response.class, produces = "application/json")
- @ApiResponses(value = { @ApiResponse(code = HTTPStatus.OK, message = "Request fulfilled"),
- @ApiResponse(code = 500, message = "Internal server error") })
+ @Operation(summary = "Retrieves all available subresources of current endpoint", method = "GET")
+ @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Request fulfilled"),
+ @ApiResponse(responseCode = "500", description = "Internal server error") })
public Response getAll() {
try {
Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName);
@@ -125,11 +130,11 @@ public Response getAll() {
@Path("team")
@RolesAllowed("time-tracking-managers")
@Consumes(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Creates a new Team", httpMethod = "POST", response = Response.class, notes = "empty response")
- @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"),
- @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"),
- @ApiResponse(code = 500, message = "Internal server error") })
- public Response createTeam(@ApiParam(value = "Team to save", required = true) Team team) {
+ @Operation(summary = "Creates a new Team", method = "POST", description = "empty response")
+ @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"),
+ @ApiResponse(responseCode = "401", description = "Unauthorized operation"),
+ @ApiResponse(responseCode = "500", description = "Internal server error") })
+ public Response createTeam(@Parameter(description = "Team to save", required = true) Team team) {
Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName);
if (sourceIdentity == null) {
return Response.status(Response.Status.UNAUTHORIZED).build();
@@ -156,11 +161,11 @@ public Response createTeam(@ApiParam(value = "Team to save", required = true) Te
@PUT
@Path("team")
@RolesAllowed("time-tracking-managers")
- @ApiOperation(value = "Updates an existing Team identified by its id", httpMethod = "PUT", response = Response.class, notes = "empty response")
- @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"),
- @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"),
- @ApiResponse(code = 500, message = "Internal server error") })
- public Response updateTeam(@ApiParam(value = "Team to update", required = true) Team team) {
+ @Operation(summary = "Updates an existing Team identified by its id", method = "PUT", description = "empty response")
+ @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"),
+ @ApiResponse(responseCode = "401", description = "Unauthorized operation"),
+ @ApiResponse(responseCode = "500", description = "Internal server error") })
+ public Response updateTeam(@Parameter(description = "Team to update", required = true) Team team) {
Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName);
if (sourceIdentity == null) {
return Response.status(Response.Status.UNAUTHORIZED).build();
@@ -190,11 +195,11 @@ public Response updateTeam(@ApiParam(value = "Team to update", required = true)
@DELETE
@Path("team")
@RolesAllowed("time-tracking-managers")
- @ApiOperation(value = "Deletes an existing Team identified by its id", httpMethod = "DELETE", response = Response.class, notes = "empty response")
- @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"),
- @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"),
- @ApiResponse(code = 500, message = "Internal server error") })
- public Response deleteTeam(@ApiParam(value = "Team technical id to delete", required = true) @QueryParam("teamId") String teamId) {
+ @Operation(summary = "Deletes an existing Team identified by its id", method = "DELETE", description = "empty response")
+ @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"),
+ @ApiResponse(responseCode = "401", description = "Unauthorized operation"),
+ @ApiResponse(responseCode = "500", description = "Internal server error") })
+ public Response deleteTeam(@Parameter(description = "Team technical id to delete", required = true) @QueryParam("teamId") String teamId) {
Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName);
if (sourceIdentity == null) {
return Response.status(Response.Status.UNAUTHORIZED).build();
@@ -226,10 +231,10 @@ public Response deleteTeam(@ApiParam(value = "Team technical id to delete", requ
@Path("teamMember")
@RolesAllowed("users")
@Produces(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Retrieves all available subresources of current endpoint", httpMethod = "GET", response = Response.class, produces = "application/json")
- @ApiResponses(value = { @ApiResponse(code = HTTPStatus.OK, message = "Request fulfilled"),
- @ApiResponse(code = 500, message = "Internal server error") })
- public Response getTeamMembers(@ApiParam(value = "Team technical id", required = true) @QueryParam("teamId") String teamId) {
+ @Operation(summary = "Retrieves all available subresources of current endpoint", method = "GET")
+ @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "Request fulfilled"),
+ @ApiResponse(responseCode = "500", description = "Internal server error") })
+ public Response getTeamMembers(@Parameter(description = "Team technical id", required = true) @QueryParam("teamId") String teamId) {
try {
Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName);
if (sourceIdentity == null) {
@@ -252,11 +257,11 @@ public Response getTeamMembers(@ApiParam(value = "Team technical id", required =
@Path("teamMember")
@RolesAllowed("time-tracking-managers")
@Consumes(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Creates a new TeamMember", httpMethod = "POST", response = Response.class, notes = "empty response")
- @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"),
- @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"),
- @ApiResponse(code = 500, message = "Internal server error") })
- public Response createTeamMember(@ApiParam(value = "TeamMember to save", required = true) TeamMember teamMember) {
+ @Operation(summary = "Creates a new TeamMember", method = "POST", description = "empty response")
+ @ApiResponses(value = { @ApiResponse(responseCode = "204", description = "Request fulfilled"),
+ @ApiResponse(responseCode = "401", description = "Unauthorized operation"),
+ @ApiResponse(responseCode = "500", description = "Internal server error") })
+ public Response createTeamMember(@Parameter(description = "TeamMember to save", required = true) TeamMember teamMember) {
Identity sourceIdentity = Util.getAuthenticatedUserIdentity(portalContainerName);
if (sourceIdentity == null) {
return Response.status(Response.Status.UNAUTHORIZED).build();
@@ -284,11 +289,11 @@ public Response createTeamMember(@ApiParam(value = "TeamMember to save", require
@Path("teamMember/all")
@RolesAllowed("time-tracking-managers")
@Consumes(MediaType.APPLICATION_JSON)
- @ApiOperation(value = "Creates a new TeamMember", httpMethod = "POST", response = Response.class, notes = "empty response")
- @ApiResponses(value = { @ApiResponse(code = HTTPStatus.NO_CONTENT, message = "Request fulfilled"),
- @ApiResponse(code = HTTPStatus.UNAUTHORIZED, message = "Unauthorized operation"),
- @ApiResponse(code = 500, message = "Internal server error") })
- public Response createAllTeamMember(@ApiParam(value = "TeamMember to save", required = true) List