This commit is contained in:
laodaming
2023-06-02 19:24:58 +08:00
parent 6c717ce30e
commit 92b29d8006
12 changed files with 609 additions and 17 deletions

View File

@@ -16,13 +16,13 @@ func GetProductListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
userInfo := auth.CheckAuth(r)
var req types.GetProductListReq
if err := httpx.Parse(r, &req); err != nil {
httpx.ErrorCtx(r.Context(), w, err)
httpx.OkJsonCtx(r.Context(), w, types.Response{Code: 500, Message: err.Error()})
return
}
l := logic.NewGetProductListLogic(r.Context(), svcCtx)
resp, err := l.GetProductList(&req, userInfo)
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)
httpx.OkJsonCtx(r.Context(), w, types.Response{Code: 500, Message: err.Error()})
} else {
httpx.OkJsonCtx(r.Context(), w, resp)
}