zm
2020-05-18 a18bfacbf56b401f6e0fdae8710fbca4df8cff77
commit | author | age
a18bfa 1 package com.changhong.epc.rely.api.epc.tenant;
Z 2
3 import com.alibaba.fastjson.TypeReference;
4 import com.changhong.epc.bean.admin.InitCompany;
5 import com.changhong.epc.constter.system.SystemClients;
6 import com.changhong.epc.constter.system.run.EpcRestInterface;
7 import com.changhong.epc.constter.tenant.TenantUrlConst;
8 import com.changhong.epc.rely.api.epc.BaseApi;
9 import com.iemsoft.framework.cloud.core.base.ResMsg;
10 import com.iemsoft.framework.cloud.core.tools.SpringUtil;
11 import com.iemsoft.framework.cloud.ribbon.RestInterface;
12 import lombok.extern.slf4j.Slf4j;
13 import org.springframework.stereotype.Service;
14 import org.springframework.ui.ModelMap;
15
16 @Slf4j
17 @Service
18 public class TenantInitApi extends BaseApi implements SystemClients {
19
20     public void init(InitCompany initCompany){
21         ResMsg<Integer> resMsg = (ResMsg<Integer>)
22         SpringUtil.getBean(SERVER_TENANT.getBeanName(), RestInterface.class).post(
23                 TenantUrlConst.REST_TENANT_INIT_INFO
24                 , initCompany
25                 , new TypeReference<ResMsg<Integer>>(){}.getType()
26                 , EpcRestInterface.getEpcHeads());
27         assertSuccess(resMsg, res->{
28             throw new RuntimeException(res.getRspMsg());
29         });
30     }
31
32
33     public void synOrg(){
34         ResMsg<Integer> resMsg = (ResMsg<Integer>)
35                 SpringUtil.getBean(SERVER_TENANT.getBeanName(), RestInterface.class).post(
36                         TenantUrlConst.REST_TENANT_SYNORG
37                         , new ModelMap()
38                         , new TypeReference<ResMsg<Integer>>(){}.getType()
39                         , EpcRestInterface.getEpcHeads());
40         assertSuccess(resMsg, res->{
41             throw new RuntimeException(res.getRspMsg());
42         });
43     }
44
45 }