ludc
2023-04-26 3cb0cef6f7189dcbb537df52cef5921d1d2c3cd9
Source/UBCS/ubcs-service/ubcs-omd/src/main/java/com/vci/ubcs/omd/repeater/DomainRepeater.java
@@ -2,20 +2,11 @@
import com.alibaba.cloud.nacos.NacosDiscoveryProperties;
import com.alibaba.cloud.nacos.NacosServiceManager;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.nacos.api.annotation.NacosInjected;
import com.alibaba.nacos.api.exception.NacosException;
import com.alibaba.nacos.api.naming.NamingService;
import com.alibaba.nacos.api.naming.pojo.Instance;
import com.alibaba.nacos.common.http.client.NacosRestTemplate;
import com.vci.ubcs.omd.vo.OmdBtmTypeVO;
import org.apache.http.Header;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import com.vci.ubcs.omd.vo.BtmTypeVO;
import org.springblade.core.launch.constant.AppConstant;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
@@ -25,8 +16,6 @@
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;
import org.springframework.web.client.RestTemplate;
import javax.annotation.PostConstruct;
@@ -89,11 +78,11 @@
      }
   }
   public static R submitBtmType (String serviceName, OmdBtmTypeVO omdBtmTypeVO) throws NacosException {
   public static R submitBtmType (String serviceName, BtmTypeVO btmTypeVO) throws NacosException {
      Instance service = namingService.selectOneHealthyInstance(AppConstant.APPLICATION_GATEWAY_NAME);
      try {
         String url = "http://" + service.getIp() +StringPool.COLON+ service.getPort() + StringPool.SLASH + serviceName + StringPool.SLASH + API_SUBMIT_BTM_TYPE;
         ResponseEntity<R> responseEntity = executePost(url, JSONObject.toJSONString(omdBtmTypeVO), null);
         ResponseEntity<R> responseEntity = executePost(url, JSONObject.toJSONString(btmTypeVO), null);
         if (responseEntity.getStatusCode().equals(HttpStatus.OK)){
            return responseEntity.getBody();
         }