123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- package logic
- import (
- "context"
- "app.yhyue.com/moapp/jyPoints/entity"
- "app.yhyue.com/moapp/jyPoints/service"
- "app.yhyue.com/moapp/jyPoints/rpc/integral"
- "app.yhyue.com/moapp/jyPoints/rpc/internal/svc"
- "github.com/tal-tech/go-zero/core/logx"
- )
- type IntegralConsumeLogic struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- logx.Logger
- }
- var (
- integralService = &service.IntegralService{}
- )
- func NewIntegralConsumeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *IntegralConsumeLogic {
- return &IntegralConsumeLogic{
- ctx: ctx,
- svcCtx: svcCtx,
- Logger: logx.WithContext(ctx),
- }
- }
- // 消耗积分
- func (l *IntegralConsumeLogic) IntegralConsume(in *integral.Req) (*integral.Resp, error) {
- // todo: add your logic here and delete this line
- result := &integral.Resp{}
- dat := entity.FlowJSON{}
- dat.UserId = in.UserId
- dat.PointType = in.PointType
- dat.BusinessTypeId = in.BusinessTypeId
- dat.BusinessType = in.BusinessType
- dat.Point = in.Point
- dat.EndDate = in.EndDate
- dat.AppId = in.AppId
- code,msg := integralService.IntegralConsumeService(dat)
- result.Code = code
- result.Message = msg
- return result,nil
- }
|