Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
basic-api-boot
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
Basic
basic-api-boot
Commits
3db465e6
提交
3db465e6
authored
6月 07, 2022
作者:
方治民
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: postgres 适配、依赖升级、修复新增/更新权限没有写入 meta 字段问题
上级
cac2d7bb
隐藏空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
388 行增加
和
70 行删除
+388
-70
build.gradle
app/build.gradle
+1
-1
application-dev-mysql.yml
app/src/main/resources/application-dev-mysql.yml
+0
-0
application-dev-postgresql.yml
app/src/main/resources/application-dev-postgresql.yml
+52
-0
application.yml
app/src/main/resources/application.yml
+1
-1
Permission.java
...in/java/com/yiring/auth/domain/permission/Permission.java
+1
-6
Role.java
...-auth/src/main/java/com/yiring/auth/domain/role/Role.java
+1
-1
User.java
...-auth/src/main/java/com/yiring/auth/domain/user/User.java
+7
-14
PermissionController.java
.../com/yiring/auth/web/permission/PermissionController.java
+3
-0
init-test-mysql.sql
basic-auth/src/main/resources/init-test-mysql.sql
+4
-4
init-test-postgresql.sql
basic-auth/src/main/resources/init-test-postgresql.sql
+266
-0
Minio.java
...mon/minio/src/main/java/com/yiring/common/core/Minio.java
+1
-1
build.gradle
build.gradle
+51
-42
没有找到文件。
app/build.gradle
浏览文件 @
3db465e6
...
...
@@ -13,7 +13,7 @@ dependencies {
runtimeOnly
'com.h2database:h2'
// 💬 Prod/Dev Env
runtimeOnly
'mysql:mysql-connector-java'
//
runtimeOnly 'org.postgresql:postgresql'
runtimeOnly
'org.postgresql:postgresql'
// 本地依赖
implementation
fileTree
(
dir:
project
.
rootDir
.
getPath
()
+
'\\libs'
,
includes:
[
'*jar'
])
...
...
app/src/main/resources/application-dev.yml
→
app/src/main/resources/application-dev
-mysql
.yml
浏览文件 @
3db465e6
File moved
app/src/main/resources/application-dev-postgresql.yml
0 → 100644
浏览文件 @
3db465e6
# 环境变量
env
:
host
:
192.168.0.156
spring
:
datasource
:
url
:
jdbc:postgresql://${env.host}:5432/basic_app
username
:
admin
password
:
123456
jpa
:
database-platform
:
org.hibernate.dialect.PostgreSQL10Dialect
open-in-view
:
true
hibernate
:
ddl-auto
:
update
show-sql
:
true
properties
:
hibernate
:
format_sql
:
true
redis
:
database
:
5
host
:
${env.host}
port
:
6379
password
:
123456
# Optional: MyBatis Plus
mybatis-plus
:
global-config
:
banner
:
false
# knife4j
knife4j
:
enable
:
true
basic
:
enable
:
false
username
:
admin
password
:
123456
setting
:
enableOpenApi
:
true
enableDebug
:
true
# minio
minio
:
access-key
:
minioadmin
secret-key
:
minioadmin
end-point
:
"
http://${env.host}:18100"
bucket
:
basic
domain
:
${minio.endpoint}/${minio.bucket}
logging
:
level
:
# sql bind parameter
org.hibernate.type.descriptor.sql.BasicBinder
:
trace
app/src/main/resources/application.yml
浏览文件 @
3db465e6
...
...
@@ -13,7 +13,7 @@ spring:
name
:
"
basic-api-app"
profiles
:
include
:
auth, conf-patch
active
:
beta
active
:
dev-postgresql
# DEBUG
debug
:
false
basic-auth/src/main/java/com/yiring/auth/domain/permission/Permission.java
浏览文件 @
3db465e6
...
...
@@ -33,12 +33,7 @@ import org.hibernate.annotations.TypeDef;
@TypeDef
(
name
=
"json"
,
typeClass
=
JsonType
.
class
)
@Table
(
name
=
"SYS_PERMISSION"
,
indexes
=
{
@Index
(
columnList
=
"type"
),
@Index
(
columnList
=
"pid"
),
@Index
(
columnList
=
"tree"
),
@Index
(
columnList
=
"uid"
,
unique
=
true
),
}
indexes
=
{
@Index
(
columnList
=
"type"
),
@Index
(
columnList
=
"pid"
),
@Index
(
columnList
=
"tree"
)
}
)
@Comment
(
"系统权限"
)
public
class
Permission
extends
BasicEntity
implements
Serializable
{
...
...
basic-auth/src/main/java/com/yiring/auth/domain/role/Role.java
浏览文件 @
3db465e6
...
...
@@ -40,7 +40,7 @@ public class Role extends BasicEntity implements Serializable {
private
static
final
long
serialVersionUID
=
910404402503275957L
;
@Comment
(
"标识"
)
@Column
(
unique
=
true
,
nullable
=
false
)
@Column
(
nullable
=
false
)
String
uid
;
@Comment
(
"名称"
)
...
...
basic-auth/src/main/java/com/yiring/auth/domain/user/User.java
浏览文件 @
3db465e6
...
...
@@ -15,6 +15,7 @@ import lombok.experimental.FieldDefaults;
import
lombok.experimental.FieldNameConstants
;
import
lombok.experimental.SuperBuilder
;
import
org.hibernate.annotations.Comment
;
import
org.hibernate.annotations.Where
;
/**
* 用户
...
...
@@ -31,17 +32,9 @@ import org.hibernate.annotations.Comment;
@AllArgsConstructor
@FieldNameConstants
@FieldDefaults
(
level
=
AccessLevel
.
PRIVATE
)
@Where
(
clause
=
"deleted = false"
)
@Entity
@Table
(
name
=
"SYS_USER"
,
indexes
=
{
@Index
(
columnList
=
"mobile"
,
unique
=
true
),
@Index
(
columnList
=
"username"
,
unique
=
true
),
@Index
(
columnList
=
"email"
,
unique
=
true
),
@Index
(
columnList
=
"enabled"
),
@Index
(
columnList
=
"deleted"
),
}
)
@Table
(
name
=
"SYS_USER"
,
indexes
=
{
@Index
(
columnList
=
"enabled"
),
@Index
(
columnList
=
"deleted"
)
})
@Comment
(
"系统用户"
)
public
class
User
extends
BasicEntity
implements
Serializable
{
...
...
@@ -81,13 +74,13 @@ public class User extends BasicEntity implements Serializable {
@JsonIgnore
@Builder
.
Default
@Comment
(
"角色集合"
)
@ManyToMany
(
fetch
=
FetchType
.
EAGER
)
@ManyToMany
@JoinTable
(
name
=
"SYS_USER_ROLES"
,
joinColumns
=
{
@JoinColumn
(
name
=
"user_id"
)
}
,
inverseJoinColumns
=
{
@JoinColumn
(
name
=
"role_id"
)
}
joinColumns
=
@JoinColumn
(
name
=
"user_id"
)
,
inverseJoinColumns
=
@JoinColumn
(
name
=
"role_id"
)
)
Set
<
Role
>
roles
=
new
HashSet
<>();
Set
<
Role
>
roles
=
new
HashSet
<>(
0
);
@Comment
(
"最后登录IP地址"
)
String
lastLoginIp
;
...
...
basic-auth/src/main/java/com/yiring/auth/web/permission/PermissionController.java
浏览文件 @
3db465e6
...
...
@@ -2,6 +2,7 @@
package
com
.
yiring
.
auth
.
web
.
permission
;
import
cn.hutool.core.util.StrUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.github.xiaoymin.knife4j.annotations.ApiSupport
;
import
com.yiring.auth.domain.permission.Permission
;
import
com.yiring.auth.domain.permission.PermissionRepository
;
...
...
@@ -61,6 +62,7 @@ public class PermissionController {
Permission
entity
=
new
Permission
();
BeanUtils
.
copyProperties
(
param
,
entity
);
entity
.
setTree
(
getTreeNode
(
param
.
getPid
()));
entity
.
setMeta
(
JSON
.
parseObject
(
param
.
getMeta
()));
permissionRepository
.
saveAndFlush
(
entity
);
return
Result
.
ok
();
}
...
...
@@ -83,6 +85,7 @@ public class PermissionController {
BeanUtils
.
copyProperties
(
param
,
entity
);
entity
.
setTree
(
getTreeNode
(
param
.
getPid
()));
entity
.
setMeta
(
JSON
.
parseObject
(
param
.
getMeta
()));
permissionRepository
.
saveAndFlush
(
entity
);
return
Result
.
ok
();
}
...
...
basic-auth/src/main/resources/init-test-mysql.sql
浏览文件 @
3db465e6
...
...
@@ -49,10 +49,10 @@ CREATE TABLE `sys_permission` (
-- ----------------------------
-- Records of sys_permission
-- ----------------------------
INSERT
INTO
`sys_permission`
VALUES
(
'1515550180340928512'
,
'2022-04-17 12:38:15.212000'
,
'2022-04-17 12:38:15.212000'
,
'LAYOUT'
,
b
'1'
,
NULL
,
'ion:grid-outline'
,
'{
\"
title
\"
:
\"
routes.dashboard.dashboard
\"
,
\"
hideChildrenInMenu
\
"
: true}'
,
'Dashboard'
,
'/dashboard'
,
0
,
'/dashboard/workbench'
,
1
,
'0'
,
'MENU'
,
'Dashboard'
);
INSERT
INTO
`sys_permission`
VALUES
(
'1515627442394370048'
,
'2022-04-17 17:45:15.941000'
,
'2022-04-17 17:45:15.941000'
,
'/dashboard/workbench/index'
,
b
'1'
,
b
'1'
,
NULL
,
'{
\"
title
\"
:
\"
routes.dashboard.workbench
\"
,
\"
hideBreadcrumb
\"
: true,
\"
currentActiveMenu
\"
:
\"
/dashboard
\"
,
\"
hideChildrenInMenu
\
"
: true}'
,
'Workbench'
,
'workbench'
,
'1515550180340928512'
,
NULL
,
1
,
'0.1515550180340928512'
,
'MENU'
,
'Workbench'
);
INSERT
INTO
`sys_permission`
VALUES
(
'1515627944716800000'
,
'2022-04-17 17:47:15.683000'
,
'2022-04-17 17:47:15.683000'
,
'LAYOUT'
,
b
'1'
,
NULL
,
'simple-icons:about-dot-me'
,
'{
\"
title
\"
:
\"
routes.dashboard.about
\"
,
\"
hideChildrenInMenu
\
"
: true}'
,
'About'
,
'/about'
,
0
,
'/about/index'
,
100000
,
'0'
,
'MENU'
,
'About'
);
INSERT
INTO
`sys_permission`
VALUES
(
'1515628470086930432'
,
'2022-04-17 17:49:20.941000'
,
'2022-04-17 17:49:20.942000'
,
'/sys/about/index'
,
b
'1'
,
NULL
,
'simple-icons:about-dot-me'
,
'{
\"
title
\"
:
\"
routes.dashboard.about
\"
,
\"
hideMenu
\
"
: true}'
,
'AboutPage'
,
'index'
,
'1515627944716800000'
,
NULL
,
NULL
,
'0.1515627944716800000'
,
'MENU'
,
'AboutPage'
);
INSERT
INTO
`sys_permission`
VALUES
(
'1515550180340928512'
,
'2022-04-17 12:38:15.212000'
,
'2022-04-17 12:38:15.212000'
,
'LAYOUT'
,
b
'1'
,
NULL
,
'ion:grid-outline'
,
'{
"title": "routes.dashboard.dashboard", "hideChildrenInMenu
": true}'
,
'Dashboard'
,
'/dashboard'
,
0
,
'/dashboard/workbench'
,
1
,
'0'
,
'MENU'
,
'Dashboard'
);
INSERT
INTO
`sys_permission`
VALUES
(
'1515627442394370048'
,
'2022-04-17 17:45:15.941000'
,
'2022-04-17 17:45:15.941000'
,
'/dashboard/workbench/index'
,
b
'1'
,
b
'1'
,
NULL
,
'{
"title": "routes.dashboard.workbench", "hideBreadcrumb": true, "currentActiveMenu": "/dashboard", "hideChildrenInMenu
": true}'
,
'Workbench'
,
'workbench'
,
'1515550180340928512'
,
NULL
,
1
,
'0.1515550180340928512'
,
'MENU'
,
'Workbench'
);
INSERT
INTO
`sys_permission`
VALUES
(
'1515627944716800000'
,
'2022-04-17 17:47:15.683000'
,
'2022-04-17 17:47:15.683000'
,
'LAYOUT'
,
b
'1'
,
NULL
,
'simple-icons:about-dot-me'
,
'{
"title": "routes.dashboard.about", "hideChildrenInMenu
": true}'
,
'About'
,
'/about'
,
0
,
'/about/index'
,
100000
,
'0'
,
'MENU'
,
'About'
);
INSERT
INTO
`sys_permission`
VALUES
(
'1515628470086930432'
,
'2022-04-17 17:49:20.941000'
,
'2022-04-17 17:49:20.942000'
,
'/sys/about/index'
,
b
'1'
,
NULL
,
'simple-icons:about-dot-me'
,
'{
"title": "routes.dashboard.about", "hideMenu
": true}'
,
'AboutPage'
,
'index'
,
'1515627944716800000'
,
NULL
,
NULL
,
'0.1515627944716800000'
,
'MENU'
,
'AboutPage'
);
-- ----------------------------
-- Table structure for sys_role
...
...
basic-auth/src/main/resources/init-test-postgresql.sql
0 → 100644
浏览文件 @
3db465e6
/*
Navicat Premium Data Transfer
Source Server : 192.168.0.156_5432
Source Server Type : PostgreSQL
Source Server Version : 130003
Source Host : 192.168.0.156:5432
Source Catalog : basic_app
Source Schema : public
Target Server Type : PostgreSQL
Target Server Version : 130003
File Encoding : 65001
Date: 27/05/2022 14:09:18
*/
-- ----------------------------
-- Table structure for sys_permission
-- ----------------------------
DROP
TABLE
IF
EXISTS
"public"
.
"sys_permission"
;
CREATE
TABLE
"public"
.
"sys_permission"
(
"id"
varchar
(
255
)
COLLATE
"pg_catalog"
.
"default"
NOT
NULL
,
"create_time"
timestamp
(
6
)
NOT
NULL
,
"update_time"
timestamp
(
6
)
NOT
NULL
,
"component"
varchar
(
255
)
COLLATE
"pg_catalog"
.
"default"
,
"enable"
bool
,
"hidden"
bool
,
"icon"
varchar
(
255
)
COLLATE
"pg_catalog"
.
"default"
,
"meta"
json
,
"name"
varchar
(
255
)
COLLATE
"pg_catalog"
.
"default"
,
"path"
varchar
(
255
)
COLLATE
"pg_catalog"
.
"default"
,
"pid"
varchar
(
255
)
COLLATE
"pg_catalog"
.
"default"
,
"redirect"
varchar
(
255
)
COLLATE
"pg_catalog"
.
"default"
,
"serial"
int4
,
"tree"
varchar
(
255
)
COLLATE
"pg_catalog"
.
"default"
,
"type"
varchar
(
255
)
COLLATE
"pg_catalog"
.
"default"
,
"uid"
varchar
(
255
)
COLLATE
"pg_catalog"
.
"default"
NOT
NULL
)
;
COMMENT
ON
COLUMN
"public"
.
"sys_permission"
.
"id"
IS
'主键'
;
COMMENT
ON
COLUMN
"public"
.
"sys_permission"
.
"create_time"
IS
'创建时间'
;
COMMENT
ON
COLUMN
"public"
.
"sys_permission"
.
"update_time"
IS
'最后修改时间'
;
COMMENT
ON
COLUMN
"public"
.
"sys_permission"
.
"component"
IS
'组件'
;
COMMENT
ON
COLUMN
"public"
.
"sys_permission"
.
"enable"
IS
'是否启用'
;
COMMENT
ON
COLUMN
"public"
.
"sys_permission"
.
"hidden"
IS
'是否隐藏'
;
COMMENT
ON
COLUMN
"public"
.
"sys_permission"
.
"icon"
IS
'图标'
;
COMMENT
ON
COLUMN
"public"
.
"sys_permission"
.
"meta"
IS
'扩展元数据信息'
;
COMMENT
ON
COLUMN
"public"
.
"sys_permission"
.
"name"
IS
'名称'
;
COMMENT
ON
COLUMN
"public"
.
"sys_permission"
.
"path"
IS
'路径'
;
COMMENT
ON
COLUMN
"public"
.
"sys_permission"
.
"pid"
IS
'权限父级ID'
;
COMMENT
ON
COLUMN
"public"
.
"sys_permission"
.
"redirect"
IS
'重定向'
;
COMMENT
ON
COLUMN
"public"
.
"sys_permission"
.
"serial"
IS
'序号'
;
COMMENT
ON
COLUMN
"public"
.
"sys_permission"
.
"tree"
IS
'树节点标识'
;
COMMENT
ON
COLUMN
"public"
.
"sys_permission"
.
"type"
IS
'类型(MENU: 菜单, BUTTON: 按钮)'
;
COMMENT
ON
COLUMN
"public"
.
"sys_permission"
.
"uid"
IS
'标识'
;
COMMENT
ON
TABLE
"public"
.
"sys_permission"
IS
'系统权限'
;
-- ----------------------------
-- Records of sys_permission
-- ----------------------------
INSERT
INTO
"public"
.
"sys_permission"
VALUES
(
'1515627442394370048'
,
'2022-04-17 17:45:15.941'
,
'2022-05-17 18:48:22.001'
,
'/dashboard/workbench/index'
,
't'
,
't'
,
NULL
,
'{"title": "routes.dashboard.workbench", "hideBreadcrumb": true, "currentActiveMenu": "/dashboard", "hideChildrenInMenu": true}'
,
'Workbenchdddd'
,
'workbench'
,
'1515550180340928512'
,
NULL
,
1
,
'0.1515550180340928512'
,
'BUTTON'
,
'Workbench'
);
INSERT
INTO
"public"
.
"sys_permission"
VALUES
(
'1515627944716800000'
,
'2022-04-17 17:47:15.683'
,
'2022-05-25 16:18:06.724'
,
'LAYOUT'
,
't'
,
NULL
,
'simple-icons:about-dot-me'
,
'{"title": "routes.dashboard.about", "hideChildrenInMenu": true}'
,
'About'
,
'/about'
,
'0'
,
NULL
,
100000
,
'0'
,
'MENU'
,
'About'
);
INSERT
INTO
"public"
.
"sys_permission"
VALUES
(
'1515628470086930432'
,
'2022-04-17 17:49:20.941'
,
'2022-05-17 18:02:15.969'
,
'/sys/about/index'
,
'f'
,
't'
,
'simple-icons:about-dot-me'
,
'{"title": "routes.dashboard.about", "hideMenu": true}'
,
'AboutPage'
,
'index'
,
'1515627944716800000'
,
NULL
,
NULL
,
'0.1515627944716800000'
,
'BUTTON'
,
'AboutPage'
);
INSERT
INTO
"public"
.
"sys_permission"
VALUES
(
'1515550180340928512'
,
'2022-04-17 12:38:15.212'
,
'2022-05-24 17:50:13.742'
,
'LAYOUT'
,
't'
,
't'
,
'ion:grid-outline'
,
'{"title": "routes.dashboard.dashboard", "hideChildrenInMenu": true}'
,
'Dashboard'
,
'/dashboard'
,
'0'
,
'/dashboard/workbench'
,
1
,
'0'
,
'MENU'
,
'Dashboard'
);
-- ----------------------------
-- Table structure for sys_role
-- ----------------------------
DROP
TABLE
IF
EXISTS
"public"
.
"sys_role"
;
CREATE
TABLE
"public"
.
"sys_role"
(
"id"
varchar
(
255
)
COLLATE
"pg_catalog"
.
"default"
NOT
NULL
,
"create_time"
timestamp
(
6
)
NOT
NULL
,
"update_time"
timestamp
(
6
)
NOT
NULL
,
"name"
varchar
(
255
)
COLLATE
"pg_catalog"
.
"default"
,
"uid"
varchar
(
255
)
COLLATE
"pg_catalog"
.
"default"
NOT
NULL
)
;
COMMENT
ON
COLUMN
"public"
.
"sys_role"
.
"id"
IS
'主键'
;
COMMENT
ON
COLUMN
"public"
.
"sys_role"
.
"create_time"
IS
'创建时间'
;
COMMENT
ON
COLUMN
"public"
.
"sys_role"
.
"update_time"
IS
'最后修改时间'
;
COMMENT
ON
COLUMN
"public"
.
"sys_role"
.
"name"
IS
'名称'
;
COMMENT
ON
COLUMN
"public"
.
"sys_role"
.
"uid"
IS
'标识'
;
COMMENT
ON
TABLE
"public"
.
"sys_role"
IS
'系统角色'
;
-- ----------------------------
-- Records of sys_role
-- ----------------------------
INSERT
INTO
"public"
.
"sys_role"
VALUES
(
'1530064847847297024'
,
'2022-05-27 13:54:21.623'
,
'2022-05-27 13:54:21.624'
,
'管理员'
,
'admin'
);
-- ----------------------------
-- Table structure for sys_role_permissions
-- ----------------------------
DROP
TABLE
IF
EXISTS
"public"
.
"sys_role_permissions"
;
CREATE
TABLE
"public"
.
"sys_role_permissions"
(
"role_id"
varchar
(
255
)
COLLATE
"pg_catalog"
.
"default"
NOT
NULL
,
"permissions_id"
varchar
(
255
)
COLLATE
"pg_catalog"
.
"default"
NOT
NULL
)
;
-- ----------------------------
-- Records of sys_role_permissions
-- ----------------------------
INSERT
INTO
"public"
.
"sys_role_permissions"
VALUES
(
'1530064847847297024'
,
'1515627442394370048'
);
INSERT
INTO
"public"
.
"sys_role_permissions"
VALUES
(
'1530064847847297024'
,
'1515627944716800000'
);
INSERT
INTO
"public"
.
"sys_role_permissions"
VALUES
(
'1530064847847297024'
,
'1515628470086930432'
);
INSERT
INTO
"public"
.
"sys_role_permissions"
VALUES
(
'1530064847847297024'
,
'1515550180340928512'
);
-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP
TABLE
IF
EXISTS
"public"
.
"sys_user"
;
CREATE
TABLE
"public"
.
"sys_user"
(
"id"
varchar
(
255
)
COLLATE
"pg_catalog"
.
"default"
NOT
NULL
,
"create_time"
timestamp
(
6
)
NOT
NULL
,
"update_time"
timestamp
(
6
)
NOT
NULL
,
"avatar"
varchar
(
255
)
COLLATE
"pg_catalog"
.
"default"
,
"deleted"
bool
,
"email"
varchar
(
255
)
COLLATE
"pg_catalog"
.
"default"
,
"enabled"
bool
,
"introduction"
varchar
(
255
)
COLLATE
"pg_catalog"
.
"default"
,
"last_login_ip"
varchar
(
255
)
COLLATE
"pg_catalog"
.
"default"
,
"last_login_time"
timestamp
(
6
),
"mobile"
varchar
(
255
)
COLLATE
"pg_catalog"
.
"default"
,
"password"
varchar
(
255
)
COLLATE
"pg_catalog"
.
"default"
,
"real_name"
varchar
(
255
)
COLLATE
"pg_catalog"
.
"default"
,
"username"
varchar
(
255
)
COLLATE
"pg_catalog"
.
"default"
)
;
COMMENT
ON
COLUMN
"public"
.
"sys_user"
.
"id"
IS
'主键'
;
COMMENT
ON
COLUMN
"public"
.
"sys_user"
.
"create_time"
IS
'创建时间'
;
COMMENT
ON
COLUMN
"public"
.
"sys_user"
.
"update_time"
IS
'最后修改时间'
;
COMMENT
ON
COLUMN
"public"
.
"sys_user"
.
"avatar"
IS
'头像'
;
COMMENT
ON
COLUMN
"public"
.
"sys_user"
.
"deleted"
IS
'是否删除'
;
COMMENT
ON
COLUMN
"public"
.
"sys_user"
.
"email"
IS
'邮箱'
;
COMMENT
ON
COLUMN
"public"
.
"sys_user"
.
"enabled"
IS
'是否启用'
;
COMMENT
ON
COLUMN
"public"
.
"sys_user"
.
"introduction"
IS
'简介'
;
COMMENT
ON
COLUMN
"public"
.
"sys_user"
.
"last_login_ip"
IS
'最后登录IP地址'
;
COMMENT
ON
COLUMN
"public"
.
"sys_user"
.
"last_login_time"
IS
'最后登录时间'
;
COMMENT
ON
COLUMN
"public"
.
"sys_user"
.
"mobile"
IS
'手机号'
;
COMMENT
ON
COLUMN
"public"
.
"sys_user"
.
"password"
IS
'密码'
;
COMMENT
ON
COLUMN
"public"
.
"sys_user"
.
"real_name"
IS
'真实姓名'
;
COMMENT
ON
COLUMN
"public"
.
"sys_user"
.
"username"
IS
'用户名'
;
COMMENT
ON
TABLE
"public"
.
"sys_user"
IS
'系统用户'
;
-- ----------------------------
-- Records of sys_user
-- ----------------------------
INSERT
INTO
"public"
.
"sys_user"
VALUES
(
'1530062713596678144'
,
'2022-05-27 13:45:52.805'
,
'2022-05-27 13:45:57.318'
,
'https://s1.ax1x.com/2022/03/30/qggJH0.jpg'
,
'f'
,
NULL
,
't'
,
'平台管理员'
,
'127.0.0.1'
,
'2022-05-27 13:45:57.309'
,
'13012345678'
,
'8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92'
,
'管理员'
,
'admin'
);
-- ----------------------------
-- Table structure for sys_user_roles
-- ----------------------------
DROP
TABLE
IF
EXISTS
"public"
.
"sys_user_roles"
;
CREATE
TABLE
"public"
.
"sys_user_roles"
(
"role_id"
varchar
(
255
)
COLLATE
"pg_catalog"
.
"default"
NOT
NULL
,
"user_id"
varchar
(
255
)
COLLATE
"pg_catalog"
.
"default"
NOT
NULL
)
;
-- ----------------------------
-- Records of sys_user_roles
-- ----------------------------
INSERT
INTO
"public"
.
"sys_user_roles"
VALUES
(
'1530064847847297024'
,
'1530062713596678144'
);
-- ----------------------------
-- Table structure for test_table
-- ----------------------------
DROP
TABLE
IF
EXISTS
"public"
.
"test_table"
;
CREATE
TABLE
"public"
.
"test_table"
(
"id"
varchar
(
255
)
COLLATE
"pg_catalog"
.
"default"
NOT
NULL
,
"age"
int4
,
"name"
varchar
(
255
)
COLLATE
"pg_catalog"
.
"default"
)
;
COMMENT
ON
COLUMN
"public"
.
"test_table"
.
"id"
IS
'主键'
;
COMMENT
ON
COLUMN
"public"
.
"test_table"
.
"age"
IS
'年龄'
;
COMMENT
ON
COLUMN
"public"
.
"test_table"
.
"name"
IS
'姓名'
;
COMMENT
ON
TABLE
"public"
.
"test_table"
IS
'测试表'
;
-- ----------------------------
-- Records of test_table
-- ----------------------------
-- ----------------------------
-- Indexes structure for table sys_permission
-- ----------------------------
CREATE
INDEX
"idxcj5qpen847f3vkcgy7lsmqyug"
ON
"public"
.
"sys_permission"
USING
btree
(
"pid"
COLLATE
"pg_catalog"
.
"default"
"pg_catalog"
.
"text_ops"
ASC
NULLS
LAST
);
CREATE
INDEX
"idxckpwmqmt2tsu8fyefxpgwypmr"
ON
"public"
.
"sys_permission"
USING
btree
(
"tree"
COLLATE
"pg_catalog"
.
"default"
"pg_catalog"
.
"text_ops"
ASC
NULLS
LAST
);
CREATE
INDEX
"idxfgtwjg4pmylcko0v6ate29j2x"
ON
"public"
.
"sys_permission"
USING
btree
(
"type"
COLLATE
"pg_catalog"
.
"default"
"pg_catalog"
.
"text_ops"
ASC
NULLS
LAST
);
-- ----------------------------
-- Uniques structure for table sys_permission
-- ----------------------------
ALTER
TABLE
"public"
.
"sys_permission"
ADD
CONSTRAINT
"uk_n5idwm5pmlgfwvau5vrwf65ai"
UNIQUE
(
"uid"
);
-- ----------------------------
-- Primary Key structure for table sys_permission
-- ----------------------------
ALTER
TABLE
"public"
.
"sys_permission"
ADD
CONSTRAINT
"sys_permission_pkey"
PRIMARY
KEY
(
"id"
);
-- ----------------------------
-- Uniques structure for table sys_role
-- ----------------------------
ALTER
TABLE
"public"
.
"sys_role"
ADD
CONSTRAINT
"uko928jdlxprqf5qyw6rvor4lse"
UNIQUE
(
"uid"
);
-- ----------------------------
-- Primary Key structure for table sys_role
-- ----------------------------
ALTER
TABLE
"public"
.
"sys_role"
ADD
CONSTRAINT
"sys_role_pkey"
PRIMARY
KEY
(
"id"
);
-- ----------------------------
-- Primary Key structure for table sys_role_permissions
-- ----------------------------
ALTER
TABLE
"public"
.
"sys_role_permissions"
ADD
CONSTRAINT
"sys_role_permissions_pkey"
PRIMARY
KEY
(
"role_id"
,
"permissions_id"
);
-- ----------------------------
-- Indexes structure for table sys_user
-- ----------------------------
CREATE
INDEX
"idxeyi36w6acltgl5j4ujw0wlsyt"
ON
"public"
.
"sys_user"
USING
btree
(
"enabled"
"pg_catalog"
.
"bool_ops"
ASC
NULLS
LAST
);
CREATE
INDEX
"idxner7sjf2kjerehlptwipdlst9"
ON
"public"
.
"sys_user"
USING
btree
(
"deleted"
"pg_catalog"
.
"bool_ops"
ASC
NULLS
LAST
);
-- ----------------------------
-- Uniques structure for table sys_user
-- ----------------------------
ALTER
TABLE
"public"
.
"sys_user"
ADD
CONSTRAINT
"uk_ahtq5ew3v0kt1n7hf1sgp7p8l"
UNIQUE
(
"email"
);
ALTER
TABLE
"public"
.
"sys_user"
ADD
CONSTRAINT
"uk_cvv4commjv5h4bai0h4vuqvkd"
UNIQUE
(
"mobile"
);
ALTER
TABLE
"public"
.
"sys_user"
ADD
CONSTRAINT
"uk_51bvuyvihefoh4kp5syh2jpi4"
UNIQUE
(
"username"
);
-- ----------------------------
-- Primary Key structure for table sys_user
-- ----------------------------
ALTER
TABLE
"public"
.
"sys_user"
ADD
CONSTRAINT
"sys_user_pkey"
PRIMARY
KEY
(
"id"
);
-- ----------------------------
-- Primary Key structure for table sys_user_roles
-- ----------------------------
ALTER
TABLE
"public"
.
"sys_user_roles"
ADD
CONSTRAINT
"sys_user_roles_pkey"
PRIMARY
KEY
(
"role_id"
,
"user_id"
);
-- ----------------------------
-- Primary Key structure for table test_table
-- ----------------------------
ALTER
TABLE
"public"
.
"test_table"
ADD
CONSTRAINT
"test_table_pkey"
PRIMARY
KEY
(
"id"
);
-- ----------------------------
-- Foreign Keys structure for table sys_role_permissions
-- ----------------------------
ALTER
TABLE
"public"
.
"sys_role_permissions"
ADD
CONSTRAINT
"fkaa4k4qhr2qdj6br8p5nrb2lhb"
FOREIGN
KEY
(
"role_id"
)
REFERENCES
"public"
.
"sys_role"
(
"id"
)
ON
DELETE
NO
ACTION
ON
UPDATE
NO
ACTION
;
ALTER
TABLE
"public"
.
"sys_role_permissions"
ADD
CONSTRAINT
"fkrg8k5oymm622ik067yjss31co"
FOREIGN
KEY
(
"permissions_id"
)
REFERENCES
"public"
.
"sys_permission"
(
"id"
)
ON
DELETE
NO
ACTION
ON
UPDATE
NO
ACTION
;
-- ----------------------------
-- Foreign Keys structure for table sys_user_roles
-- ----------------------------
ALTER
TABLE
"public"
.
"sys_user_roles"
ADD
CONSTRAINT
"fkp2804vh0ea810pitigxq5n6pn"
FOREIGN
KEY
(
"user_id"
)
REFERENCES
"public"
.
"sys_user"
(
"id"
)
ON
DELETE
NO
ACTION
ON
UPDATE
NO
ACTION
;
ALTER
TABLE
"public"
.
"sys_user_roles"
ADD
CONSTRAINT
"fkqwiuml6b7mjmk48u5b9hmk853"
FOREIGN
KEY
(
"role_id"
)
REFERENCES
"public"
.
"sys_role"
(
"id"
)
ON
DELETE
NO
ACTION
ON
UPDATE
NO
ACTION
;
basic-common/minio/src/main/java/com/yiring/common/core/Minio.java
浏览文件 @
3db465e6
...
...
@@ -167,7 +167,7 @@ public record Minio(MinioConfig config, MinioClient client) {
public
ObjectWriteResponse
putBusinessObject
(
Path
path
,
String
object
)
throws
Exception
{
UploadObjectArgs
args
=
UploadObjectArgs
.
builder
()
// 固定
的
储存桶位置
// 固定
地
储存桶位置
.
bucket
(
BUSINESS_BUCKET
)
.
filename
(
path
.
toString
())
.
object
(
object
)
...
...
build.gradle
浏览文件 @
3db465e6
buildscript
{
repositories
{
maven
{
url
"https://plugins.gradle.org/m2/"
}
}
ext
{
// https://mvnrepository.com/artifact/com.github.xiaoymin/knife4j-spring-boot-starter
knife4jVersion
=
'2.0.9'
// https://mvnrepository.com/artifact/io.swagger/swagger-annotations
swaggerAnnotationsVersion
=
'1.6.6'
// https://mvnrepository.com/artifact/cn.dev33/sa-token-spring-boot-starter
saTokenVersion
=
'1.29.1.trial'
// https://mvnrepository.com/artifact/cn.hutool/hutool-all
hutoolVersion
=
'5.8.0'
// https://mvnrepository.com/artifact/com.alibaba/fastjson
fastJsonVersion
=
'2.0.2'
// https://mvnrepository.com/artifact/com.xuxueli/xxl-job-core
xxlJobVersion
=
'2.3.0'
// https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp
okhttpVersion
=
'4.9.3'
// https://mvnrepository.com/artifact/io.minio/minio
minioVersion
=
'8.4.0'
// https://mvnrepository.com/artifact/com.vladmihalcea/hibernate-types-55
hibernateTypesVersion
=
'2.16.2'
// https://mvnrepository.com/artifact/org.hibernate/hibernate-spatial
hibernateSpatialVersion
=
'5.6.8.Final'
// https://mvnrepository.com/artifact/org.locationtech.jts/jts-core
jtsVersion
=
'1.18.2'
// https://mvnrepository.com/artifact/com.baomidou/mybatis-plus-boot-starter
mybatisPlusVersion
=
'3.5.1'
// https://mvnrepository.com/artifact/com.github.liaochong/myexcel
myexcelVersion
=
'4.2.0'
}
}
plugins
{
id
'java'
id
'org.springframework.boot'
version
'2.6.7'
// https://start.spring.io
id
'org.springframework.boot'
version
'2.6.8'
// https://plugins.gradle.org/plugin/io.spring.dependency-management
id
'io.spring.dependency-management'
version
'1.0.11.RELEASE'
// https://plugins.gradle.org/plugin/com.diffplug.spotless
id
"com.diffplug.spotless"
version
"6.
5.2
"
id
"com.diffplug.spotless"
version
"6.
7.0
"
// https://plugins.gradle.org/plugin/com.github.spotbugs
// id "com.github.spotbugs" version "5.0.6"
// id "com.github.spotbugs" version "5.0.7"
}
ext
{
// Spotless
// https://www.npmjs.com/package/prettier
prettierVersion
=
'2.6.2'
// https://www.npmjs.com/package/prettier-plugin-java
prettierJavaVersion
=
'1.6.2'
// https://start.spring.io/
springCloudVersion
=
'2021.0.3'
// https://mvnrepository.com/artifact/com.github.xiaoymin/knife4j-spring-boot-starter
knife4jVersion
=
'2.0.9'
// https://mvnrepository.com/artifact/io.swagger/swagger-annotations
swaggerAnnotationsVersion
=
'1.6.6'
// https://mvnrepository.com/artifact/cn.dev33/sa-token-spring-boot-starter
saTokenVersion
=
'1.30.0'
// https://mvnrepository.com/artifact/cn.hutool/hutool-all
hutoolVersion
=
'5.8.2'
// https://mvnrepository.com/artifact/com.alibaba/fastjson
fastJsonVersion
=
'2.0.6'
// https://mvnrepository.com/artifact/com.xuxueli/xxl-job-core
xxlJobVersion
=
'2.3.1'
// https://mvnrepository.com/artifact/com.squareup.okhttp3/okhttp
okhttpVersion
=
'4.9.3'
// https://mvnrepository.com/artifact/io.minio/minio
minioVersion
=
'8.4.1'
// https://mvnrepository.com/artifact/com.vladmihalcea/hibernate-types-55
hibernateTypesVersion
=
'2.16.2'
// https://mvnrepository.com/artifact/org.hibernate/hibernate-spatial
hibernateSpatialVersion
=
'5.6.9.Final'
// https://mvnrepository.com/artifact/org.locationtech.jts/jts-core
jtsVersion
=
'1.18.2'
// https://mvnrepository.com/artifact/com.baomidou/mybatis-plus-boot-starter
mybatisPlusVersion
=
'3.5.2'
// https://mvnrepository.com/artifact/com.github.liaochong/myexcel
myexcelVersion
=
'4.2.0'
}
allprojects
{
...
...
@@ -76,6 +81,12 @@ subprojects {
annotationProcessor
'org.springframework.boot:spring-boot-configuration-processor'
}
dependencyManagement
{
imports
{
mavenBom
"org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
[
compileJava
,
compileTestJava
,
javadoc
]*.
options
*.
encoding
=
'UTF-8'
tasks
.
withType
(
JavaCompile
)
{
...
...
@@ -86,7 +97,7 @@ subprojects {
enabled
=
false
}
t
est
{
t
asks
.
named
(
'test'
)
{
useJUnitPlatform
()
}
...
...
@@ -110,9 +121,7 @@ subprojects {
importOrder
()
removeUnusedImports
()
licenseHeader
'/* (C) $YEAR YiRing, Inc. */'
// https://www.npmjs.com/package/prettier
// https://www.npmjs.com/package/prettier-plugin-java
prettier
([
'prettier'
:
'2.6.2'
,
'prettier-plugin-java'
:
'1.6.1'
]).
config
([
prettier
([
'prettier'
:
prettierVersion
,
'prettier-plugin-java'
:
prettierJavaVersion
]).
config
([
'parser'
:
'java'
,
'tabWidth'
:
4
,
'printWidth'
:
120
,
...
...
@@ -123,6 +132,7 @@ subprojects {
}
task
hooks
()
{
// fix: CI/CD
try
{
// GitHook pre-commit (spotless, spotbugs)
def
hook
=
new
File
(
"$rootProject.projectDir/.git/hooks/pre-commit"
)
...
...
@@ -139,7 +149,6 @@ task hooks() {
gradle
.
getTaskGraph
().
whenReady
{
def
skipHooks
=
gradle
.
startParameter
.
getSystemPropertiesArgs
().
containsKey
(
'skip-hooks'
)
printf
(
"skip-hooks: %s"
,
skipHooks
)
if
(!
skipHooks
)
{
hooks
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论