integralexpirechecklogic.go 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package logic
  2. import (
  3. "app.yhyue.com/moapp/jyPoints/rpc/integral"
  4. "context"
  5. "app.yhyue.com/moapp/jyPoints/api/internal/svc"
  6. "app.yhyue.com/moapp/jyPoints/api/internal/types"
  7. "github.com/zeromicro/go-zero/core/logx"
  8. )
  9. type IntegralExpireCheckLogic struct {
  10. logx.Logger
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. }
  14. func NewIntegralExpireCheckLogic(ctx context.Context, svcCtx *svc.ServiceContext) IntegralExpireCheckLogic {
  15. return IntegralExpireCheckLogic{
  16. Logger: logx.WithContext(ctx),
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. }
  20. }
  21. func (l *IntegralExpireCheckLogic) IntegralExpireCheck(req types.ExpireReq) (*types.Response, error) {
  22. // todo: add your logic here and delete this line
  23. result := &types.Response{}
  24. lsi := l.svcCtx.Integral
  25. resp, err := lsi.IntegralExpireCheck(l.ctx, &integral.Req{
  26. UserId: req.UserId,
  27. AppId: req.AppId,
  28. EndDate: req.EndDate,
  29. })
  30. if err != nil {
  31. return nil, err
  32. }
  33. result.Code = resp.Code
  34. result.Data = resp.Data
  35. result.Message = resp.Message
  36. return result, nil
  37. }