Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
JAVA小学生-王铁柱
eladmin
提交
40852235
E
eladmin
项目概览
JAVA小学生-王铁柱
/
eladmin
与 Fork 源项目一致
从无法访问的项目Fork
通知
4
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
eladmin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
40852235
编写于
11月 24, 2019
作者:
D
dqjdda
浏览文件
操作
浏览文件
下载
差异文件
Merge branch '2.4dev' into 2.3opt
上级
4681ca6e
776cee4b
变更
89
隐藏空白更改
内联
并排
Showing
89 changed file
with
1055 addition
and
415 deletion
+1055
-415
eladmin-common/src/main/java/me/zhengjie/annotation/Query.java
...in-common/src/main/java/me/zhengjie/annotation/Query.java
+4
-0
eladmin-common/src/main/java/me/zhengjie/utils/QueryHelp.java
...min-common/src/main/java/me/zhengjie/utils/QueryHelp.java
+8
-0
eladmin-generator/pom.xml
eladmin-generator/pom.xml
+39
-0
eladmin-generator/src/main/java/me/zhengjie/domain/ColumnInfo.java
...enerator/src/main/java/me/zhengjie/domain/ColumnInfo.java
+76
-0
eladmin-generator/src/main/java/me/zhengjie/domain/GenConfig.java
...generator/src/main/java/me/zhengjie/domain/GenConfig.java
+19
-5
eladmin-generator/src/main/java/me/zhengjie/domain/vo/TableInfo.java
...erator/src/main/java/me/zhengjie/domain/vo/TableInfo.java
+1
-1
eladmin-generator/src/main/java/me/zhengjie/repository/ColumnInfoRepository.java
...ain/java/me/zhengjie/repository/ColumnInfoRepository.java
+14
-0
eladmin-generator/src/main/java/me/zhengjie/repository/GenConfigRepository.java
...main/java/me/zhengjie/repository/GenConfigRepository.java
+4
-2
eladmin-generator/src/main/java/me/zhengjie/rest/GenConfigController.java
...r/src/main/java/me/zhengjie/rest/GenConfigController.java
+7
-7
eladmin-generator/src/main/java/me/zhengjie/rest/GeneratorController.java
...r/src/main/java/me/zhengjie/rest/GeneratorController.java
+32
-12
eladmin-generator/src/main/java/me/zhengjie/service/GenConfigService.java
...r/src/main/java/me/zhengjie/service/GenConfigService.java
+14
-0
eladmin-generator/src/main/java/me/zhengjie/service/GeneratorService.java
...r/src/main/java/me/zhengjie/service/GeneratorService.java
+56
-0
eladmin-generator/src/main/java/me/zhengjie/service/impl/GenConfigServiceImpl.java
...n/java/me/zhengjie/service/impl/GenConfigServiceImpl.java
+14
-13
eladmin-generator/src/main/java/me/zhengjie/service/impl/GeneratorServiceImpl.java
...n/java/me/zhengjie/service/impl/GeneratorServiceImpl.java
+129
-0
eladmin-generator/src/main/java/me/zhengjie/utils/ColUtil.java
...in-generator/src/main/java/me/zhengjie/utils/ColUtil.java
+2
-4
eladmin-generator/src/main/java/me/zhengjie/utils/GenUtil.java
...in-generator/src/main/java/me/zhengjie/utils/GenUtil.java
+132
-60
eladmin-logging/src/main/java/me/zhengjie/service/dto/LogQueryCriteria.java
...c/main/java/me/zhengjie/service/dto/LogQueryCriteria.java
+3
-6
eladmin-system/pom.xml
eladmin-system/pom.xml
+12
-0
eladmin-system/src/main/java/me/zhengjie/AppRun.java
eladmin-system/src/main/java/me/zhengjie/AppRun.java
+10
-0
eladmin-system/src/main/java/me/zhengjie/modules/quartz/rest/QuartzJobController.java
.../me/zhengjie/modules/quartz/rest/QuartzJobController.java
+1
-1
eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/dto/JobQueryCriteria.java
...zhengjie/modules/quartz/service/dto/JobQueryCriteria.java
+3
-5
eladmin-system/src/main/java/me/zhengjie/modules/system/rest/DictController.java
.../java/me/zhengjie/modules/system/rest/DictController.java
+8
-0
eladmin-system/src/main/java/me/zhengjie/modules/system/rest/JobController.java
...n/java/me/zhengjie/modules/system/rest/JobController.java
+2
-2
eladmin-system/src/main/java/me/zhengjie/modules/system/rest/UserController.java
.../java/me/zhengjie/modules/system/rest/UserController.java
+2
-2
eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DeptQueryCriteria.java
...hengjie/modules/system/service/dto/DeptQueryCriteria.java
+3
-5
eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DictDetailDTO.java
...me/zhengjie/modules/system/service/dto/DictDetailDTO.java
+2
-0
eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DictSmallDTO.java
.../me/zhengjie/modules/system/service/dto/DictSmallDTO.java
+16
-0
eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/JobQueryCriteria.java
...zhengjie/modules/system/service/dto/JobQueryCriteria.java
+3
-7
eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/MenuQueryCriteria.java
...hengjie/modules/system/service/dto/MenuQueryCriteria.java
+3
-5
eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/RoleQueryCriteria.java
...hengjie/modules/system/service/dto/RoleQueryCriteria.java
+3
-5
eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/UserQueryCriteria.java
...hengjie/modules/system/service/dto/UserQueryCriteria.java
+3
-5
eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapper/DictDetailMapper.java
...ngjie/modules/system/service/mapper/DictDetailMapper.java
+1
-1
eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapper/DictSmallMapper.java
...engjie/modules/system/service/mapper/DictSmallMapper.java
+17
-0
eladmin-system/src/main/resources/template/generator/admin/Controller.ftl
...rc/main/resources/template/generator/admin/Controller.ftl
+9
-0
eladmin-system/src/main/resources/template/generator/admin/Dto.ftl
...ystem/src/main/resources/template/generator/admin/Dto.ftl
+2
-2
eladmin-system/src/main/resources/template/generator/admin/Entity.ftl
...em/src/main/resources/template/generator/admin/Entity.ftl
+25
-3
eladmin-system/src/main/resources/template/generator/admin/QueryCriteria.ftl
...main/resources/template/generator/admin/QueryCriteria.ftl
+31
-6
eladmin-system/src/main/resources/template/generator/admin/Service.ftl
...m/src/main/resources/template/generator/admin/Service.ftl
+2
-0
eladmin-system/src/main/resources/template/generator/admin/ServiceImpl.ftl
...c/main/resources/template/generator/admin/ServiceImpl.ftl
+9
-2
eladmin-system/src/main/resources/template/generator/front/api.ftl
...ystem/src/main/resources/template/generator/front/api.ftl
+7
-0
eladmin-system/src/main/resources/template/generator/front/eForm.ftl
...tem/src/main/resources/template/generator/front/eForm.ftl
+52
-12
eladmin-system/src/main/resources/template/generator/front/index.ftl
...tem/src/main/resources/template/generator/front/index.ftl
+88
-9
eladmin-system/src/test/java/me/zhengjie/EladminSystemApplicationTests.java
.../test/java/me/zhengjie/EladminSystemApplicationTests.java
+6
-0
eladmin-tools/pom.xml
eladmin-tools/pom.xml
+0
-14
eladmin-tools/src/main/java/me/zhengjie/domain/AlipayConfig.java
...-tools/src/main/java/me/zhengjie/domain/AlipayConfig.java
+1
-1
eladmin-tools/src/main/java/me/zhengjie/domain/EmailConfig.java
...n-tools/src/main/java/me/zhengjie/domain/EmailConfig.java
+1
-1
eladmin-tools/src/main/java/me/zhengjie/domain/LocalStorage.java
...-tools/src/main/java/me/zhengjie/domain/LocalStorage.java
+1
-1
eladmin-tools/src/main/java/me/zhengjie/domain/Picture.java
eladmin-tools/src/main/java/me/zhengjie/domain/Picture.java
+1
-1
eladmin-tools/src/main/java/me/zhengjie/domain/QiniuConfig.java
...n-tools/src/main/java/me/zhengjie/domain/QiniuConfig.java
+1
-1
eladmin-tools/src/main/java/me/zhengjie/domain/QiniuContent.java
...-tools/src/main/java/me/zhengjie/domain/QiniuContent.java
+1
-1
eladmin-tools/src/main/java/me/zhengjie/domain/VerificationCode.java
...ls/src/main/java/me/zhengjie/domain/VerificationCode.java
+1
-1
eladmin-tools/src/main/java/me/zhengjie/domain/vo/EmailVo.java
...in-tools/src/main/java/me/zhengjie/domain/vo/EmailVo.java
+1
-1
eladmin-tools/src/main/java/me/zhengjie/domain/vo/TradeVo.java
...in-tools/src/main/java/me/zhengjie/domain/vo/TradeVo.java
+1
-1
eladmin-tools/src/main/java/me/zhengjie/modules/generator/domain/vo/ColumnInfo.java
...a/me/zhengjie/modules/generator/domain/vo/ColumnInfo.java
+0
-40
eladmin-tools/src/main/java/me/zhengjie/repository/AlipayRepository.java
...rc/main/java/me/zhengjie/repository/AlipayRepository.java
+2
-2
eladmin-tools/src/main/java/me/zhengjie/repository/EmailRepository.java
...src/main/java/me/zhengjie/repository/EmailRepository.java
+2
-2
eladmin-tools/src/main/java/me/zhengjie/repository/LocalStorageRepository.java
...n/java/me/zhengjie/repository/LocalStorageRepository.java
+2
-2
eladmin-tools/src/main/java/me/zhengjie/repository/PictureRepository.java
...c/main/java/me/zhengjie/repository/PictureRepository.java
+2
-2
eladmin-tools/src/main/java/me/zhengjie/repository/QiNiuConfigRepository.java
...in/java/me/zhengjie/repository/QiNiuConfigRepository.java
+2
-2
eladmin-tools/src/main/java/me/zhengjie/repository/QiniuContentRepository.java
...n/java/me/zhengjie/repository/QiniuContentRepository.java
+2
-2
eladmin-tools/src/main/java/me/zhengjie/repository/VerificationCodeRepository.java
...va/me/zhengjie/repository/VerificationCodeRepository.java
+2
-2
eladmin-tools/src/main/java/me/zhengjie/rest/AliPayController.java
...ools/src/main/java/me/zhengjie/rest/AliPayController.java
+6
-6
eladmin-tools/src/main/java/me/zhengjie/rest/EmailController.java
...tools/src/main/java/me/zhengjie/rest/EmailController.java
+4
-4
eladmin-tools/src/main/java/me/zhengjie/rest/LocalStorageController.java
...rc/main/java/me/zhengjie/rest/LocalStorageController.java
+4
-4
eladmin-tools/src/main/java/me/zhengjie/rest/PictureController.java
...ols/src/main/java/me/zhengjie/rest/PictureController.java
+4
-4
eladmin-tools/src/main/java/me/zhengjie/rest/QiniuController.java
...tools/src/main/java/me/zhengjie/rest/QiniuController.java
+6
-6
eladmin-tools/src/main/java/me/zhengjie/rest/VerificationCodeController.java
...ain/java/me/zhengjie/rest/VerificationCodeController.java
+5
-5
eladmin-tools/src/main/java/me/zhengjie/service/AlipayService.java
...ools/src/main/java/me/zhengjie/service/AlipayService.java
+3
-3
eladmin-tools/src/main/java/me/zhengjie/service/EmailService.java
...tools/src/main/java/me/zhengjie/service/EmailService.java
+3
-3
eladmin-tools/src/main/java/me/zhengjie/service/LocalStorageService.java
...rc/main/java/me/zhengjie/service/LocalStorageService.java
+4
-4
eladmin-tools/src/main/java/me/zhengjie/service/PictureService.java
...ols/src/main/java/me/zhengjie/service/PictureService.java
+3
-3
eladmin-tools/src/main/java/me/zhengjie/service/QiNiuService.java
...tools/src/main/java/me/zhengjie/service/QiNiuService.java
+4
-4
eladmin-tools/src/main/java/me/zhengjie/service/VerificationCodeService.java
...ain/java/me/zhengjie/service/VerificationCodeService.java
+3
-3
eladmin-tools/src/main/java/me/zhengjie/service/dto/LocalStorageDTO.java
...rc/main/java/me/zhengjie/service/dto/LocalStorageDTO.java
+1
-1
eladmin-tools/src/main/java/me/zhengjie/service/dto/LocalStorageQueryCriteria.java
...va/me/zhengjie/service/dto/LocalStorageQueryCriteria.java
+5
-6
eladmin-tools/src/main/java/me/zhengjie/service/dto/PictureQueryCriteria.java
...in/java/me/zhengjie/service/dto/PictureQueryCriteria.java
+4
-6
eladmin-tools/src/main/java/me/zhengjie/service/dto/QiniuQueryCriteria.java
...main/java/me/zhengjie/service/dto/QiniuQueryCriteria.java
+4
-6
eladmin-tools/src/main/java/me/zhengjie/service/impl/AlipayServiceImpl.java
...main/java/me/zhengjie/service/impl/AlipayServiceImpl.java
+5
-5
eladmin-tools/src/main/java/me/zhengjie/service/impl/EmailServiceImpl.java
.../main/java/me/zhengjie/service/impl/EmailServiceImpl.java
+5
-5
eladmin-tools/src/main/java/me/zhengjie/service/impl/LocalStorageServiceImpl.java
...ava/me/zhengjie/service/impl/LocalStorageServiceImpl.java
+7
-7
eladmin-tools/src/main/java/me/zhengjie/service/impl/PictureServiceImpl.java
...ain/java/me/zhengjie/service/impl/PictureServiceImpl.java
+5
-5
eladmin-tools/src/main/java/me/zhengjie/service/impl/QiNiuServiceImpl.java
.../main/java/me/zhengjie/service/impl/QiNiuServiceImpl.java
+8
-8
eladmin-tools/src/main/java/me/zhengjie/service/impl/VerificationCodeServiceImpl.java
...me/zhengjie/service/impl/VerificationCodeServiceImpl.java
+5
-5
eladmin-tools/src/main/java/me/zhengjie/service/mapper/LocalStorageMapper.java
...n/java/me/zhengjie/service/mapper/LocalStorageMapper.java
+3
-3
eladmin-tools/src/main/java/me/zhengjie/utils/AliPayStatusEnum.java
...ols/src/main/java/me/zhengjie/utils/AliPayStatusEnum.java
+1
-1
eladmin-tools/src/main/java/me/zhengjie/utils/AlipayUtils.java
...in-tools/src/main/java/me/zhengjie/utils/AlipayUtils.java
+2
-2
eladmin-tools/src/main/java/me/zhengjie/utils/QiNiuUtil.java
eladmin-tools/src/main/java/me/zhengjie/utils/QiNiuUtil.java
+1
-1
pom.xml
pom.xml
+2
-1
sql/eladmin.sql
sql/eladmin.sql
+51
-45
未找到文件。
eladmin-common/src/main/java/me/zhengjie/annotation/Query.java
浏览文件 @
40852235
...
...
@@ -50,6 +50,10 @@ public @interface Query {
,
LESS_THAN_NQ
// jie 2019/6/4 包含
,
IN
// 不等于
,
NOT_EQUAL
// between
,
BETWEEN
}
/**
...
...
eladmin-common/src/main/java/me/zhengjie/utils/QueryHelp.java
浏览文件 @
40852235
...
...
@@ -106,6 +106,14 @@ public class QueryHelp {
list
.
add
(
getExpression
(
attributeName
,
join
,
root
).
in
((
Collection
<
Long
>)
val
));
}
break
;
case
NOT_EQUAL:
list
.
add
(
cb
.
notEqual
(
getExpression
(
attributeName
,
join
,
root
),
val
));
break
;
case
BETWEEN:
List
<
Object
>
between
=
new
ArrayList
<>((
List
<
Object
>)
val
);
list
.
add
(
cb
.
between
(
getExpression
(
attributeName
,
join
,
root
).
as
((
Class
<?
extends
Comparable
>)
between
.
get
(
0
).
getClass
()),
(
Comparable
)
between
.
get
(
0
),
(
Comparable
)
between
.
get
(
1
)));
break
;
default
:
break
;
}
}
...
...
eladmin-generator/pom.xml
0 → 100644
浏览文件 @
40852235
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<artifactId>
eladmin
</artifactId>
<groupId>
me.zhengjie
</groupId>
<version>
2.3
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
eladmin-generator
</artifactId>
<name>
代码生成模块
</name>
<properties>
<configuration.version>
1.9
</configuration.version>
</properties>
<dependencies>
<dependency>
<groupId>
me.zhengjie
</groupId>
<artifactId>
eladmin-common
</artifactId>
<version>
2.3
</version>
</dependency>
<!--模板引擎-->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-freemarker
</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-configuration/commons-configuration -->
<dependency>
<groupId>
commons-configuration
</groupId>
<artifactId>
commons-configuration
</artifactId>
<version>
${configuration.version}
</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
eladmin-generator/src/main/java/me/zhengjie/domain/ColumnInfo.java
0 → 100644
浏览文件 @
40852235
package
me.zhengjie.domain
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
me.zhengjie.utils.GenUtil
;
import
javax.persistence.*
;
/**
* 列的数据信息
* @author Zheng Jie
* @date 2019-01-02
*/
@Data
@Entity
@NoArgsConstructor
@Table
(
name
=
"column_config"
)
public
class
ColumnInfo
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"id"
)
private
Long
id
;
private
String
tableName
;
// 数据库字段名称
private
String
columnName
;
// 数据库字段类型
private
String
columnType
;
// 数据库字段键类型
private
String
keyType
;
// 字段额外的参数
private
String
extra
;
// 数据库字段描述
private
String
remark
;
// 必填
private
Boolean
notNull
;
// 是否在列表显示
private
Boolean
listShow
;
// 是否表单显示
private
Boolean
formShow
;
// 表单类型
private
String
formType
;
// 查询 1:模糊 2:精确
private
String
queryType
;
// 字典名称
private
String
dictName
;
// 日期注解
private
String
dateAnnotation
;
public
ColumnInfo
(
String
tableName
,
String
columnName
,
Boolean
notNull
,
String
columnType
,
String
remark
,
String
keyType
,
String
extra
)
{
this
.
tableName
=
tableName
;
this
.
columnName
=
columnName
;
this
.
columnType
=
columnType
;
this
.
keyType
=
keyType
;
this
.
extra
=
extra
;
this
.
notNull
=
notNull
;
if
(
GenUtil
.
PK
.
equalsIgnoreCase
(
keyType
)
&&
GenUtil
.
EXTRA
.
equalsIgnoreCase
(
extra
)){
this
.
notNull
=
false
;
}
this
.
remark
=
remark
;
this
.
listShow
=
true
;
this
.
formShow
=
true
;
}
}
eladmin-
tools/src/main/java/me/zhengjie/modules/generator
/domain/GenConfig.java
→
eladmin-
generator/src/main/java/me/zhengjie
/domain/GenConfig.java
浏览文件 @
40852235
package
me.zhengjie.
modules.generator.
domain
;
package
me.zhengjie.domain
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.Entity
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
lombok.NoArgsConstructor
;
import
javax.persistence.*
;
import
javax.validation.constraints.NotBlank
;
/**
* 代码生成配置
...
...
@@ -13,20 +12,35 @@ import javax.persistence.Table;
*/
@Data
@Entity
@NoArgsConstructor
@Table
(
name
=
"gen_config"
)
public
class
GenConfig
{
public
GenConfig
(
String
tableName
)
{
this
.
cover
=
false
;
this
.
moduleName
=
"eladmin-system"
;
this
.
tableName
=
tableName
;
}
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
@Column
(
name
=
"id"
)
private
Long
id
;
@NotBlank
private
String
tableName
;
// 包路径
@NotBlank
private
String
pack
;
// 模块名
@Column
(
name
=
"module_name"
)
@NotBlank
private
String
moduleName
;
// 前端文件路径
@NotBlank
private
String
path
;
// 前端文件路径
...
...
eladmin-
tools/src/main/java/me/zhengjie/modules/generator
/domain/vo/TableInfo.java
→
eladmin-
generator/src/main/java/me/zhengjie
/domain/vo/TableInfo.java
浏览文件 @
40852235
package
me.zhengjie.
modules.generator.
domain.vo
;
package
me.zhengjie.domain.vo
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
...
...
eladmin-generator/src/main/java/me/zhengjie/repository/ColumnInfoRepository.java
0 → 100644
浏览文件 @
40852235
package
me.zhengjie.repository
;
import
me.zhengjie.domain.ColumnInfo
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
java.util.List
;
/**
* @author Zheng Jie
* @date 2019-01-14
*/
public
interface
ColumnInfoRepository
extends
JpaRepository
<
ColumnInfo
,
Long
>
{
List
<
ColumnInfo
>
findByTableNameOrderByIdAsc
(
String
tableName
);
}
eladmin-
tools/src/main/java/me/zhengjie/modules/generator
/repository/GenConfigRepository.java
→
eladmin-
generator/src/main/java/me/zhengjie
/repository/GenConfigRepository.java
浏览文件 @
40852235
package
me.zhengjie.
modules.generator.
repository
;
package
me.zhengjie.repository
;
import
me.zhengjie.
modules.generator.
domain.GenConfig
;
import
me.zhengjie.domain.GenConfig
;
import
org.springframework.data.jpa.repository.JpaRepository
;
/**
...
...
@@ -8,4 +8,6 @@ import org.springframework.data.jpa.repository.JpaRepository;
* @date 2019-01-14
*/
public
interface
GenConfigRepository
extends
JpaRepository
<
GenConfig
,
Long
>
{
GenConfig
findByTableName
(
String
tableName
);
}
eladmin-
tools/src/main/java/me/zhengjie/modules/generator
/rest/GenConfigController.java
→
eladmin-
generator/src/main/java/me/zhengjie
/rest/GenConfigController.java
浏览文件 @
40852235
package
me.zhengjie.
modules.generator.
rest
;
package
me.zhengjie.rest
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
me.zhengjie.
modules.generator.
domain.GenConfig
;
import
me.zhengjie.
modules.generator.
service.GenConfigService
;
import
me.zhengjie.domain.GenConfig
;
import
me.zhengjie.service.GenConfigService
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.validation.annotation.Validated
;
...
...
@@ -25,14 +25,14 @@ public class GenConfigController {
}
@ApiOperation
(
"查询"
)
@GetMapping
public
ResponseEntity
get
(){
return
new
ResponseEntity
<>(
genConfigService
.
find
(),
HttpStatus
.
OK
);
@GetMapping
(
value
=
"/{tableName}"
)
public
ResponseEntity
get
(
@PathVariable
String
tableName
){
return
new
ResponseEntity
<>(
genConfigService
.
find
(
tableName
),
HttpStatus
.
OK
);
}
@ApiOperation
(
"修改"
)
@PutMapping
public
ResponseEntity
emailConfig
(
@Validated
@RequestBody
GenConfig
genConfig
){
return
new
ResponseEntity
<>(
genConfigService
.
update
(
genConfig
),
HttpStatus
.
OK
);
return
new
ResponseEntity
<>(
genConfigService
.
update
(
genConfig
.
getTableName
(),
genConfig
),
HttpStatus
.
OK
);
}
}
eladmin-
tools/src/main/java/me/zhengjie/modules/generator
/rest/GeneratorController.java
→
eladmin-
generator/src/main/java/me/zhengjie
/rest/GeneratorController.java
浏览文件 @
40852235
package
me.zhengjie.
modules.generator.
rest
;
package
me.zhengjie.rest
;
import
cn.hutool.core.util.PageUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
me.zhengjie.domain.ColumnInfo
;
import
me.zhengjie.exception.BadRequestException
;
import
me.zhengjie.
modules.generator.domain.vo.ColumnInfo
;
import
me.zhengjie.
modules.generator.service.GenConfig
Service
;
import
me.zhengjie.
modules.generator.service.GeneratorService
;
import
me.zhengjie.
service.GenConfigService
;
import
me.zhengjie.
service.Generator
Service
;
import
me.zhengjie.
utils.PageUtil
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
...
...
@@ -35,7 +34,13 @@ public class GeneratorController {
this
.
genConfigService
=
genConfigService
;
}
@ApiOperation
(
"查询数据库元数据"
)
@ApiOperation
(
"查询数据库数据"
)
@GetMapping
(
value
=
"/tables/all"
)
public
ResponseEntity
getTables
(){
return
new
ResponseEntity
<>(
generatorService
.
getTables
(),
HttpStatus
.
OK
);
}
@ApiOperation
(
"查询数据库数据"
)
@GetMapping
(
value
=
"/tables"
)
public
ResponseEntity
getTables
(
@RequestParam
(
defaultValue
=
""
)
String
name
,
@RequestParam
(
defaultValue
=
"0"
)
Integer
page
,
...
...
@@ -44,19 +49,34 @@ public class GeneratorController {
return
new
ResponseEntity
<>(
generatorService
.
getTables
(
name
,
startEnd
),
HttpStatus
.
OK
);
}
@ApiOperation
(
"查询
表内元
数据"
)
@ApiOperation
(
"查询
字段
数据"
)
@GetMapping
(
value
=
"/columns"
)
public
ResponseEntity
getTables
(
@RequestParam
String
tableName
){
return
new
ResponseEntity
<>(
generatorService
.
getColumns
(
tableName
),
HttpStatus
.
OK
);
List
<
ColumnInfo
>
columnInfos
=
generatorService
.
getColumns
(
tableName
);
// 异步同步表信息
generatorService
.
sync
(
columnInfos
);
return
new
ResponseEntity
<>(
PageUtil
.
toPage
(
columnInfos
,
columnInfos
.
size
()),
HttpStatus
.
OK
);
}
@ApiOperation
(
"保存字段数据"
)
@PutMapping
public
ResponseEntity
save
(
@RequestBody
List
<
ColumnInfo
>
columnInfos
){
generatorService
.
save
(
columnInfos
);
return
new
ResponseEntity
(
HttpStatus
.
OK
);
}
@ApiOperation
(
"生成代码"
)
@PostMapping
public
ResponseEntity
generator
(
@
RequestBody
List
<
ColumnInfo
>
columnInfos
,
@RequestParam
String
tableNam
e
){
@PostMapping
(
value
=
"/{tableName}/{type}"
)
public
ResponseEntity
generator
(
@
PathVariable
String
tableName
,
@PathVariable
Integer
typ
e
){
if
(!
generatorEnabled
){
throw
new
BadRequestException
(
"此环境不允许生成代码!"
);
}
generatorService
.
generator
(
columnInfos
,
genConfigService
.
find
(),
tableName
);
switch
(
type
){
// 生成代码
case
0
:
generatorService
.
generator
(
genConfigService
.
find
(
tableName
),
generatorService
.
getColumns
(
tableName
));
break
;
default
:
break
;
}
return
new
ResponseEntity
(
HttpStatus
.
OK
);
}
}
eladmin-
tools/src/main/java/me/zhengjie/modules/generator
/service/GenConfigService.java
→
eladmin-
generator/src/main/java/me/zhengjie
/service/GenConfigService.java
浏览文件 @
40852235
package
me.zhengjie.
modules.generator.
service
;
package
me.zhengjie.service
;
import
me.zhengjie.
modules.generator.
domain.GenConfig
;
import
me.zhengjie.domain.GenConfig
;
/**
* @author Zheng Jie
...
...
@@ -8,7 +8,7 @@ import me.zhengjie.modules.generator.domain.GenConfig;
*/
public
interface
GenConfigService
{
GenConfig
find
();
GenConfig
find
(
String
tableName
);
GenConfig
update
(
GenConfig
genConfig
);
GenConfig
update
(
String
tableName
,
GenConfig
genConfig
);
}
eladmin-
tools/src/main/java/me/zhengjie/modules/generator
/service/GeneratorService.java
→
eladmin-
generator/src/main/java/me/zhengjie
/service/GeneratorService.java
浏览文件 @
40852235
package
me.zhengjie.modules.generator.service
;
package
me.zhengjie.service
;
import
me.zhengjie.domain.GenConfig
;
import
me.zhengjie.domain.ColumnInfo
;
import
org.springframework.scheduling.annotation.Async
;
import
me.zhengjie.modules.generator.domain.GenConfig
;
import
me.zhengjie.modules.generator.domain.vo.ColumnInfo
;
import
java.util.List
;
/**
...
...
@@ -23,13 +25,32 @@ public interface GeneratorService {
* @param name 表名
* @return /
*/
Object
getColumns
(
String
name
);
List
<
ColumnInfo
>
getColumns
(
String
name
);
/**
* 同步表数据
* @param columnInfos /
*/
@Async
void
sync
(
List
<
ColumnInfo
>
columnInfos
);
/**
* 保持数据
* @param columnInfos /
*/
void
save
(
List
<
ColumnInfo
>
columnInfos
);
/**
* 获取所有table
* @return /
*/
Object
getTables
();
/**
*
生成代码
* @param
columnInfos 表字段数据
* @param
genConfig 代码生成配置
* @
param tableName 表名
*
代码生成
* @param
genConfig 配置信息
* @param
columns 字段信息
* @
return /
*/
void
generator
(
List
<
ColumnInfo
>
columnInfos
,
GenConfig
genConfig
,
String
tableName
);
Object
generator
(
GenConfig
genConfig
,
List
<
ColumnInfo
>
columns
);
}
eladmin-
tools/src/main/java/me/zhengjie/modules/generator
/service/impl/GenConfigServiceImpl.java
→
eladmin-
generator/src/main/java/me/zhengjie
/service/impl/GenConfigServiceImpl.java
浏览文件 @
40852235
package
me.zhengjie.
modules.generator.
service.impl
;
package
me.zhengjie.service.impl
;
import
me.zhengjie.
modules.generator.
domain.GenConfig
;
import
me.zhengjie.
modules.generator.
repository.GenConfigRepository
;
import
me.zhengjie.
modules.generator.
service.GenConfigService
;
import
me.zhengjie.domain.GenConfig
;
import
me.zhengjie.repository.GenConfigRepository
;
import
me.zhengjie.service.GenConfigService
;
import
org.springframework.cache.annotation.CacheConfig
;
import
org.springframework.cache.annotation.Cache
Evic
t
;
import
org.springframework.cache.annotation.Cache
Pu
t
;
import
org.springframework.cache.annotation.Cacheable
;
import
org.springframework.stereotype.Service
;
import
java.io.File
;
import
java.util.Optional
;
/**
* @author Zheng Jie
...
...
@@ -25,16 +24,18 @@ public class GenConfigServiceImpl implements GenConfigService {
}
@Override
@Cacheable
(
key
=
"'1'"
)
public
GenConfig
find
()
{
Optional
<
GenConfig
>
genConfig
=
genConfigRepository
.
findById
(
1L
);
return
genConfig
.
orElseGet
(
GenConfig:
:
new
);
@Cacheable
(
key
=
"#p0"
)
public
GenConfig
find
(
String
tableName
)
{
GenConfig
genConfig
=
genConfigRepository
.
findByTableName
(
tableName
);
if
(
genConfig
==
null
){
return
new
GenConfig
(
tableName
);
}
return
genConfig
;
}
@Override
@CacheEvict
(
allEntries
=
true
)
public
GenConfig
update
(
GenConfig
genConfig
)
{
genConfig
.
setId
(
1L
);
@CachePut
(
key
=
"#p0"
)
public
GenConfig
update
(
String
tableName
,
GenConfig
genConfig
)
{
// 自动设置Api路径,注释掉前需要同步取消前端的注释
String
separator
=
File
.
separator
;
String
[]
paths
;
...
...
eladmin-
tools/src/main/java/me/zhengjie/modules/generator
/service/impl/GeneratorServiceImpl.java
→
eladmin-
generator/src/main/java/me/zhengjie
/service/impl/GeneratorServiceImpl.java
浏览文件 @
40852235
package
me.zhengjie.
modules.generator.
service.impl
;
package
me.zhengjie.service.impl
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
me.zhengjie.domain.GenConfig
;
import
me.zhengjie.domain.ColumnInfo
;
import
me.zhengjie.domain.vo.TableInfo
;
import
me.zhengjie.exception.BadRequestException
;
import
me.zhengjie.modules.generator.domain.GenConfig
;
import
me.zhengjie.modules.generator.domain.vo.ColumnInfo
;
import
me.zhengjie.modules.generator.domain.vo.TableInfo
;
import
me.zhengjie.modules.generator.service.GeneratorService
;
import
me.zhengjie.modules.generator.utils.GenUtil
;
import
me.zhengjie.repository.ColumnInfoRepository
;
import
me.zhengjie.service.GeneratorService
;
import
me.zhengjie.utils.GenUtil
;
import
me.zhengjie.utils.PageUtil
;
import
me.zhengjie.utils.StringUtils
;
import
org.springframework.stereotype.Service
;
...
...
@@ -22,13 +24,29 @@ import java.util.List;
* @date 2019-01-02
*/
@Service
@SuppressWarnings
(
"all"
)
public
class
GeneratorServiceImpl
implements
GeneratorService
{
@PersistenceContext
private
EntityManager
em
;
private
final
ColumnInfoRepository
columnInfoRepository
;
public
GeneratorServiceImpl
(
ColumnInfoRepository
columnInfoRepository
)
{
this
.
columnInfoRepository
=
columnInfoRepository
;
}
@Override
public
Object
getTables
()
{
// 使用预编译防止sql注入
String
sql
=
"select table_name ,create_time , engine, table_collation, table_comment from information_schema.tables "
+
"where table_schema = (select database()) "
+
"order by create_time desc"
;
Query
query
=
em
.
createNativeQuery
(
sql
);
return
query
.
getResultList
();
}
@Override
@SuppressWarnings
(
"all"
)
public
Object
getTables
(
String
name
,
int
[]
startEnd
)
{
// 使用预编译防止sql注入
String
sql
=
"select table_name ,create_time , engine, table_collation, table_comment from information_schema.tables "
+
...
...
@@ -50,31 +68,62 @@ public class GeneratorServiceImpl implements GeneratorService {
}
@Override
@SuppressWarnings
(
"all"
)
public
Object
getColumns
(
String
name
)
{
public
List
<
ColumnInfo
>
getColumns
(
String
tableName
)
{
List
<
ColumnInfo
>
columnInfos
=
columnInfoRepository
.
findByTableNameOrderByIdAsc
(
tableName
);
if
(
CollectionUtil
.
isNotEmpty
(
columnInfos
)){
return
columnInfos
;
}
else
{
columnInfos
=
query
(
tableName
);
return
columnInfoRepository
.
saveAll
(
columnInfos
);
}
}
public
List
<
ColumnInfo
>
query
(
String
tableName
){
// 使用预编译防止sql注入
String
sql
=
"select column_name, is_nullable, data_type, column_comment, column_key, extra from information_schema.columns "
+
"where table_name = ? and table_schema = (select database()) order by ordinal_position"
;
Query
query
=
em
.
createNativeQuery
(
sql
);
query
.
setParameter
(
1
,
StringUtils
.
isNotBlank
(
name
)
?
name
:
null
);
query
.
setParameter
(
1
,
tableName
);
List
result
=
query
.
getResultList
();
List
<
ColumnInfo
>
columnInfos
=
new
ArrayList
<>();
for
(
Object
obj
:
result
)
{
Object
[]
arr
=
(
Object
[])
obj
;
columnInfos
.
add
(
new
ColumnInfo
(
arr
[
0
],
arr
[
1
],
arr
[
2
],
arr
[
3
],
arr
[
4
],
arr
[
5
],
null
,
"true"
));
columnInfos
.
add
(
new
ColumnInfo
(
tableName
,
arr
[
0
].
toString
(),
arr
[
1
].
equals
(
"NO"
),
arr
[
2
].
toString
(),
ObjectUtil
.
isNotNull
(
arr
[
3
])
?
arr
[
3
].
toString
()
:
null
,
ObjectUtil
.
isNotNull
(
arr
[
4
])
?
arr
[
4
].
toString
()
:
null
,
ObjectUtil
.
isNotNull
(
arr
[
5
])
?
arr
[
5
].
toString
()
:
null
)
);
}
return
PageUtil
.
toPage
(
columnInfos
,
columnInfos
.
size
());
return
columnInfos
;
}
@Override
public
void
sync
(
List
<
ColumnInfo
>
columnInfos
)
{
}
@Override
public
void
save
(
List
<
ColumnInfo
>
columnInfos
)
{
columnInfoRepository
.
saveAll
(
columnInfos
);
}
@Override
public
void
generator
(
List
<
ColumnInfo
>
columnInfos
,
GenConfig
genConfig
,
String
tableName
)
{
public
Object
generator
(
GenConfig
genConfig
,
List
<
ColumnInfo
>
columns
)
{
if
(
genConfig
.
getId
()
==
null
){
throw
new
BadRequestException
(
"请先配置生成器"
);
}
try
{
GenUtil
.
generatorCode
(
columnInfos
,
genConfig
,
tableName
);
// 查询是否存在关联实体字段信息
GenUtil
.
generatorCode
(
columns
,
genConfig
);
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
e
);
e
.
printStackTrace
();
throw
new
BadRequestException
(
"生成失败,请手动处理已生成的文件"
);
}
return
null
;
}
}
eladmin-
tools/src/main/java/me/zhengjie/modules/generator
/utils/ColUtil.java
→
eladmin-
generator/src/main/java/me/zhengjie
/utils/ColUtil.java
浏览文件 @
40852235
package
me.zhengjie.
modules.generator.
utils
;
package
me.zhengjie.utils
;
import
org.apache.commons.configuration.Configuration
;
import
org.apache.commons.configuration.ConfigurationException
;
import
org.apache.commons.configuration.PropertiesConfiguration
;
import
org.apache.commons.configuration.*
;
/**
* sql字段转java
...
...
eladmin-
tools/src/main/java/me/zhengjie/modules/generator
/utils/GenUtil.java
→
eladmin-
generator/src/main/java/me/zhengjie
/utils/GenUtil.java
浏览文件 @
40852235
package
me.zhengjie.
modules.generator.
utils
;
package
me.zhengjie.utils
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.extra.template.*
;
import
lombok.extern.slf4j.Slf4j
;
import
me.zhengjie.modules.generator.domain.GenConfig
;
import
me.zhengjie.modules.generator.domain.vo.ColumnInfo
;
import
me.zhengjie.utils.FileUtil
;
import
me.zhengjie.utils.StringUtils
;
import
me.zhengjie.domain.GenConfig
;
import
me.zhengjie.domain.ColumnInfo
;
import
org.springframework.util.ObjectUtils
;
import
java.io.File
;
import
java.io.FileWriter
;
...
...
@@ -30,9 +28,9 @@ public class GenUtil {
private
static
final
String
BIGDECIMAL
=
"BigDecimal"
;
p
rivate
static
final
String
PK
=
"PRI"
;
p
ublic
static
final
String
PK
=
"PRI"
;
p
rivate
static
final
String
EXTRA
=
"auto_increment"
;
p
ublic
static
final
String
EXTRA
=
"auto_increment"
;
/**
* 获取后端代码模板名称
...
...
@@ -63,85 +61,159 @@ public class GenUtil {
return
templateNames
;
}
/**
* 生成代码
* @param columnInfos 表元数据
* @param genConfig 生成代码的参数配置,如包路径,作者
*/
public
static
void
generatorCode
(
List
<
ColumnInfo
>
columnInfos
,
GenConfig
genConfig
,
String
tableName
)
throws
IOException
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"package"
,
genConfig
.
getPack
());
map
.
put
(
"moduleName"
,
genConfig
.
getModuleName
());
map
.
put
(
"author"
,
genConfig
.
getAuthor
());
map
.
put
(
"date"
,
LocalDate
.
now
().
toString
());
map
.
put
(
"tableName"
,
tableName
);
String
className
=
StringUtils
.
toCapitalizeCamelCase
(
tableName
);
String
changeClassName
=
StringUtils
.
toCamelCase
(
tableName
);
public
static
void
generatorCode
(
List
<
ColumnInfo
>
columnInfos
,
GenConfig
genConfig
)
throws
IOException
{
// 存储模版字段数据
Map
<
String
,
Object
>
genMap
=
new
HashMap
<>();
// 包名称
genMap
.
put
(
"package"
,
genConfig
.
getPack
());
// 模块名称
genMap
.
put
(
"moduleName"
,
genConfig
.
getModuleName
());
// 作者
genMap
.
put
(
"author"
,
genConfig
.
getAuthor
());
// 创建日期
genMap
.
put
(
"date"
,
LocalDate
.
now
().
toString
());
// 表名
genMap
.
put
(
"tableName"
,
genConfig
.
getTableName
());
// 大写开头的类名
String
className
=
StringUtils
.
toCapitalizeCamelCase
(
genConfig
.
getTableName
());
// 小写开头的类名
String
changeClassName
=
StringUtils
.
toCamelCase
(
genConfig
.
getTableName
());
// 判断是否去除表前缀
if
(
StringUtils
.
isNotEmpty
(
genConfig
.
getPrefix
()))
{
className
=
StringUtils
.
toCapitalizeCamelCase
(
StrUtil
.
removePrefix
(
tableName
,
genConfig
.
getPrefix
()));
changeClassName
=
StringUtils
.
toCamelCase
(
StrUtil
.
removePrefix
(
tableName
,
genConfig
.
getPrefix
()));
className
=
StringUtils
.
toCapitalizeCamelCase
(
StrUtil
.
removePrefix
(
genConfig
.
getTableName
()
,
genConfig
.
getPrefix
()));
changeClassName
=
StringUtils
.
toCamelCase
(
StrUtil
.
removePrefix
(
genConfig
.
getTableName
()
,
genConfig
.
getPrefix
()));
}
map
.
put
(
"className"
,
className
);
map
.
put
(
"upperCaseClassName"
,
className
.
toUpperCase
());
map
.
put
(
"changeClassName"
,
changeClassName
);
map
.
put
(
"hasTimestamp"
,
false
);
map
.
put
(
"queryHasTimestamp"
,
false
);
map
.
put
(
"queryHasBigDecimal"
,
false
);
map
.
put
(
"hasBigDecimal"
,
false
);
map
.
put
(
"hasQuery"
,
false
);
map
.
put
(
"auto"
,
false
);
// 保存类名
genMap
.
put
(
"className"
,
className
);
// 保存小写开头的类名
genMap
.
put
(
"changeClassName"
,
changeClassName
);
// 存在 Timestamp 字段
genMap
.
put
(
"hasTimestamp"
,
false
);
// 查询类中存在 Timestamp 字段
genMap
.
put
(
"queryHasTimestamp"
,
false
);
// 存在 BigDecimal 字段
genMap
.
put
(
"hasBigDecimal"
,
false
);
// 查询类中存在 BigDecimal 字段
genMap
.
put
(
"queryHasBigDecimal"
,
false
);
// 是否需要创建查询
genMap
.
put
(
"hasQuery"
,
false
);
// 自增主键
genMap
.
put
(
"auto"
,
false
);
// 存在字典
genMap
.
put
(
"hasDict"
,
false
);
// 存在日期注解
genMap
.
put
(
"hasDateAnnotation"
,
false
);
// 保存字段信息
List
<
Map
<
String
,
Object
>>
columns
=
new
ArrayList
<>();
// 保存查询字段的信息
List
<
Map
<
String
,
Object
>>
queryColumns
=
new
ArrayList
<>();
// 存储字典信息
List
<
String
>
dicts
=
new
ArrayList
<>();
// 存储 DateRange 信息
List
<
Map
<
String
,
Object
>>
dateRanges
=
new
ArrayList
<>();
// 存储不为空的字段信息
List
<
Map
<
String
,
Object
>>
isNotNullColumns
=
new
ArrayList
<>();
for
(
ColumnInfo
column
:
columnInfos
)
{
Map
<
String
,
Object
>
listMap
=
new
HashMap
<>();
listMap
.
put
(
"columnComment"
,
column
.
getColumnComment
());
listMap
.
put
(
"columnKey"
,
column
.
getColumnKey
());
String
colType
=
ColUtil
.
cloToJava
(
column
.
getColumnType
().
toString
());
// 字段描述
listMap
.
put
(
"remark"
,
column
.
getRemark
());
// 字段类型
listMap
.
put
(
"columnKey"
,
column
.
getKeyType
());
// 主键类型
String
colType
=
ColUtil
.
cloToJava
(
column
.
getColumnType
());
// 小写开头的字段名
String
changeColumnName
=
StringUtils
.
toCamelCase
(
column
.
getColumnName
().
toString
());
// 大写开头的字段名
String
capitalColumnName
=
StringUtils
.
toCapitalizeCamelCase
(
column
.
getColumnName
().
toString
());
if
(
PK
.
equals
(
column
.
getColumnKey
())){
map
.
put
(
"pkColumnType"
,
colType
);
map
.
put
(
"pkChangeColName"
,
changeColumnName
);
map
.
put
(
"pkCapitalColName"
,
capitalColumnName
);
if
(
PK
.
equals
(
column
.
getKeyType
())){
// 存储主键类型
genMap
.
put
(
"pkColumnType"
,
colType
);
// 存储小写开头的字段名
genMap
.
put
(
"pkChangeColName"
,
changeColumnName
);
// 存储大写开头的字段名
genMap
.
put
(
"pkCapitalColName"
,
capitalColumnName
);
}
// 是否存在 Timestamp 类型的字段
if
(
TIMESTAMP
.
equals
(
colType
)){
m
ap
.
put
(
"hasTimestamp"
,
true
);
genM
ap
.
put
(
"hasTimestamp"
,
true
);
}
// 是否存在 BigDecimal 类型的字段
if
(
BIGDECIMAL
.
equals
(
colType
)){
m
ap
.
put
(
"hasBigDecimal"
,
true
);
genM
ap
.
put
(
"hasBigDecimal"
,
true
);
}
// 主键是否自增
if
(
EXTRA
.
equals
(
column
.
getExtra
())){
map
.
put
(
"auto"
,
true
);
genMap
.
put
(
"auto"
,
true
);
}
// 主键存在字典
if
(
StringUtils
.
isNotBlank
(
column
.
getDictName
())){
genMap
.
put
(
"hasDict"
,
true
);
dicts
.
add
(
column
.
getDictName
());
}
// 存储字段类型
listMap
.
put
(
"columnType"
,
colType
);
// 存储字原始段名称
listMap
.
put
(
"columnName"
,
column
.
getColumnName
());
listMap
.
put
(
"isNullable"
,
column
.
getIsNullable
());
listMap
.
put
(
"columnShow"
,
column
.
getColumnShow
());
// 不为空
listMap
.
put
(
"istNotNull"
,
column
.
getNotNull
());
// 字段列表显示
listMap
.
put
(
"columnShow"
,
column
.
getListShow
());
// 表单显示
listMap
.
put
(
"formShow"
,
column
.
getFormShow
());
// 表单组件类型
listMap
.
put
(
"formType"
,
column
.
getFormType
());
// 小写开头的字段名称
listMap
.
put
(
"changeColumnName"
,
changeColumnName
);
//大写开头的字段名称
listMap
.
put
(
"capitalColumnName"
,
capitalColumnName
);
// 字典名称
listMap
.
put
(
"dictName"
,
column
.
getDictName
());
// 日期注解
listMap
.
put
(
"dateAnnotation"
,
column
.
getDateAnnotation
());
if
(
StringUtils
.
isNotBlank
(
column
.
getDateAnnotation
())){
genMap
.
put
(
"hasDateAnnotation"
,
true
);
}
// 添加非空字段信息
if
(
column
.
getNotNull
()){
isNotNullColumns
.
add
(
listMap
);
}
// 判断是否有查询,如有则把查询的字段set进columnQuery
if
(!
StringUtils
.
isBlank
(
column
.
getColumnQuery
())){
listMap
.
put
(
"columnQuery"
,
column
.
getColumnQuery
());
map
.
put
(
"hasQuery"
,
true
);
if
(!
StringUtils
.
isBlank
(
column
.
getQueryType
())){
// 查询类型
listMap
.
put
(
"queryType"
,
column
.
getQueryType
());
// 是否存在查询
genMap
.
put
(
"hasQuery"
,
true
);
if
(
TIMESTAMP
.
equals
(
colType
)){
map
.
put
(
"queryHasTimestamp"
,
true
);
// 查询中存储 Timestamp 类型
genMap
.
put
(
"queryHasTimestamp"
,
true
);
}
if
(
BIGDECIMAL
.
equals
(
colType
)){
map
.
put
(
"queryHasBigDecimal"
,
true
);
// 查询中存储 BigDecimal 类型
genMap
.
put
(
"queryHasBigDecimal"
,
true
);
}
if
(
"DateRange"
.
equalsIgnoreCase
(
column
.
getQueryType
())){
dateRanges
.
add
(
listMap
);
}
else
{
// 添加到查询列表中
queryColumns
.
add
(
listMap
);
}
queryColumns
.
add
(
listMap
);
}
// 添加到字段列表中
columns
.
add
(
listMap
);
}
map
.
put
(
"columns"
,
columns
);
map
.
put
(
"queryColumns"
,
queryColumns
);
// 保存字段列表
genMap
.
put
(
"columns"
,
columns
);
// 保存查询列表
genMap
.
put
(
"queryColumns"
,
queryColumns
);
// 保存字段列表
genMap
.
put
(
"dicts"
,
dicts
);
// 保存查询列表
genMap
.
put
(
"dateRanges"
,
dateRanges
);
// 保存非空字段信息
genMap
.
put
(
"isNotNullColumns"
,
isNotNullColumns
);
TemplateEngine
engine
=
TemplateUtil
.
createEngine
(
new
TemplateConfig
(
"template"
,
TemplateConfig
.
ResourceMode
.
CLASSPATH
));
// 生成后端代码
List
<
String
>
templates
=
getAdminTemplateNames
();
for
(
String
templateName
:
templates
)
{
...
...
@@ -156,14 +228,14 @@ public class GenUtil {
continue
;
}
// 生成代码
genFile
(
file
,
template
,
m
ap
);
genFile
(
file
,
template
,
genM
ap
);
}
// 生成前端代码
templates
=
getFrontTemplateNames
();
for
(
String
templateName
:
templates
)
{
Template
template
=
engine
.
getTemplate
(
"generator/front/"
+
templateName
+
".ftl"
);
String
filePath
=
getFrontFilePath
(
templateName
,
genConfig
,
m
ap
.
get
(
"changeClassName"
).
toString
());
String
filePath
=
getFrontFilePath
(
templateName
,
genConfig
,
genM
ap
.
get
(
"changeClassName"
).
toString
());
assert
filePath
!=
null
;
File
file
=
new
File
(
filePath
);
...
...
@@ -173,7 +245,7 @@ public class GenUtil {
continue
;
}
// 生成代码
genFile
(
file
,
template
,
m
ap
);
genFile
(
file
,
template
,
genM
ap
);
}
}
...
...
eladmin-logging/src/main/java/me/zhengjie/service/dto/LogQueryCriteria.java
浏览文件 @
40852235
...
...
@@ -2,8 +2,8 @@ package me.zhengjie.service.dto;
import
lombok.Data
;
import
me.zhengjie.annotation.Query
;
import
java.sql.Timestamp
;
import
java.util.List
;
/**
* 日志查询类
...
...
@@ -20,9 +20,6 @@ public class LogQueryCriteria {
@Query
private
String
logType
;
@Query
(
type
=
Query
.
Type
.
GREATER_THAN
,
propName
=
"createTime"
)
private
Timestamp
startTime
;
@Query
(
type
=
Query
.
Type
.
LESS_THAN
,
propName
=
"createTime"
)
private
Timestamp
endTime
;
@Query
(
type
=
Query
.
Type
.
BETWEEN
)
private
List
<
Timestamp
>
createTime
;
}
eladmin-system/pom.xml
浏览文件 @
40852235
...
...
@@ -17,6 +17,18 @@
</properties>
<dependencies>
<!-- 代码生成模块 -->
<dependency>
<groupId>
me.zhengjie
</groupId>
<artifactId>
eladmin-generator
</artifactId>
<version>
2.3
</version>
<exclusions>
<exclusion>
<groupId>
me.zhengjie
</groupId>
<artifactId>
eladmin-common
</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- tools 模块包含了 common 和 logging 模块 -->
<dependency>
...
...
eladmin-system/src/main/java/me/zhengjie/AppRun.java
浏览文件 @
40852235
...
...
@@ -3,6 +3,9 @@ package me.zhengjie;
import
me.zhengjie.utils.SpringContextHolder
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.web.embedded.tomcat.TomcatConnectorCustomizer
;
import
org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory
;
import
org.springframework.boot.web.servlet.server.ServletWebServerFactory
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.transaction.annotation.EnableTransactionManagement
;
...
...
@@ -24,4 +27,11 @@ public class AppRun {
public
SpringContextHolder
springContextHolder
()
{
return
new
SpringContextHolder
();
}
@Bean
public
ServletWebServerFactory
webServerFactory
()
{
TomcatServletWebServerFactory
fa
=
new
TomcatServletWebServerFactory
();
fa
.
addConnectorCustomizers
((
TomcatConnectorCustomizer
)
connector
->
connector
.
setProperty
(
"relaxedQueryChars"
,
"[]{}"
));
return
fa
;
}
}
eladmin-system/src/main/java/me/zhengjie/modules/quartz/rest/QuartzJobController.java
浏览文件 @
40852235
...
...
@@ -54,7 +54,7 @@ public class QuartzJobController {
@Log
(
"导出日志数据"
)
@ApiOperation
(
"导出日志数据"
)
@GetMapping
(
value
=
"/
download/log
"
)
@GetMapping
(
value
=
"/
logs/download
"
)
@PreAuthorize
(
"@el.check('timing:list')"
)
public
void
downloadLog
(
HttpServletResponse
response
,
JobQueryCriteria
criteria
)
throws
IOException
{
quartzJobService
.
downloadLog
(
quartzJobService
.
queryAllLog
(
criteria
),
response
);
...
...
eladmin-system/src/main/java/me/zhengjie/modules/quartz/service/dto/JobQueryCriteria.java
浏览文件 @
40852235
...
...
@@ -4,6 +4,7 @@ import lombok.Data;
import
me.zhengjie.annotation.Query
;
import
java.sql.Timestamp
;
import
java.util.List
;
/**
* @author Zheng Jie
...
...
@@ -18,9 +19,6 @@ public class JobQueryCriteria {
@Query
private
Boolean
isSuccess
;
@Query
(
type
=
Query
.
Type
.
GREATER_THAN
,
propName
=
"createTime"
)
private
Timestamp
startTime
;
@Query
(
type
=
Query
.
Type
.
LESS_THAN
,
propName
=
"createTime"
)
private
Timestamp
endTime
;
@Query
(
type
=
Query
.
Type
.
BETWEEN
)
private
List
<
Timestamp
>
createTime
;
}
eladmin-system/src/main/java/me/zhengjie/modules/system/rest/DictController.java
浏览文件 @
40852235
...
...
@@ -42,6 +42,14 @@ public class DictController {
dictService
.
download
(
dictService
.
queryAll
(
criteria
),
response
);
}
@Log
(
"查询字典"
)
@ApiOperation
(
"查询字典"
)
@GetMapping
(
value
=
"/all"
)
@PreAuthorize
(
"@el.check('dict:list')"
)
public
ResponseEntity
all
(){
return
new
ResponseEntity
<>(
dictService
.
queryAll
(
new
DictQueryCriteria
()),
HttpStatus
.
OK
);
}
@Log
(
"查询字典"
)
@ApiOperation
(
"查询字典"
)
@GetMapping
...
...
eladmin-system/src/main/java/me/zhengjie/modules/system/rest/JobController.java
浏览文件 @
40852235
...
...
@@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.*;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.util.List
;
/**
* @author Zheng Jie
...
...
@@ -51,8 +52,7 @@ public class JobController {
@ApiOperation
(
"查询岗位"
)
@GetMapping
@PreAuthorize
(
"@el.check('job:list','user:list')"
)
public
ResponseEntity
getJobs
(
JobQueryCriteria
criteria
,
Pageable
pageable
){
public
ResponseEntity
getJobs
(
JobQueryCriteria
criteria
,
Pageable
pageable
){
// 数据权限
criteria
.
setDeptIds
(
dataScope
.
getDeptIds
());
return
new
ResponseEntity
<>(
jobService
.
queryAll
(
criteria
,
pageable
),
HttpStatus
.
OK
);
...
...
eladmin-system/src/main/java/me/zhengjie/modules/system/rest/UserController.java
浏览文件 @
40852235
...
...
@@ -4,7 +4,7 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
import
me.zhengjie.aop.log.Log
;
import
me.zhengjie.config.DataScope
;
import
me.zhengjie.
modules.tools.
domain.VerificationCode
;
import
me.zhengjie.domain.VerificationCode
;
import
me.zhengjie.modules.system.domain.User
;
import
me.zhengjie.exception.BadRequestException
;
import
me.zhengjie.modules.system.domain.vo.UserPassVo
;
...
...
@@ -12,7 +12,7 @@ import me.zhengjie.modules.system.service.DeptService;
import
me.zhengjie.modules.system.service.RoleService
;
import
me.zhengjie.modules.system.service.dto.RoleSmallDTO
;
import
me.zhengjie.modules.system.service.dto.UserQueryCriteria
;
import
me.zhengjie.
modules.tools.
service.VerificationCodeService
;
import
me.zhengjie.service.VerificationCodeService
;
import
me.zhengjie.utils.*
;
import
me.zhengjie.modules.system.service.UserService
;
import
org.springframework.data.domain.Pageable
;
...
...
eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DeptQueryCriteria.java
浏览文件 @
40852235
...
...
@@ -4,6 +4,7 @@ import lombok.Data;
import
me.zhengjie.annotation.Query
;
import
java.sql.Timestamp
;
import
java.util.List
;
import
java.util.Set
;
/**
...
...
@@ -25,9 +26,6 @@ public class DeptQueryCriteria{
@Query
private
Long
pid
;
@Query
(
type
=
Query
.
Type
.
GREATER_THAN
,
propName
=
"createTime"
)
private
Timestamp
startTime
;
@Query
(
type
=
Query
.
Type
.
LESS_THAN
,
propName
=
"createTime"
)
private
Timestamp
endTime
;
@Query
(
type
=
Query
.
Type
.
BETWEEN
)
private
List
<
Timestamp
>
createTime
;
}
\ No newline at end of file
eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DictDetailDTO.java
浏览文件 @
40852235
...
...
@@ -22,5 +22,7 @@ public class DictDetailDTO implements Serializable {
private
String
sort
;
private
DictSmallDTO
dict
;
private
Timestamp
createTime
;
}
\ No newline at end of file
eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/DictSmallDTO.java
0 → 100644
浏览文件 @
40852235
package
me.zhengjie.modules.system.service.dto
;
import
lombok.Getter
;
import
lombok.Setter
;
import
java.io.Serializable
;
/**
* @author Zheng Jie
* @date 2019-04-10
*/
@Getter
@Setter
public
class
DictSmallDTO
implements
Serializable
{
private
Long
id
;
}
eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/JobQueryCriteria.java
浏览文件 @
40852235
...
...
@@ -3,9 +3,8 @@ package me.zhengjie.modules.system.service.dto;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
me.zhengjie.annotation.Query
;
import
java.io.Serializable
;
import
java.sql.Timestamp
;
import
java.util.List
;
import
java.util.Set
;
/**
...
...
@@ -28,9 +27,6 @@ public class JobQueryCriteria {
@Query
(
propName
=
"id"
,
joinName
=
"dept"
,
type
=
Query
.
Type
.
IN
)
private
Set
<
Long
>
deptIds
;
@Query
(
type
=
Query
.
Type
.
GREATER_THAN
,
propName
=
"createTime"
)
private
Timestamp
startTime
;
@Query
(
type
=
Query
.
Type
.
LESS_THAN
,
propName
=
"createTime"
)
private
Timestamp
endTime
;
@Query
(
type
=
Query
.
Type
.
BETWEEN
)
private
List
<
Timestamp
>
createTime
;
}
\ No newline at end of file
eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/MenuQueryCriteria.java
浏览文件 @
40852235
...
...
@@ -4,6 +4,7 @@ import lombok.Data;
import
me.zhengjie.annotation.Query
;
import
java.sql.Timestamp
;
import
java.util.List
;
/**
* 公共查询类
...
...
@@ -15,9 +16,6 @@ public class MenuQueryCriteria {
@Query
(
blurry
=
"name,path,component"
)
private
String
blurry
;
@Query
(
type
=
Query
.
Type
.
GREATER_THAN
,
propName
=
"createTime"
)
private
Timestamp
startTime
;
@Query
(
type
=
Query
.
Type
.
LESS_THAN
,
propName
=
"createTime"
)
private
Timestamp
endTime
;
@Query
(
type
=
Query
.
Type
.
BETWEEN
)
private
List
<
Timestamp
>
createTime
;
}
eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/RoleQueryCriteria.java
浏览文件 @
40852235
...
...
@@ -4,6 +4,7 @@ import lombok.Data;
import
me.zhengjie.annotation.Query
;
import
java.sql.Timestamp
;
import
java.util.List
;
/**
* 公共查询类
...
...
@@ -15,9 +16,6 @@ public class RoleQueryCriteria {
@Query
(
blurry
=
"name,remark"
)
private
String
blurry
;
@Query
(
type
=
Query
.
Type
.
GREATER_THAN
,
propName
=
"createTime"
)
private
Timestamp
startTime
;
@Query
(
type
=
Query
.
Type
.
LESS_THAN
,
propName
=
"createTime"
)
private
Timestamp
endTime
;
@Query
(
type
=
Query
.
Type
.
BETWEEN
)
private
List
<
Timestamp
>
createTime
;
}
eladmin-system/src/main/java/me/zhengjie/modules/system/service/dto/UserQueryCriteria.java
浏览文件 @
40852235
...
...
@@ -4,6 +4,7 @@ import lombok.Data;
import
me.zhengjie.annotation.Query
;
import
java.io.Serializable
;
import
java.sql.Timestamp
;
import
java.util.List
;
import
java.util.Set
;
/**
...
...
@@ -28,9 +29,6 @@ public class UserQueryCriteria implements Serializable {
private
Long
deptId
;
@Query
(
type
=
Query
.
Type
.
GREATER_THAN
,
propName
=
"createTime"
)
private
Timestamp
startTime
;
@Query
(
type
=
Query
.
Type
.
LESS_THAN
,
propName
=
"createTime"
)
private
Timestamp
endTime
;
@Query
(
type
=
Query
.
Type
.
BETWEEN
)
private
List
<
Timestamp
>
createTime
;
}
eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapper/DictDetailMapper.java
浏览文件 @
40852235
...
...
@@ -10,7 +10,7 @@ import org.mapstruct.ReportingPolicy;
* @author Zheng Jie
* @date 2019-04-10
*/
@Mapper
(
componentModel
=
"spring"
,
unmappedTargetPolicy
=
ReportingPolicy
.
IGNORE
)
@Mapper
(
componentModel
=
"spring"
,
uses
=
{
DictSmallMapper
.
class
},
unmappedTargetPolicy
=
ReportingPolicy
.
IGNORE
)
public
interface
DictDetailMapper
extends
BaseMapper
<
DictDetailDTO
,
DictDetail
>
{
}
\ No newline at end of file
eladmin-system/src/main/java/me/zhengjie/modules/system/service/mapper/DictSmallMapper.java
0 → 100644
浏览文件 @
40852235
package
me.zhengjie.modules.system.service.mapper
;
import
me.zhengjie.base.BaseMapper
;
import
me.zhengjie.modules.system.domain.Dict
;
import
me.zhengjie.modules.system.service.dto.DictDTO
;
import
me.zhengjie.modules.system.service.dto.DictSmallDTO
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.ReportingPolicy
;
/**
* @author Zheng Jie
* @date 2019-04-10
*/
@Mapper
(
componentModel
=
"spring"
,
unmappedTargetPolicy
=
ReportingPolicy
.
IGNORE
)
public
interface
DictSmallMapper
extends
BaseMapper
<
DictSmallDTO
,
Dict
>
{
}
\ No newline at end of file
eladmin-system/src/main/resources/template/generator/admin/Controller.ftl
浏览文件 @
40852235
...
...
@@ -70,4 +70,13 @@ public class ${className}Controller {
${
changeClassName
}
Service
.
delete
(${
pkChangeColName
});
return
new
ResponseEntity
(
HttpStatus
.
OK
);
}
@
Log
(
"多选删除${className}"
)
@
ApiOperation
(
"多选删除${className}"
)
@
PreAuthorize
(
"@el.check('${changeClassName}:del')"
)
@
DeleteMapping
public
ResponseEntity
deleteAll
(@
RequestBody
${
pkColumnType
}[]
ids
)
{
${
changeClassName
}
Service
.
deleteAll
(
ids
);
return
new
ResponseEntity
(
HttpStatus
.
OK
);
}
}
\ No newline at end of file
eladmin-system/src/main/resources/template/generator/admin/Dto.ftl
浏览文件 @
40852235
...
...
@@ -23,8 +23,8 @@ public class ${className}DTO implements Serializable {
<#
if
columns
??>
<#
list
columns
as
column
>
<#
if
column
.
columnComment
!= ''>
//
${
column
.
columnComment
}
<#
if
column
.
remark
!= ''>
//
${
column
.
remark
}
</#
if
>
<#
if
column
.
columnKey
=
'PRI'
>
<#
if
!auto && pkColumnType = 'Long'>
...
...
eladmin-system/src/main/resources/template/generator/admin/Entity.ftl
浏览文件 @
40852235
...
...
@@ -4,6 +4,14 @@ import lombok.Data;
import
cn
.
hutool
.
core
.
bean
.
BeanUtil
;
import
cn
.
hutool
.
core
.
bean
.
copier
.
CopyOptions
;
import
javax
.
persistence
.*;
<#
if
isNotNullColumns
??>
import
javax
.
validation
.
constraints
.*;
</#
if
>
<#
if
hasDateAnnotation
>
import
javax
.
persistence
.
Entity
;
import
javax
.
persistence
.
Table
;
import
org
.
hibernate
.
annotations
.*;
</#
if
>
<#
if
hasTimestamp
>
import
java
.
sql
.
Timestamp
;
</#
if
>
...
...
@@ -23,8 +31,8 @@ public class ${className} implements Serializable {
<#
if
columns
??>
<#
list
columns
as
column
>
<#
if
column
.
columnComment
!= ''>
//
${
column
.
columnComment
}
<#
if
column
.
remark
!= ''>
//
${
column
.
remark
}
</#
if
>
<#
if
column
.
columnKey
=
'PRI'
>
@
Id
...
...
@@ -32,7 +40,21 @@ public class ${className} implements Serializable {
@
GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
</#
if
>
</#
if
>
@
Column
(
name
=
"${column.columnName}"
<#
if
column
.
columnKey
=
'UNI'
>,
unique
=
true
</#
if
><#
if
column
.
isNullable
=
'NO'
&&
column
.
columnKey
!= 'PRI'>,nullable = false</#if>)
@
Column
(
name
=
"${column.columnName}"
<#
if
column
.
columnKey
=
'UNI'
>,
unique
=
true
</#
if
><#
if
column
.
istNotNull
&&
column
.
columnKey
!= 'PRI'>,nullable = false</#if>)
<#
if
column
.
istNotNull
&&
column
.
columnKey
!= 'PRI'>
<#
if
column
.
columnType
=
'String'
>
@
NotBlank
<#
else
>
@
NotNull
</#
if
>
</#
if
>
<#
if
column
.
dateAnnotation
??>
<#
if
column
.
dateAnnotation
=
'CreationTimestamp'
>
@
CreationTimestamp
<#
else
>
@
UpdateTimestamp
</#
if
>
</#
if
>
private
${
column
.
columnType
}
${
column
.
changeColumnName
};
</#
list
>
</#
if
>
...
...
eladmin-system/src/main/resources/template/generator/admin/QueryCriteria.ftl
浏览文件 @
40852235
...
...
@@ -7,6 +7,9 @@ import java.sql.Timestamp;
<#
if
queryHasBigDecimal
>
import
java
.
math
.
BigDecimal
;
</#
if
>
<#
if
dateRanges
??>
import
java
.
util
.
List
;
</#
if
>
<#
if
queryColumns
??>
import
me
.
zhengjie
.
annotation
.
Query
;
</#
if
>
...
...
@@ -20,15 +23,37 @@ public class ${className}QueryCriteria{
<#
if
queryColumns
??>
<#
list
queryColumns
as
column
>
<#
if
column
.
columnQuery
=
'1'
>
//
模糊
@
Query
(
type
=
Query
.
Type
.
INNER_LIKE
)
</#
if
>
<#
if
column
.
columnQuery
=
'2'
>
<#
if
column
.
queryType
=
'='
>
//
精确
@
Query
</#
if
>
private
${
column
.
columnType
}
${
column
.
changeColumnName
};
</#
if
>
<#
if
column
.
queryType
=
'Like'
>
//
模糊
@
Query
(
type
=
Query
.
Type
.
INNER_LIKE
)
private
${
column
.
columnType
}
${
column
.
changeColumnName
};
</#
if
>
<#
if
column
.
queryType
=
'!='
>
//
不等于
@
Query
(
type
=
Query
.
Type
.
NOT_EQUAL
)
private
${
column
.
columnType
}
${
column
.
changeColumnName
};
</#
if
>
<#
if
column
.
queryType
=
'>='
>
//
大于等于
@
Query
(
type
=
Query
.
Type
.
GREATER_THAN
)
private
${
column
.
columnType
}
${
column
.
changeColumnName
};
</#
if
>
<#
if
column
.
queryType
=
'<='
>
//
小于等于
@
Query
(
type
=
Query
.
Type
.
LESS_THAN
)
private
${
column
.
columnType
}
${
column
.
changeColumnName
};
</#
if
>
</#
list
>
</#
if
>
<#
if
dateRanges
??>
<#
list
dateRanges
as
column
>
@
Query
(
type
=
Query
.
Type
.
BETWEEN
)
private
List
<${
column
.
columnType
}>
createTime
;
</#
list
>
</#
if
>
}
\ No newline at end of file
eladmin-system/src/main/resources/template/generator/admin/Service.ftl
浏览文件 @
40852235
...
...
@@ -43,5 +43,7 @@ public interface ${className}Service {
void
delete
(${
pkColumnType
}
${
pkChangeColName
});
void
deleteAll
(${
pkColumnType
}[]
ids
);
void
download
(
List
<${
className
}
DTO
>
all
,
HttpServletResponse
response
)
throws
IOException
;
}
\ No newline at end of file
eladmin-system/src/main/resources/template/generator/admin/ServiceImpl.ftl
浏览文件 @
40852235
...
...
@@ -133,6 +133,13 @@ public class ${className}ServiceImpl implements ${className}Service {
${
changeClassName
}
Repository
.
deleteById
(${
pkChangeColName
});
}
@
Override
@
CacheEvict
(
allEntries
=
true
)
public
void
deleteAll
(${
pkColumnType
}[]
ids
)
{
for
(${
pkColumnType
}
id
:
ids
)
{
${
changeClassName
}
Repository
.
deleteById
(${
pkChangeColName
});
}
}
@
Override
public
void
download
(
List
<${
className
}
DTO
>
all
,
HttpServletResponse
response
)
throws
IOException
{
...
...
@@ -141,8 +148,8 @@ public class ${className}ServiceImpl implements ${className}Service {
Map
<
String
,
Object
>
map
=
new
LinkedHashMap
<>();
<#
list
columns
as
column
>
<#
if
column
.
columnKey
!= 'PRI'>
<#
if
column
.
columnComment
!= ''>
map
.
put
(
"${column.
columnComment
}"
,
${
changeClassName
}.
get
${
column
.
capitalColumnName
}());
<#
if
column
.
remark
!= ''>
map
.
put
(
"${column.
remark
}"
,
${
changeClassName
}.
get
${
column
.
capitalColumnName
}());
<#
else
>
map
.
put
(
" ${column.changeColumnName}"
,
${
changeClassName
}.
get
${
column
.
capitalColumnName
}());
</#
if
>
...
...
eladmin-system/src/main/resources/template/generator/front/api.ftl
浏览文件 @
40852235
...
...
@@ -14,6 +14,13 @@ export function del(${pkChangeColName}) {
method: 'delete'
})
}
export function delAll(ids) {
return request({
url: 'api/${changeClassName}/',
method: 'delete',
data: ids
})
}
export function edit(data) {
return request({
...
...
eladmin-system/src/main/resources/template/generator/front/eForm.ftl
浏览文件 @
40852235
<template>
<el-dialog :append-to-body="true" :close-on-click-modal="false" :before-close="cancel" :visible.sync="dialog" :title="isAdd ? '新增' : '编辑'" width="500px">
<el-form ref="form" :model="form"
:rules="rules"
size="small" label-width="80px">
<el-form ref="form" :model="form"
<#if isNotNullColumns??>:rules="rules"</#if>
size="small" label-width="80px">
<#if columns??>
<#list columns as column>
<#if column.
changeColumnName != '${pkChangeColName}'
>
<el-form-item label="<#if column.
columnComment != ''>${column.columnComment}<#else>${column.changeColumnName}</#if>" <#if column.columnKey = 'UNI'
>prop="${column.changeColumnName}"</#if>>
<#if column.
columnType != 'Timestamp
'>
<#if column.
formShow
>
<el-form-item label="<#if column.
remark != ''>${column.remark}<#else>${column.changeColumnName}</#if>" <#if column.istNotNull
>prop="${column.changeColumnName}"</#if>>
<#if column.
formType = 'Input
'>
<el-input v-model="form.${column.changeColumnName}" style="width: 370px;"/>
<#else >
<#elseif column.formType = 'Textarea'>
<el-input :rows="3" v-model="form.${column.changeColumnName}" type="textarea" style="width: 370px;"/>
<#elseif column.formType = 'Radio'>
<#if column.dictName??>
<el-radio v-for="item in dicts.${column.dictName}" :key="item.id" v-model="form.${column.changeColumnName}" :label="item.value">{{ item.label }}</el-radio>
<#else>
未设置字典,请手动设置 Radio
</#if>
<#elseif column.formType = 'Select'>
<#if column.dictName??>
<el-select v-model="form.${column.changeColumnName}" filterable placeholder="请选择">
<el-option
v-for="item in dicts.${column.dictName}"
:key="item.id"
:label="item.label"
:value="item.value"/>
</el-select>
<#else>
未设置字典,请手动设置 Select
</#if>
<#else>
<el-date-picker v-model="form.${column.changeColumnName}" type="datetime" style="width: 370px;"/>
</#if>
</el-form-item>
...
...
@@ -29,7 +49,12 @@ export default {
isAdd: {
type: Boolean,
required: true
}<#if hasDict>,
dicts: {
type: Object,
required: true
}
</#if>
},
data() {
return {
...
...
@@ -42,13 +67,15 @@ export default {
</#if>
},
rules: {
<#list columns as column>
<#if column.columnKey = 'UNI'>
<#if isNotNullColumns??>
<#list isNotNullColumns as column>
<#if column.istNotNull>
${column.changeColumnName}: [
{ required: true, message: 'please enter', trigger: 'blur' }
]<#if
(column_has_next)
>,</#if>
]<#if
column_has_next
>,</#if>
</#if>
</#list>
</#if>
}
}
},
...
...
@@ -57,10 +84,23 @@ export default {
this.resetForm()
},
doSubmit() {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
<#if isNotNullColumns??>
this.$refs['form'].validate((valid) => {
if (valid) {
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
} else {
return false
}
})
<#else>
this.loading = true
if (this.isAdd) {
this.doAdd()
} else this.doEdit()
</#if>
},
doAdd() {
add(this.form).then(res => {
...
...
eladmin-system/src/main/resources/template/generator/front/index.ftl
浏览文件 @
40852235
...
...
@@ -9,6 +9,22 @@
<el-select v-model="query.type" clearable placeholder="类型" class="filter-item" style="width: 130px">
<el-option v-for="item in queryTypeOptions" :key="item.key" :label="item.display_name" :value="item.key"/>
</el-select>
<#if dateRanges??>
<#list dateRanges as column>
<#if column.queryType = 'DateRange'>
<el-date-picker
v-model="query.${column.changeColumnName}"
:default-time="['00:00:00','23:59:59']"
type="daterange"
range-separator=":"
class="el-range-editor--small filter-item"
style="height: 30.5px;width: 225px;"
value-format="yyyy-MM-dd HH:mm:ss"
start-placeholder="${column.changeColumnName}Start"
end-placeholder="${column.changeColumnName}End"/>
</#if>
</#list>
</#if>
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
</#if>
<!-- 新增 -->
...
...
@@ -31,18 +47,36 @@
icon="el-icon-download"
@click="download">导出</el-button>
</div>
<!-- 多选删除 -->
<div v-permission="['admin','${changeClassName}:del']" style="display: inline-block;">
<el-button
:loading="delAllLoading"
:disabled="data.length === 0 || $refs.table.selection.length === 0"
class="filter-item"
size="mini"
type="danger"
icon="el-icon-delete"
@click="open">删除</el-button>
</div>
</div>
<!--表单组件-->
<eForm ref="form" :is-add="isAdd"/>
<eForm ref="form" :is-add="isAdd"
<#if hasDict>:dicts="dict"</#if>
/>
<!--表格渲染-->
<el-table v-loading="loading" :data="data" size="small" style="width: 100%;">
<el-table v-loading="loading" ref="table" :data="data" size="small" style="width: 100%;">
<el-table-column type="selection" width="55"/>
<#if columns??>
<#list columns as column>
<#if column.columnShow = 'true'>
<#if column.columnType != 'Timestamp'>
<el-table-column prop="${column.changeColumnName}" label="<#if column.columnComment != ''>${column.columnComment}<#else>${column.changeColumnName}</#if>"/>
<#if column.columnShow>
<#if column.dictName??>
<el-table-column prop="${column.changeColumnName}" label="<#if column.remark != ''>${column.remark}<#else>${column.changeColumnName}</#if>">
<template slot-scope="scope">
{{ dict.label.${column.dictName}[scope.row.${column.changeColumnName}] }}
</template>
</el-table-column>
<#elseif column.columnType != 'Timestamp'>
<el-table-column prop="${column.changeColumnName}" label="<#if column.remark != ''>${column.remark}<#else>${column.changeColumnName}</#if>"/>
<#else>
<el-table-column prop="${column.changeColumnName}" label="<#if column.
columnComment != ''>${column.columnComment
}<#else>${column.changeColumnName}</#if>">
<el-table-column prop="${column.changeColumnName}" label="<#if column.
remark != ''>${column.remark
}<#else>${column.changeColumnName}</#if>">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.${column.changeColumnName}) }}</span>
</template>
...
...
@@ -83,7 +117,7 @@
<script>
import checkPermission from '@/utils/permission'
import initData from '@/mixins/initData'
import { del, download${className} } from '@/api/${changeClassName}'
import { del, download${className}
, delAll
} from '@/api/${changeClassName}'
<#if hasTimestamp>
import { parseTime, downloadFile } from '@/utils/index'
</#if>
...
...
@@ -91,14 +125,19 @@ import eForm from './form'
export default {
components: { eForm },
mixins: [initData],
<#if hasDict>
dicts: [<#if hasDict??><#list dicts as dict>'${dict}'<#if dict_has_next>, </#if></#list></#if>],
</#if>
data() {
return {
delLoading: false,
delLoading: false,
delAllLoading: false,
<#if hasQuery>
queryTypeOptions: [
<#if queryColumns??>
<#list queryColumns as column>
{ key: '${column.changeColumnName}', display_name: '<#if column.columnComment != ''>${column.columnComment}<#else>${column.changeColumnName}</#if>' }<#if column_has_next>,</#if>
<#if column.queryType != 'DateRange'>
{ key: '${column.changeColumnName}', display_name: '<#if column.remark != ''>${column.remark}<#else>${column.changeColumnName}</#if>' }<#if column_has_next>,</#if>
</#if>
</#list>
</#if>
]
...
...
@@ -124,6 +163,16 @@ export default {
const type = query.type
const value = query.value
if (type && value) { this.params[type] = value }
<#if dateRanges??>
<#list dateRanges as column>
<#if column.queryType = 'DateRange'>
if (query.${column.changeColumnName}) {
this.params['${column.changeColumnName}Start'] = query.${column.changeColumnName}[0]
this.params['${column.changeColumnName}End'] = query.${column.changeColumnName}[1]
}
</#if>
</#list>
</#if>
</#if>
return true
},
...
...
@@ -171,6 +220,36 @@ export default {
}).catch(() => {
this.downloadLoading = false
})
},
doDelete() {
this.delAllLoading = true
const data = this.$refs.table.selection
const ids = []
for (let i = 0; i < data.length; i++) {
ids.push(data[i].id)
}
delAll(ids).then(res => {
this.delAllLoading = false
this.init()
this.dleChangePage(ids.length)
this.$notify({
title: '删除成功',
type: 'success',
duration: 2500
})
}).catch(err => {
this.delAllLoading = false
console.log(err.response.data.message)
})
},
open() {
this.$confirm('你确定删除选中的数据吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.doDelete()
})
}
}
}
...
...
eladmin-system/src/test/java/me/zhengjie/EladminSystemApplicationTests.java
浏览文件 @
40852235
...
...
@@ -5,6 +5,9 @@ import org.junit.runner.RunWith;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
java.util.ArrayList
;
import
java.util.List
;
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
public
class
EladminSystemApplicationTests
{
...
...
@@ -13,5 +16,8 @@ public class EladminSystemApplicationTests {
public
void
contextLoads
()
{
}
public
static
void
main
(
String
[]
args
)
{
}
}
eladmin-tools/pom.xml
浏览文件 @
40852235
...
...
@@ -16,7 +16,6 @@
<mail.version>
1.4.7
</mail.version>
<qiniu.version>
[7.2.0, 7.2.99]
</qiniu.version>
<alipay.version>
3.1.0
</alipay.version>
<configuration.version>
1.9
</configuration.version>
</properties>
<dependencies>
...
...
@@ -34,19 +33,6 @@
<version>
${mail.version}
</version>
</dependency>
<!--模板引擎-->
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-freemarker
</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/commons-configuration/commons-configuration -->
<dependency>
<groupId>
commons-configuration
</groupId>
<artifactId>
commons-configuration
</artifactId>
<version>
${configuration.version}
</version>
</dependency>
<!--七牛云存储-->
<dependency>
<groupId>
com.qiniu
</groupId>
...
...
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
domain/AlipayConfig.java
→
eladmin-tools/src/main/java/me/zhengjie/domain/AlipayConfig.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
domain
;
package
me.zhengjie.domain
;
import
lombok.Data
;
import
javax.persistence.*
;
...
...
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
domain/EmailConfig.java
→
eladmin-tools/src/main/java/me/zhengjie/domain/EmailConfig.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
domain
;
package
me.zhengjie.domain
;
import
lombok.Data
;
...
...
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
domain/LocalStorage.java
→
eladmin-tools/src/main/java/me/zhengjie/domain/LocalStorage.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
domain
;
package
me.zhengjie.domain
;
import
lombok.*
;
import
cn.hutool.core.bean.BeanUtil
;
...
...
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
domain/Picture.java
→
eladmin-tools/src/main/java/me/zhengjie/domain/Picture.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
domain
;
package
me.zhengjie.domain
;
import
lombok.Data
;
import
org.hibernate.annotations.CreationTimestamp
;
...
...
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
domain/QiniuConfig.java
→
eladmin-tools/src/main/java/me/zhengjie/domain/QiniuConfig.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
domain
;
package
me.zhengjie.domain
;
import
lombok.Data
;
import
javax.persistence.*
;
...
...
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
domain/QiniuContent.java
→
eladmin-tools/src/main/java/me/zhengjie/domain/QiniuContent.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
domain
;
package
me.zhengjie.domain
;
import
lombok.Data
;
import
org.hibernate.annotations.UpdateTimestamp
;
...
...
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
domain/VerificationCode.java
→
eladmin-tools/src/main/java/me/zhengjie/domain/VerificationCode.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
domain
;
package
me.zhengjie.domain
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
...
...
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
domain/vo/EmailVo.java
→
eladmin-tools/src/main/java/me/zhengjie/domain/vo/EmailVo.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
domain.vo
;
package
me.zhengjie.domain.vo
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
...
...
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
domain/vo/TradeVo.java
→
eladmin-tools/src/main/java/me/zhengjie/domain/vo/TradeVo.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
domain.vo
;
package
me.zhengjie.domain.vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
eladmin-tools/src/main/java/me/zhengjie/modules/generator/domain/vo/ColumnInfo.java
已删除
100644 → 0
浏览文件 @
4681ca6e
package
me.zhengjie.modules.generator.domain.vo
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* 列的数据信息
* @author Zheng Jie
* @date 2019-01-02
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
ColumnInfo
{
// 数据库字段名称
private
Object
columnName
;
// 允许空值
private
Object
isNullable
;
// 数据库字段类型
private
Object
columnType
;
// 数据库字段注释
private
Object
columnComment
;
// 数据库字段键类型
private
Object
columnKey
;
// 额外的参数
private
Object
extra
;
// 查询 1:模糊 2:精确
private
String
columnQuery
;
// 是否在列表显示
private
String
columnShow
;
}
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
repository/AlipayRepository.java
→
eladmin-tools/src/main/java/me/zhengjie/repository/AlipayRepository.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
repository
;
package
me.zhengjie.repository
;
import
me.zhengjie.
modules.tools.
domain.AlipayConfig
;
import
me.zhengjie.domain.AlipayConfig
;
import
org.springframework.data.jpa.repository.JpaRepository
;
/**
...
...
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
repository/EmailRepository.java
→
eladmin-tools/src/main/java/me/zhengjie/repository/EmailRepository.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
repository
;
package
me.zhengjie.repository
;
import
me.zhengjie.
modules.tools.
domain.EmailConfig
;
import
me.zhengjie.domain.EmailConfig
;
import
org.springframework.data.jpa.repository.JpaRepository
;
/**
...
...
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
repository/LocalStorageRepository.java
→
eladmin-tools/src/main/java/me/zhengjie/repository/LocalStorageRepository.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
repository
;
package
me.zhengjie.repository
;
import
me.zhengjie.
modules.tools.
domain.LocalStorage
;
import
me.zhengjie.domain.LocalStorage
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
...
...
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
repository/PictureRepository.java
→
eladmin-tools/src/main/java/me/zhengjie/repository/PictureRepository.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
repository
;
package
me.zhengjie.repository
;
import
me.zhengjie.
modules.tools.
domain.Picture
;
import
me.zhengjie.domain.Picture
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
...
...
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
repository/QiNiuConfigRepository.java
→
eladmin-tools/src/main/java/me/zhengjie/repository/QiNiuConfigRepository.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
repository
;
package
me.zhengjie.repository
;
import
me.zhengjie.
modules.tools.
domain.QiniuConfig
;
import
me.zhengjie.domain.QiniuConfig
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.Modifying
;
import
org.springframework.data.jpa.repository.Query
;
...
...
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
repository/QiniuContentRepository.java
→
eladmin-tools/src/main/java/me/zhengjie/repository/QiniuContentRepository.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
repository
;
package
me.zhengjie.repository
;
import
me.zhengjie.
modules.tools.
domain.QiniuContent
;
import
me.zhengjie.domain.QiniuContent
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaSpecificationExecutor
;
...
...
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
repository/VerificationCodeRepository.java
→
eladmin-tools/src/main/java/me/zhengjie/repository/VerificationCodeRepository.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
repository
;
package
me.zhengjie.repository
;
import
me.zhengjie.
modules.tools.
domain.VerificationCode
;
import
me.zhengjie.domain.VerificationCode
;
import
org.springframework.data.jpa.repository.JpaRepository
;
/**
...
...
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
rest/AliPayController.java
→
eladmin-tools/src/main/java/me/zhengjie/rest/AliPayController.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
rest
;
package
me.zhengjie.rest
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
me.zhengjie.annotation.AnonymousAccess
;
import
me.zhengjie.aop.log.Log
;
import
me.zhengjie.
modules.tools.domain.AlipayConfig
;
import
me.zhengjie.
modules.tools.domain.vo.TradeVo
;
import
me.zhengjie.
modules.tools.
utils.AliPayStatusEnum
;
import
me.zhengjie.
modules.tools.
utils.AlipayUtils
;
import
me.zhengjie.
modules.tools.
service.AlipayService
;
import
me.zhengjie.
domain.vo.TradeVo
;
import
me.zhengjie.
domain.AlipayConfig
;
import
me.zhengjie.utils.AliPayStatusEnum
;
import
me.zhengjie.utils.AlipayUtils
;
import
me.zhengjie.service.AlipayService
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.validation.annotation.Validated
;
...
...
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
rest/EmailController.java
→
eladmin-tools/src/main/java/me/zhengjie/rest/EmailController.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
rest
;
package
me.zhengjie.rest
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
me.zhengjie.aop.log.Log
;
import
me.zhengjie.
modules.tools.domain.EmailConfig
;
import
me.zhengjie.
modules.tools.domain.vo.EmailVo
;
import
me.zhengjie.
modules.tools.
service.EmailService
;
import
me.zhengjie.
domain.vo.EmailVo
;
import
me.zhengjie.
domain.EmailConfig
;
import
me.zhengjie.service.EmailService
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.validation.annotation.Validated
;
...
...
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
rest/LocalStorageController.java
→
eladmin-tools/src/main/java/me/zhengjie/rest/LocalStorageController.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
rest
;
package
me.zhengjie.rest
;
import
me.zhengjie.aop.log.Log
;
import
me.zhengjie.
modules.tools.
domain.LocalStorage
;
import
me.zhengjie.
modules.tools.
service.LocalStorageService
;
import
me.zhengjie.
modules.tools.
service.dto.LocalStorageQueryCriteria
;
import
me.zhengjie.domain.LocalStorage
;
import
me.zhengjie.service.LocalStorageService
;
import
me.zhengjie.service.dto.LocalStorageQueryCriteria
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
...
...
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
rest/PictureController.java
→
eladmin-tools/src/main/java/me/zhengjie/rest/PictureController.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
rest
;
package
me.zhengjie.rest
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
me.zhengjie.aop.log.Log
;
import
me.zhengjie.
modules.tools.
domain.Picture
;
import
me.zhengjie.
modules.tools.
service.PictureService
;
import
me.zhengjie.
modules.tools.
service.dto.PictureQueryCriteria
;
import
me.zhengjie.domain.Picture
;
import
me.zhengjie.service.PictureService
;
import
me.zhengjie.service.dto.PictureQueryCriteria
;
import
me.zhengjie.utils.SecurityUtils
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.http.HttpStatus
;
...
...
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
rest/QiniuController.java
→
eladmin-tools/src/main/java/me/zhengjie/rest/QiniuController.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
rest
;
package
me.zhengjie.rest
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
me.zhengjie.aop.log.Log
;
import
me.zhengjie.
modules.tools.
domain.QiniuConfig
;
import
me.zhengjie.
modules.tools.service.dto.QiniuQueryCriteria
;
import
me.zhengjie.
modules.tools.domain.QiniuContent
;
import
me.zhengjie.
modules.tools.
service.QiNiuService
;
import
me.zhengjie.domain.QiniuConfig
;
import
me.zhengjie.
domain.QiniuContent
;
import
me.zhengjie.
service.dto.QiniuQueryCriteria
;
import
me.zhengjie.service.QiNiuService
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
...
...
@@ -52,7 +52,7 @@ public class QiniuController {
@Log
(
"导出数据"
)
@ApiOperation
(
"导出数据"
)
@GetMapping
(
value
=
"/download
/list
"
)
@GetMapping
(
value
=
"/download"
)
public
void
download
(
HttpServletResponse
response
,
QiniuQueryCriteria
criteria
)
throws
IOException
{
qiNiuService
.
downloadList
(
qiNiuService
.
queryAll
(
criteria
),
response
);
}
...
...
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
rest/VerificationCodeController.java
→
eladmin-tools/src/main/java/me/zhengjie/rest/VerificationCodeController.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
rest
;
package
me.zhengjie.rest
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
me.zhengjie.
modules.tools.
domain.VerificationCode
;
import
me.zhengjie.
modules.tools.
domain.vo.EmailVo
;
import
me.zhengjie.
modules.tools.
service.EmailService
;
import
me.zhengjie.
modules.tools.
service.VerificationCodeService
;
import
me.zhengjie.domain.VerificationCode
;
import
me.zhengjie.domain.vo.EmailVo
;
import
me.zhengjie.service.EmailService
;
import
me.zhengjie.service.VerificationCodeService
;
import
me.zhengjie.utils.ElAdminConstant
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
...
...
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
service/AlipayService.java
→
eladmin-tools/src/main/java/me/zhengjie/service/AlipayService.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
service
;
package
me.zhengjie.service
;
import
me.zhengjie.
modules.tools.domain.AlipayConfig
;
import
me.zhengjie.
modules.tools.domain.vo.TradeVo
;
import
me.zhengjie.
domain.vo.TradeVo
;
import
me.zhengjie.
domain.AlipayConfig
;
/**
* @author Zheng Jie
...
...
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
service/EmailService.java
→
eladmin-tools/src/main/java/me/zhengjie/service/EmailService.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
service
;
package
me.zhengjie.service
;
import
me.zhengjie.
modules.tools.domain.EmailConfig
;
import
me.zhengjie.
modules.tools.domain.vo.EmailVo
;
import
me.zhengjie.
domain.vo.EmailVo
;
import
me.zhengjie.
domain.EmailConfig
;
import
org.springframework.scheduling.annotation.Async
;
/**
...
...
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
service/LocalStorageService.java
→
eladmin-tools/src/main/java/me/zhengjie/service/LocalStorageService.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
service
;
package
me.zhengjie.service
;
import
me.zhengjie.
modules.tools.
domain.LocalStorage
;
import
me.zhengjie.
modules.tools.
service.dto.LocalStorageDTO
;
import
me.zhengjie.
modules.tools.
service.dto.LocalStorageQueryCriteria
;
import
me.zhengjie.domain.LocalStorage
;
import
me.zhengjie.service.dto.LocalStorageDTO
;
import
me.zhengjie.service.dto.LocalStorageQueryCriteria
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.web.multipart.MultipartFile
;
...
...
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
service/PictureService.java
→
eladmin-tools/src/main/java/me/zhengjie/service/PictureService.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
service
;
package
me.zhengjie.service
;
import
me.zhengjie.
modules.tools.
domain.Picture
;
import
me.zhengjie.
modules.tools.
service.dto.PictureQueryCriteria
;
import
me.zhengjie.domain.Picture
;
import
me.zhengjie.service.dto.PictureQueryCriteria
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.web.multipart.MultipartFile
;
...
...
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
service/QiNiuService.java
→
eladmin-tools/src/main/java/me/zhengjie/service/QiNiuService.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
service
;
package
me.zhengjie.service
;
import
me.zhengjie.
modules.tools.
domain.QiniuConfig
;
import
me.zhengjie.
modules.tools.
domain.QiniuContent
;
import
me.zhengjie.
modules.tools.
service.dto.QiniuQueryCriteria
;
import
me.zhengjie.domain.QiniuConfig
;
import
me.zhengjie.domain.QiniuContent
;
import
me.zhengjie.service.dto.QiniuQueryCriteria
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.web.multipart.MultipartFile
;
...
...
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
service/VerificationCodeService.java
→
eladmin-tools/src/main/java/me/zhengjie/service/VerificationCodeService.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
service
;
package
me.zhengjie.service
;
import
me.zhengjie.
modules.tools.
domain.VerificationCode
;
import
me.zhengjie.
modules.tools.
domain.vo.EmailVo
;
import
me.zhengjie.domain.VerificationCode
;
import
me.zhengjie.domain.vo.EmailVo
;
/**
* @author Zheng Jie
...
...
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
service/dto/LocalStorageDTO.java
→
eladmin-tools/src/main/java/me/zhengjie/service/dto/LocalStorageDTO.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
service.dto
;
package
me.zhengjie.service.dto
;
import
lombok.Getter
;
import
lombok.Setter
;
...
...
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
service/dto/LocalStorageQueryCriteria.java
→
eladmin-tools/src/main/java/me/zhengjie/service/dto/LocalStorageQueryCriteria.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
service.dto
;
package
me.zhengjie.service.dto
;
import
lombok.Data
;
import
java.sql.Timestamp
;
import
java.util.List
;
import
me.zhengjie.annotation.Query
;
/**
...
...
@@ -15,9 +17,6 @@ public class LocalStorageQueryCriteria{
@Query
(
blurry
=
"name,suffix,type,operate,size"
)
private
String
blurry
;
@Query
(
type
=
Query
.
Type
.
GREATER_THAN
,
propName
=
"createTime"
)
private
Timestamp
startTime
;
@Query
(
type
=
Query
.
Type
.
LESS_THAN
,
propName
=
"createTime"
)
private
Timestamp
endTime
;
@Query
(
type
=
Query
.
Type
.
BETWEEN
)
private
List
<
Timestamp
>
createTime
;
}
\ No newline at end of file
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
service/dto/PictureQueryCriteria.java
→
eladmin-tools/src/main/java/me/zhengjie/service/dto/PictureQueryCriteria.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
service.dto
;
package
me.zhengjie.service.dto
;
import
lombok.Data
;
import
me.zhengjie.annotation.Query
;
import
java.sql.Timestamp
;
import
java.util.List
;
/**
* sm.ms图床
...
...
@@ -20,9 +21,6 @@ public class PictureQueryCriteria{
@Query
(
type
=
Query
.
Type
.
INNER_LIKE
)
private
String
username
;
@Query
(
type
=
Query
.
Type
.
GREATER_THAN
,
propName
=
"createTime"
)
private
Timestamp
startTime
;
@Query
(
type
=
Query
.
Type
.
LESS_THAN
,
propName
=
"createTime"
)
private
Timestamp
endTime
;
@Query
(
type
=
Query
.
Type
.
BETWEEN
)
private
List
<
Timestamp
>
createTime
;
}
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
service/dto/QiniuQueryCriteria.java
→
eladmin-tools/src/main/java/me/zhengjie/service/dto/QiniuQueryCriteria.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
service.dto
;
package
me.zhengjie.service.dto
;
import
lombok.Data
;
import
me.zhengjie.annotation.Query
;
import
java.sql.Timestamp
;
import
java.util.List
;
/**
* @author Zheng Jie
...
...
@@ -15,9 +16,6 @@ public class QiniuQueryCriteria{
@Query
(
type
=
Query
.
Type
.
INNER_LIKE
)
private
String
key
;
@Query
(
type
=
Query
.
Type
.
GREATER_THAN
,
propName
=
"updateTime"
)
private
Timestamp
startTime
;
@Query
(
type
=
Query
.
Type
.
LESS_THAN
,
propName
=
"updateTime"
)
private
Timestamp
endTime
;
@Query
(
type
=
Query
.
Type
.
BETWEEN
)
private
List
<
Timestamp
>
createTime
;
}
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
service/impl/AlipayServiceImpl.java
→
eladmin-tools/src/main/java/me/zhengjie/service/impl/AlipayServiceImpl.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
service.impl
;
package
me.zhengjie.service.impl
;
import
com.alipay.api.AlipayClient
;
import
com.alipay.api.DefaultAlipayClient
;
import
com.alipay.api.request.AlipayTradePagePayRequest
;
import
com.alipay.api.request.AlipayTradeWapPayRequest
;
import
me.zhengjie.
modules.tools.domain.AlipayConfig
;
import
me.zhengjie.
modules.tools.domain.vo.TradeVo
;
import
me.zhengjie.
domain.vo.TradeVo
;
import
me.zhengjie.
domain.AlipayConfig
;
import
me.zhengjie.exception.BadRequestException
;
import
me.zhengjie.
modules.tools.
repository.AlipayRepository
;
import
me.zhengjie.
modules.tools.
service.AlipayService
;
import
me.zhengjie.repository.AlipayRepository
;
import
me.zhengjie.service.AlipayService
;
import
org.springframework.cache.annotation.CacheConfig
;
import
org.springframework.cache.annotation.CachePut
;
import
org.springframework.cache.annotation.Cacheable
;
...
...
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
service/impl/EmailServiceImpl.java
→
eladmin-tools/src/main/java/me/zhengjie/service/impl/EmailServiceImpl.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
service.impl
;
package
me.zhengjie.service.impl
;
import
cn.hutool.extra.mail.Mail
;
import
cn.hutool.extra.mail.MailAccount
;
import
me.zhengjie.
modules.tools.
domain.EmailConfig
;
import
me.zhengjie.
modules.tools.
domain.vo.EmailVo
;
import
me.zhengjie.domain.EmailConfig
;
import
me.zhengjie.domain.vo.EmailVo
;
import
me.zhengjie.exception.BadRequestException
;
import
me.zhengjie.
modules.tools.
repository.EmailRepository
;
import
me.zhengjie.
modules.tools.
service.EmailService
;
import
me.zhengjie.repository.EmailRepository
;
import
me.zhengjie.service.EmailService
;
import
me.zhengjie.utils.EncryptUtils
;
import
org.springframework.cache.annotation.CacheConfig
;
import
org.springframework.cache.annotation.CachePut
;
...
...
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
service/impl/LocalStorageServiceImpl.java
→
eladmin-tools/src/main/java/me/zhengjie/service/impl/LocalStorageServiceImpl.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
service.impl
;
package
me.zhengjie.service.impl
;
import
cn.hutool.core.util.ObjectUtil
;
import
me.zhengjie.
modules.tools.
domain.LocalStorage
;
import
me.zhengjie.
modules.tools.
service.dto.LocalStorageDTO
;
import
me.zhengjie.
modules.tools.
service.dto.LocalStorageQueryCriteria
;
import
me.zhengjie.
modules.tools.
service.mapper.LocalStorageMapper
;
import
me.zhengjie.domain.LocalStorage
;
import
me.zhengjie.service.dto.LocalStorageDTO
;
import
me.zhengjie.service.dto.LocalStorageQueryCriteria
;
import
me.zhengjie.service.mapper.LocalStorageMapper
;
import
me.zhengjie.exception.BadRequestException
;
import
me.zhengjie.utils.*
;
import
me.zhengjie.
modules.tools.
repository.LocalStorageRepository
;
import
me.zhengjie.
modules.tools.
service.LocalStorageService
;
import
me.zhengjie.repository.LocalStorageRepository
;
import
me.zhengjie.service.LocalStorageService
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.cache.annotation.CacheConfig
;
import
org.springframework.cache.annotation.CacheEvict
;
...
...
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
service/impl/PictureServiceImpl.java
→
eladmin-tools/src/main/java/me/zhengjie/service/impl/PictureServiceImpl.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
service.impl
;
package
me.zhengjie.service.impl
;
import
cn.hutool.http.HttpUtil
;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONUtil
;
import
com.alibaba.fastjson.JSON
;
import
lombok.extern.slf4j.Slf4j
;
import
me.zhengjie.
modules.tools.
domain.Picture
;
import
me.zhengjie.
modules.tools.
repository.PictureRepository
;
import
me.zhengjie.
modules.tools.
service.PictureService
;
import
me.zhengjie.
modules.tools.
service.dto.PictureQueryCriteria
;
import
me.zhengjie.domain.Picture
;
import
me.zhengjie.repository.PictureRepository
;
import
me.zhengjie.service.PictureService
;
import
me.zhengjie.service.dto.PictureQueryCriteria
;
import
me.zhengjie.exception.BadRequestException
;
import
me.zhengjie.utils.*
;
import
org.springframework.cache.annotation.CacheConfig
;
...
...
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
service/impl/QiNiuServiceImpl.java
→
eladmin-tools/src/main/java/me/zhengjie/service/impl/QiNiuServiceImpl.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
service.impl
;
package
me.zhengjie.service.impl
;
import
com.alibaba.fastjson.JSON
;
import
com.qiniu.common.QiniuException
;
...
...
@@ -9,14 +9,14 @@ import com.qiniu.storage.UploadManager;
import
com.qiniu.storage.model.DefaultPutRet
;
import
com.qiniu.storage.model.FileInfo
;
import
com.qiniu.util.Auth
;
import
me.zhengjie.
modules.tools.
domain.QiniuConfig
;
import
me.zhengjie.
modules.tools.
domain.QiniuContent
;
import
me.zhengjie.
modules.tools.
repository.QiniuContentRepository
;
import
me.zhengjie.
modules.tools.
service.dto.QiniuQueryCriteria
;
import
me.zhengjie.
modules.tools.
utils.QiNiuUtil
;
import
me.zhengjie.domain.QiniuConfig
;
import
me.zhengjie.domain.QiniuContent
;
import
me.zhengjie.repository.QiniuContentRepository
;
import
me.zhengjie.service.dto.QiniuQueryCriteria
;
import
me.zhengjie.utils.QiNiuUtil
;
import
me.zhengjie.exception.BadRequestException
;
import
me.zhengjie.
modules.tools.
repository.QiNiuConfigRepository
;
import
me.zhengjie.
modules.tools.
service.QiNiuService
;
import
me.zhengjie.repository.QiNiuConfigRepository
;
import
me.zhengjie.service.QiNiuService
;
import
me.zhengjie.utils.FileUtil
;
import
me.zhengjie.utils.PageUtil
;
import
me.zhengjie.utils.QueryHelp
;
...
...
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
service/impl/VerificationCodeServiceImpl.java
→
eladmin-tools/src/main/java/me/zhengjie/service/impl/VerificationCodeServiceImpl.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
service.impl
;
package
me.zhengjie.service.impl
;
import
cn.hutool.core.lang.Dict
;
import
cn.hutool.core.util.RandomUtil
;
...
...
@@ -6,11 +6,11 @@ import cn.hutool.extra.template.Template;
import
cn.hutool.extra.template.TemplateConfig
;
import
cn.hutool.extra.template.TemplateEngine
;
import
cn.hutool.extra.template.TemplateUtil
;
import
me.zhengjie.
modules.tools.domain.VerificationCode
;
import
me.zhengjie.
modules.tools.domain.vo.EmailVo
;
import
me.zhengjie.
domain.vo.EmailVo
;
import
me.zhengjie.
domain.VerificationCode
;
import
me.zhengjie.exception.BadRequestException
;
import
me.zhengjie.
modules.tools.
repository.VerificationCodeRepository
;
import
me.zhengjie.
modules.tools.
service.VerificationCodeService
;
import
me.zhengjie.repository.VerificationCodeRepository
;
import
me.zhengjie.service.VerificationCodeService
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
...
...
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
service/mapper/LocalStorageMapper.java
→
eladmin-tools/src/main/java/me/zhengjie/service/mapper/LocalStorageMapper.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
service.mapper
;
package
me.zhengjie.service.mapper
;
import
me.zhengjie.base.BaseMapper
;
import
me.zhengjie.
modules.tools.
service.dto.LocalStorageDTO
;
import
me.zhengjie.
modules.tools.
domain.LocalStorage
;
import
me.zhengjie.service.dto.LocalStorageDTO
;
import
me.zhengjie.domain.LocalStorage
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.ReportingPolicy
;
...
...
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
utils/AliPayStatusEnum.java
→
eladmin-tools/src/main/java/me/zhengjie/utils/AliPayStatusEnum.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
utils
;
package
me.zhengjie.utils
;
/**
* 支付状态
...
...
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
utils/AlipayUtils.java
→
eladmin-tools/src/main/java/me/zhengjie/utils/AlipayUtils.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
utils
;
package
me.zhengjie.utils
;
import
com.alipay.api.AlipayApiException
;
import
com.alipay.api.internal.util.AlipaySignature
;
import
me.zhengjie.
modules.tools.
domain.AlipayConfig
;
import
me.zhengjie.domain.AlipayConfig
;
import
org.springframework.stereotype.Component
;
import
javax.servlet.http.HttpServletRequest
;
import
java.text.SimpleDateFormat
;
...
...
eladmin-tools/src/main/java/me/zhengjie/
modules/tools/
utils/QiNiuUtil.java
→
eladmin-tools/src/main/java/me/zhengjie/utils/QiNiuUtil.java
浏览文件 @
40852235
package
me.zhengjie.
modules.tools.
utils
;
package
me.zhengjie.utils
;
import
com.qiniu.storage.Region
;
import
me.zhengjie.utils.FileUtil
;
...
...
pom.xml
浏览文件 @
40852235
...
...
@@ -15,7 +15,8 @@
<module>
eladmin-system
</module>
<module>
eladmin-tools
</module>
<module>
eladmin-monitor
</module>
</modules>
<module>
eladmin-generator
</module>
</modules>
<name>
EL-ADMIN后台管理系统
</name>
<url>
http://auauz.net
</url>
...
...
sql/eladmin.sql
浏览文件 @
40852235
...
...
@@ -11,7 +11,7 @@
Target Server Version : 50562
File Encoding : 65001
Date:
31/10/2019 12:24:38
Date:
08/11/2019 21:19:49
*/
SET
NAMES
utf8mb4
;
...
...
@@ -52,7 +52,7 @@ CREATE TABLE `dept` (
`enabled`
bit
(
1
)
NOT
NULL
,
`create_time`
datetime
NULL
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
USING
BTREE
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
4
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
ROW_FORMAT
=
Compact
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
2
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
ROW_FORMAT
=
Compact
;
-- ----------------------------
-- Records of dept
...
...
@@ -75,7 +75,7 @@ CREATE TABLE `dict` (
`remark`
varchar
(
255
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NULL
DEFAULT
NULL
COMMENT
'描述'
,
`create_time`
datetime
NULL
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
USING
BTREE
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
8
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
ROW_FORMAT
=
Compact
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
6
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
ROW_FORMAT
=
Compact
;
-- ----------------------------
-- Records of dict
...
...
@@ -98,7 +98,7 @@ CREATE TABLE `dict_detail` (
PRIMARY
KEY
(
`id`
)
USING
BTREE
,
INDEX
`FK5tpkputc6d9nboxojdbgnpmyb`
(
`dict_id`
)
USING
BTREE
,
CONSTRAINT
`FK5tpkputc6d9nboxojdbgnpmyb`
FOREIGN
KEY
(
`dict_id`
)
REFERENCES
`dict`
(
`id`
)
ON
DELETE
RESTRICT
ON
UPDATE
RESTRICT
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
7
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
ROW_FORMAT
=
Compact
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
5
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
ROW_FORMAT
=
Compact
;
-- ----------------------------
-- Records of dict_detail
...
...
@@ -124,6 +124,11 @@ CREATE TABLE `email_config` (
PRIMARY
KEY
(
`id`
)
USING
BTREE
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
2
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
ROW_FORMAT
=
Compact
;
-- ----------------------------
-- Records of email_config
-- ----------------------------
INSERT
INTO
`email_config`
VALUES
(
1
,
'**'
,
'**'
,
'**'
,
'465'
,
'eladmin'
);
-- ----------------------------
-- Table structure for gen_config
-- ----------------------------
...
...
@@ -143,7 +148,7 @@ CREATE TABLE `gen_config` (
-- ----------------------------
-- Records of gen_config
-- ----------------------------
INSERT
INTO
`gen_config`
VALUES
(
1
,
'Zheng Jie'
,
b
'0'
,
'eladmin-system'
,
'me.zhengjie.test'
,
'E:
\\
workspace
\\
me
\\
front
\\
eladmin-
qt
\\
src
\\
views
\\
test1111'
,
'E:
\\
workspace
\\
me
\\
front
\\
eladmin-qt
\\
src
\\
api'
,
NULL
);
INSERT
INTO
`gen_config`
VALUES
(
1
,
'Zheng Jie'
,
b
'0'
,
'eladmin-system'
,
'me.zhengjie.test'
,
'E:
\\
workspace
\\
me
\\
front
\\
eladmin-
web
\\
src
\\
views
\\
test'
,
'E:
\\
workspace
\\
me
\\
front
\\
eladmin-web
\\
src
\\
api'
,
NULL
);
-- ----------------------------
-- Table structure for job
...
...
@@ -159,7 +164,7 @@ CREATE TABLE `job` (
PRIMARY
KEY
(
`id`
)
USING
BTREE
,
INDEX
`FKmvhj0rogastlctflsxf1d6k3i`
(
`dept_id`
)
USING
BTREE
,
CONSTRAINT
`FKmvhj0rogastlctflsxf1d6k3i`
FOREIGN
KEY
(
`dept_id`
)
REFERENCES
`dept`
(
`id`
)
ON
DELETE
RESTRICT
ON
UPDATE
RESTRICT
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
4
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
ROW_FORMAT
=
Compact
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
3
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
ROW_FORMAT
=
Compact
;
-- ----------------------------
-- Records of job
...
...
@@ -185,7 +190,7 @@ CREATE TABLE `local_storage` (
`operate`
varchar
(
255
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NULL
DEFAULT
NULL
COMMENT
'操作人'
,
`create_time`
datetime
NULL
DEFAULT
NULL
COMMENT
'创建日期'
,
PRIMARY
KEY
(
`id`
)
USING
BTREE
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
3
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
ROW_FORMAT
=
Compact
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
2
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
ROW_FORMAT
=
Compact
;
-- ----------------------------
-- Table structure for log
...
...
@@ -205,7 +210,7 @@ CREATE TABLE `log` (
`address`
varchar
(
255
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NULL
DEFAULT
NULL
,
`browser`
varchar
(
255
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NULL
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
USING
BTREE
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
17
040
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
ROW_FORMAT
=
Compact
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
17
373
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
ROW_FORMAT
=
Compact
;
-- ----------------------------
-- Table structure for menu
...
...
@@ -239,8 +244,8 @@ INSERT INTO `menu` VALUES (3, b'0', '角色管理', 'system/role/index', 1, 3, '
INSERT
INTO
`menu`
VALUES
(
5
,
b
'0'
,
'菜单管理'
,
'system/menu/index'
,
1
,
5
,
'menu'
,
'menu'
,
b
'0'
,
b
'0'
,
'Menu'
,
'2018-12-18 15:17:28'
,
'menu:list'
,
1
);
INSERT
INTO
`menu`
VALUES
(
6
,
b
'0'
,
'系统监控'
,
NULL
,
0
,
10
,
'monitor'
,
'monitor'
,
b
'0'
,
b
'0'
,
NULL
,
'2018-12-18 15:17:48'
,
NULL
,
0
);
INSERT
INTO
`menu`
VALUES
(
7
,
b
'0'
,
'操作日志'
,
'monitor/log/index'
,
6
,
11
,
'log'
,
'logs'
,
b
'0'
,
b
'0'
,
'Log'
,
'2018-12-18 15:18:26'
,
NULL
,
1
);
INSERT
INTO
`menu`
VALUES
(
8
,
b
'0'
,
'系统缓存'
,
'monitor/redis/index'
,
6
,
1
3
,
'redis'
,
'redis'
,
b
'0'
,
b
'0'
,
'Redis'
,
'2018-12-18 15:19:01'
,
'redis:list'
,
1
);
INSERT
INTO
`menu`
VALUES
(
9
,
b
'0'
,
'SQL监控'
,
'monitor/sql/index'
,
6
,
1
4
,
'sqlMonitor'
,
'druid'
,
b
'0'
,
b
'0'
,
'Sql'
,
'2018-12-18 15:19:34'
,
NULL
,
1
);
INSERT
INTO
`menu`
VALUES
(
8
,
b
'0'
,
'系统缓存'
,
'monitor/redis/index'
,
6
,
1
5
,
'redis'
,
'redis'
,
b
'0'
,
b
'0'
,
'Redis'
,
'2018-12-18 15:19:01'
,
'redis:list'
,
1
);
INSERT
INTO
`menu`
VALUES
(
9
,
b
'0'
,
'SQL监控'
,
'monitor/sql/index'
,
6
,
1
8
,
'sqlMonitor'
,
'druid'
,
b
'0'
,
b
'0'
,
'Sql'
,
'2018-12-18 15:19:34'
,
NULL
,
1
);
INSERT
INTO
`menu`
VALUES
(
10
,
b
'0'
,
'组件管理'
,
NULL
,
0
,
50
,
'zujian'
,
'components'
,
b
'0'
,
b
'0'
,
NULL
,
'2018-12-19 13:38:16'
,
NULL
,
0
);
INSERT
INTO
`menu`
VALUES
(
11
,
b
'0'
,
'图标库'
,
'components/IconSelect'
,
10
,
51
,
'icon'
,
'icon'
,
b
'0'
,
b
'0'
,
'Icons'
,
'2018-12-19 13:38:49'
,
NULL
,
1
);
INSERT
INTO
`menu`
VALUES
(
14
,
b
'0'
,
'邮件工具'
,
'tools/email/index'
,
36
,
24
,
'email'
,
'email'
,
b
'0'
,
b
'0'
,
'Email'
,
'2018-12-27 10:13:09'
,
NULL
,
1
);
...
...
@@ -291,7 +296,35 @@ INSERT INTO `menu` VALUES (75, b'0', '任务删除', '', 28, 4, '', '', b'0', b'
INSERT
INTO
`menu`
VALUES
(
77
,
b
'0'
,
'上传文件'
,
''
,
18
,
2
,
''
,
''
,
b
'0'
,
b
'0'
,
''
,
'2019-10-29 13:09:09'
,
'storage:add'
,
2
);
INSERT
INTO
`menu`
VALUES
(
78
,
b
'0'
,
'文件编辑'
,
''
,
18
,
3
,
''
,
''
,
b
'0'
,
b
'0'
,
''
,
'2019-10-29 13:09:22'
,
'storage:edit'
,
2
);
INSERT
INTO
`menu`
VALUES
(
79
,
b
'0'
,
'文件删除'
,
''
,
18
,
4
,
''
,
''
,
b
'0'
,
b
'0'
,
''
,
'2019-10-29 13:09:34'
,
'storage:del'
,
2
);
INSERT
INTO
`menu`
VALUES
(
81
,
b
'0'
,
'服务器监控'
,
'monitor/server/index'
,
6
,
15
,
'system'
,
'server'
,
b
'0'
,
b
'0'
,
'Server'
,
'2019-11-01 16:37:41'
,
'server:list'
,
1
);
INSERT
INTO
`menu`
VALUES
(
80
,
b
'0'
,
'服务监控'
,
'monitor/server/index'
,
6
,
14
,
'codeConsole'
,
'server'
,
b
'0'
,
b
'0'
,
'ServerMonitor'
,
'2019-11-07 13:06:39'
,
'server:list'
,
1
);
-- ----------------------------
-- Table structure for monitor_server
-- ----------------------------
DROP
TABLE
IF
EXISTS
`monitor_server`
;
CREATE
TABLE
`monitor_server`
(
`id`
int
(
11
)
NOT
NULL
AUTO_INCREMENT
,
`cpu_core`
int
(
11
)
NULL
DEFAULT
NULL
,
`cpu_rate`
double
NULL
DEFAULT
NULL
,
`disk_total`
double
NULL
DEFAULT
NULL
,
`disk_used`
double
NULL
DEFAULT
NULL
,
`ip`
varchar
(
255
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NOT
NULL
,
`mem_total`
double
NULL
DEFAULT
NULL
,
`mem_used`
double
NULL
DEFAULT
NULL
,
`name`
varchar
(
255
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NULL
DEFAULT
NULL
,
`port`
int
(
11
)
NULL
DEFAULT
NULL
,
`sort`
int
(
11
)
NULL
DEFAULT
NULL
,
`state`
varchar
(
255
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NULL
DEFAULT
NULL
,
`swap_total`
double
NULL
DEFAULT
NULL
,
`swap_used`
double
NULL
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
USING
BTREE
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
2
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
ROW_FORMAT
=
Compact
;
-- ----------------------------
-- Records of monitor_server
-- ----------------------------
INSERT
INTO
`monitor_server`
VALUES
(
1
,
NULL
,
NULL
,
NULL
,
NULL
,
'localhost'
,
NULL
,
NULL
,
'本地'
,
8777
,
1
,
'0'
,
NULL
,
NULL
);
-- ----------------------------
-- Table structure for picture
-- ----------------------------
...
...
@@ -308,7 +341,7 @@ CREATE TABLE `picture` (
`width`
varchar
(
255
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NULL
DEFAULT
NULL
COMMENT
'图片宽度'
,
`md5code`
varchar
(
255
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NULL
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
USING
BTREE
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
4
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
ROW_FORMAT
=
Compact
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
ROW_FORMAT
=
Compact
;
-- ----------------------------
-- Table structure for qiniu_config
...
...
@@ -339,7 +372,7 @@ CREATE TABLE `qiniu_content` (
`url`
varchar
(
255
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NULL
DEFAULT
NULL
COMMENT
'文件url'
,
`suffix`
varchar
(
255
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NULL
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
USING
BTREE
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
5
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
ROW_FORMAT
=
Compact
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
ROW_FORMAT
=
Compact
;
-- ----------------------------
-- Table structure for quartz_job
...
...
@@ -381,7 +414,7 @@ CREATE TABLE `quartz_log` (
`params`
varchar
(
255
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NULL
DEFAULT
NULL
,
`time`
bigint
(
20
)
NULL
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
USING
BTREE
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
7
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
ROW_FORMAT
=
Compact
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
269
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
ROW_FORMAT
=
Compact
;
-- ----------------------------
-- Table structure for role
...
...
@@ -396,7 +429,7 @@ CREATE TABLE `role` (
`create_time`
datetime
NULL
DEFAULT
NULL
COMMENT
'创建日期'
,
`permission`
varchar
(
255
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NULL
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
USING
BTREE
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
6
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
ROW_FORMAT
=
Compact
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
3
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
ROW_FORMAT
=
Compact
;
-- ----------------------------
-- Records of role
...
...
@@ -497,7 +530,7 @@ INSERT INTO `roles_menus` VALUES (75, 1);
INSERT
INTO
`roles_menus`
VALUES
(
77
,
1
);
INSERT
INTO
`roles_menus`
VALUES
(
78
,
1
);
INSERT
INTO
`roles_menus`
VALUES
(
79
,
1
);
INSERT
INTO
`roles_menus`
VALUES
(
8
1
,
1
);
INSERT
INTO
`roles_menus`
VALUES
(
8
0
,
1
);
INSERT
INTO
`roles_menus`
VALUES
(
1
,
2
);
INSERT
INTO
`roles_menus`
VALUES
(
2
,
2
);
INSERT
INTO
`roles_menus`
VALUES
(
3
,
2
);
...
...
@@ -556,7 +589,7 @@ CREATE TABLE `user` (
CONSTRAINT
`FK5rwmryny6jthaaxkogownknqp`
FOREIGN
KEY
(
`dept_id`
)
REFERENCES
`dept`
(
`id`
)
ON
DELETE
RESTRICT
ON
UPDATE
RESTRICT
,
CONSTRAINT
`FKfftoc2abhot8f2wu6cl9a5iky`
FOREIGN
KEY
(
`job_id`
)
REFERENCES
`job`
(
`id`
)
ON
DELETE
RESTRICT
ON
UPDATE
RESTRICT
,
CONSTRAINT
`FKpq2dhypk2qgt68nauh2by22jb`
FOREIGN
KEY
(
`avatar_id`
)
REFERENCES
`user_avatar`
(
`id`
)
ON
DELETE
RESTRICT
ON
UPDATE
RESTRICT
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
6
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
ROW_FORMAT
=
Compact
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
4
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
ROW_FORMAT
=
Compact
;
-- ----------------------------
-- Records of user
...
...
@@ -624,33 +657,6 @@ CREATE TABLE `visits` (
`week_day`
varchar
(
255
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NULL
DEFAULT
NULL
,
PRIMARY
KEY
(
`id`
)
USING
BTREE
,
UNIQUE
INDEX
`UK_11aksgq87euk9bcyeesfs4vtp`
(
`date`
)
USING
BTREE
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
111
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
ROW_FORMAT
=
Compact
;
-- ----------------------------
-- Records of visits
-- ----------------------------
INSERT
INTO
`visits`
VALUES
(
108
,
'2019-10-29 21:45:49'
,
'2019-10-29'
,
1
,
1
,
'Tue'
);
INSERT
INTO
`visits`
VALUES
(
109
,
'2019-10-30 08:58:54'
,
'2019-10-30'
,
2
,
11
,
'Wed'
);
INSERT
INTO
`visits`
VALUES
(
110
,
'2019-10-31 09:04:18'
,
'2019-10-31'
,
2
,
8
,
'Thu'
);
DROP
TABLE
IF
EXISTS
`monitor_server`
;
CREATE
TABLE
`monitor_server`
(
`id`
int
(
11
)
NOT
NULL
AUTO_INCREMENT
COMMENT
'编号'
,
`name`
varchar
(
255
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NULL
DEFAULT
NULL
COMMENT
'名称'
,
`ip`
varchar
(
255
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NOT
NULL
COMMENT
'IP地址'
,
`port`
int
(
11
)
NULL
DEFAULT
NULL
COMMENT
'访问端口'
,
`state`
varchar
(
255
)
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NULL
DEFAULT
NULL
COMMENT
'状态'
,
`cpu_rate`
float
NULL
DEFAULT
NULL
COMMENT
'CPU使用率'
,
`cpu_core`
int
(
11
)
NULL
DEFAULT
NULL
COMMENT
'CPU内核数'
,
`mem_total`
float
NULL
DEFAULT
NULL
COMMENT
'内存总数'
,
`mem_used`
float
NULL
DEFAULT
NULL
COMMENT
'内存使用量'
,
`disk_total`
float
NULL
DEFAULT
NULL
COMMENT
'磁盘总量'
,
`disk_used`
float
NULL
DEFAULT
NULL
COMMENT
'磁盘使用量'
,
`swap_total`
float
NULL
DEFAULT
NULL
COMMENT
'交换区总量'
,
`swap_used`
float
NULL
DEFAULT
NULL
COMMENT
'交换区使用量'
,
`sort`
int
(
11
)
NULL
DEFAULT
NULL
COMMENT
'排序'
,
PRIMARY
KEY
(
`id`
)
USING
BTREE
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
5
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
COMMENT
=
'服务器监控'
ROW_FORMAT
=
Dynamic
;
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
118
CHARACTER
SET
=
utf8
COLLATE
=
utf8_general_ci
ROW_FORMAT
=
Compact
;
SET
FOREIGN_KEY_CHECKS
=
1
;
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录