-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* sonar updates * update menu controller * add external api with tests --------- Co-authored-by: milan.horvath <[email protected]>
- Loading branch information
1 parent
c281e96
commit db40032
Showing
29 changed files
with
296 additions
and
222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
src/main/java/io/github/onecx/workspace/domain/models/WorkspaceInfo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package io.github.onecx.workspace.domain.models; | ||
|
||
public record WorkspaceInfo(String workspaceName, String description) { | ||
} |
32 changes: 32 additions & 0 deletions
32
.../github/onecx/workspace/rs/external/v1/controllers/WorkspaceExternalV1RestController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package io.github.onecx.workspace.rs.external.v1.controllers; | ||
|
||
import jakarta.enterprise.context.ApplicationScoped; | ||
import jakarta.inject.Inject; | ||
import jakarta.transaction.Transactional; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.core.Response; | ||
|
||
import org.tkit.quarkus.log.cdi.LogService; | ||
|
||
import gen.io.github.onecx.workspace.rs.external.v1.WorkspaceExternalV1Api; | ||
import io.github.onecx.workspace.domain.daos.WorkspaceDAO; | ||
import io.github.onecx.workspace.rs.external.v1.mappers.WorkspaceMapper; | ||
|
||
@LogService | ||
@ApplicationScoped | ||
@Path("/v1/workspaces/theme/{themeName}") | ||
@Transactional(Transactional.TxType.NOT_SUPPORTED) | ||
public class WorkspaceExternalV1RestController implements WorkspaceExternalV1Api { | ||
|
||
@Inject | ||
WorkspaceDAO workspaceDAO; | ||
|
||
@Inject | ||
WorkspaceMapper mapper; | ||
|
||
@Override | ||
public Response getWorkspaceInfos(String themeName) { | ||
var workspaceInfos = workspaceDAO.findByThemeName(themeName); | ||
return Response.ok(mapper.mapInfoList(workspaceInfos)).build(); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/main/java/io/github/onecx/workspace/rs/external/v1/mappers/WorkspaceMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package io.github.onecx.workspace.rs.external.v1.mappers; | ||
|
||
import java.util.List; | ||
import java.util.stream.Stream; | ||
|
||
import org.mapstruct.Mapper; | ||
import org.tkit.quarkus.rs.mappers.OffsetDateTimeMapper; | ||
|
||
import gen.io.github.onecx.workspace.rs.external.v1.model.WorkspaceInfoDTOV1; | ||
import gen.io.github.onecx.workspace.rs.external.v1.model.WorkspaceInfoListDTOV1; | ||
import io.github.onecx.workspace.domain.models.WorkspaceInfo; | ||
|
||
@Mapper(uses = { OffsetDateTimeMapper.class }) | ||
public abstract class WorkspaceMapper { | ||
|
||
public WorkspaceInfoListDTOV1 mapInfoList(Stream<WorkspaceInfo> data) { | ||
var result = new WorkspaceInfoListDTOV1(); | ||
result.setWorkspaces(mapInfo(data)); | ||
return result; | ||
} | ||
|
||
public abstract List<WorkspaceInfoDTOV1> mapInfo(Stream<WorkspaceInfo> page); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.