Config change verify (#780)

* init code for verify module

* init code for verify module

* create application for config modify in thread pool manage

* finish rejectModification

* finish rejectModification

* add todo

* finish threadPoolManage accept

* finish threadPoolManage accept

* finish threadPoolManage config verify

* formatting code

* optimize ConfigModifyVerifyService

* finish config modification verify

* finish config modification verify

* finish webConfig modification verify

* finish webConfig modification verify

* finish webConfig modification verify

* finish threadPoolInstanceConfig modification verify

* finish adapterThreadPoolConfig modification verify

* finish adapterThreadPoolConfig modification verify

* finish adapterThreadPoolConfig modification verify

* optmize ConfigVerifyController

* optmize ConfigVerifyController

* optmize ConfigVerifyController

* fix ConfigModifyVerifyReqDTO

* fix bug

* optimize verifyController

* optimize verifyController

* fix request param

* finish modify application query page

* finish modify application query page

* finish modify application query detail

* finish modify application query detail

* finish thread pool config modification verify module

* optimize accept modification logic

* formatting code

* fix bug

* formatting code

* formatting code

* update sql file

* add annotation

* add annotation and formatting code

* add annotation and formatting code

* remove useless code

* fix sql

* fix bug in web thread pool verify and adapter thread pool

Co-authored-by: airoger <czzx201101136>
pull/784/head
shanjianq 2 years ago committed by GitHub
parent 3f8dfb4c31
commit 8f742e559c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -19,8 +19,12 @@ package cn.hippo4j.config.service.biz.impl;
import cn.hippo4j.common.constant.ConfigModifyTypeConstants;
import cn.hippo4j.common.toolkit.JSONUtil;
import cn.hippo4j.common.toolkit.StringUtil;
import cn.hippo4j.config.model.biz.threadpool.ConfigModifyVerifyReqDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
@ -41,12 +45,13 @@ public class AdapterThreadPoolConfigModificationVerifyServiceImpl extends Abstra
@Override
protected void updateThreadPoolParameter(ConfigModifyVerifyReqDTO reqDTO) {
for (String each : getClientAddress(reqDTO)) {
String urlString = new StringBuilder()
.append("http://")
.append(each)
.append("/adapter/thread-pool/update")
.toString();
restTemplate.postForObject(urlString, JSONUtil.toJSONString(reqDTO), Object.class);
String urlString = StringUtil.newBuilder("http://", each, "/adapter/thread-pool/update");
RestTemplate restTemplate = new RestTemplate();
// again appoint MediaType
HttpHeaders requestHeaders = new HttpHeaders();
requestHeaders.setContentType(MediaType.APPLICATION_JSON);
HttpEntity<String> requestEntity = new HttpEntity<>(JSONUtil.toJSONString(reqDTO), requestHeaders);
restTemplate.postForObject(urlString, requestEntity, Object.class);
}
}
}

@ -19,8 +19,12 @@ package cn.hippo4j.config.service.biz.impl;
import cn.hippo4j.common.constant.ConfigModifyTypeConstants;
import cn.hippo4j.common.toolkit.JSONUtil;
import cn.hippo4j.common.toolkit.StringUtil;
import cn.hippo4j.config.model.biz.threadpool.ConfigModifyVerifyReqDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
@ -41,12 +45,13 @@ public class WebThreadPoolConfigModificationVerifyServiceImpl extends AbstractCo
@Override
protected void updateThreadPoolParameter(ConfigModifyVerifyReqDTO reqDTO) {
for (String each : getClientAddress(reqDTO)) {
String urlString = new StringBuilder()
.append("http://")
.append(each)
.append("/web/update/pool")
.toString();
restTemplate.postForObject(urlString, JSONUtil.toJSONString(reqDTO), Object.class);
String urlString = StringUtil.newBuilder("http://", each, "/web/update/pool");
RestTemplate restTemplate = new RestTemplate();
// again appoint MediaType
HttpHeaders requestHeaders = new HttpHeaders();
requestHeaders.setContentType(MediaType.APPLICATION_JSON);
HttpEntity<String> requestEntity = new HttpEntity<>(JSONUtil.toJSONString(reqDTO), requestHeaders);
restTemplate.postForObject(urlString, requestEntity, Object.class);
}
}
}

Loading…
Cancel
Save