12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- package logic
- import (
- "context"
- "fmt"
- "points_service/entity"
- "points_service/service"
- "points_service/rpc/integral"
- "points_service/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.AddReq) (*integral.AddResp, error) {
- // todo: add your logic here and delete this line
- dat := entity.FlowJSON{}
- dat.UserId = in.UserId
- dat.PointType = 1
- dat.BusinessTypeId = 1
- dat.BusinessType = "1"
- dat.Point = in.CountPoints
- dat.EndDate = "2021-03-10"
- dat.AppId = 10000
- dat.Sort = entity.ReduceCode
- fmt.Println(integralService.IntegralConsumeService(dat))
- return &integral.AddResp{
- Status: true,
- },nil
- }
|