v1.1.0 新增通知、暂时性2折

This commit is contained in:
2025-01-01 02:00:06 +08:00
parent 0a79a2435b
commit ac656a4125
10 changed files with 595 additions and 40 deletions

View File

@@ -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)
}
}

View File

@@ -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{
{