crreempowerlogic.go 955 B

12345678910111213141516171819202122232425262728293031323334353637
  1. package logic
  2. import (
  3. "context"
  4. "fmt"
  5. . "bp.jydev.jianyu360.cn/BaseService/resourceCenter/public/service"
  6. "bp.jydev.jianyu360.cn/BaseService/resourceCenter/rpc/internal/svc"
  7. "bp.jydev.jianyu360.cn/BaseService/resourceCenter/rpc/pb"
  8. "github.com/zeromicro/go-zero/core/logx"
  9. )
  10. type CrReEmpowerLogic struct {
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. logx.Logger
  14. }
  15. func NewCrReEmpowerLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CrReEmpowerLogic {
  16. return &CrReEmpowerLogic{
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. Logger: logx.WithContext(ctx),
  20. }
  21. }
  22. // 先根据功能分类把人的权益清空,再给人授权新的权益
  23. func (l *CrReEmpowerLogic) CrReEmpower(in *pb.CrReEmpowerReq) (*pb.Resp, error) {
  24. resp := &pb.Resp{}
  25. status, err := CrReEmpower(in.Appid, in.FunctionModule, in.FunctionCode, in.EntId, in.EntUserId)
  26. if err != nil {
  27. l.Error(fmt.Sprintf("%+v", in), err)
  28. }
  29. resp.Status = status
  30. return resp, nil
  31. }