feat:新增商户列表/保存用户信息

This commit is contained in:
Hiven
2023-08-14 14:40:50 +08:00
parent 9b0a18fcd8
commit 57e635c26c
22 changed files with 665 additions and 7 deletions

View File

@@ -0,0 +1,35 @@
package handler
import (
"net/http"
"reflect"
"fusenapi/utils/basic"
"fusenapi/server/base/internal/logic"
"fusenapi/server/base/internal/svc"
"fusenapi/server/base/internal/types"
)
func MerchantCategoryListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.MerchantCategoryListReq
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
if err != nil {
return
}
// 创建一个业务逻辑层实例
l := logic.NewMerchantCategoryListLogic(r.Context(), svcCtx)
rl := reflect.ValueOf(l)
basic.BeforeLogic(w, r, rl)
resp := l.MerchantCategoryList(&req, userinfo)
if !basic.AfterLogic(w, r, rl, resp) {
basic.NormalAfterLogic(w, r, resp)
}
}
}

View File

@@ -0,0 +1,22 @@
// Code generated by goctl. DO NOT EDIT.
package handler
import (
"net/http"
"fusenapi/server/base/internal/svc"
"github.com/zeromicro/go-zero/rest"
)
func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
server.AddRoutes(
[]rest.Route{
{
Method: http.MethodGet,
Path: "/api/base/merchant_category_list",
Handler: MerchantCategoryListHandler(serverCtx),
},
},
)
}