增加同步指令下发与同步状态获取功能,修改同步下发配置的asn业务逻辑
This commit is contained in:
@@ -631,9 +631,9 @@ public class ConfigServiceUtil {
|
||||
* @return
|
||||
* @throws MaatConvertException
|
||||
*/
|
||||
public static ToMaatResult configSyncCmd(String params) throws MaatConvertException{
|
||||
public static JSONObject configSyncCmd(String params) throws MaatConvertException{
|
||||
Response response=null;
|
||||
ToMaatResult bean = null;
|
||||
JSONObject bean = null;
|
||||
try {
|
||||
String result = null;
|
||||
String url = DictUtils.getDictLabel("config_sync_url", "sync_cmd");
|
||||
@@ -653,9 +653,7 @@ public class ConfigServiceUtil {
|
||||
}
|
||||
if(response != null && response.getStatus() == 200){
|
||||
logger.info("get result success");
|
||||
JsonConfig config=new JsonConfig();
|
||||
JSONObject resObject = JSONObject.fromObject(result,config);
|
||||
bean = (ToMaatResult) JSONObject.toBean(resObject,ToMaatResult.class);
|
||||
bean = JSONObject.fromObject(result);
|
||||
}else{
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+result);
|
||||
}
|
||||
@@ -674,9 +672,9 @@ public class ConfigServiceUtil {
|
||||
* @return
|
||||
* @throws MaatConvertException
|
||||
*/
|
||||
public static ToMaatResult configSyncStatus() throws MaatConvertException{
|
||||
public static JSONObject configSyncStatus() throws MaatConvertException{
|
||||
Response response=null;
|
||||
ToMaatResult bean = null;
|
||||
JSONObject bean = null;
|
||||
try {
|
||||
String result = null;
|
||||
String url = DictUtils.getDictLabel("config_sync_url", "get_sync_status");
|
||||
@@ -696,9 +694,7 @@ public class ConfigServiceUtil {
|
||||
}
|
||||
if(response != null && response.getStatus() == 200){
|
||||
logger.info("get result success");
|
||||
JsonConfig config=new JsonConfig();
|
||||
JSONObject resObject = JSONObject.fromObject(result,config);
|
||||
bean = (ToMaatResult) JSONObject.toBean(resObject,ToMaatResult.class);
|
||||
bean= JSONObject.fromObject(result);
|
||||
}else{
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+result);
|
||||
}
|
||||
@@ -717,9 +713,9 @@ public class ConfigServiceUtil {
|
||||
* @return
|
||||
* @throws MaatConvertException
|
||||
*/
|
||||
public static ToMaatResult configSync(String params,Integer cfgType,Integer serviceId,String tableName,String completeTag) throws MaatConvertException{
|
||||
public static JSONObject configSync(String params,Integer cfgType,Integer serviceId,String tableName,String completeTag) throws MaatConvertException{
|
||||
Response response=null;
|
||||
ToMaatResult bean = null;
|
||||
JSONObject bean = null;
|
||||
try {
|
||||
String result = null;
|
||||
String url = DictUtils.getDictLabel("config_sync_url", "sync_send");
|
||||
@@ -743,10 +739,7 @@ public class ConfigServiceUtil {
|
||||
}
|
||||
if(response != null && response.getStatus() == 200){
|
||||
logger.info("get result success");
|
||||
JsonConfig config=new JsonConfig();
|
||||
config.setExcludes(new String[]{"configCompileList"});
|
||||
JSONObject resObject = JSONObject.fromObject(result,config);
|
||||
bean = (ToMaatResult) JSONObject.toBean(resObject,ToMaatResult.class);
|
||||
bean = JSONObject.fromObject(result);
|
||||
}else{
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user