package logic import ( "context" "app.yhyue.com/moapp/jyPoints/rpc/integral" "app.yhyue.com/moapp/jyPoints/api/internal/svc" "app.yhyue.com/moapp/jyPoints/api/internal/types" "github.com/tal-tech/go-zero/core/logx" ) type IntegralHarvestLogic struct { logx.Logger ctx context.Context svcCtx *svc.ServiceContext } func NewIntegralHarvestLogic(ctx context.Context, svcCtx *svc.ServiceContext) IntegralHarvestLogic { return IntegralHarvestLogic{ Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx, } } //新增积分 func (l *IntegralHarvestLogic) IntegralHarvest(req types.AddReq) (*types.AddResp, error) { // todo: add your logic here and delete this line result := &types.AddResp{} lsi := l.svcCtx.Integral resp, err := lsi.IntegralHarvest(l.ctx, &integral.Req{ UserId: req.UserId, AppId: req.AppId, EndDate: req.EndDate, BusinessType: req.BusinessType, BusinessTypeId: req.BusinessTypeId, Point: req.Point, PointType: req.PointType, OperationType: req.OperationType, }) if err != nil { return nil, err } result.Code = resp.Code result.Message = resp.Message return result, nil }