2025-09-30
未读变已读 查询列表排序
This commit is contained in:
23
src/controller/message.controller.ts
Normal file
23
src/controller/message.controller.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import {Body, Controller, Get, Post, Query} from "@nestjs/common";
|
||||
import {MessageService} from "../service";
|
||||
import {ProgramGroupMessageEntity, ReadDto} from "../entity";
|
||||
|
||||
@Controller('message')
|
||||
export class MessageController {
|
||||
|
||||
constructor(private messageService: MessageService) {
|
||||
}
|
||||
|
||||
// 获取未读消息
|
||||
@Get("unread")
|
||||
async getUnread(@Query() readDto: ReadDto) {
|
||||
return await this.messageService.getUnread(readDto)
|
||||
}
|
||||
|
||||
// 将未读消息置为已读
|
||||
@Post('read')
|
||||
async read(@Body() readDto: ReadDto) {
|
||||
return await this.messageService.read(readDto)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user