- service/dto/controller 各拆 18 文件,一表一文件;跨表编排留在 outfit_generation_task_service - controller 共享 struct(outfit/member)保 /outfit/*、/member/* 前缀,路由零漂移(28 路径 diff 为空) - 修复 4 个缺失 g.Meta handler:/user/profile、/avatar/get、/body-measurement/get、/hairstyle/list 从 ALL 收敛为 GET - 工具包并入 agent/ 单包(weather/imagegen/avatar/scoring),NewCache 泛化 NewTTLCache - 虎皮椒支付适配器内联 service/payment_order_service.go,member 服务拆 4 表文件 - 冒烟 21 路径全绿 + 客户端 dart analyze 零 error
34 lines
1.1 KiB
Go
34 lines
1.1 KiB
Go
package controller
|
||
|
||
import (
|
||
"context"
|
||
|
||
"slogan-agent/common"
|
||
"slogan-agent/styleagent/model/dto"
|
||
"slogan-agent/styleagent/service"
|
||
|
||
"github.com/gogf/gf/v2/frame/g"
|
||
)
|
||
|
||
// PlanList 方案列表
|
||
func (c *outfit) PlanList(ctx context.Context, req *dto.OutfitPlanListReq) (res *dto.OutfitPlanListRes, err error) {
|
||
list, err := service.OutfitPlanService.ListPlans(ctx, common.GetUserId(g.RequestFromCtx(ctx)))
|
||
if err != nil {
|
||
return nil, err
|
||
}
|
||
return &dto.OutfitPlanListRes{List: list}, nil
|
||
}
|
||
|
||
// PlanDetail 方案详情(items + images + hairstyle)
|
||
func (c *outfit) PlanDetail(ctx context.Context, req *dto.OutfitPlanDetailReq) (res *dto.OutfitPlanDetailRes, err error) {
|
||
return service.OutfitPlanService.GetPlanDetail(ctx, common.GetUserId(g.RequestFromCtx(ctx)), req.PlanId)
|
||
}
|
||
|
||
// SelectMain 选定主方案(触发效果图生成)
|
||
func (c *outfit) SelectMain(ctx context.Context, req *dto.OutfitSelectMainReq) (res *struct{}, err error) {
|
||
if err = service.OutfitPlanService.SelectMain(ctx, common.GetUserId(g.RequestFromCtx(ctx)), req.PlanId); err != nil {
|
||
return nil, err
|
||
}
|
||
return &struct{}{}, nil
|
||
}
|