feat: add notify handlers and routes to manage-app
This commit is contained in:
+41
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user