-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
206 additions
and
25 deletions.
There are no files selected for viewing
62 changes: 38 additions & 24 deletions
62
client-generation/rcktbs-commons/packages/openapi-client/src/model/openapi.ts
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 |
---|---|---|
@@ -1,39 +1,53 @@ | ||
// Generated using typescript-generator version 3.1.1185 on 2023-02-27 14:28:43. | ||
// Generated using typescript-generator version 3.2.1263 on 2024-04-16 18:09:05. | ||
|
||
export interface Activity { | ||
type: "comment" | "dossier"; | ||
id: string; | ||
dated: Date; | ||
user: string; | ||
type: "comment" | "dossier"; | ||
id: string; | ||
dated: string; | ||
user: string; | ||
} | ||
|
||
export interface CommentActivity extends Activity { | ||
type: "comment"; | ||
comment: string; | ||
attachments: string[]; | ||
type: "comment"; | ||
comment: string; | ||
attachments: string[]; | ||
} | ||
|
||
export interface PermissionCmd { | ||
objectId: string; | ||
identityIds: string[]; | ||
permissionId: number; | ||
} | ||
|
||
export interface RecommendationActivity extends Activity { | ||
type: "dossier"; | ||
objectId: string; | ||
objectTitle: string; | ||
message: string; | ||
type: "dossier"; | ||
objectId: string; | ||
objectTitle: string; | ||
message: string; | ||
} | ||
|
||
export interface Tile { | ||
id: string; | ||
type: TileType; | ||
name: string; | ||
description: string; | ||
commentCount: number; | ||
itemCount: number; | ||
userPreference: UserPreference; | ||
created: Date; | ||
lastModified: Date; | ||
id: string; | ||
type: TileType; | ||
name: string; | ||
description: string; | ||
commentCount: number; | ||
itemCount: number; | ||
userPreference: UserPreference; | ||
created: string; | ||
lastModified: string; | ||
} | ||
|
||
export type TileType = "search-config" | "pinboard" | "briefing" | "showroom"; | ||
export type ActivityUnion = CommentActivity | RecommendationActivity; | ||
|
||
export type UserPreference = "favored" | "disfavored"; | ||
export enum TileType { | ||
SEARCH_CONFIG = "search-config", | ||
PINBOARD = "pinboard", | ||
BRIEFING = "briefing", | ||
SHOWROOM = "showroom", | ||
} | ||
|
||
export type ActivityUnion = CommentActivity | RecommendationActivity; | ||
export enum UserPreference { | ||
FAVORED = "favored", | ||
DISFAVORED = "disfavored", | ||
} |
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
27 changes: 27 additions & 0 deletions
27
...ns-rest-openapi/src/test/java/io/rocketbase/commons/openapi/sample/dto/PermissionCmd.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,27 @@ | ||
package io.rocketbase.commons.openapi.sample.dto; | ||
|
||
import io.hypersistence.tsid.TSID; | ||
import jakarta.validation.constraints.NotNull; | ||
import jakarta.validation.constraints.Size; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import lombok.experimental.SuperBuilder; | ||
|
||
import java.util.Set; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@SuperBuilder | ||
public class PermissionCmd { | ||
|
||
@NotNull | ||
protected TSID objectId; | ||
|
||
@Size(min = 1) | ||
protected Set<TSID> identityIds; | ||
|
||
@NotNull | ||
protected Short permissionId; | ||
} |
24 changes: 24 additions & 0 deletions
24
...st-openapi/src/test/java/io/rocketbase/commons/openapi/sample/resource/PermissionApi.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,24 @@ | ||
package io.rocketbase.commons.openapi.sample.resource; | ||
|
||
import io.rocketbase.commons.generator.MutationHook; | ||
import io.rocketbase.commons.openapi.sample.dto.PermissionCmd; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.security.SecurityRequirement; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import jakarta.validation.Valid; | ||
import jakarta.validation.constraints.NotNull; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.util.MimeTypeUtils; | ||
import org.springframework.web.bind.annotation.PutMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
|
||
@SecurityRequirement(name = "OAuth2", scopes = {"user"}) | ||
@Tag(name = "permissionCommand", description = "create or update object's permissions") | ||
public interface PermissionApi { | ||
|
||
@MutationHook(invalidateKeys = {"element,detail,${body.objectId}", "activities,${body.objectId}"}) | ||
@Operation(description = "add/update permission for a set of identities") | ||
@PutMapping(value = {"/element/set-permission"}, consumes = MimeTypeUtils.APPLICATION_JSON_VALUE, produces = MimeTypeUtils.APPLICATION_JSON_VALUE) | ||
ResponseEntity<Void> setPermission(@Valid @NotNull @RequestBody PermissionCmd cmd); | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
...api/src/test/java/io/rocketbase/commons/openapi/sample/resource/PermissionController.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,13 @@ | ||
package io.rocketbase.commons.openapi.sample.resource; | ||
|
||
import io.rocketbase.commons.openapi.sample.dto.PermissionCmd; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
public class PermissionController implements PermissionApi { | ||
@Override | ||
public ResponseEntity<Void> setPermission(PermissionCmd cmd) { | ||
return null; | ||
} | ||
} |
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