resourceserver.go 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. // Code generated by goctl. DO NOT EDIT!
  2. // Source: resource.proto
  3. package server
  4. import (
  5. "context"
  6. "bp.jydev.jianyu360.cn/BaseService/resourceCenter/rpc/internal/logic"
  7. "bp.jydev.jianyu360.cn/BaseService/resourceCenter/rpc/internal/svc"
  8. "bp.jydev.jianyu360.cn/BaseService/resourceCenter/rpc/pb"
  9. )
  10. type ResourceServer struct {
  11. svcCtx *svc.ServiceContext
  12. pb.UnimplementedResourceServer
  13. }
  14. func NewResourceServer(svcCtx *svc.ServiceContext) *ResourceServer {
  15. return &ResourceServer{
  16. svcCtx: svcCtx,
  17. }
  18. }
  19. // 开通或者取消用户/企业权益
  20. func (s *ResourceServer) PowerHandle(ctx context.Context, in *pb.PowerReq) (*pb.Resp, error) {
  21. l := logic.NewPowerHandleLogic(ctx, s.svcCtx)
  22. return l.PowerHandle(in)
  23. }
  24. // 检查用户/企业权益
  25. func (s *ResourceServer) CheckPower(ctx context.Context, in *pb.CheckPowerReq) (*pb.Resp, error) {
  26. l := logic.NewCheckPowerLogic(ctx, s.svcCtx)
  27. return l.CheckPower(in)
  28. }
  29. // 资源扣减
  30. func (s *ResourceServer) Deduction(ctx context.Context, in *pb.DeductionReq) (*pb.Resp, error) {
  31. l := logic.NewDeductionLogic(ctx, s.svcCtx)
  32. return l.Deduction(in)
  33. }
  34. // 资源充值
  35. func (s *ResourceServer) Recharge(ctx context.Context, in *pb.RechargeReq) (*pb.Resp, error) {
  36. l := logic.NewRechargeLogic(ctx, s.svcCtx)
  37. return l.Recharge(in)
  38. }
  39. // 重新授权
  40. func (s *ResourceServer) ReEmpower(ctx context.Context, in *pb.EmpowerReq) (*pb.Resp, error) {
  41. l := logic.NewReEmpowerLogic(ctx, s.svcCtx)
  42. return l.ReEmpower(in)
  43. }
  44. // 授权
  45. func (s *ResourceServer) Empower(ctx context.Context, in *pb.EmpowerReq) (*pb.Resp, error) {
  46. l := logic.NewEmpowerLogic(ctx, s.svcCtx)
  47. return l.Empower(in)
  48. }
  49. // 取消授权
  50. func (s *ResourceServer) CancelEmpower(ctx context.Context, in *pb.EmpowerReq) (*pb.Resp, error) {
  51. l := logic.NewCancelEmpowerLogic(ctx, s.svcCtx)
  52. return l.CancelEmpower(in)
  53. }
  54. // 取消授权
  55. func (s *ResourceServer) CancelAllEmpower(ctx context.Context, in *pb.EmpowerReq) (*pb.Resp, error) {
  56. l := logic.NewCancelAllEmpowerLogic(ctx, s.svcCtx)
  57. return l.CancelAllEmpower(in)
  58. }
  59. // 授权列表
  60. func (s *ResourceServer) EmpowerList(ctx context.Context, in *pb.EmpowerListReq) (*pb.EmpowerListResp, error) {
  61. l := logic.NewEmpowerListLogic(ctx, s.svcCtx)
  62. return l.EmpowerList(in)
  63. }
  64. // 所有的权益
  65. func (s *ResourceServer) Haspowers(ctx context.Context, in *pb.HaspowersReq) (*pb.HaspowersResp, error) {
  66. l := logic.NewHaspowersLogic(ctx, s.svcCtx)
  67. return l.Haspowers(in)
  68. }
  69. // 根据功能代码获取待授权详情
  70. func (s *ResourceServer) WaitEmpowerDetail(ctx context.Context, in *pb.WaitEmpowerDetailReq) (*pb.WaitEmpowerDetailResp, error) {
  71. l := logic.NewWaitEmpowerDetailLogic(ctx, s.svcCtx)
  72. return l.WaitEmpowerDetail(in)
  73. }
  74. // 根据商品规格获取待授权详情
  75. func (s *ResourceServer) WaitEmpowerDetailBySpecId(ctx context.Context, in *pb.WaitEmpowerDetailBySpecIdReq) (*pb.WaitEmpowerDetailsResp, error) {
  76. l := logic.NewWaitEmpowerDetailBySpecIdLogic(ctx, s.svcCtx)
  77. return l.WaitEmpowerDetailBySpecId(in)
  78. }