package logic import ( "context" "fmt" "bp.jydev.jianyu360.cn/ApplicationCenter/threeMarket/rpc/pb" "bp.jydev.jianyu360.cn/ApplicationCenter/threeMarket/api/internal/svc" "bp.jydev.jianyu360.cn/ApplicationCenter/threeMarket/api/internal/types" . "bp.jydev.jianyu360.cn/ApplicationCenter/threeMarket/public/service" "github.com/zeromicro/go-zero/core/logx" ) type AssessListLogic struct { logx.Logger ctx context.Context svcCtx *svc.ServiceContext } func NewAssessListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AssessListLogic { return &AssessListLogic{ Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx, } } func (l *AssessListLogic) AssessList(req *types.AssessListReq) (resp *types.Reply, err error) { // todo: add your logic here and delete this line resp = &types.Reply{} threeMarketResp, err := ThreemarketRpc.AssessList(l.ctx, &pb.AssessListReq{ Appid: req.AppId, GoodsCode: req.Goods_code, Impression: req.Impression, PageSize: req.Page_size, PageNum: req.Page_num, }) if threeMarketResp.ErrorMsg != "" { resp.Error_msg = threeMarketResp.ErrorMsg resp.Error_code = -1 l.Error(fmt.Sprintf("%+v", req), resp.Error_msg) } resp.Data = map[string]interface{}{ "count": threeMarketResp.Count, "access": threeMarketResp.Assess, "list": threeMarketResp.Data, } return }