This commit is contained in:
laodaming
2023-06-02 12:12:51 +08:00
parent 4df573bbc7
commit efd0f28d51
3 changed files with 28 additions and 17 deletions

View File

@@ -13,18 +13,14 @@ import (
func GetProductListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
//检测登录权限
userInfo, err := auth.CheckAuth(r)
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)
return
}
userInfo := auth.CheckAuth(r)
var req types.GetProductListReq
if err := httpx.Parse(r, &req); err != nil {
httpx.ErrorCtx(r.Context(), w, err)
return
}
l := logic.NewGetProductListLogic(r.Context(), svcCtx)
resp, err := l.GetProductList(&req, userInfo.UserId)
resp, err := l.GetProductList(&req, userInfo)
if err != nil {
httpx.ErrorCtx(r.Context(), w, err)
} else {