美团/京东/淘宝联盟适配器(选品/搜索/转链,未配置 key 优雅降级), CPS 四表五层骨架,方案驱动推荐零新增 LLM(发型/买同款/到店试穿/场合), 定时同步 + 点击日志 + 最近优惠;outfit_plan 容错迁移 occasion 列; Dockerfile 补 mesa/nodejs 运行时。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
36 lines
1.1 KiB
Go
36 lines
1.1 KiB
Go
package controller
|
|
|
|
import (
|
|
"context"
|
|
"errors"
|
|
|
|
"slogan-agent/common"
|
|
"slogan-agent/styleagent/model/dto"
|
|
"slogan-agent/styleagent/service"
|
|
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
)
|
|
|
|
// PlanRecommend 方案驱动推荐(发型/买同款/到店试穿/场合)
|
|
func (c *cps) PlanRecommend(ctx context.Context, req *dto.CpsPlanRecommendReq) (res *dto.CpsPlanRecommendRes, err error) {
|
|
userId := common.GetUserId(g.RequestFromCtx(ctx))
|
|
plan, err := service.OutfitPlanService.GetPlan(ctx, userId, req.PlanId)
|
|
if err != nil || plan == nil {
|
|
return nil, errors.New("方案不存在")
|
|
}
|
|
list, err := service.SceneCategoryMapService.Recommend(ctx, plan, req.Scene)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &dto.CpsPlanRecommendRes{List: list}, nil
|
|
}
|
|
|
|
// WardrobeUpgrade 衣橱升级款
|
|
func (c *cps) WardrobeUpgrade(ctx context.Context, req *dto.CpsWardrobeUpgradeReq) (res *dto.CpsWardrobeUpgradeRes, err error) {
|
|
list, err := service.SceneCategoryMapService.WardrobeUpgrade(ctx, common.GetUserId(g.RequestFromCtx(ctx)), req.ItemId)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &dto.CpsWardrobeUpgradeRes{List: list}, nil
|
|
}
|