🎨 新增公告通知模块

This commit is contained in:
2025-05-10 03:34:25 +08:00
parent bf220076dd
commit e074395859
15 changed files with 374 additions and 12 deletions

View File

@@ -5,6 +5,7 @@ import (
"git.echol.cn/loser/lckt/router/bot"
"git.echol.cn/loser/lckt/router/category"
"git.echol.cn/loser/lckt/router/example"
"git.echol.cn/loser/lckt/router/notice"
"git.echol.cn/loser/lckt/router/system"
"git.echol.cn/loser/lckt/router/user"
"git.echol.cn/loser/lckt/router/vip"
@@ -20,4 +21,5 @@ type RouterGroup struct {
Article article.RouterGroup
User user.UserRouter
Vip vip.VipRouter
Notice notice.NoticeRouter
}

9
router/notice/enter.go Normal file
View File

@@ -0,0 +1,9 @@
package notice
import api "git.echol.cn/loser/lckt/api/v1"
type RouterGroup struct{ NoticeRouter }
var (
notApi = api.ApiGroupApp.NoticeApiGroup.NoticeApi
)

28
router/notice/notice.go Normal file
View File

@@ -0,0 +1,28 @@
package notice
import (
"git.echol.cn/loser/lckt/middleware"
"github.com/gin-gonic/gin"
)
type NoticeRouter struct{}
// InitNoticeRouter 初始化 通知 路由信息
func (s *NoticeRouter) InitNoticeRouter(Router *gin.RouterGroup, PublicRouter *gin.RouterGroup) {
notRouter := Router.Group("not").Use(middleware.OperationRecord())
notRouterWithoutRecord := Router.Group("not")
notRouterWithoutAuth := PublicRouter.Group("not")
{
notRouter.POST("createNotice", notApi.CreateNotice) // 新建通知
notRouter.DELETE("deleteNotice", notApi.DeleteNotice) // 删除通知
notRouter.DELETE("deleteNoticeByIds", notApi.DeleteNoticeByIds) // 批量删除通知
notRouter.PUT("updateNotice", notApi.UpdateNotice) // 更新通知
}
{
notRouterWithoutRecord.GET("findNotice", notApi.FindNotice) // 根据ID获取通知
notRouterWithoutRecord.GET("getNoticeList", notApi.GetNoticeList) // 获取通知列表
}
{
notRouterWithoutAuth.GET("getNoticePublic", notApi.GetNoticePublic) // 通知开放接口
}
}