integralharvestlogic.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package logic
  2. import (
  3. "context"
  4. "fmt"
  5. "app.yhyue.com/moapp/jyPoints/entity"
  6. "app.yhyue.com/moapp/jyPoints/rpc/integral"
  7. "app.yhyue.com/moapp/jyPoints/rpc/internal/svc"
  8. "github.com/tal-tech/go-zero/core/logx"
  9. )
  10. type IntegralHarvestLogic struct {
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. logx.Logger
  14. }
  15. func NewIntegralHarvestLogic(ctx context.Context, svcCtx *svc.ServiceContext) *IntegralHarvestLogic {
  16. return &IntegralHarvestLogic{
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. Logger: logx.WithContext(ctx),
  20. }
  21. }
  22. // 收获积分
  23. func (l *IntegralHarvestLogic) IntegralHarvest(in *integral.Req) (*integral.Resp, error) {
  24. result := &integral.Resp{}
  25. dat := entity.FlowJSON{}
  26. dat.PointType = in.PointType
  27. dat.SourceId = in.SourceId
  28. dat.SourceType = in.SourceType
  29. dat.EndDate = in.EndDate
  30. dat.AppId = in.AppId
  31. dat.OperationType = in.OperationType
  32. dat.UserId = in.UserId
  33. dat.Point = in.Point
  34. dat.Abstract=in.Abstract
  35. code, msg := integralService.IntegralAddService(dat)
  36. fmt.Println(code, msg)
  37. result.Code = code
  38. result.Message = msg
  39. return result, nil
  40. }