fix
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user