feat: add notify handlers and routes to manage-app

This commit is contained in:
张翔
2026-03-14 11:40:34 +08:00
parent 2d14b47bcf
commit 6453c8c6fb
7 changed files with 316 additions and 0 deletions
@@ -9,6 +9,9 @@ import cn.novalon.manage.sys.handler.menu.MenuHandler;
import cn.novalon.manage.sys.handler.role.SysRoleHandler;
import cn.novalon.manage.sys.handler.stats.StatsHandler;
import cn.novalon.manage.sys.handler.user.SysUserHandler;
import cn.novalon.manage.notify.handler.SysNoticeHandler;
import cn.novalon.manage.notify.handler.SysUserMessageHandler;
import cn.novalon.manage.file.handler.SysFileHandler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.function.server.RouterFunction;
@@ -152,4 +155,42 @@ public class SystemRouter {
.DELETE("/api/dict/data/{id}", dictHandler::deleteDictData)
.build();
}
@Bean
public RouterFunction<ServerResponse> noticeRoutes(SysNoticeHandler noticeHandler) {
return route()
.GET("/api/notices", noticeHandler::getAllNotices)
.GET("/api/notices/{id}", noticeHandler::getNoticeById)
.GET("/api/notices/status/{status}", noticeHandler::getNoticesByStatus)
.POST("/api/notices", noticeHandler::createNotice)
.PUT("/api/notices/{id}", noticeHandler::updateNotice)
.DELETE("/api/notices/{id}", noticeHandler::deleteNotice)
.build();
}
@Bean
public RouterFunction<ServerResponse> messageRoutes(SysUserMessageHandler messageHandler) {
return route()
.GET("/api/messages/user/{userId}", messageHandler::getMessagesByUser)
.GET("/api/messages/user/{userId}/unread", messageHandler::getUnreadCount)
.GET("/api/messages/user/{userId}/unread/list", messageHandler::getUnreadList)
.POST("/api/messages", messageHandler::createMessage)
.PUT("/api/messages/{id}/read", messageHandler::markAsRead)
.DELETE("/api/messages/{id}", messageHandler::deleteMessage)
.build();
}
@Bean
public RouterFunction<ServerResponse> fileRoutes(SysFileHandler fileHandler) {
return route()
.GET("/api/files", fileHandler::getAllFiles)
.GET("/api/files/{id}", fileHandler::getFileById)
.POST("/api/files/upload", fileHandler::uploadFile)
.GET("/api/files/{id}/download", fileHandler::downloadFile)
.GET("/api/files/download/{fileName}", fileHandler::downloadFileByName)
.GET("/api/files/{id}/preview", fileHandler::previewFile)
.GET("/api/files/preview/{fileName}", fileHandler::previewFileByName)
.DELETE("/api/files/{id}", fileHandler::deleteFile)
.build();
}
}