This commit is contained in:
laodaming
2023-10-20 11:46:51 +08:00
parent 6253acf53c
commit 82f1e3984f
5 changed files with 13 additions and 17 deletions

View File

@@ -11,22 +11,22 @@ import (
"fusenapi/server/product/internal/types"
)
func GetRecommandProductListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
func GetRecommendProductListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.GetRecommandProductListReq
var req types.GetRecommendProductListReq
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
if err != nil {
return
}
// 创建一个业务逻辑层实例
l := logic.NewGetRecommandProductListLogic(r.Context(), svcCtx)
l := logic.NewGetRecommendProductListLogic(r.Context(), svcCtx)
rl := reflect.ValueOf(l)
basic.BeforeLogic(w, r, rl)
resp := l.GetRecommandProductList(&req, userinfo)
resp := l.GetRecommendProductList(&req, userinfo)
if !basic.AfterLogic(w, r, rl, resp) {
basic.NormalAfterLogic(w, r, resp)

View File

@@ -60,7 +60,7 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
{
Method: http.MethodGet,
Path: "/api/product/recommand",
Handler: GetRecommandProductListHandler(serverCtx),
Handler: GetRecommendProductListHandler(serverCtx),
},
{
Method: http.MethodGet,