package com.changhong.epc.rely.api.epc.tenant;
|
|
import com.alibaba.fastjson.TypeReference;
|
import com.changhong.epc.bean.admin.InitCompany;
|
import com.changhong.epc.constter.system.SystemClients;
|
import com.changhong.epc.constter.system.run.EpcRestInterface;
|
import com.changhong.epc.constter.tenant.TenantUrlConst;
|
import com.changhong.epc.rely.api.epc.BaseApi;
|
import com.iemsoft.framework.cloud.core.base.ResMsg;
|
import com.iemsoft.framework.cloud.core.tools.SpringUtil;
|
import com.iemsoft.framework.cloud.ribbon.RestInterface;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.stereotype.Service;
|
import org.springframework.ui.ModelMap;
|
|
@Slf4j
|
@Service
|
public class TenantInitApi extends BaseApi implements SystemClients {
|
|
public void init(InitCompany initCompany){
|
ResMsg<Integer> resMsg = (ResMsg<Integer>)
|
SpringUtil.getBean(SERVER_TENANT.getBeanName(), RestInterface.class).post(
|
TenantUrlConst.REST_TENANT_INIT_INFO
|
, initCompany
|
, new TypeReference<ResMsg<Integer>>(){}.getType()
|
, EpcRestInterface.getEpcHeads());
|
assertSuccess(resMsg, res->{
|
throw new RuntimeException(res.getRspMsg());
|
});
|
}
|
|
|
public void synOrg(){
|
ResMsg<Integer> resMsg = (ResMsg<Integer>)
|
SpringUtil.getBean(SERVER_TENANT.getBeanName(), RestInterface.class).post(
|
TenantUrlConst.REST_TENANT_SYNORG
|
, new ModelMap()
|
, new TypeReference<ResMsg<Integer>>(){}.getType()
|
, EpcRestInterface.getEpcHeads());
|
assertSuccess(resMsg, res->{
|
throw new RuntimeException(res.getRspMsg());
|
});
|
}
|
|
}
|