Commit 88042ad1 authored by zhangc's avatar zhangc

添加function列表查询接口

parent 47c2622a
...@@ -279,3 +279,21 @@ CREATE TABLE `t_api_direction` ( ...@@ -279,3 +279,21 @@ CREATE TABLE `t_api_direction` (
`is_deleted` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '是否删除', `is_deleted` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '是否删除',
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='api字典表信息表'; ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='api字典表信息表';
# api模板方法表
CREATE TABLE `t_api_function` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'api 信息表自增ID',
`alias` varchar(100) DEFAULT NULL COMMENT '别名',
`name` varchar(100) NOT NULL COMMENT '模板名称',
`template_url` varchar(200) DEFAULT '' COMMENT '请求路径',
`type` varchar(100) DEFAULT '' COMMENT '模板类型',
`status` tinyint(2) NOT NULL DEFAULT '1' COMMENT '是否启用:0 否, 1 是',
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
`create_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`create_user` varchar(100) DEFAULT NULL COMMENT '创建人',
`update_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
`update_user` varchar(100) DEFAULT NULL COMMENT '更新人',
`is_deleted` tinyint(2) unsigned NOT NULL DEFAULT '0' COMMENT '是否删除',
PRIMARY KEY (`id`),
UNIQUE KEY `API_ID_UNIQ_INDEX` (`name`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='api模板方法表';
\ No newline at end of file
package com.jz.dm.common.enums;
/**
* 路由类型
* @author key
*/
public enum RouteType {
/**
* 漏油类型
*/
SRPING;
}
...@@ -15,7 +15,7 @@ public enum DirectionTypeEnum { ...@@ -15,7 +15,7 @@ public enum DirectionTypeEnum {
*/ */
API_TYPE; API_TYPE;
public static DirectionTypeEnum fromTypeName(String typeName) { public static DirectionTypeEnum fromTypeDirectionName(String typeName) {
for (DirectionTypeEnum type : DirectionTypeEnum.values()) { for (DirectionTypeEnum type : DirectionTypeEnum.values()) {
if (type.name().equals(typeName)) { if (type.name().equals(typeName)) {
return type; return type;
......
...@@ -25,7 +25,7 @@ public enum OrgStatusEnum { ...@@ -25,7 +25,7 @@ public enum OrgStatusEnum {
return text; return text;
} }
public static OrgStatusEnum fromTypeName(String typeName) { public static OrgStatusEnum fromOrgStatusTypeName(String typeName) {
for (OrgStatusEnum type : OrgStatusEnum.values()) { for (OrgStatusEnum type : OrgStatusEnum.values()) {
if (type.name().equals(typeName)) { if (type.name().equals(typeName)) {
return type; return type;
......
...@@ -42,16 +42,6 @@ public enum OpenApiResultCode implements ResultCode { ...@@ -42,16 +42,6 @@ public enum OpenApiResultCode implements ResultCode {
/** 签名校验错误 */ /** 签名校验错误 */
SIGN_VERIFY_ERROR("SIGN_VERIFY_ERROR", "签名校验错误"), SIGN_VERIFY_ERROR("SIGN_VERIFY_ERROR", "签名校验错误"),
/*
*//** 不支持该信息摘要算法 *//*
NO_SUCH_MD_ALGORITHM("NO_SUCH_MD_ALGORITHM", "不支持该信息摘要算法"),*/
/*
*/
/** 信息摘要错误 *//*
MESSAGE_DIGEST_ERROR("MESSAGE_DIGEST_ERROR", "信息摘要错误"),
*/
/** 数据加密错误 */ /** 数据加密错误 */
DATA_ENCRYPTION_ERROR("DATA_ENCRYPTION_ERROR", "数据加密错误"),; DATA_ENCRYPTION_ERROR("DATA_ENCRYPTION_ERROR", "数据加密错误"),;
......
package com.jz.dm.config; package com.jz.dm.config;
import com.github.xiaoymin.swaggerbootstrapui.annotations.EnableSwaggerBootstrapUI; import com.github.xiaoymin.swaggerbootstrapui.annotations.EnableSwaggerBootstrapUI;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder; import springfox.documentation.builders.ApiInfoBuilder;
...@@ -21,9 +22,12 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2; ...@@ -21,9 +22,12 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2;
@EnableSwaggerBootstrapUI @EnableSwaggerBootstrapUI
public class SwaggerConfiguration { public class SwaggerConfiguration {
@Value("${swagger.enable}")
private Boolean swaggerEnable;
@Bean @Bean
public Docket createRestApi() { public Docket createRestApi() {
return new Docket(DocumentationType.SWAGGER_2) return new Docket(DocumentationType.SWAGGER_2)
.enable(swaggerEnable)
.apiInfo(apiInfo()) .apiInfo(apiInfo())
.select() .select()
.apis(RequestHandlerSelectors.basePackage("com.jz.dm.controller")) .apis(RequestHandlerSelectors.basePackage("com.jz.dm.controller"))
......
...@@ -73,6 +73,11 @@ public class ProducerController { ...@@ -73,6 +73,11 @@ public class ProducerController {
public Mono<Result> bigDataMakeApi(@RequestBody @Valid ApiInterfaceReq req) { public Mono<Result> bigDataMakeApi(@RequestBody @Valid ApiInterfaceReq req) {
return Mono.fromSupplier(() -> producerService.addBigDataMakeApi(req)); return Mono.fromSupplier(() -> producerService.addBigDataMakeApi(req));
} }
@ApiOperation("获取function模板列表")
@GetMapping(value = "/getFunctionTemplateList")
public Mono<Result> getFunctionTemplateList() {
return Mono.fromSupplier(() -> producerService.getFunctionTemplateList());
}
/* @ApiOperation("服务发布列表") /* @ApiOperation("服务发布列表")
@PostMapping(value = "/getServiceIssueList") @PostMapping(value = "/getServiceIssueList")
......
...@@ -33,7 +33,7 @@ public class MybatisPlusGenerate { ...@@ -33,7 +33,7 @@ public class MybatisPlusGenerate {
.setAuthor("ZC") .setAuthor("ZC")
// 生成路径,最好使用绝对路径,window路径是不一样的 // 生成路径,最好使用绝对路径,window路径是不一样的
//TODO TODO TODO TODO //TODO TODO TODO TODO
.setOutputDir("/Users/xdclass/Desktop/demo/src/main/java") .setOutputDir("C:\\Users\\key\\Desktop\\make")
// 文件覆盖 // 文件覆盖
.setFileOverride(true) .setFileOverride(true)
// 主键策略 // 主键策略
...@@ -59,11 +59,11 @@ public class MybatisPlusGenerate { ...@@ -59,11 +59,11 @@ public class MybatisPlusGenerate {
DataSourceConfig dsConfig = new DataSourceConfig(); DataSourceConfig dsConfig = new DataSourceConfig();
// 设置数据库类型 // 设置数据库类型
dsConfig.setDbType(DbType.MYSQL) dsConfig.setDbType(DbType.MYSQL)
.setDriverName("com.mysql.cj.jdbc.Driver") .setDriverName("com.mysql.jdbc.Driver")
//TODO TODO TODO TODO //TODO TODO TODO TODO
.setUrl("jdbc:mysql://127.0.0.1:3306/xd_shop?useSSL=false") .setUrl("jdbc:mysql://119.23.32.151:3306/api_gateway?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false")
.setUsername("root") .setUsername("dmp")
.setPassword("xdclass.net"); .setPassword("Ioubuy@2019@!");
//3. 策略配置globalConfiguration中 //3. 策略配置globalConfiguration中
StrategyConfig stConfig = new StrategyConfig(); StrategyConfig stConfig = new StrategyConfig();
...@@ -81,13 +81,13 @@ public class MybatisPlusGenerate { ...@@ -81,13 +81,13 @@ public class MybatisPlusGenerate {
// 生成的表, 支持多表一起生成,以数组形式填写 // 生成的表, 支持多表一起生成,以数组形式填写
//TODO TODO TODO TODO 两个方式,直接写,或者使用命令行输入 //TODO TODO TODO TODO 两个方式,直接写,或者使用命令行输入
.setInclude("product", "banner", "address", "coupon", "product_order"); .setInclude("t_api_function");
//.setInclude(scanner("表名,多个英文逗号分割").split(",")); //.setInclude(scanner("表名,多个英文逗号分割").split(","));
//TODO TODO TODO TODO //TODO TODO TODO TODO
//4. 包名策略配置(生成的项目包名) //4. 包名策略配置(生成的项目包名)
PackageConfig pkConfig = new PackageConfig(); PackageConfig pkConfig = new PackageConfig();
pkConfig.setParent("net.xdclass.shopmanager") pkConfig.setParent("com.jz.dm.models.domian")
.setMapper("mapper") .setMapper("mapper")
.setService("service") .setService("service")
.setController("controller") .setController("controller")
...@@ -103,7 +103,7 @@ public class MybatisPlusGenerate { ...@@ -103,7 +103,7 @@ public class MybatisPlusGenerate {
//6. 执行操作 //6. 执行操作
ag.execute(); ag.execute();
System.out.println("======= 小滴课堂 Done 相关代码生成完毕 ========"); System.out.println("======= Done 相关代码生成完毕 ========");
} }
/** /**
......
...@@ -125,6 +125,12 @@ public interface ProducerService { ...@@ -125,6 +125,12 @@ public interface ProducerService {
*/ */
Result serverUpload(Long id); Result serverUpload(Long id);
/**
* 获取function模板方法列表
* @return
*/
Result getFunctionTemplateList();
//Result saveObjOnRedis(); //Result saveObjOnRedis();
//Result getObjOnRedis(); //Result getObjOnRedis();
......
...@@ -14,15 +14,13 @@ import com.jz.dm.common.enums.GeneralStatusTypeEnum; ...@@ -14,15 +14,13 @@ import com.jz.dm.common.enums.GeneralStatusTypeEnum;
import com.jz.dm.common.enums.apiInterface.ApiInfoOutTypeEnum; import com.jz.dm.common.enums.apiInterface.ApiInfoOutTypeEnum;
import com.jz.dm.common.enums.apiInterface.ApiStatusEnum; import com.jz.dm.common.enums.apiInterface.ApiStatusEnum;
import com.jz.dm.common.util.RandomUtil; import com.jz.dm.common.util.RandomUtil;
import com.jz.dm.mapper.ApiInterfaceCustomMapper; import com.jz.dm.mapper.*;
import com.jz.dm.mapper.ApiInterfaceFileMapper;
import com.jz.dm.mapper.ApiInterfaceMapper;
import com.jz.dm.mapper.ApiOpenApiEsFieldsMapper;
import com.jz.dm.models.domian.*; import com.jz.dm.models.domian.*;
import com.jz.dm.models.dto.DataFileDto; import com.jz.dm.models.dto.DataFileDto;
import com.jz.dm.models.req.folder.CreateFolderReq; import com.jz.dm.models.req.folder.CreateFolderReq;
import com.jz.dm.models.req.producer.ApiInterfaceReq; import com.jz.dm.models.req.producer.ApiInterfaceReq;
import com.jz.dm.service.ApiInterfaceService; import com.jz.dm.service.ApiInterfaceService;
import com.jz.dm.service.OrganizationManageService;
import com.jz.dm.service.ProducerService; import com.jz.dm.service.ProducerService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
...@@ -64,7 +62,9 @@ public class ProducerServiceImpl implements ProducerService { ...@@ -64,7 +62,9 @@ public class ProducerServiceImpl implements ProducerService {
@Autowired @Autowired
private ApiInterfaceService apiInterfaceService; private ApiInterfaceService apiInterfaceService;
@Autowired @Autowired
private com.jz.dm.service.OrganizationManageService organizationManageService; private OrganizationManageService organizationManageService;
@Autowired
private ApiFunctionMapper apiFunctionMapper;
@Autowired @Autowired
private RedisUtils redisUtils; private RedisUtils redisUtils;
@Autowired @Autowired
...@@ -87,6 +87,19 @@ public class ProducerServiceImpl implements ProducerService { ...@@ -87,6 +87,19 @@ public class ProducerServiceImpl implements ProducerService {
@Value("${data.select.flowUrl}") @Value("${data.select.flowUrl}")
private String flowUrl; private String flowUrl;
/**
* 获取function模板方法列表
* @return
*/
@Override
public Result getFunctionTemplateList() {
QueryWrapper<ApiFunction> queryWra = new QueryWrapper<>();
queryWra.eq("status",true);
queryWra.eq("is_deleted",0);
List<ApiFunction> list = apiFunctionMapper.selectList(queryWra);
return Result.of_success(list);
}
/** /**
* 获取文件列表 * 获取文件列表
* *
......
...@@ -109,6 +109,10 @@ data: ...@@ -109,6 +109,10 @@ data:
#token: #dataBank 制作验签 #token: #dataBank 制作验签
# dataBank: dataBank123 # dataBank: dataBank123
swagger:
enable: true
......
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