This commit is contained in:
Hiven
2023-07-20 15:55:01 +08:00
parent 810f4fbee7
commit b93c2d4708
5 changed files with 41 additions and 13 deletions

View File

@@ -75,7 +75,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
{
Method: http.MethodGet,
Path: "/api/user/order-list",
Handler: GetUserOrderListHandler(serverCtx),
Handler: UserOrderListHandler(serverCtx),
},
{
Method: http.MethodGet,

View File

@@ -0,0 +1,28 @@
package handler
import (
"net/http"
"fusenapi/utils/basic"
"fusenapi/server/home-user-auth/internal/logic"
"fusenapi/server/home-user-auth/internal/svc"
"fusenapi/server/home-user-auth/internal/types"
)
func UserOrderListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.UserOrderListReq
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
if err != nil {
return
}
// 创建一个业务逻辑层实例
l := logic.NewUserOrderListLogic(r.Context(), svcCtx)
resp := l.UserOrderList(&req, userinfo)
basic.AfterLogic(w, r, resp)
}
}