feat: add endpoint skeleton
This commit is contained in:
parent
3391a53daf
commit
7ff88a2487
2 changed files with 81 additions and 0 deletions
80
src/controllers/00-notification-controller.ts
Normal file
80
src/controllers/00-notification-controller.ts
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
import {
|
||||
Body,
|
||||
Controller,
|
||||
Delete,
|
||||
Get,
|
||||
Path,
|
||||
Post,
|
||||
Put,
|
||||
Query,
|
||||
Request,
|
||||
Route,
|
||||
Security,
|
||||
Tags,
|
||||
} from "tsoa";
|
||||
import { RequestWithUser } from "../interfaces/user";
|
||||
import HttpStatus from "../interfaces/http-status";
|
||||
|
||||
type NotificationCreate = {};
|
||||
type NotificationUpdate = {};
|
||||
|
||||
@Route("/api/v1/notification")
|
||||
@Tags("Notification")
|
||||
export class NotificationController extends Controller {
|
||||
@Get()
|
||||
@Security("keycloak")
|
||||
async getNotificationList(
|
||||
@Request() req: RequestWithUser,
|
||||
@Query() page: number = 1,
|
||||
@Query() pageSize: number = 30,
|
||||
@Query() query = "",
|
||||
) {
|
||||
const total = 0;
|
||||
|
||||
// TODO: implement
|
||||
|
||||
return {
|
||||
result: [],
|
||||
page,
|
||||
pageSize,
|
||||
total,
|
||||
};
|
||||
}
|
||||
|
||||
@Get("{notificationId}")
|
||||
@Security("keycloak")
|
||||
async getNotification(@Request() req: RequestWithUser, @Path() notificationId: string) {
|
||||
// TODO: implement
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
@Post()
|
||||
@Security("keycloak")
|
||||
async createNotification(@Request() req: RequestWithUser, @Body() body: NotificationCreate) {
|
||||
// TODO: implement
|
||||
|
||||
this.setStatus(HttpStatus.CREATED);
|
||||
return {};
|
||||
}
|
||||
|
||||
@Put("{notificationId}")
|
||||
@Security("keycloak")
|
||||
async updateNotification(
|
||||
@Request() req: RequestWithUser,
|
||||
@Path() notificationId: string,
|
||||
@Body() body: NotificationUpdate,
|
||||
) {
|
||||
// TODO: implement
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
@Delete("{notificationId}")
|
||||
@Security("keycloak")
|
||||
async deleteNotification(@Request() req: RequestWithUser, @Path() notificationId: string) {
|
||||
// TODO: implement
|
||||
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
|
@ -18,6 +18,7 @@
|
|||
{ "name": "OpenAPI" },
|
||||
{ "name": "Config" },
|
||||
{ "name": "Single-Sign On" },
|
||||
{ "name": "Notification" },
|
||||
{ "name": "Permission" },
|
||||
{ "name": "Address" },
|
||||
{ "name": "Branch" },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue