|
@@ -1,12 +1,14 @@
|
|
|
package com.persagy.proxy.adm.controller;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import com.persagy.proxy.adm.constant.AdmCommonConstant;
|
|
|
import com.persagy.proxy.adm.model.AdmTenant;
|
|
|
import com.persagy.proxy.adm.request.AdmCreateRequest;
|
|
|
import com.persagy.proxy.adm.request.AdmQueryCriteria;
|
|
|
import com.persagy.proxy.adm.request.AdmResponse;
|
|
|
import com.persagy.proxy.adm.service.IAdmTenantService;
|
|
|
+import com.persagy.proxy.adm.utils.ObjectNameUtil;
|
|
|
import com.persagy.proxy.common.entity.InstanceUrlParam;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
@@ -60,6 +62,11 @@ public class AdmTenantController {
|
|
|
// 组装上下文条件
|
|
|
InstanceUrlParam context = new InstanceUrlParam(groupCode, null, projectId, AdmCommonConstant.APP_ID);
|
|
|
List<AdmTenant> vos = CollUtil.newArrayList(createRequest.getContent());
|
|
|
+ vos.stream().forEach(admTenant -> {
|
|
|
+ if (StrUtil.isEmpty(admTenant.getName())){
|
|
|
+ admTenant.setName(ObjectNameUtil.objectName("租户-"));
|
|
|
+ }
|
|
|
+ });
|
|
|
vos = service.doInsert(context, AdmTenant.class, vos);
|
|
|
return AdmResponse.success(vos);
|
|
|
}
|