integralexpirechecklogic.go 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package logic
  2. import (
  3. "context"
  4. "fmt"
  5. "points_service/entity"
  6. "points_service/rpc/integral"
  7. "points_service/rpc/internal/svc"
  8. "github.com/tal-tech/go-zero/core/logx"
  9. )
  10. type IntegralExpireCheckLogic struct {
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. logx.Logger
  14. }
  15. func NewIntegralExpireCheckLogic(ctx context.Context, svcCtx *svc.ServiceContext) *IntegralExpireCheckLogic {
  16. return &IntegralExpireCheckLogic{
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. Logger: logx.WithContext(ctx),
  20. }
  21. }
  22. // 到期积分查询
  23. func (l *IntegralExpireCheckLogic) IntegralExpireCheck(in *integral.AddReq) (*integral.AddResp, error) {
  24. // todo: add your logic here and delete this line
  25. result := &integral.AddResp{}
  26. dat := entity.ExpireJSON{}
  27. dat.UserId = in.UserId
  28. dat.EndDate = "2021-03-16"
  29. dat.AppId = 10000
  30. dataType,points := integralService.IntegralExpireCheckService(dat)
  31. res := make(map[string]interface{})
  32. res["code"] = dataType
  33. res["data"] = points
  34. res["msg"] = "到期积分查询成功"
  35. fmt.Println(res)
  36. result.Status = true
  37. return result,nil
  38. }