jws-backend/src/controllers/00-notification-controller.ts
2024-10-29 15:21:09 +07:00

80 lines
1.5 KiB
TypeScript

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 {};
}
}