package logic import ( "app.yhyue.com/moapp/jyPoints/api/internal/svc" "app.yhyue.com/moapp/jyPoints/api/internal/types" "app.yhyue.com/moapp/jyPoints/rpc/integral" "context" "github.com/zeromicro/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, SourceType: req.SourceType, SourceId: req.SourceId, Point: req.Point, PointType: req.PointType, Abstract: req.Abstract, OperationType: req.OperationType, }) if err != nil { return nil, err } result.Code = resp.Code result.Message = resp.Message result.SerialNumber = resp.SerialNumber return result, nil }