powercheck.go 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. Ent = pb.Ent
  14. Entniche = pb.Entniche
  15. Free = pb.Free
  16. Member = pb.Member
  17. PowerCheckResp = pb.PowerCheckResp
  18. Vip = pb.Vip
  19. PowerCheck interface {
  20. // 用户权限判断
  21. Check(ctx context.Context, in *CheckReq, opts ...grpc.CallOption) (*CheckResp, error)
  22. // 清除权限缓存
  23. DelCheckRedis(ctx context.Context, in *CheckReq, opts ...grpc.CallOption) (*PowerCheckResp, error)
  24. }
  25. defaultPowerCheck struct {
  26. cli zrpc.Client
  27. }
  28. )
  29. func NewPowerCheck(cli zrpc.Client) PowerCheck {
  30. return &defaultPowerCheck{
  31. cli: cli,
  32. }
  33. }
  34. // 用户权限判断
  35. func (m *defaultPowerCheck) Check(ctx context.Context, in *CheckReq, opts ...grpc.CallOption) (*CheckResp, error) {
  36. client := pb.NewPowerCheckClient(m.cli.Conn())
  37. return client.Check(ctx, in, opts...)
  38. }
  39. // 清除权限缓存
  40. func (m *defaultPowerCheck) DelCheckRedis(ctx context.Context, in *CheckReq, opts ...grpc.CallOption) (*PowerCheckResp, error) {
  41. client := pb.NewPowerCheckClient(m.cli.Conn())
  42. return client.DelCheckRedis(ctx, in, opts...)
  43. }