Commit 98c3bbb0 authored by mcb's avatar mcb

no message

parent 060cb2ef
......@@ -150,12 +150,12 @@ public class DmpApiServiceMangeController {
}
/**
* API计量--API列表
* API计量--API调用列表
*
* @author Bellamy
* @since 2021-01-19
*/
@ApiOperation(value = "API计量--API列表", notes = "API计量--API列表")
@ApiOperation(value = "API计量--API调用列表", notes = "API计量--API调用列表")
@PostMapping(value = "/apiCountListPage")
public JsonResult apiCountListPage(@RequestBody @Validated ApiInterfaceInfoListReq req, HttpServletRequest httpRequest) {
JsonResult jsonResult = new JsonResult();
......@@ -169,6 +169,26 @@ public class DmpApiServiceMangeController {
return jsonResult;
}
/**
* API计量--API未调用列表
*
* @author Bellamy
* @since 2021-01-22
*/
@ApiOperation(value = "API计量--API未调用列表", notes = "API计量--API未调用列表")
@PostMapping(value = "/notCalledList")
public JsonResult apiNotCalledListPage(@RequestBody @Validated ApiInterfaceInfoListReq req, HttpServletRequest httpRequest) {
JsonResult jsonResult = new JsonResult();
try {
jsonResult = dmpApiServiceMangeService.queryApiNotCalledListPage(req);
} catch (Exception e) {
jsonResult.setMessage(e.getMessage());
jsonResult.setCode(ResultCode.INTERNAL_SERVER_ERROR);
e.printStackTrace();
}
return jsonResult;
}
/**
* 获取数据源库——下拉框
*
......
package com.jz.dmp.modules.service;
import com.jz.common.constant.JsonResult;
import com.jz.dmp.modules.controller.dataService.bean.ApiInterfaceInfoListReq;
import com.jz.dmp.modules.controller.dataService.bean.ApiInterfaceReq;
import com.jz.dmp.modules.controller.dataService.bean.MakeBigDataApiReq;
import com.jz.dmp.modules.model.DvRuleT;
......@@ -61,7 +62,7 @@ public interface DmpApiServiceMangeService {
* @return
* @author Bellamy
*/
JsonResult querygSourceDbList(Integer projectId,String dbName) throws Exception;
JsonResult querygSourceDbList(Integer projectId, String dbName) throws Exception;
/**
* 配置数据源——下拉框
......@@ -71,4 +72,12 @@ public interface DmpApiServiceMangeService {
* @since 2021-01-21
*/
JsonResult getSourceSetting() throws Exception;
/**
* API计量--API未调用列表
*
* @author Bellamy
* @since 2021-01-22
*/
JsonResult queryApiNotCalledListPage(ApiInterfaceInfoListReq req) throws Exception;
}
\ No newline at end of file
......@@ -7,6 +7,7 @@ import com.jz.common.utils.DateUtils;
import com.jz.common.utils.web.HttpClientUtils;
import com.jz.common.utils.web.SessionUtils;
import com.jz.dmp.modules.controller.DataIntegration.bean.SourceDbNameListDto;
import com.jz.dmp.modules.controller.dataService.bean.ApiInterfaceInfoListReq;
import com.jz.dmp.modules.controller.dataService.bean.ApiInterfaceReq;
import com.jz.dmp.modules.controller.dataService.bean.MakeBigDataApiReq;
import com.jz.dmp.modules.dao.DvRuleTDao;
......@@ -48,6 +49,9 @@ public class DmpApiServiceMangeServiceImpl implements DmpApiServiceMangeService
//API计量调用次数和执行时长url
private static final String countAPiCallStat = "/api/logging/countAPiCallStat";
//API计量--API未调用列表url
private static final String notCalledList = "/api/interface/listUnCallApiInterface";
@Value("${spring.gateway-url}")
private String gatewayUrl;
......@@ -264,4 +268,34 @@ public class DmpApiServiceMangeServiceImpl implements DmpApiServiceMangeService
List<String> list = Arrays.asList(arr);
return JsonResult.ok(list);
}
/**
* API计量--API未调用列表
*
* @author Bellamy
* @since 2021-01-22
*/
@Override
public JsonResult queryApiNotCalledListPage(ApiInterfaceInfoListReq req) throws Exception {
JsonResult result = new JsonResult();
String url = gatewayUrl + notCalledList;
String resultData = HttpClientUtils.post(url, JSONObject.toJSONString(req));
if (StringUtils.isEmpty(resultData)) {
throw new RuntimeException("查询失败!");
}
logger.info("#################响应结果数据{}" + resultData);
Map jsonObject = JSONObject.parseObject(resultData);
if (jsonObject.containsKey("code")) {
if ("200".equals(jsonObject.get("code").toString())) {
return JsonResult.ok(jsonObject.get("data"));
}
}
if (jsonObject.containsKey("message")) {
logger.info(jsonObject.get("message").toString());
result.setMessage(jsonObject.get("message").toString());
result.setCode(ResultCode.INTERNAL_SERVER_ERROR);
}
return result;
}
}
\ No newline at end of file
# 测试环境配置
server:
port: 7181
port: 7182
#contextPath: /resource
management:
port: 54001
port: 54002
health:
mail:
enabled: false
......@@ -36,6 +36,10 @@ spring:
caffeine:
spec: maximumSize=1000,expireAfterWrite=30s
public-key: rajZdV0xpCox+2vEHFLsKq2o2XVdMaQq
#gatewayIP
gateway-url: http://localhost:8088
#API配置--大数据查询,数据源支持类型条件
api-bigData-setting: Hive,MySQL,Oracle
redis:
#database: 0
#host: 119.23.13.83
......@@ -93,13 +97,6 @@ dmp:
open: false
name:
#mybatis的配置
#mybatis:
# #配置mapper.xml文件所在路径
# mapper-locations: classpath:mapper.*/*.xml
# #配置映射类所在的包名
# type-aliases-package: com.jz.dmp.modules.model
#日志打印
logging:
level:
......
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