Commit 7f2c7f50 authored by zhangc's avatar zhangc

修改api制作,组织创建相关接口

parent 78fd3f92
...@@ -4,25 +4,21 @@ CREATE TABLE `t_api_interface` ( ...@@ -4,25 +4,21 @@ CREATE TABLE `t_api_interface` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'api 信息表自增ID', `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'api 信息表自增ID',
`api_key` varchar(200) NOT NULL COMMENT 'api唯一标识', `api_key` varchar(200) NOT NULL COMMENT 'api唯一标识',
`api_name` varchar(100) DEFAULT NULL COMMENT 'api名称', `api_name` varchar(100) DEFAULT NULL COMMENT 'api名称',
`api_desc` varchar(300) DEFAULT NULL COMMENT 'api描述',
`api_protocl` varchar(32) DEFAULT NULL COMMENT 'api请求协议:http,https', `api_protocl` varchar(32) DEFAULT NULL COMMENT 'api请求协议:http,https',
`api_path` varchar(100) DEFAULT NULL COMMENT '请求地址',
`target_url` varchar(100) DEFAULT NULL COMMENT '目标url', `target_url` varchar(100) DEFAULT NULL COMMENT '目标url',
`api_type` varchar(50) NULL DEFAULT '' COMMENT 'api类型:1 数据银行制作大数据表 2 数据银行制作数据包,3,数据银行制作自定义API 4 API实时接入 6 标签查询 9自定义', `api_type` varchar(50) NULL DEFAULT '' COMMENT 'api类型:1 数据银行制作大数据表 2 数据银行制作数据包,3,数据银行制作自定义API 4 API实时接入 6 标签查询 9自定义',
`req_method` varchar(20) NULL DEFAULT NULL COMMENT '请求方式: GET, POST', `req_method` varchar(20) NULL DEFAULT NULL COMMENT '请求方式: GET, POST',
`api_function` varchar(200) DEFAULT NULL COMMENT '接口功能', `api_function` varchar(200) DEFAULT NULL COMMENT '接口功能',
`join_type` varchar(50) NULL DEFAULT NULL COMMENT '接入类型:字典表对应key值', `join_type` varchar(50) NULL DEFAULT NULL COMMENT '接入类型:字典表对应key值',
`test_example` varchar(255) NULL DEFAULT NULL COMMENT '测试实例',
`status` varchar(50) NOT NULL COMMENT '状态(DRAFT-草稿 ISSUE-发布 OUTMODED-过时 4FREEZE-冻结 EXPIRY-失效)', `status` varchar(50) NOT NULL COMMENT '状态(DRAFT-草稿 ISSUE-发布 OUTMODED-过时 4FREEZE-冻结 EXPIRY-失效)',
`output_type` varchar(50) NULL DEFAULT 'JSON' COMMENT '输出类型:flow 流形式输出, json格式输出', `output_type` varchar(50) NULL DEFAULT 'JSON' COMMENT '输出类型:flow 流形式输出, json格式输出',
`page` tinyint(2) NULL DEFAULT '0' COMMENT '是否分页:0 false ,1 true',
`version` varchar(20) DEFAULT 'v1.0' COMMENT '版本号', `version` varchar(20) DEFAULT 'v1.0' COMMENT '版本号',
`sign_type` varchar(50) DEFAULT NULL COMMENT '加密方式: MD5 RSA', `sign_type` varchar(50) DEFAULT NULL COMMENT '加密方式: MD5 RSA',
`timeout` varchar(50) DEFAULT NULL COMMENT '超时时间', `timeout` varchar(50) DEFAULT NULL COMMENT '超时时间',
`file_id` bigint(20) NOT NULL COMMENT '文件夹id', `file_id` bigint(20) NOT NULL COMMENT '文件夹id',
`req_type` varchar(20) DEFAULT NULL COMMENT '限流类型:DAY 按天,MONTH 按月, YEAR 按年', `req_type` varchar(20) DEFAULT NULL COMMENT '限流类型:DAY 按天,MONTH 按月, YEAR 按年',
`req_frequency` bigint(20) DEFAULT '100' COMMENT '限制次数', `req_frequency` bigint(20) DEFAULT '100' COMMENT '限制次数',
`is_test` tinyint(2) NOT NULL DEFAULT '0' COMMENT '是否测试数据:0 否,1 是', `api_custom_id` bigint(20) NULL COMMENT 'API扩展表id'
`remark` varchar(500) DEFAULT NULL COMMENT '备注', `remark` varchar(500) DEFAULT NULL COMMENT '备注',
`create_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `create_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`create_user` varchar(100) DEFAULT NULL COMMENT '创建人', `create_user` varchar(100) DEFAULT NULL COMMENT '创建人',
...@@ -38,20 +34,18 @@ DROP TABLE IF EXISTS `t_api_interface_custom`; ...@@ -38,20 +34,18 @@ DROP TABLE IF EXISTS `t_api_interface_custom`;
CREATE TABLE `t_api_interface_custom` ( CREATE TABLE `t_api_interface_custom` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'api 信息表自增ID', `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'api 信息表自增ID',
`api_key` varchar(200) NOT NULL COMMENT 'api唯一标识', `api_key` varchar(200) NOT NULL COMMENT 'api唯一标识',
`api_interface_id` bigint(20) NOT NULL COMMENT 'api表自增id',
`api_type` varchar(50) DEFAULT '' COMMENT 'api类型:1 数据银行制作大数据表 2 数据银行制作数据包,3,数据银行制作自定义API 4 API实时接入 5 DMP标签查询 6.DMP大数据表查询 7 DMP自定义', `api_type` varchar(50) DEFAULT '' COMMENT 'api类型:1 数据银行制作大数据表 2 数据银行制作数据包,3,数据银行制作自定义API 4 API实时接入 5 DMP标签查询 6.DMP大数据表查询 7 DMP自定义',
`es_data_source` varchar(100) DEFAULT NULL COMMENT '数据源id', `es_data_source` varchar(100) DEFAULT NULL COMMENT '数据源id',
`es_data_base` varchar(100) DEFAULT NULL COMMENT '源数据库名称', `es_data_base` varchar(100) DEFAULT NULL COMMENT '源数据库名称',
`es_table` varchar(100) DEFAULT NULL COMMENT '源数据表名称', `es_table` varchar(100) DEFAULT NULL COMMENT '源数据表名称',
`handle_type` varchar(50) DEFAULT NULL COMMENT '处理类型',
`request_param` varchar(300) DEFAULT NULL COMMENT '请求参数', `request_param` varchar(300) DEFAULT NULL COMMENT '请求参数',
`response_param` varchar(300) DEFAULT NULL COMMENT '响应参数', `response_param` varchar(300) DEFAULT NULL COMMENT '响应参数',
`req_headers` varchar(300) DEFAULT NULL COMMENT '请求头', `req_headers` varchar(300) DEFAULT NULL COMMENT '请求头',
`resp_code` varchar(300) DEFAULT NULL COMMENT '响应状态码', `resp_code` varchar(300) DEFAULT NULL COMMENT '响应状态码',
`api_example` varchar(300) DEFAULT NULL COMMENT 'api返回样例', `api_example` varchar(300) DEFAULT NULL COMMENT 'api返回样例',
`inbox_param` varchar(300) NULL DEFAULT NULL COMMENT '固定参数', `inbox_param` varchar(300) NULL DEFAULT NULL COMMENT '固定参数',
`page_num` int(10) NULL DEFAULT '1' COMMENT '当前页', `page_num` int(10) NULL DEFAULT 1000000 COMMENT '最大行数',
`page_size` int(10) NULL DEFAULT '100' COMMENT '当前页显示数' `page_size` int(10) NULL DEFAULT 1000 COMMENT '每页返回行数',
`remark` varchar(500) DEFAULT NULL COMMENT '备注', `remark` varchar(500) DEFAULT NULL COMMENT '备注',
`create_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', `create_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`create_user` varchar(100) DEFAULT NULL COMMENT '创建人', `create_user` varchar(100) DEFAULT NULL COMMENT '创建人',
...@@ -67,7 +61,7 @@ DROP TABLE IF EXISTS `t_api_interface_file`; ...@@ -67,7 +61,7 @@ DROP TABLE IF EXISTS `t_api_interface_file`;
CREATE TABLE `t_api_interface_file` ( CREATE TABLE `t_api_interface_file` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'api文件表自增ID', `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'api文件表自增ID',
`project_id` bigint(20) NOT NULL COMMENT '项目编号', `project_id` bigint(20) NOT NULL COMMENT '项目编号',
`file_source` varchar(50) DEFAULT NULL COMMENT '文件来源:,1 dmp, 2 数据银行', `file_source` varchar(50) DEFAULT NULL COMMENT '文件来源:,1 API制做,2 组织创建',
`file_name` varchar(50) DEFAULT NULL COMMENT '文件名称', `file_name` varchar(50) DEFAULT NULL COMMENT '文件名称',
`file_en_name` varchar(50) DEFAULT NULL COMMENT '文件英文名称', `file_en_name` varchar(50) DEFAULT NULL COMMENT '文件英文名称',
`parent_id` bigint(20) DEFAULT NULL COMMENT '父类id', `parent_id` bigint(20) DEFAULT NULL COMMENT '父类id',
...@@ -94,6 +88,7 @@ CREATE TABLE `t_api_org` ( ...@@ -94,6 +88,7 @@ CREATE TABLE `t_api_org` (
`org_type` varchar(20) NULL DEFAULT NULL COMMENT '组织类型:OUT 外部组织, IN 内部组织', `org_type` varchar(20) NULL DEFAULT NULL COMMENT '组织类型:OUT 外部组织, IN 内部组织',
`status` tinyint(2) DEFAULT '1' COMMENT '状态: 0- 注销 1- 正常', `status` tinyint(2) DEFAULT '1' COMMENT '状态: 0- 注销 1- 正常',
`org_mail` varchar(100) DEFAULT NULL COMMENT '组织邮箱', `org_mail` varchar(100) DEFAULT NULL COMMENT '组织邮箱',
`org_folder_id` bigint(20) DEFAULT NULL COMMENT '组织所在文件夹id',
`org_sort` int(10) DEFAULT '999' COMMENT '组织排序', `org_sort` int(10) DEFAULT '999' COMMENT '组织排序',
`parent_id` varchar(100) DEFAULT NULL COMMENT '父类组织编码', `parent_id` varchar(100) DEFAULT NULL COMMENT '父类组织编码',
`remark` varchar(500) DEFAULT NULL COMMENT '备注', `remark` varchar(500) DEFAULT NULL COMMENT '备注',
......
...@@ -30,4 +30,10 @@ public class TagConstants { ...@@ -30,4 +30,10 @@ public class TagConstants {
//redis限流相关 //redis限流相关
public static final String OPEN_API_REDIS_LIMIT_KEY = "jz:openapi:redis:limit:"; public static final String OPEN_API_REDIS_LIMIT_KEY = "jz:openapi:redis:limit:";
//API缓存Key
public static final String OPEN_API_CACHE_KEY = "jz:openapi:cache:";
} }
...@@ -62,16 +62,6 @@ public class OrganizationManageController { ...@@ -62,16 +62,6 @@ public class OrganizationManageController {
public Mono<Result> add(@RequestBody @Valid OrganizationManageAddReq req) { public Mono<Result> add(@RequestBody @Valid OrganizationManageAddReq req) {
return Mono.fromSupplier(() -> organizationManageService.add(req)); return Mono.fromSupplier(() -> organizationManageService.add(req));
} }
/**
* @Description:更新组织信息
* @Author: Mr.zhang
* @Date: 2020-12-24
*/
/* @ApiOperation("更新组织信息")
@PostMapping(value = "/update")
public Mono<Result> update(@RequestBody @Valid OrganizationManageUpdateReq req) {
return Mono.fromSupplier(() -> organizationManageService.update(req));
}*/
/** /**
* @Description:注销组织 * @Description:注销组织
* @Author: Mr.zhang * @Author: Mr.zhang
......
package com.jz.dm.controller; package com.jz.dm.controller;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.dm.models.req.make.*; import com.jz.dm.models.req.CreateFolderReq;
import com.jz.dm.models.req.make.ApiInterfaceReq;
import com.jz.dm.service.ProducerService; import com.jz.dm.service.ProducerService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -46,115 +47,125 @@ public class ProducerController { ...@@ -46,115 +47,125 @@ public class ProducerController {
*/ */
@ApiOperation("创建项目文件夹") @ApiOperation("创建项目文件夹")
@PostMapping(value = "/createProjectFolder") @PostMapping(value = "/createProjectFolder")
public Mono<Result> createProjectFolder(@RequestParam(name = "projectId")Long projectId, public Mono<Result> createProjectFolder(@RequestBody @Valid CreateFolderReq req) {
@RequestParam(name = "parentId")Long parentId, return Mono.fromSupplier(() -> producerService.createProjectFolder(req));
@RequestParam(name = "currentUser") String currentUser ) {
return Mono.fromSupplier(() -> producerService.createProjectFolder(projectId,parentId,currentUser));
} }
/** /**
* @Description:Api制作(自定义DMP) * @Description:获取APIID
* @Author: Mr.zhang * @Author: Mr.zhang
* @Date: 2020-12-26 * @Date: 2020-12-26
*/ */
@ApiOperation("Api制作(自定义DMP)") @ApiOperation("Api制作(获取ApiId)")
@PostMapping(value = "/getCustomApiId")
public Mono<Result> getCustomApiId() {
return Mono.fromSupplier(() -> Result.of_success(producerService.getCustomApiId()));
}
/**
* @Description:Api制作(第三方)
* @Author: Mr.zhang
* @Date: 2020-12-26
*/
@ApiOperation("Api制作(第三方)")
@PostMapping(value = "/addCustomApi") @PostMapping(value = "/addCustomApi")
public Mono<Result> makeCustomApi(@RequestBody @Valid ApiInterfaceReq req) { public Mono<Result> makeCustomApi(@RequestBody @Valid ApiInterfaceReq req) {
return Mono.fromSupplier(() -> Result.of_success(producerService.addCustomApi(req))); return Mono.fromSupplier(() -> Result.of_success(producerService.saveInterfaceAPi(req)));
} }
/**
* @Description:Api制作(数据查询/标签查询)
* @Author: Mr.zhang
* @Date: 2020-12-26
*/
@ApiOperation("Api制作(数据查询/标签查询)")
@PostMapping(value = "/addDataTableSelect")
public Mono<Result> bigDataMakeApi(@RequestBody @Valid ApiInterfaceReq req) {
return Mono.fromSupplier(() -> producerService.addBigDataMakeApi(req));
}
/** /**
* @Description:Api制作(数据银行) * @Description:Api制作(大数据查询/标签查询)保存修改的api信息
* @return: (自定义更新同时使用)
* @Author: Mr.zhang * @Author: Mr.zhang
* @Date: 2020-12-26 * @Date: 2020-12-26
*/ */
/* @ApiOperation("保存修改的api信息")
@PostMapping(value = "/saveUpdate")
public Mono<Result> saveUpdateAPiInfo(@RequestBody @Valid ApiInterfaceReq req) {
return Mono.fromSupplier(() -> producerService.saveUpdateAPiInfo(req));
}*/
/* *//**
* @Description:Api制作(数据银行)
* @Author: Mr.zhang
* @Date: 2020-12-26
*//*
@ApiOperation("Api制作(数据银行)") @ApiOperation("Api制作(数据银行)")
@PostMapping(value = "/addDataBankApiInfo") @PostMapping(value = "/addDataBankApiInfo")
public Mono<Result> addDataBankApiInfo(@RequestBody @Valid MakeDataBankApiReq req) { public Mono<Result> addDataBankApiInfo(@RequestBody @Valid MakeDataBankApiReq req) {
return Mono.fromSupplier(() -> producerService.addDataBankApiInfo(req)); return Mono.fromSupplier(() -> producerService.addDataBankApiInfo(req));
} }
/** *//**
* @Description:Api制作(实时接入) * @Description:Api制作(实时接入)
* @Author: Mr.zhang * @Author: Mr.zhang
* @Date: 2020-12-26 * @Date: 2020-12-26
*/ *//*
@ApiOperation("Api制作(实时接入)") @ApiOperation("Api制作(实时接入)")
@PostMapping(value = "/realMakeApi") @PostMapping(value = "/realMakeApi")
public Mono<Result> realCustomApi(@RequestBody @Valid MakeRealCustomApiReq req) { public Mono<Result> realCustomApi(@RequestBody @Valid MakeRealCustomApiReq req) {
return Mono.fromSupplier(() -> Result.of_success(producerService.addRealCustomApi(req))); return Mono.fromSupplier(() -> Result.of_success(producerService.addRealCustomApi(req)));
} }*/
/**
* @Description:Api制作(大数据查询/标签查询)
* @return:
* @Author: Mr.zhang
* @Date: 2020-12-26
*/
@ApiOperation("Api制作(大数据查询/标签查询)")
@PostMapping(value = "/makeBigDataApi")
public Mono<Result> bigDataMakeApi(@RequestBody @Valid MakeBigDataApiReq req) {
return Mono.fromSupplier(() -> producerService.addBigDataMakeApi(req));
}
/** /**
* @Description:保存API基本信息/自定义API * @Description:保存API基本信息/自定义API
* @return: (保存API基本信息) * @return: (保存API基本信息)
* @Author: Mr.zhang * @Author: Mr.zhang
* @Date: 2020-12-26 * @Date: 2020-12-26
*/ *//*
@ApiOperation("保存API基本信息") @ApiOperation("保存API基本信息")
@PostMapping(value = "/saveInterface") @PostMapping(value = "/saveInterface")
public Mono<Result> saveInsetInterface(@RequestBody @Valid ApiInterfaceReq req) { public Mono<Result> saveInsetInterface(@RequestBody @Valid ApiInterfaceReq req) {
return Mono.fromSupplier(() -> producerService.saveInterfaceAPi(req)); return Mono.fromSupplier(() -> producerService.saveInterfaceAPi(req));
} }*/
/**
* @Description:Api制作(大数据查询/标签查询)保存修改的api信息
* @return: (自定义更新同时使用)
* @Author: Mr.zhang
* @Date: 2020-12-26
*/
@ApiOperation("保存修改的api信息")
@PostMapping(value = "/saveUpdate")
public Mono<Result> saveUpdateAPiInfo(@RequestBody @Valid ApiInterfaceReq req) {
return Mono.fromSupplier(() -> producerService.saveUpdateAPiInfo(req));
}
/** /*
*//**
* @Description:获取数据源配置 * @Description:获取数据源配置
* @Author: Mr.zhang * @Author: Mr.zhang
* @Date: 2020-12-26 * @Date: 2020-12-26
*/ *//*
@ApiOperation("获取数据源配置") @ApiOperation("获取数据源配置")
@PostMapping(value = "/getSourceConfig") @PostMapping(value = "/getSourceConfig")
public Mono<Result> getSourceConfig(@RequestBody @Valid SourceConfigReq req) { public Mono<Result> getSourceConfig(@RequestBody @Valid SourceConfigReq req) {
return Mono.fromSupplier(() -> producerService.getSourceConfig(req)); return Mono.fromSupplier(() -> producerService.getSourceConfig(req));
} }
/** *//**
* @Description:获取索引 * @Description:获取索引
* @Author: Mr.zhang * @Author: Mr.zhang
* @Date: 2020-12-26 * @Date: 2020-12-26
*/ *//*
@ApiOperation("获取索引") @ApiOperation("获取索引")
@GetMapping(value = "/getIndicess") @GetMapping(value = "/getIndicess")
public Mono<Result> getSourceWarehouseList(@RequestParam(name = "id") Long id) { public Mono<Result> getSourceWarehouseList(@RequestParam(name = "id") Long id) {
return Mono.fromSupplier(() -> producerService.getSourceWarehouseList(id)); return Mono.fromSupplier(() -> producerService.getSourceWarehouseList(id));
} }
/** *//**
* @Description:获取某个索引下的type * @Description:获取某个索引下的type
* @Author: Mr.zhang * @Author: Mr.zhang
* @Date: 2020-12-26 * @Date: 2020-12-26
*/ *//*
@ApiOperation("获取某个索引下的type") @ApiOperation("获取某个索引下的type")
@GetMapping(value = "/getIndicesTypes") @GetMapping(value = "/getIndicesTypes")
public Mono<Result> getIndicesTypes(@RequestParam(name = "indices") String indices, public Mono<Result> getIndicesTypes(@RequestParam(name = "indices") String indices,
@RequestParam(name = "id") Long id) { @RequestParam(name = "id") Long id) {
return Mono.fromSupplier(() -> producerService.getIndicesTypes(indices,id)); return Mono.fromSupplier(() -> producerService.getIndicesTypes(indices,id));
} }
/** *//**
* @Description:获取某个索引 type的fields * @Description:获取某个索引 type的fields
* @Author: Mr.zhang * @Author: Mr.zhang
* @Date: 2020-12-26 * @Date: 2020-12-26
*/ *//*
@ApiOperation("获取某个索引 type的fields") @ApiOperation("获取某个索引 type的fields")
@GetMapping(value = "/getIndicesTypesFields") @GetMapping(value = "/getIndicesTypesFields")
public Mono<Result> getIndicesTypesFields(@RequestParam(name = "indices") String indices, public Mono<Result> getIndicesTypesFields(@RequestParam(name = "indices") String indices,
...@@ -174,5 +185,5 @@ public class ProducerController { ...@@ -174,5 +185,5 @@ public class ProducerController {
@GetMapping(value = "/getRedisObj") @GetMapping(value = "/getRedisObj")
public Result getObjOnRedis() { public Result getObjOnRedis() {
return producerService.getObjOnRedis(); return producerService.getObjOnRedis();
} }*/
} }
...@@ -38,12 +38,6 @@ public class ApiInterface extends BaseObject implements Serializable { ...@@ -38,12 +38,6 @@ public class ApiInterface extends BaseObject implements Serializable {
@JsonIgnore @JsonIgnore
private String apiName; private String apiName;
/**
* api描述
*/
@TableField("api_desc")
private String apiDesc;
/** /**
* api请求协议:http,https * api请求协议:http,https
*/ */
...@@ -51,16 +45,11 @@ public class ApiInterface extends BaseObject implements Serializable { ...@@ -51,16 +45,11 @@ public class ApiInterface extends BaseObject implements Serializable {
private String apiProtocl; private String apiProtocl;
/** /**
* api类型:1 数据银行制作大数据表 2 数据银行制作数据包,3,数据银行制作自定义API 4 API实时接入 5 DMP标签查询 6.DMP大数据表查询 7 DMP自定义' * api类型: 1 API实时接入 2 DMP标签查询 3 数据表查询 4 三方查询'
*/ */
@TableField("api_type") @TableField("api_type")
private String apiType; private String apiType;
/**
* 请求地址
*/
@TableField("api_path")
private String apiPath;
/** /**
* 目标url * 目标url
*/ */
...@@ -76,21 +65,13 @@ public class ApiInterface extends BaseObject implements Serializable { ...@@ -76,21 +65,13 @@ public class ApiInterface extends BaseObject implements Serializable {
*/ */
@TableField("join_type") @TableField("join_type")
private String joinType; private String joinType;
/**
* 测试实例
*/
@TableField("test_example")
private String testExample;
/** /**
* '输出类型:flow 流形式输出, json格式输出', * '输出类型:flow 流形式输出, json格式输出',
*/ */
@TableField("output_type") @TableField("output_type")
private String outputType; private String outputType;
/**
* 是否分页:0 false ,1 true
*/
@TableField("page")
private Boolean page;
/** /**
* 状态(1-草稿 2-发布 3-过时 4-冻结 5-失效) * 状态(1-草稿 2-发布 3-过时 4-冻结 5-失效)
...@@ -132,17 +113,18 @@ public class ApiInterface extends BaseObject implements Serializable { ...@@ -132,17 +113,18 @@ public class ApiInterface extends BaseObject implements Serializable {
@TableField("timeout") @TableField("timeout")
private String timeout; private String timeout;
/**
* 是否测试数据:0 否,1 是
*/
@TableField("is_test")
private Integer isTest;
/** /**
* 文件夹id * 文件夹id
*/ */
@TableField("file_id") @TableField("file_id")
private Long fileId; private Long fileId;
/**
* API扩展表id
*/
@TableField("api_custom_id")
private Long apiCustomId;
/*-----------------------------------保存数据库时忽略字段--------------------------------*/ /*-----------------------------------保存数据库时忽略字段--------------------------------*/
/** /**
* 请求总次数 * 请求总次数
......
...@@ -33,8 +33,8 @@ public class ApiInterfaceCustom extends BaseObject implements Serializable { ...@@ -33,8 +33,8 @@ public class ApiInterfaceCustom extends BaseObject implements Serializable {
/** /**
* apiInterfaceId * apiInterfaceId
*/ */
@TableField("api_interface_id") /* @TableField("api_interface_id")
private Long apiInterfaceId; private Long apiInterfaceId;*/
/** /**
...@@ -94,14 +94,15 @@ public class ApiInterfaceCustom extends BaseObject implements Serializable { ...@@ -94,14 +94,15 @@ public class ApiInterfaceCustom extends BaseObject implements Serializable {
@TableField("inbox_param") @TableField("inbox_param")
private String inboxParam; private String inboxParam;
/** /**
* 当前页 * 最大行数
*/ */
@TableField("page_num") @TableField("max_row")
private Integer pageNum; private Long maxRow;
/** /**
* 当前页显示数据 * 每页返回行数
*/ */
@TableField("page_size") @TableField("page_row")
private Integer pageSize; private Long pageRow;
} }
...@@ -31,17 +31,11 @@ public class ApiInterfaceFile extends BaseObject implements Serializable { ...@@ -31,17 +31,11 @@ public class ApiInterfaceFile extends BaseObject implements Serializable {
private Long projectId; private Long projectId;
/** /**
* 文件来源:1 DMP 2 数据银行 * 文件来源:,1 API制做,2 组织创建
*/ */
@TableField("file_source") @TableField("file_source")
private String fileSource; private String fileSource;
///**
//* 文件类型:1 文件夹 ,2 文件
//*/
//@TableField("file_type")
//private String fileType;
/** /**
* 文件名称 * 文件名称
*/ */
......
...@@ -55,6 +55,13 @@ public class ApiOrg extends BaseObject implements Serializable { ...@@ -55,6 +55,13 @@ public class ApiOrg extends BaseObject implements Serializable {
*/ */
@TableField("linkman") @TableField("linkman")
private String linkman; private String linkman;
/**
* 组织目录文件夹
*/
@TableField("org_folder_id")
private Long orgFolderId;
/** /**
* 组织类型 OUT 外部组织 IN 内部组织 * 组织类型 OUT 外部组织 IN 内部组织
*/ */
......
...@@ -20,27 +20,28 @@ import java.io.Serializable; ...@@ -20,27 +20,28 @@ import java.io.Serializable;
@ApiModel(value = "api基本信息") @ApiModel(value = "api基本信息")
public class ApiInterfaceReq implements Serializable { public class ApiInterfaceReq implements Serializable {
@ApiModelProperty(value = "接口描述",required = false)
public String apiDesc;
@ApiModelProperty(value = "传输方式:http https",required = true) @ApiModelProperty(value = "传输方式:http https",required = true)
@NotNull(message = "传输方式不能为空") @NotNull(message = "传输方式不能为空")
public String transMode; public String apiProtocl;
@ApiModelProperty(value = "加密方式0 无,1:MD5 2:RSA",required = true) @ApiModelProperty(value = "加密方式0 无,1:MD5 2:RSA",required = true)
@NotNull(message = "加密方式不能为空") @NotNull(message = "加密方式不能为空")
public String signType; public String signType;
@ApiModelProperty(value = "接入类型:对应字典表key",required = true) @ApiModelProperty(value = "Api类型:对应字典表key",required = true)
@NotNull(message = "接入类型不能为空") @NotNull(message = "Api类型不能为空")
public String joinType; public String joinType;
@ApiModelProperty(value = "apiKey",required = true)
@NotNull(message = "apiKey不能为空")
public String apiKey;
@ApiModelProperty(value = "目标地址",required = true) @ApiModelProperty(value = "目标地址",required = true)
@NotNull(message="目标地址不能为空") @NotNull(message="目标地址不能为空")
public String targetUrl; public String targetUrl;
@ApiModelProperty(value = "请求方式:GET POST",required = false) @ApiModelProperty(value = "请求方式:GET POST",required = true)
@NotNull(message="请求方式不能为空")
public String reqMethod; public String reqMethod;
@ApiModelProperty(value = "超时时间",required = true) @ApiModelProperty(value = "超时时间",required = true)
...@@ -51,22 +52,49 @@ public class ApiInterfaceReq implements Serializable { ...@@ -51,22 +52,49 @@ public class ApiInterfaceReq implements Serializable {
@NotNull(message = "限流类型不能为空") @NotNull(message = "限流类型不能为空")
public String reqType; public String reqType;
@ApiModelProperty(value = "API名称",required = false)
public String apiName;
@ApiModelProperty(value = "限制次数",required = false) @ApiModelProperty(value = "限制次数",required = false)
public Long reqFrequency; public Long reqFrequency;
@ApiModelProperty(value = "api描述",required = false) @ApiModelProperty(value = "api描述",required = false)
public String apiFunction; public String apiFunction;
/* @ApiModelProperty(value = "父类文件id,一级文件夹传入0",required = false) @ApiModelProperty(value = "文件夹Id",required = true)
public Long parentId; @NotNull(message="文件夹Id不能为空")
public Long folderId;
@ApiModelProperty(value = "项目编号",required = true)
@NotNull(message="项目编号不能为空")
public Long projectId;
@ApiModelProperty(value = "输出类型:JSON 文件流形式",required = false)
public String outType;
@ApiModelProperty(value = "文件id",required = false) @ApiModelProperty(value = "最大行数:",required = false)
public Long fileId; public Long maxRow;
@ApiModelProperty(value = "项目id",required = true) @ApiModelProperty(value = "每页返回数据数:",required = false)
@NotNull(message="项目id不能为空") public Long pageRow;
public Long projectId;*/
@ApiModelProperty(value = "请求参数:",required = false)
public String requestParam;
@ApiModelProperty(value = "响应参数:",required = false)
public String responseParam;
@ApiModelProperty(value = "参数字段:",required = false)
public String tableFields;
@ApiModelProperty(value = "数据源id",required = false)
public String esDataSource;
@ApiModelProperty(value = "数据库名称",required = false)
public String esDataBase;
@ApiModelProperty(value = "数据表名称",required = false)
public String esTable;
@ApiModelProperty(value = "状态",required = false) @ApiModelProperty(value = "状态",required = false)
public String status; public String status;
...@@ -75,6 +103,8 @@ public class ApiInterfaceReq implements Serializable { ...@@ -75,6 +103,8 @@ public class ApiInterfaceReq implements Serializable {
public Long id; public Long id;
@ApiModelProperty(value = "创建用户",hidden = true) @ApiModelProperty(value = "创建用户",hidden = true)
public String createUser; public String createUser;
@ApiModelProperty(value = "创建用户",hidden = true)
public String updateUser;
@ApiModelProperty(value = "api类型:1.数据银行制作大数据表 " + @ApiModelProperty(value = "api类型:1.数据银行制作大数据表 " +
"2 数据银行制作数据包,3,数据银行制作自定义API " + "2 数据银行制作数据包,3,数据银行制作自定义API " +
......
...@@ -20,14 +20,10 @@ import java.io.Serializable; ...@@ -20,14 +20,10 @@ import java.io.Serializable;
@ApiModel("组织管理详情请求体") @ApiModel("组织管理详情请求体")
public class OrganizationManageAddReq implements Serializable { public class OrganizationManageAddReq implements Serializable {
@ApiModelProperty(value = "组织类型:INT 内部组织 OUT 外部组织",required = true) /*@ApiModelProperty(value = "组织类型:INT 内部组织 OUT 外部组织",required = true)
@NotNull(message = "组织类型不能为空!") @NotNull(message = "组织类型不能为空!")
private String orgType; private String orgType;
@ApiModelProperty(value = "组织名称",required = true)
@NotNull(message = "组织名称不能为空")
private String orgName;
@ApiModelProperty(value = "组织描述",required = false) @ApiModelProperty(value = "组织描述",required = false)
private String orgDesc; private String orgDesc;
...@@ -35,21 +31,31 @@ public class OrganizationManageAddReq implements Serializable { ...@@ -35,21 +31,31 @@ public class OrganizationManageAddReq implements Serializable {
private String orgCnName; private String orgCnName;
@ApiModelProperty(value = "组织邮箱",required = false) @ApiModelProperty(value = "组织邮箱",required = false)
private String orgMail; private String orgMail;*/
@ApiModelProperty(value = "组织名称",required = true)
@NotNull(message = "组织名称不能为空")
private String orgName;
@ApiModelProperty(value = "组织电话",required = false) @ApiModelProperty(value = "组织电话",required = true)
@NotNull(message="组织电话不能为空")
private String orgPhone; private String orgPhone;
@ApiModelProperty(value = "组织联系人",required = false) @ApiModelProperty(value = "组织联系人",required = true)
@NotNull(message="组织联系人不能为空")
private String linkman; private String linkman;
@ApiModelProperty(value = "文件夹Id",required = true)
@NotNull(message="文件夹Id不能为空")
private Long orgFolderId;
@ApiModelProperty(value = "备注",required = false) @ApiModelProperty(value = "备注",required = false)
private String remark; private String remark;
@ApiModelProperty(value = "创建用户",required = false) @ApiModelProperty(value = "创建用户",required = false)
private String createUser; private String createUser;
@ApiModelProperty(value = "创建用户",required = false) @ApiModelProperty(value = "更新用户",required = false)
private String updateUser; private String updateUser;
@ApiModelProperty(value = "id ----更新时必传",required = false) @ApiModelProperty(value = "id ----更新时必传",required = false)
......
...@@ -38,12 +38,6 @@ public interface OrganizationManageService { ...@@ -38,12 +38,6 @@ public interface OrganizationManageService {
*/ */
Result add(OrganizationManageAddReq req); Result add(OrganizationManageAddReq req);
/**
* 更新组织信息
* @param req
* @return
*/
//Result update(OrganizationManageUpdateReq req);
/** /**
* 根据id注销组织 * 根据id注销组织
......
package com.jz.dm.service; package com.jz.dm.service;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.dm.models.req.make.*; import com.jz.dm.models.req.CreateFolderReq;
import com.jz.dm.models.req.make.ApiInterfaceReq;
/** /**
* @author ZC * @author ZC
...@@ -13,40 +14,34 @@ import com.jz.dm.models.req.make.*; ...@@ -13,40 +14,34 @@ import com.jz.dm.models.req.make.*;
* @Description: * @Description:
**/ **/
public interface ProducerService { public interface ProducerService {
/**
* 制作自定义APi
* @param req
* @return
*/
Result addCustomApi(ApiInterfaceReq req);
/** /**
* Api制作(实时接入) * Api制作(实时接入)
* @param req * @param req
* @return * @return
*/ */
Result addRealCustomApi(MakeRealCustomApiReq req); // Result addRealCustomApi(MakeRealCustomApiReq req);
/** /**
* Api制作(数据查询/标签查询) * Api制作(数据查询/标签查询)
* @param req * @param req
* @return * @return
*/ */
Result addBigDataMakeApi(MakeBigDataApiReq req); Result addBigDataMakeApi(ApiInterfaceReq req);
/** /**
* 获取数据源配置 * 获取数据源配置
* @param req * @param req
* @return * @return
*/ */
Result getSourceConfig(SourceConfigReq req); // Result getSourceConfig(SourceConfigReq req);
/** /**
* 获取数据库列表 * 获取数据库列表
* @param id * @param id
* @return * @return
*/ */
Result getSourceWarehouseList(Long id); // Result getSourceWarehouseList(Long id);
/** /**
* 获取某个索引下的type * 获取某个索引下的type
...@@ -54,7 +49,7 @@ public interface ProducerService { ...@@ -54,7 +49,7 @@ public interface ProducerService {
* @param id * @param id
* @return * @return
*/ */
Result getIndicesTypes(String indices, Long id); // Result getIndicesTypes(String indices, Long id);
/** /**
* 获取某个索引 type的fields * 获取某个索引 type的fields
...@@ -63,22 +58,22 @@ public interface ProducerService { ...@@ -63,22 +58,22 @@ public interface ProducerService {
* @param id * @param id
* @return * @return
*/ */
Result getIndicesTypesFields(String indices, String type, Long id); // Result getIndicesTypesFields(String indices, String type, Long id);
/** /**
* 保存修改的api信息 * 数据银行制作API/数据包
* @param req * @param req
* @return * @return
*/ */
Result saveUpdateAPiInfo(ApiInterfaceReq req); // Result addDataBankApiInfo(MakeDataBankApiReq req);
/** /**
* 数据银行制作API/数据包 * 保存修改的api信息
* @param req * @param req
* @return * @return
*/ */
Result addDataBankApiInfo(MakeDataBankApiReq req); //Result saveUpdateAPiInfo(ApiInterfaceReq req);
/** /**
* 保存 API基本信息 * 保存 API基本信息
...@@ -96,15 +91,21 @@ public interface ProducerService { ...@@ -96,15 +91,21 @@ public interface ProducerService {
/** /**
* 创建文件夹 * 创建文件夹
* @param projectId * @param req
* @param parentId
* @param currentUser
* @return * @return
*/ */
Result createProjectFolder(Long projectId, Long parentId,String currentUser); Result createProjectFolder(CreateFolderReq req);
/**
* 获取生成后的APIId
* @return
*/
Result getCustomApiId();
//Result saveObjOnRedis();
//Result getObjOnRedis();
Result saveObjOnRedis();
Result getObjOnRedis();
} }
...@@ -77,9 +77,16 @@ dmp: ...@@ -77,9 +77,16 @@ dmp:
ignoreRedis: true ignoreRedis: true
openapi: openapi:
timeout: timeout:
default: 5000 default: 10000
max: 5000 max: 10000
#logback日志配置
logging:
config: classpath:logback-dev.xml
level:
com:
zhl:
springbootlogback: off
#流处理配置 #流处理配置
windows: #文件流输出地址设置 windows: #文件流输出地址设置
name: stream name: stream
...@@ -95,17 +102,16 @@ sentinel: #sentinel每秒中最大的请求个数 ...@@ -95,17 +102,16 @@ sentinel: #sentinel每秒中最大的请求个数
data: data:
bank: bank:
balanceUrl: http://192.168.1.139:8081 #余额信息url #扣款信通知url balanceUrl: http://192.168.1.139:8081 #余额信息url #扣款信通知url
select: #大数据查询请求链接
jsonUrl: http://192.168.1.140:8082/api/data/query/json
flowUrl: http://192.168.1.140:8082/api/data/query/streaming
#token: #dataBank 制作验签
# dataBank: dataBank123
token: #dataBank 制作验签
dataBank: dataBank123
#logback日志配置
logging:
config: classpath:logback-dev.xml
level:
com:
zhl:
springbootlogback: off
......
...@@ -2,10 +2,8 @@ package com.jz.dm.gateway.org; ...@@ -2,10 +2,8 @@ package com.jz.dm.gateway.org;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.jz.common.utils.Result; import com.jz.common.utils.Result;
import com.jz.dm.common.enums.auth.AuthTypeEnum;
import com.jz.dm.gateway.SpringTestCase; import com.jz.dm.gateway.SpringTestCase;
import com.jz.dm.models.domian.ApiOrg; import com.jz.dm.models.domian.ApiOrg;
import com.jz.dm.models.req.organizationManage.OrganizationManageAddReq;
import com.jz.dm.models.req.organizationManage.OrganizationManageDetailQueryReq; import com.jz.dm.models.req.organizationManage.OrganizationManageDetailQueryReq;
import com.jz.dm.models.req.organizationManage.OrganizationManageListQueryReq; import com.jz.dm.models.req.organizationManage.OrganizationManageListQueryReq;
import com.jz.dm.service.OrganizationManageService; import com.jz.dm.service.OrganizationManageService;
...@@ -53,7 +51,7 @@ public class TestOrganizationManage extends SpringTestCase { ...@@ -53,7 +51,7 @@ public class TestOrganizationManage extends SpringTestCase {
*/ */
@Test @Test
public void addOrg(){ public void addOrg(){
OrganizationManageAddReq req = new OrganizationManageAddReq(); /* OrganizationManageAddReq req = new OrganizationManageAddReq();
req.setOrgName("数据银行"); req.setOrgName("数据银行");
req.setOrgDesc("粗这次"); req.setOrgDesc("粗这次");
req.setOrgCnName("databank"); req.setOrgCnName("databank");
...@@ -62,7 +60,7 @@ public class TestOrganizationManage extends SpringTestCase { ...@@ -62,7 +60,7 @@ public class TestOrganizationManage extends SpringTestCase {
req.setOrgPhone("18279668524"); req.setOrgPhone("18279668524");
req.setOrgType(AuthTypeEnum.DATA_BANK_AUTH.name()); req.setOrgType(AuthTypeEnum.DATA_BANK_AUTH.name());
Result result = organizationManageService.add(req); Result result = organizationManageService.add(req);
System.out.println(result.getMessage()); System.out.println(result.getMessage());*/
} }
/** /**
......
...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject; ...@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Random;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -15,16 +16,24 @@ import java.util.stream.Collectors; ...@@ -15,16 +16,24 @@ import java.util.stream.Collectors;
*/ */
public class TestStr { public class TestStr {
public static void main(String[] args) { public static void main(String[] args) {
Random ran = new Random();
int num = ran.nextInt(999999);
String str = String.format("%06d", num);
System.out.println(str);
String stereo = "000101";
Integer valueOf = Integer.valueOf(stereo);
System.out.println(valueOf);
}
public void resolveParameter(){
String str ="[{\"name\":\"flelds1\",\"bindName\":\"flelds1\",\"type\":\"BIGINT\",\"sampleValue\":\"1\",\"defaultValue\":\"1\",\"required\":true,\"desc\":\"\"},{\"name\":\"flelds2\",\"bindName\":\"flelds2\",\"type\":\"BIGINT\",\"sampleValue\":\"1\",\"defaultValue\":\"1\",\"required\":true,\"desc\":\"\"}]"; String str ="[{\"name\":\"flelds1\",\"bindName\":\"flelds1\",\"type\":\"BIGINT\",\"sampleValue\":\"1\",\"defaultValue\":\"1\",\"required\":true,\"desc\":\"\"},{\"name\":\"flelds2\",\"bindName\":\"flelds2\",\"type\":\"BIGINT\",\"sampleValue\":\"1\",\"defaultValue\":\"1\",\"required\":true,\"desc\":\"\"}]";
String str2="[{\"name\":\"field1\",\"bindName\":\"field1\",\"type\":\"STRING\",\"sampleValue\":\"1\",\"desc\":\"\"},{\"name\":\"field2\",\"bindName\":\"field2\",\"type\":\"BIGINT\",\"sampleValue\":\"1\",\"desc\":\"\"},{\"name\":\"field3\",\"bindName\":\"field3\",\"type\":\"BIGINT\",\"sampleValue\":\"1\",\"desc\":\"\"},{\"name\":\"field4\",\"bindName\":\"field4\",\"type\":\"STRING\",\"sampleValue\":\"1\",\"desc\":\"\"}]"; String str2="[{\"name\":\"field1\",\"bindName\":\"field1\",\"type\":\"STRING\",\"sampleValue\":\"1\",\"desc\":\"\"},{\"name\":\"field2\",\"bindName\":\"field2\",\"type\":\"BIGINT\",\"sampleValue\":\"1\",\"desc\":\"\"},{\"name\":\"field3\",\"bindName\":\"field3\",\"type\":\"BIGINT\",\"sampleValue\":\"1\",\"desc\":\"\"},{\"name\":\"field4\",\"bindName\":\"field4\",\"type\":\"STRING\",\"sampleValue\":\"1\",\"desc\":\"\"}]";
List<Map> maps = JSONObject.parseArray(str2, Map.class); List<Map> maps = JSONObject.parseArray(str2, Map.class);
for (Map map : maps) { for (Map map : maps) {
System.out.println("map:"+map); System.out.println("map:"+map);
} }
}
}
/** /**
* 获取集合信息 * 获取集合信息
*/ */
......
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