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)