integralharvestlogic.go 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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.BusinessTypeId = in.BusinessTypeId
  28. dat.BusinessType = in.BusinessType
  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. code, msg := integralService.IntegralAddService(dat)
  35. fmt.Println(code, msg)
  36. result.Code = code
  37. result.Message = msg
  38. return result, nil
  39. }