This commit is contained in:
laodaming
2023-06-07 11:35:04 +08:00
parent ef50dbb6fe
commit 3d492ff720
14 changed files with 117 additions and 117 deletions

View File

@@ -2,7 +2,6 @@ package handler
import (
"errors"
"fusenapi/utils/auth"
"net/http"
"github.com/zeromicro/go-zero/core/logx"
@@ -15,8 +14,6 @@ import (
func GetProductListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
//用户登录信息
userInfo := auth.CheckAuth(r)
var req types.GetProductListReq
if err := httpx.Parse(r, &req); err != nil {
httpx.OkJsonCtx(r.Context(), w, &types.Response{
@@ -28,7 +25,7 @@ func GetProductListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
}
l := logic.NewGetProductListLogic(r.Context(), svcCtx)
resp := l.GetProductList(&req, userInfo)
resp := l.GetProductList(&req)
if resp != nil {
httpx.OkJsonCtx(r.Context(), w, resp)
} else {

View File

@@ -2,7 +2,6 @@ package handler
import (
"errors"
"fusenapi/utils/auth"
"net/http"
"github.com/zeromicro/go-zero/core/logx"
@@ -15,8 +14,6 @@ import (
func GetSuccessRecommandHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
//用户登录信息
userInfo := auth.CheckAuth(r)
var req types.GetSuccessRecommandReq
if err := httpx.Parse(r, &req); err != nil {
httpx.OkJsonCtx(r.Context(), w, &types.Response{
@@ -28,7 +25,7 @@ func GetSuccessRecommandHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
}
l := logic.NewGetSuccessRecommandLogic(r.Context(), svcCtx)
resp := l.GetSuccessRecommand(&req, userInfo)
resp := l.GetSuccessRecommand(&req)
if resp != nil {
httpx.OkJsonCtx(r.Context(), w, resp)
} else {

View File

@@ -23,5 +23,6 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
Handler: GetSuccessRecommandHandler(serverCtx),
},
},
rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
)
}