powercheck.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // Code generated by goctl. DO NOT EDIT.
  2. // Source: powerCheck.proto
  3. package powercheck
  4. import (
  5. "context"
  6. "bp.jydev.jianyu360.cn/BaseService/powerCheckCenter/rpc/pb"
  7. "github.com/zeromicro/go-zero/zrpc"
  8. "google.golang.org/grpc"
  9. )
  10. type (
  11. CheckReq = pb.CheckReq
  12. CheckResp = pb.CheckResp
  13. Docs = pb.Docs
  14. Ent = pb.Ent
  15. Entniche = pb.Entniche
  16. Free = pb.Free
  17. Member = pb.Member
  18. PowerCheckResp = pb.PowerCheckResp
  19. Vip = pb.Vip
  20. PowerCheck interface {
  21. // 用户权限判断
  22. Check(ctx context.Context, in *CheckReq, opts ...grpc.CallOption) (*CheckResp, error)
  23. // 清除权限缓存
  24. DelCheckRedis(ctx context.Context, in *CheckReq, opts ...grpc.CallOption) (*PowerCheckResp, error)
  25. }
  26. defaultPowerCheck struct {
  27. cli zrpc.Client
  28. }
  29. )
  30. func NewPowerCheck(cli zrpc.Client) PowerCheck {
  31. return &defaultPowerCheck{
  32. cli: cli,
  33. }
  34. }
  35. // 用户权限判断
  36. func (m *defaultPowerCheck) Check(ctx context.Context, in *CheckReq, opts ...grpc.CallOption) (*CheckResp, error) {
  37. client := pb.NewPowerCheckClient(m.cli.Conn())
  38. return client.Check(ctx, in, opts...)
  39. }
  40. // 清除权限缓存
  41. func (m *defaultPowerCheck) DelCheckRedis(ctx context.Context, in *CheckReq, opts ...grpc.CallOption) (*PowerCheckResp, error) {
  42. client := pb.NewPowerCheckClient(m.cli.Conn())
  43. return client.DelCheckRedis(ctx, in, opts...)
  44. }