integralharvestlogic.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package logic
  2. import (
  3. "app.yhyue.com/moapp/jyPoints/entity"
  4. "app.yhyue.com/moapp/jyPoints/rpc/integral"
  5. "app.yhyue.com/moapp/jyPoints/rpc/internal/svc"
  6. "context"
  7. "fmt"
  8. "github.com/zeromicro/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, serialNumber := integralService.IntegralAddService(dat)
  36. fmt.Println(code, msg)
  37. result.Code = code
  38. result.SerialNumber = serialNumber
  39. result.Message = msg
  40. return result, nil
  41. }