v1.1.0 新增通知、暂时性2折
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package notification
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"qnc-server/app/user/cmd/api/internal/logic/notification"
|
||||
"qnc-server/app/user/cmd/api/internal/svc"
|
||||
"qnc-server/common/result"
|
||||
)
|
||||
|
||||
func GetNotificationsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
l := notification.NewGetNotificationsLogic(r.Context(), svcCtx)
|
||||
resp, err := l.GetNotifications()
|
||||
result.HttpResult(r, w, resp, err)
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
"net/http"
|
||||
|
||||
auth "qnc-server/app/user/cmd/api/internal/handler/auth"
|
||||
notification "qnc-server/app/user/cmd/api/internal/handler/notification"
|
||||
pay "qnc-server/app/user/cmd/api/internal/handler/pay"
|
||||
product "qnc-server/app/user/cmd/api/internal/handler/product"
|
||||
query "qnc-server/app/user/cmd/api/internal/handler/query"
|
||||
@@ -27,6 +28,18 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||
rest.WithPrefix("/api/v1"),
|
||||
)
|
||||
|
||||
server.AddRoutes(
|
||||
[]rest.Route{
|
||||
{
|
||||
// get notifications
|
||||
Method: http.MethodGet,
|
||||
Path: "/notification/list",
|
||||
Handler: notification.GetNotificationsHandler(serverCtx),
|
||||
},
|
||||
},
|
||||
rest.WithPrefix("/api/v1"),
|
||||
)
|
||||
|
||||
server.AddRoutes(
|
||||
[]rest.Route{
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user