Commit 464ae021 by yuwei

项目初始化jar版本升级

parent 906361b7
......@@ -15,7 +15,7 @@ public abstract class BaseEntity implements Serializable {
/**
* 主键
*/
@TableId(value = "id", type = IdType.ID_WORKER_STR)
@TableId(value = "id", type = IdType.ASSIGN_ID)
private String id;
/**
......
......@@ -21,6 +21,18 @@
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-gateway</artifactId>
<exclusions>
<exclusion>
<artifactId>reactor-netty</artifactId>
<groupId>io.projectreactor.netty</groupId>
</exclusion>
</exclusions>
</dependency>
<!--bug https://github.com/spring-cloud/spring-cloud-gateway/issues/1532 -->
<dependency>
<groupId>io.projectreactor.netty</groupId>
<artifactId>reactor-netty</artifactId>
<version>0.9.4.RELEASE</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
......
......@@ -61,7 +61,7 @@ public class DataGatewayExceptionHandler extends DefaultErrorWebExceptionHandler
}
@Override
protected HttpStatus getHttpStatus(Map<String, Object> errorAttributes) {
return HttpStatus.INTERNAL_SERVER_ERROR;
protected int getHttpStatus(Map<String, Object> errorAttributes) {
return HttpStatus.INTERNAL_SERVER_ERROR.value();
}
}
......@@ -30,7 +30,7 @@ public class HystrixFallbackHandler implements HandlerFunction<ServerResponse> {
//返回空的response
return ServerResponse
.status(HttpStatus.INTERNAL_SERVER_ERROR.value())
.contentType(MediaType.APPLICATION_JSON_UTF8)
.body(BodyInserters.fromObject(R.error("服务超时或者服务不可用,请稍后重试")));
.contentType(MediaType.APPLICATION_JSON)
.body(BodyInserters.fromValue(R.error("服务超时或者服务不可用,请稍后重试")));
}
}
......@@ -26,7 +26,7 @@ public class DeptRelationEntity implements Serializable {
/**
* 主键
*/
@TableId(value = "id", type = IdType.ID_WORKER_STR)
@TableId(value = "id", type = IdType.ASSIGN_ID)
private String id;
/**
......
......@@ -26,7 +26,7 @@ public class LogEntity implements Serializable {
/**
* 主键
*/
@TableId(value = "id", type = IdType.ID_WORKER_STR)
@TableId(value = "id", type = IdType.ASSIGN_ID)
private String id;
/**
......
......@@ -26,7 +26,7 @@ public class RoleDeptEntity implements Serializable {
/**
* 主键
*/
@TableId(value = "id", type = IdType.ID_WORKER_STR)
@TableId(value = "id", type = IdType.ASSIGN_ID)
private String id;
/**
......
......@@ -26,7 +26,7 @@ public class RoleMenuEntity implements Serializable {
/**
* 主键
*/
@TableId(value = "id", type = IdType.ID_WORKER_STR)
@TableId(value = "id", type = IdType.ASSIGN_ID)
private String id;
/**
......
......@@ -26,7 +26,7 @@ public class UserDeptEntity implements Serializable {
/**
* 主键
*/
@TableId(value = "id", type = IdType.ID_WORKER_STR)
@TableId(value = "id", type = IdType.ASSIGN_ID)
private String id;
/**
......
......@@ -26,7 +26,7 @@ public class UserPostEntity implements Serializable {
/**
* 主键
*/
@TableId(value = "id", type = IdType.ID_WORKER_STR)
@TableId(value = "id", type = IdType.ASSIGN_ID)
private String id;
/**
......
......@@ -26,7 +26,7 @@ public class UserRoleEntity implements Serializable {
/**
* 主键
*/
@TableId(value = "id", type = IdType.ID_WORKER_STR)
@TableId(value = "id", type = IdType.ASSIGN_ID)
private String id;
/**
......
......@@ -318,7 +318,7 @@ public class Generate {
.setSwagger2(false)
.setAuthor("yuwei")
//指定生成的主键的ID类型
.setIdType(IdType.ID_WORKER_STR)
.setIdType(IdType.ASSIGN_ID)
//设置输出路径
.setOutputDir(System.getProperty("user.dir") + "/src/main/java/")
.setEntityName("%sEntity")
......@@ -336,23 +336,25 @@ public class Generate {
* @return StrategyConfig
*/
private StrategyConfig getStrategyConfig(List<String> tableNames) {
return new StrategyConfig()
StrategyConfig strategyConfig = new StrategyConfig()
//从数据库表到文件的命名策略
.setNaming(NamingStrategy.underline_to_camel)
.setColumnNaming(NamingStrategy.underline_to_camel)
.setSuperEntityClass("cn.datax.common.base.BaseEntity")
//写于父类中的公共字段
.setSuperEntityColumns(new String[]{"id", "create_time", "create_by", "update_time", "update_by", "status"})
.setEntityLombokModel(true)
.setRestControllerStyle(true)
.setControllerMappingHyphenStyle(true)
//表前缀
.setTablePrefix("sys_")
//写于父类中的公共字段
.setSuperEntityColumns(new String[]{"id", "create_time", "create_by", "update_time", "update_by", "status"})
.setInclude(tableNames.toArray(new String[tableNames.size()]))
//公共父类
.setSuperControllerClass("cn.datax.common.base.BaseController")
.setSuperEntityClass("cn.datax.common.base.BaseEntity")
.setSuperServiceClass("cn.datax.common.base.BaseService")
.setSuperServiceImplClass("cn.datax.common.base.BaseServiceImpl")
.setSuperMapperClass("cn.datax.common.base.BaseDao")
.setControllerMappingHyphenStyle(true)
.setTablePrefix("sys_")
.setInclude(tableNames.toArray(new String[tableNames.size()]));
.setSuperMapperClass("cn.datax.common.base.BaseDao");
strategyConfig.setSuperControllerClass("cn.datax.common.base.BaseController");
return strategyConfig;
}
/**
......
......@@ -20,15 +20,15 @@
<java.version>1.8</java.version>
<app.version>1.0.0</app.version>
<spring-boot.version>2.1.9.RELEASE</spring-boot.version>
<spring-cloud.version>Greenwich.SR3</spring-cloud.version>
<spring-boot.version>2.2.3.RELEASE</spring-boot.version>
<spring-cloud.version>Hoxton.SR1</spring-cloud.version>
<spring-boot-admin.version>2.1.6</spring-boot-admin.version>
<fastjson.version>1.2.62</fastjson.version>
<hutool.version>5.0.3</hutool.version>
<mybatis-plus.version>3.2.0</mybatis-plus.version>
<hutool.version>5.1.1</hutool.version>
<mybatis-plus.version>3.3.0</mybatis-plus.version>
<dynamic-datasource.version>2.5.7</dynamic-datasource.version>
<p6spy.version>3.8.6</p6spy.version>
<p6spy.version>3.8.7</p6spy.version>
<velocity.version>2.1</velocity.version>
<commons.io.version>2.6</commons.io.version>
<commons.fileupload.version>1.4</commons.fileupload.version>
......
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