Commit 27d738ad authored by mcb's avatar mcb

commit

parent 3ac7ab42
......@@ -65,4 +65,7 @@ public class GatewayApiConstant {
//API计量--API未调用列表url
public static final String notCalledList = "/api/interface/listUnCallApiInterface";
//服务发布/服务取消url
public static final String apiPublishCancel = "/api/producer/optionApiIssueStatus";
}
......@@ -89,10 +89,12 @@ public class RealTimeSyncController {
DmpRealtimeSyncInfo dmpRealtimeSyncInfo = list.get(i);
String srcTopicName = dmpRealtimeSyncInfo.getSrcTopicName();
System.out.println(srcTopicName);
logger.info("############正常执行表数据id........" + ids[i]);
logger.info("############正常执行表数据id{}........" + ids[i]);
String shellPath = "/app/bigdata-app/scripts/trigger_straming.sh";
boolean flag = CmdUtils.callShell(shellPath, srcTopicName);
logger.info("############" + flag);
if(flag){
logger.info("############执行成功{}" + flag);
}
}
}
return new JsonResult();
......
......@@ -240,4 +240,29 @@ public class DmpApiMangeController {
}
return jsonResult;
}
/**
* 服务发布/服务取消
*
* @author Bellamy
* @since 2021-02-07
*/
@ApiOperation(value = "服务发布/服务取消", notes = "服务发布/服务取消")
@GetMapping(value = "/apiPublishCancel")
@ApiImplicitParam(name = "id", value = "id", required = true)
public JsonResult apiPublishCancel(@RequestParam String id, @RequestParam(name = "optStatus") Boolean optStatus) {
if (StringUtils.isEmpty(id)) {
return JsonResult.error(ResultCode.PARAMS_ERROR, "id不能为空!");
}
JsonResult jsonResult = new JsonResult();
try {
jsonResult = dmpApiMangeService.apiPublishCancel(id, optStatus);
} catch (Exception e) {
jsonResult.setMessage(e.getMessage());
jsonResult.setCode(ResultCode.INTERNAL_SERVER_ERROR);
e.printStackTrace();
}
return jsonResult;
}
}
\ No newline at end of file
......@@ -83,4 +83,11 @@ public interface DmpApiMangeService {
* @since 2021-01-19
*/
JsonResult getAuthOrgList(String key) throws Exception;
/**
* @Description:服务发布/服务取消
* @author Bellamy
* @since 2021-02-07
*/
JsonResult apiPublishCancel(String id, Boolean optStatus) throws Exception;
}
......@@ -314,4 +314,38 @@ public class DmpApiMangeServiceImpl implements DmpApiMangeService {
return result;
}
/**
* @param id
* @param optStatus
* @Description:服务发布/服务取消
* @author Bellamy
* @since 2021-02-07
*/
@Override
public JsonResult apiPublishCancel(String id, Boolean optStatus) throws Exception {
JsonResult result = new JsonResult();
String url = gatewayUrl + GatewayApiConstant.apiPublishCancel;
Map params = new HashMap();
params.put("id", id);
params.put("optStatus", optStatus);
String returnData = HttpClientUtils.getJsonForParam(url, params);
if (StringUtils.isEmpty(returnData)) {
throw new RuntimeException("失败!");
}
logger.info("#################响应结果{}" + returnData);
Map map = JSONObject.parseObject(returnData);
if (map.containsKey("code")) {
if ("200".equals(map.get("code").toString())) {
return JsonResult.ok();
}
}
if (map.containsKey("message")) {
logger.info(map.get("message").toString());
result.setMessage(map.get("message").toString());
result.setCode(ResultCode.INTERNAL_SERVER_ERROR);
}
return result;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment