Commit 86026ecd authored by mcb's avatar mcb

commit

parent 7413cc0f
......@@ -75,6 +75,10 @@ public class GatewayApiConstant {
//获取文件夹树
public static final String folderTree = "/api/producer/getFileCatalog";
//获取文件夹树
public static final String getApiId = "/api/producer/getCustomApiId";
//服务开发---获取ApiId
private static Logger logger = LoggerFactory.getLogger(GatewayApiConstant.class);
/*
......
......@@ -54,12 +54,16 @@ public class DmpApiServiceMangeController {
* @author Bellamy
* @since 2021-01-19
*/
@ApiOperation(value = "制作/编辑API(第三方)", notes = "保存/编辑API(第三方)")
@ApiOperation(value = "制作/编辑API(第三方)和(大数据查询/标签查询)", notes = "保存/编辑API(第三方)")
@PostMapping(value = "/saveApi")
public JsonResult saveApiInfo(@RequestBody @Validated ApiInterfaceReq req, HttpServletRequest httpRequest) {
JsonResult jsonResult = new JsonResult();
try {
jsonResult = dmpApiServiceMangeService.saveApiInfo(req);
if ("10004".equals(req.getApiType())) {
jsonResult = dmpApiServiceMangeService.saveApiInfo(req);
} else if ("10002".equals(req.getApiType())) {
jsonResult = dmpApiServiceMangeService.saveApiBigDataInfo(req);
}
} catch (Exception e) {
jsonResult.setMessage(e.getMessage());
jsonResult.setCode(ResultCode.INTERNAL_SERVER_ERROR);
......@@ -74,7 +78,7 @@ public class DmpApiServiceMangeController {
* @author Bellamy
* @since 2021-01-19
*/
@ApiOperation(value = "制作/编辑API(大数据查询/标签查询)", notes = "制作/编辑API(大数据查询/标签查询)")
/* @ApiOperation(value = "制作/编辑API(大数据查询/标签查询)", notes = "制作/编辑API(大数据查询/标签查询)")
@PostMapping(value = "/saveApiBigData")
public JsonResult saveApiBigDataInfo(@RequestBody @Validated ApiInterfaceReq req, HttpServletRequest httpRequest) {
JsonResult jsonResult = new JsonResult();
......@@ -86,7 +90,7 @@ public class DmpApiServiceMangeController {
e.printStackTrace();
}
return jsonResult;
}
}*/
/**
* 编辑API(第三方)基本信息
......@@ -149,7 +153,7 @@ public class DmpApiServiceMangeController {
return jsonResult;
}
/* *//**
/* *//**
* API计量--API调用列表
*
* @author Bellamy
......@@ -219,10 +223,10 @@ public class DmpApiServiceMangeController {
@GetMapping(value = "/sourceDbList")
@ApiImplicitParams({@ApiImplicitParam(name = "projectId", value = "项目id", required = true),
@ApiImplicitParam(name = "dbName", value = "数据源类型名称", required = true)})
public JsonResult<List<SourceDbNameListDto>> getSourceDbList(@RequestParam Integer projectId,@RequestParam String dbName) {
public JsonResult<List<SourceDbNameListDto>> getSourceDbList(@RequestParam Integer projectId, @RequestParam String dbName) {
JsonResult jsonResult = new JsonResult();
try {
jsonResult = dmpApiServiceMangeService.querygSourceDbList(projectId,dbName);
jsonResult = dmpApiServiceMangeService.querygSourceDbList(projectId, dbName);
} catch (Exception e) {
jsonResult.setMessage("查询失败");
jsonResult.setCode(ResultCode.INTERNAL_SERVER_ERROR);
......@@ -295,10 +299,30 @@ public class DmpApiServiceMangeController {
@GetMapping(value = "/folderTree")
@ApiImplicitParams({@ApiImplicitParam(name = "projectId", value = "项目id"),
@ApiImplicitParam(name = "orgCode", value = "组织编码")})
public JsonResult getFolderTree(@RequestParam(name = "projectId",required = false) String projectId,@RequestParam(name = "orgCode",required = false) String orgCode) {
public JsonResult getFolderTree(@RequestParam(name = "projectId", required = false) String projectId, @RequestParam(name = "orgCode", required = false) String orgCode) {
JsonResult jsonResult = new JsonResult();
try {
jsonResult = dmpApiServiceMangeService.getFolderTree(projectId, orgCode);
} catch (Exception e) {
jsonResult.setMessage(e.getMessage());
jsonResult.setCode(ResultCode.INTERNAL_SERVER_ERROR);
e.printStackTrace();
}
return jsonResult;
}
/**
* 服务开发---获取ApiId
*
* @author Bellamy
* @since 2021-01-19
*/
@ApiOperation(value = "服务开发---获取ApiId", notes = "服务开发---获取ApiId")
@PostMapping(value = "/getApiId")
public JsonResult getApiId() {
JsonResult jsonResult = new JsonResult();
try {
jsonResult = dmpApiServiceMangeService.getFolderTree(projectId,orgCode);
jsonResult = dmpApiServiceMangeService.getApiId();
} catch (Exception e) {
jsonResult.setMessage(e.getMessage());
jsonResult.setCode(ResultCode.INTERNAL_SERVER_ERROR);
......
......@@ -18,7 +18,9 @@ import java.io.Serializable;
@ApiModel(value = "api基本信息")
public class ApiInterfaceReq implements Serializable {
@ApiModelProperty(value = "Api类型:对应字典表key:10004 三方,10002 数据查询",required = true)
@NotNull(message = "Api类型不能为空")
public String apiType;
@ApiModelProperty(value = "传输方式:0,http 1.https",required = true)
@NotNull(message = "传输方式不能为空")
public Integer apiProtocl;
......@@ -27,10 +29,6 @@ public class ApiInterfaceReq implements Serializable {
@NotNull(message = "加密方式不能为空")
public Integer signType;
@ApiModelProperty(value = "Api类型:对应字典表key",required = true)
@NotNull(message = "Api类型不能为空")
public String apiType;
@ApiModelProperty(value = "apiKey",required = true)
@NotNull(message = "apiKey不能为空")
public String apiKey;
......@@ -107,5 +105,4 @@ public class ApiInterfaceReq implements Serializable {
public String updateUser;
@ApiModelProperty(value = "状态",required = false)
public String status;
}
......@@ -105,4 +105,12 @@ public interface DmpApiServiceMangeService {
* @since 2021-02-25
*/
JsonResult listCallApi(ApiInterfaceInfoListReq req) throws Exception;
/**
* 服务开发---获取ApiId
*
* @author Bellamy
* @since 2021-01-19
*/
JsonResult getApiId() throws Exception;
}
\ No newline at end of file
......@@ -216,6 +216,19 @@ public class DmpApiServiceMangeServiceImpl implements DmpApiServiceMangeService
return result;
}
/**
* 服务开发---获取ApiId
*
* @author Bellamy
* @since 2021-01-19
*/
@Override
public JsonResult getApiId() throws Exception {
String url = gatewayUrl + GatewayApiConstant.getApiId;
JsonResult result = GatewayApiConstant.postRequest2GetData(url, "");
return result;
}
/**
* 服务开发API列表
*
......
......@@ -82,6 +82,8 @@
{
"params": {
//"version": "1.0", //版本
"treeId": 669,
"projectId": "31",
"taskId":"", //任务id
......@@ -104,6 +106,7 @@
"fieldMapping":""//字段映射关系
},
"reader": {
"sourceDbId": "",
"dbConnection": "mysql_dmp_demo_test", //来源名称
"registerTableName": "dmp_azkaban_exector_server_config",
"sourceHdfsPath": "", //HDFS存储目录
......@@ -144,6 +147,7 @@
]
},
"writer": {
"targetDbId":"",
"targetDbConnection": "mysql_dmp_demo",
"targetTable": "dmp_azkaban_exector_server_config",
"targetFtpDir": "",//文件所在目录
......
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