feat: 添加通知微服务,支持站内通知已读状态
This commit is contained in:
@@ -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"),
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user