integral.go 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. // Code generated by goctl. DO NOT EDIT!
  2. // Source: integral.proto
  3. //go:generate mockgen -destination ./integral_mock.go -package integralclient -source $GOFILE
  4. package integralclient
  5. import (
  6. "context"
  7. "app.yhyue.com/moapp/jyPoints/rpc/integral"
  8. "github.com/tal-tech/go-zero/zrpc"
  9. )
  10. type (
  11. Req = integral.Req
  12. Resp = integral.Resp
  13. RespList = integral.RespList
  14. Point = integral.Point
  15. Integral interface {
  16. // 收获积分
  17. IntegralHarvest(ctx context.Context, in *Req) (*Resp, error)
  18. // 消耗积分
  19. IntegralConsume(ctx context.Context, in *Req) (*Resp, error)
  20. // 积分余额查询
  21. IntegralBalanceCheck(ctx context.Context, in *Req) (*Resp, error)
  22. // 积分明细查询
  23. IntegralDetailedCheck(ctx context.Context, in *Req) (*RespList, error)
  24. // 积分守护
  25. IntegralGuard(ctx context.Context, in *Req) (*Resp, error)
  26. // 到期积分查询
  27. IntegralExpireCheck(ctx context.Context, in *Req) (*Resp, error)
  28. }
  29. defaultIntegral struct {
  30. cli zrpc.Client
  31. }
  32. )
  33. func NewIntegral(cli zrpc.Client) Integral {
  34. return &defaultIntegral{
  35. cli: cli,
  36. }
  37. }
  38. // 收获积分
  39. func (m *defaultIntegral) IntegralHarvest(ctx context.Context, in *Req) (*Resp, error) {
  40. client := integral.NewIntegralClient(m.cli.Conn())
  41. return client.IntegralHarvest(ctx, in)
  42. }
  43. // 消耗积分
  44. func (m *defaultIntegral) IntegralConsume(ctx context.Context, in *Req) (*Resp, error) {
  45. client := integral.NewIntegralClient(m.cli.Conn())
  46. return client.IntegralConsume(ctx, in)
  47. }
  48. // 积分余额查询
  49. func (m *defaultIntegral) IntegralBalanceCheck(ctx context.Context, in *Req) (*Resp, error) {
  50. client := integral.NewIntegralClient(m.cli.Conn())
  51. return client.IntegralBalanceCheck(ctx, in)
  52. }
  53. // 积分明细查询
  54. func (m *defaultIntegral) IntegralDetailedCheck(ctx context.Context, in *Req) (*RespList, error) {
  55. client := integral.NewIntegralClient(m.cli.Conn())
  56. return client.IntegralDetailedCheck(ctx, in)
  57. }
  58. // 积分守护
  59. func (m *defaultIntegral) IntegralGuard(ctx context.Context, in *Req) (*Resp, error) {
  60. client := integral.NewIntegralClient(m.cli.Conn())
  61. return client.IntegralGuard(ctx, in)
  62. }
  63. // 到期积分查询
  64. func (m *defaultIntegral) IntegralExpireCheck(ctx context.Context, in *Req) (*Resp, error) {
  65. client := integral.NewIntegralClient(m.cli.Conn())
  66. return client.IntegralExpireCheck(ctx, in)
  67. }