integralconsumelogic.go 1015 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. package logic
  2. import (
  3. "context"
  4. "points_service/entity"
  5. "points_service/service"
  6. "points_service/rpc/integral"
  7. "points_service/rpc/internal/svc"
  8. "github.com/tal-tech/go-zero/core/logx"
  9. )
  10. type IntegralConsumeLogic struct {
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. logx.Logger
  14. }
  15. var (
  16. integralService = &service.IntegralService{}
  17. )
  18. func NewIntegralConsumeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *IntegralConsumeLogic {
  19. return &IntegralConsumeLogic{
  20. ctx: ctx,
  21. svcCtx: svcCtx,
  22. Logger: logx.WithContext(ctx),
  23. }
  24. }
  25. // 消耗积分
  26. func (l *IntegralConsumeLogic) IntegralConsume(in *integral.AddReq) (*integral.AddResp, error) {
  27. // todo: add your logic here and delete this line
  28. dat := entity.FlowJSON{}
  29. dat.UserId = "ABC"
  30. dat.PointType = 1
  31. dat.BusinessTypeId = 1
  32. dat.BusinessType = "1"
  33. dat.Point = 1
  34. dat.EndDate = "2021-03-10"
  35. dat.AppId = 10000
  36. dat.Sort = false
  37. integralService.IntegralConsumeService(dat)
  38. return &integral.AddResp{
  39. Status: true,
  40. },nil
  41. }