소스 검색

feat:升级

wangchuanjin 1 년 전
부모
커밋
3980ca71b7
1개의 변경된 파일16개의 추가작업 그리고 6개의 파일을 삭제
  1. 16 6
      api/internal/logic/resempowerlogic.go

+ 16 - 6
api/internal/logic/resempowerlogic.go

@@ -31,12 +31,22 @@ func (l *ResEmpowerLogic) ResEmpower(req *types.ResEmpowerReq) (resp *types.BiRe
 	for _, v := range strings.Split(req.EntUserId, ",") {
 		entUserIds = append(entUserIds, Int64All(v))
 	}
-	r, err := l.svcCtx.ResourceCenterRpc.Empower(context.Background(), &pb.EmpowerReq{
-		Appid:        "10000",
-		FunctionCode: req.FunctionCode,
-		EntId:        req.EntId,
-		EntUserId:    entUserIds,
-	})
+	var r *pb.Resp
+	if req.ReqType == 1 {
+		r, err = l.svcCtx.ResourceCenterRpc.Empower(context.Background(), &pb.EmpowerReq{
+			Appid:        "10000",
+			FunctionCode: req.FunctionCode,
+			EntId:        req.EntId,
+			EntUserId:    entUserIds,
+		})
+	} else {
+		r, err = l.svcCtx.ResourceCenterRpc.CancelEmpower(context.Background(), &pb.EmpowerReq{
+			Appid:        "10000",
+			FunctionCode: req.FunctionCode,
+			EntId:        req.EntId,
+			EntUserId:    entUserIds,
+		})
+	}
 	var status int64
 	if err != nil {
 		l.Error(err)