Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
查尔斯-BUG万象集
Continew Admin
提交
9def265a
Continew Admin
项目概览
查尔斯-BUG万象集
/
Continew Admin
10 个月 前同步成功
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
分析
仓库
DevOps
项目成员
Pages
Continew Admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9def265a
编写于
8月 12, 2023
作者:
查尔斯-BUG万象集
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
docs: 完善代码生成相关接口文档信息
上级
72399d92
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
48 addition
and
37 deletion
+48
-37
continew-admin-common/src/main/java/top/charles7c/cnadmin/common/model/query/PageQuery.java
...a/top/charles7c/cnadmin/common/model/query/PageQuery.java
+2
-2
continew-admin-common/src/main/java/top/charles7c/cnadmin/common/model/vo/PageDataVO.java
...ava/top/charles7c/cnadmin/common/model/vo/PageDataVO.java
+1
-1
continew-admin-common/src/main/java/top/charles7c/cnadmin/common/model/vo/R.java
...rc/main/java/top/charles7c/cnadmin/common/model/vo/R.java
+4
-4
continew-admin-tool/src/main/java/top/charles7c/cnadmin/tool/model/entity/FieldConfigDO.java
...op/charles7c/cnadmin/tool/model/entity/FieldConfigDO.java
+13
-13
continew-admin-tool/src/main/java/top/charles7c/cnadmin/tool/model/entity/GenConfigDO.java
.../top/charles7c/cnadmin/tool/model/entity/GenConfigDO.java
+10
-10
continew-admin-tool/src/main/java/top/charles7c/cnadmin/tool/model/query/TableQuery.java
...va/top/charles7c/cnadmin/tool/model/query/TableQuery.java
+1
-1
continew-admin-tool/src/main/java/top/charles7c/cnadmin/tool/model/vo/TableVO.java
...ain/java/top/charles7c/cnadmin/tool/model/vo/TableVO.java
+6
-6
continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/tool/GeneratorController.java
...c/cnadmin/webapi/controller/tool/GeneratorController.java
+11
-0
未找到文件。
continew-admin-common/src/main/java/top/charles7c/cnadmin/common/model/query/PageQuery.java
浏览文件 @
9def265a
...
...
@@ -55,14 +55,14 @@ public class PageQuery extends SortQuery {
/**
* 页码
*/
@Schema
(
description
=
"页码"
)
@Schema
(
description
=
"页码"
,
example
=
"1"
)
@Min
(
value
=
1
,
message
=
"页码最小值为 {value}"
)
private
Integer
page
=
DEFAULT_PAGE
;
/**
* 每页条数
*/
@Schema
(
description
=
"每页条数"
)
@Schema
(
description
=
"每页条数"
,
example
=
"10"
)
@Range
(
min
=
1
,
max
=
1000
,
message
=
"每页条数(取值范围 {min}-{max})"
)
private
Integer
size
=
DEFAULT_SIZE
;
...
...
continew-admin-common/src/main/java/top/charles7c/cnadmin/common/model/vo/PageDataVO.java
浏览文件 @
9def265a
...
...
@@ -52,7 +52,7 @@ public class PageDataVO<V> implements Serializable {
/**
* 总记录数
*/
@Schema
(
description
=
"总记录数"
)
@Schema
(
description
=
"总记录数"
,
example
=
"10"
)
private
int
total
;
/**
...
...
continew-admin-common/src/main/java/top/charles7c/cnadmin/common/model/vo/R.java
浏览文件 @
9def265a
...
...
@@ -40,15 +40,15 @@ public class R<V> implements Serializable {
private
static
final
long
serialVersionUID
=
1L
;
/** 是否成功 */
@Schema
(
description
=
"是否成功"
)
@Schema
(
description
=
"是否成功"
,
example
=
"true"
)
private
boolean
success
;
/** 状态码 */
@Schema
(
description
=
"状态码"
)
@Schema
(
description
=
"状态码"
,
example
=
"200"
)
private
int
code
;
/** 状态信息 */
@Schema
(
description
=
"状态信息"
)
@Schema
(
description
=
"状态信息"
,
example
=
"操作成功"
)
private
String
msg
;
/** 返回数据 */
...
...
@@ -56,7 +56,7 @@ public class R<V> implements Serializable {
private
V
data
;
/** 时间戳 */
@Schema
(
description
=
"时间戳"
)
@Schema
(
description
=
"时间戳"
,
example
=
"1691453288000"
)
private
long
timestamp
=
System
.
currentTimeMillis
();
/** 成功状态码 */
...
...
continew-admin-tool/src/main/java/top/charles7c/cnadmin/tool/model/entity/FieldConfigDO.java
浏览文件 @
9def265a
...
...
@@ -57,84 +57,84 @@ public class FieldConfigDO implements Serializable {
/**
* 表名称
*/
@Schema
(
description
=
"表名称"
)
@Schema
(
description
=
"表名称"
,
example
=
"sys_user"
)
@NotBlank
(
message
=
"表名称不能为空"
)
private
String
tableName
;
/**
* 列名称
*/
@Schema
(
description
=
"列名称"
)
@Schema
(
description
=
"列名称"
,
example
=
"nickname"
)
@NotBlank
(
message
=
"列名称不能为空"
)
private
String
columnName
;
/**
* 列类型
*/
@Schema
(
description
=
"列类型"
)
@Schema
(
description
=
"列类型"
,
example
=
"varchar"
)
@NotBlank
(
message
=
"列类型不能为空"
)
private
String
columnType
;
/**
* 字段名称
*/
@Schema
(
description
=
"字段名称"
)
@Schema
(
description
=
"字段名称"
,
example
=
"nickname"
)
@NotBlank
(
message
=
"字段名称不能为空"
)
private
String
fieldName
;
/**
* 字段类型
*/
@Schema
(
description
=
"字段类型"
)
@Schema
(
description
=
"字段类型"
,
example
=
"String"
)
@NotBlank
(
message
=
"字段类型不能为空"
)
private
String
fieldType
;
/**
* 注释
*/
@Schema
(
description
=
"注释"
)
@Schema
(
description
=
"注释"
,
example
=
"昵称"
)
private
String
comment
;
/**
* 是否必填
*/
@Schema
(
description
=
"是否必填"
)
@Schema
(
description
=
"是否必填"
,
example
=
"true"
)
private
Boolean
isRequired
;
/**
* 是否在列表中显示
*/
@Schema
(
description
=
"是否在列表中显示"
)
@Schema
(
description
=
"是否在列表中显示"
,
example
=
"true"
)
private
Boolean
showInList
;
/**
* 是否在表单中显示
*/
@Schema
(
description
=
"是否在表单中显示"
)
@Schema
(
description
=
"是否在表单中显示"
,
example
=
"true"
)
private
Boolean
showInForm
;
/**
* 是否在查询中显示
*/
@Schema
(
description
=
"是否在查询中显示"
)
@Schema
(
description
=
"是否在查询中显示"
,
example
=
"true"
)
private
Boolean
showInQuery
;
/**
* 表单类型
*/
@Schema
(
description
=
"表单类型"
)
@Schema
(
description
=
"表单类型"
,
example
=
"1"
)
private
FormTypeEnum
formType
;
/**
* 查询方式
*/
@Schema
(
description
=
"查询方式"
)
@Schema
(
description
=
"查询方式"
,
example
=
"1"
)
private
QueryTypeEnum
queryType
;
/**
* 创建时间
*/
@Schema
(
description
=
"创建时间"
)
@Schema
(
description
=
"创建时间"
,
example
=
"2023-08-08 08:08:08"
)
@TableField
(
fill
=
FieldFill
.
INSERT
)
private
LocalDateTime
createTime
;
...
...
continew-admin-tool/src/main/java/top/charles7c/cnadmin/tool/model/entity/GenConfigDO.java
浏览文件 @
9def265a
...
...
@@ -57,15 +57,15 @@ public class GenConfigDO implements Serializable {
/**
* 表名称
*/
@Schema
(
description
=
"表名称"
,
example
=
"sys_user"
)
@TableId
(
type
=
IdType
.
INPUT
)
@Schema
(
description
=
"表名称"
)
@NotBlank
(
message
=
"表名称不能为空"
)
private
String
tableName
;
/**
* 模块名称
*/
@Schema
(
description
=
"模块名称"
)
@Schema
(
description
=
"模块名称"
,
example
=
"continew-admin-system"
)
@NotBlank
(
message
=
"模块名称不能为空"
)
@Length
(
max
=
60
,
message
=
"模块名称不能超过 {max} 个字符"
)
private
String
moduleName
;
...
...
@@ -73,7 +73,7 @@ public class GenConfigDO implements Serializable {
/**
* 包名称
*/
@Schema
(
description
=
"包名称"
)
@Schema
(
description
=
"包名称"
,
example
=
"top.charles7c.cnadmin.system"
)
@NotBlank
(
message
=
"包名称不能为空"
)
@Pattern
(
regexp
=
RegexConsts
.
PACKAGE_NAME
,
message
=
"包名称格式错误"
)
@Length
(
max
=
60
,
message
=
"包名称不能超过 {max} 个字符"
)
...
...
@@ -82,7 +82,7 @@ public class GenConfigDO implements Serializable {
/**
* 前端路径
*/
@Schema
(
description
=
"前端路径"
)
@Schema
(
description
=
"前端路径"
,
example
=
"D:/continew-admin/continew-admin-ui/src/views/system/user"
)
@Length
(
max
=
255
,
message
=
"前端路径不能超过 {max} 个字符"
)
@Pattern
(
regexp
=
"^(?=.*src\\/views)(?!.*\\/views\\/?$).*"
,
message
=
"前端路径配置错误"
)
private
String
frontendPath
;
...
...
@@ -90,7 +90,7 @@ public class GenConfigDO implements Serializable {
/**
* 业务名称
*/
@Schema
(
description
=
"业务名称"
)
@Schema
(
description
=
"业务名称"
,
example
=
"用户"
)
@NotBlank
(
message
=
"业务名称不能为空"
)
@Length
(
max
=
50
,
message
=
"业务名称不能超过 {max} 个字符"
)
private
String
businessName
;
...
...
@@ -98,7 +98,7 @@ public class GenConfigDO implements Serializable {
/**
* 作者
*/
@Schema
(
description
=
"作者"
)
@Schema
(
description
=
"作者"
,
example
=
"Charles7c"
)
@NotBlank
(
message
=
"作者名称不能为空"
)
@Length
(
max
=
100
,
message
=
"作者名称不能超过 {max} 个字符"
)
private
String
author
;
...
...
@@ -106,27 +106,27 @@ public class GenConfigDO implements Serializable {
/**
* 表前缀
*/
@Schema
(
description
=
"表前缀"
)
@Schema
(
description
=
"表前缀"
,
example
=
"sys_"
)
private
String
tablePrefix
;
/**
* 是否覆盖
*/
@Schema
(
description
=
"是否覆盖"
)
@Schema
(
description
=
"是否覆盖"
,
example
=
"false"
)
@NotNull
(
message
=
"是否覆盖不能为空"
)
private
Boolean
isOverride
;
/**
* 创建时间
*/
@Schema
(
description
=
"创建时间"
)
@Schema
(
description
=
"创建时间"
,
example
=
"2023-08-08 08:08:08"
)
@TableField
(
fill
=
FieldFill
.
INSERT
)
private
LocalDateTime
createTime
;
/**
* 修改时间
*/
@Schema
(
description
=
"修改时间"
)
@Schema
(
description
=
"修改时间"
,
example
=
"2023-08-08 08:08:08"
)
@TableField
(
fill
=
FieldFill
.
INSERT_UPDATE
)
private
LocalDateTime
updateTime
;
...
...
continew-admin-tool/src/main/java/top/charles7c/cnadmin/tool/model/query/TableQuery.java
浏览文件 @
9def265a
...
...
@@ -37,6 +37,6 @@ public class TableQuery implements Serializable {
/**
* 表名称
*/
@Schema
(
description
=
"表名称"
)
@Schema
(
description
=
"表名称"
,
example
=
"sys_user"
)
private
String
tableName
;
}
continew-admin-tool/src/main/java/top/charles7c/cnadmin/tool/model/vo/TableVO.java
浏览文件 @
9def265a
...
...
@@ -38,36 +38,36 @@ public class TableVO implements Serializable {
/**
* 表名称
*/
@Schema
(
description
=
"表名称"
)
@Schema
(
description
=
"表名称"
,
example
=
"sys_user"
)
private
String
tableName
;
/**
* 描述
*/
@Schema
(
description
=
"描述"
)
@Schema
(
description
=
"描述"
,
example
=
"用户表"
)
private
String
comment
;
/**
* 存储引擎
*/
@Schema
(
description
=
"存储引擎"
)
@Schema
(
description
=
"存储引擎"
,
example
=
"InnoDB"
)
private
String
engine
;
/**
* 字符集
*/
@Schema
(
description
=
"字符集"
)
@Schema
(
description
=
"字符集"
,
example
=
"utf8mb4_general_ci"
)
private
String
charset
;
/**
* 创建时间
*/
@Schema
(
description
=
"创建时间"
)
@Schema
(
description
=
"创建时间"
,
example
=
"2023-08-08 08:08:08"
)
private
LocalDateTime
createTime
;
/**
* 是否已配置
*/
@Schema
(
description
=
"是否已配置"
)
@Schema
(
description
=
"是否已配置"
,
example
=
"true"
)
private
Boolean
isConfiged
;
}
continew-admin-webapi/src/main/java/top/charles7c/cnadmin/webapi/controller/tool/GeneratorController.java
浏览文件 @
9def265a
...
...
@@ -22,6 +22,9 @@ import java.util.List;
import
lombok.RequiredArgsConstructor
;
import
io.swagger.v3.oas.annotations.Operation
;
import
io.swagger.v3.oas.annotations.Parameter
;
import
io.swagger.v3.oas.annotations.Parameters
;
import
io.swagger.v3.oas.annotations.enums.ParameterIn
;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
org.springframework.validation.annotation.Validated
;
...
...
@@ -62,6 +65,11 @@ public class GeneratorController {
}
@Operation
(
summary
=
"查询字段配置列表"
,
description
=
"查询字段配置列表"
)
@Parameters
({
@Parameter
(
name
=
"tableName"
,
description
=
"表名称"
,
required
=
true
,
example
=
"sys_user"
,
in
=
ParameterIn
.
PATH
),
@Parameter
(
name
=
"requireSync"
,
description
=
"是否需要同步"
,
example
=
"true"
,
in
=
ParameterIn
.
QUERY
)})
@GetMapping
(
"/field/{tableName}"
)
public
R
<
List
<
FieldConfigDO
>>
listFieldConfig
(
@PathVariable
String
tableName
,
@RequestParam
(
required
=
false
,
defaultValue
=
"false"
)
Boolean
requireSync
)
{
...
...
@@ -69,12 +77,14 @@ public class GeneratorController {
}
@Operation
(
summary
=
"查询生成配置信息"
,
description
=
"查询生成配置信息"
)
@Parameter
(
name
=
"tableName"
,
description
=
"表名称"
,
required
=
true
,
example
=
"sys_user"
,
in
=
ParameterIn
.
PATH
)
@GetMapping
(
"/config/{tableName}"
)
public
R
<
GenConfigDO
>
getGenConfig
(
@PathVariable
String
tableName
)
throws
SQLException
{
return
R
.
ok
(
generatorService
.
getGenConfig
(
tableName
));
}
@Operation
(
summary
=
"保存配置信息"
,
description
=
"保存配置信息"
)
@Parameter
(
name
=
"tableName"
,
description
=
"表名称"
,
required
=
true
,
example
=
"sys_user"
,
in
=
ParameterIn
.
PATH
)
@PostMapping
(
"/config/{tableName}"
)
public
R
saveConfig
(
@Validated
@RequestBody
GenConfigRequest
request
,
@PathVariable
String
tableName
)
{
generatorService
.
saveConfig
(
request
,
tableName
);
...
...
@@ -82,6 +92,7 @@ public class GeneratorController {
}
@Operation
(
summary
=
"生成代码"
,
description
=
"生成代码"
)
@Parameter
(
name
=
"tableName"
,
description
=
"表名称"
,
required
=
true
,
example
=
"sys_user"
,
in
=
ParameterIn
.
PATH
)
@PostMapping
(
"/{tableName}"
)
public
R
generate
(
@PathVariable
String
tableName
)
{
ValidationUtils
.
throwIf
(
"prod"
.
equals
(
SpringUtil
.
getActiveProfile
()),
"仅支持在开发环境生成代码"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录