feat: 添加通知微服务,支持站内通知已读状态

This commit is contained in:
zetaloop
2026-04-24 12:44:59 +08:00
parent 95f2f10f9f
commit b557bfcc2e
52 changed files with 7035 additions and 30 deletions
@@ -0,0 +1,39 @@
// Code generated by goctl. DO NOT EDIT.
// goctl 1.10.1
package handler
import (
"net/http"
notification "juwan-backend/app/notification/api/internal/handler/notification"
"juwan-backend/app/notification/api/internal/svc"
"github.com/zeromicro/go-zero/rest"
)
func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
server.AddRoutes(
[]rest.Route{
{
// 获取通知列表
Method: http.MethodGet,
Path: "/notifications",
Handler: notification.ListNotificationsHandler(serverCtx),
},
{
// 标记已读
Method: http.MethodPut,
Path: "/notifications/:id/read",
Handler: notification.ReadNotificationHandler(serverCtx),
},
{
// 全部已读
Method: http.MethodPut,
Path: "/notifications/read-all",
Handler: notification.ReadAllNotificationsHandler(serverCtx),
},
},
rest.WithPrefix("/api/v1"),
)
}