refactor: 项目规范
This commit is contained in:
@@ -6,6 +6,19 @@
|
|||||||
|
|
||||||
模板文档: [https://panjiachen.github.io/vue-element-admin-site/zh/guide/](https://panjiachen.github.io/vue-element-admin-site/zh/guide/)
|
模板文档: [https://panjiachen.github.io/vue-element-admin-site/zh/guide/](https://panjiachen.github.io/vue-element-admin-site/zh/guide/)
|
||||||
|
|
||||||
|
#### 集成、自定义组件
|
||||||
|
- echart 图表
|
||||||
|
- wangEditor 富文本
|
||||||
|
- MavonEditor Markdown编辑器
|
||||||
|
- CodeMirror Yaml编辑器
|
||||||
|
- CodeMirror Java代码编辑器
|
||||||
|
- 自定义业务组件(用户下拉选择框、部门下拉选择框)
|
||||||
|
- 滚动数字
|
||||||
|
- 表格拖拽
|
||||||
|
- 面板分割
|
||||||
|
- WebSocket
|
||||||
|
- 快速复制
|
||||||
|
|
||||||
## 快速开始
|
## 快速开始
|
||||||
|
|
||||||
### 环境要求
|
### 环境要求
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
export function describeDeptList(params) {
|
export function queryDeptList(params) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/dept',
|
url: 'api/dept',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
@@ -8,11 +8,11 @@ export function describeDeptList(params) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function describeDeptSuperiorTree(ids, exclude) {
|
export function queryDeptSuperiorTree(ids, exclude) {
|
||||||
exclude = exclude !== undefined ? exclude : false
|
exclude = exclude !== undefined ? exclude : false
|
||||||
const data = Array.isArray(ids) ? ids : [ids]
|
const data = Array.isArray(ids) ? ids : [ids]
|
||||||
return request({
|
return request({
|
||||||
url: 'api/dept/describeDeptSuperiorTree?exclude=' + exclude,
|
url: 'api/dept/queryDeptSuperiorTree?exclude=' + exclude,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -42,4 +42,4 @@ export function edit(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export default { add, edit, del, describeDeptList, describeDeptSuperiorTree }
|
export default { add, edit, del, queryDeptList, queryDeptSuperiorTree }
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
export function describeMenuListByPid(pid) {
|
export function queryMenuListByPid(pid) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/menus/describeMenuListByPid?pid=' + pid,
|
url: 'api/menus/queryMenuListByPid?pid=' + pid,
|
||||||
method: 'post'
|
method: 'post'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -15,18 +15,18 @@ export function getMenus(params) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function describeMenuSuperior(ids) {
|
export function queryMenuSuperior(ids) {
|
||||||
const data = Array.isArray(ids) ? ids : [ids]
|
const data = Array.isArray(ids) ? ids : [ids]
|
||||||
return request({
|
return request({
|
||||||
url: 'api/menus/describeMenuSuperior',
|
url: 'api/menus/queryMenuSuperior',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function describeChildMenuSet(id) {
|
export function queryChildMenuSet(id) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/menus/describeChildMenuSet?id=' + id,
|
url: 'api/menus/queryChildMenuSet?id=' + id,
|
||||||
method: 'post'
|
method: 'post'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -62,4 +62,4 @@ export function edit(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export default { add, edit, del, describeMenuListByPid, describeMenuSuperior, getMenus, describeChildMenuSet }
|
export default { add, edit, del, queryMenuListByPid, queryMenuSuperior, getMenus, queryChildMenuSet }
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
// 获取所有的Role
|
// 获取所有的Role
|
||||||
export function describeRoleList() {
|
export function queryRoleList() {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/roles/describeRoleList',
|
url: 'api/roles/queryRoleList',
|
||||||
method: 'post'
|
method: 'post'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -18,7 +18,7 @@ export function add(data) {
|
|||||||
|
|
||||||
export function get(id) {
|
export function get(id) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/roles/describeRoleById',
|
url: 'api/roles/queryRoleById',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: { id: id }
|
data: { id: id }
|
||||||
})
|
})
|
||||||
@@ -26,7 +26,7 @@ export function get(id) {
|
|||||||
|
|
||||||
export function getLevel() {
|
export function getLevel() {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/roles/describeRoleLevel',
|
url: 'api/roles/queryRoleLevel',
|
||||||
method: 'post'
|
method: 'post'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ export function updateEmail(form) {
|
|||||||
|
|
||||||
export function queryUserMetaPage(query) {
|
export function queryUserMetaPage(query) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/users/describeUserMetadataOptions',
|
url: 'api/users/queryUserMetadataOptions',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: {
|
data: {
|
||||||
page: 1,
|
page: 1,
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
export function describeEmailConfig() {
|
export function queryEmailConfig() {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/email/describeEmailConfig',
|
url: 'api/email/queryEmailConfig',
|
||||||
method: 'post'
|
method: 'post'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
export function describeQiniuConfig() {
|
export function queryQiniuConfig() {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/qiNiuContent/describeQiniuConfig',
|
url: 'api/qiNiuContent/queryQiniuConfig',
|
||||||
method: 'post'
|
method: 'post'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ export default {
|
|||||||
' zone: primary # This is needed for the load balancer\n' +
|
' zone: primary # This is needed for the load balancer\n' +
|
||||||
' profile: ${spring.profiles.active}\n' +
|
' profile: ${spring.profiles.active}\n' +
|
||||||
' version: ${info.project.version:}\n' +
|
' version: ${info.project.version:}\n' +
|
||||||
' git-version: ${git.commit.id.describe:}\n' +
|
' git-version: ${git.commit.id.query:}\n' +
|
||||||
' git-commit: ${git.commit.id.abbrev:}\n' +
|
' git-commit: ${git.commit.id.abbrev:}\n' +
|
||||||
' git-branch: ${git.branch:}\n' +
|
' git-branch: ${git.branch:}\n' +
|
||||||
'ribbon:\n' +
|
'ribbon:\n' +
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import { describeDeptList } from '@/api/system/dept'
|
import { queryDeptList } from '@/api/system/dept'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'CuteDeptTree',
|
name: 'CuteDeptTree',
|
||||||
@@ -60,7 +60,7 @@ export default {
|
|||||||
params['pid'] = node.data.id
|
params['pid'] = node.data.id
|
||||||
}
|
}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
describeDeptList(params).then(res => {
|
queryDeptList(params).then(res => {
|
||||||
if (resolve) {
|
if (resolve) {
|
||||||
resolve(res.content)
|
resolve(res.content)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
show: false,
|
show: false,
|
||||||
monitor: null,
|
monitor: null,
|
||||||
url: 'api/monitor/describeServerMonitorInfo',
|
url: 'api/monitor/queryServerMonitorInfo',
|
||||||
data: {},
|
data: {},
|
||||||
cpuInfo: {
|
cpuInfo: {
|
||||||
tooltip: {
|
tooltip: {
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ export default {
|
|||||||
getDeptDatas(tree, treeNode, resolve) {
|
getDeptDatas(tree, treeNode, resolve) {
|
||||||
const params = { pid: tree.id }
|
const params = { pid: tree.id }
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
crudDept.describeDeptList(params).then(res => {
|
crudDept.queryDeptList(params).then(res => {
|
||||||
resolve(res.content)
|
resolve(res.content)
|
||||||
})
|
})
|
||||||
}, 100)
|
}, 100)
|
||||||
@@ -161,7 +161,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
getSupDepts(id) {
|
getSupDepts(id) {
|
||||||
crudDept.describeDeptSuperiorTree(id, true).then(res => {
|
crudDept.queryDeptSuperiorTree(id, true).then(res => {
|
||||||
const data = res.content
|
const data = res.content
|
||||||
this.buildDepts(data)
|
this.buildDepts(data)
|
||||||
this.depts = data
|
this.depts = data
|
||||||
@@ -178,7 +178,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
getDepts() {
|
getDepts() {
|
||||||
crudDept.describeDeptList({ enabled: true }).then(res => {
|
crudDept.queryDeptList({ enabled: true }).then(res => {
|
||||||
this.depts = res.content.map(function(obj) {
|
this.depts = res.content.map(function(obj) {
|
||||||
if (obj.hasChildren) {
|
if (obj.hasChildren) {
|
||||||
obj.children = null
|
obj.children = null
|
||||||
@@ -190,7 +190,7 @@ export default {
|
|||||||
// 获取弹窗内部门数据
|
// 获取弹窗内部门数据
|
||||||
loadDepts({ action, parentNode, callback }) {
|
loadDepts({ action, parentNode, callback }) {
|
||||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||||
crudDept.describeDeptList({ enabled: true, pid: parentNode.id }).then(res => {
|
crudDept.queryDeptList({ enabled: true, pid: parentNode.id }).then(res => {
|
||||||
parentNode.children = res.content.map(function(obj) {
|
parentNode.children = res.content.map(function(obj) {
|
||||||
if (obj.hasChildren) {
|
if (obj.hasChildren) {
|
||||||
obj.children = null
|
obj.children = null
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ export default {
|
|||||||
}, 100)
|
}, 100)
|
||||||
},
|
},
|
||||||
getSupDepts(id) {
|
getSupDepts(id) {
|
||||||
crudMenu.describeMenuSuperior(id).then(res => {
|
crudMenu.queryMenuSuperior(id).then(res => {
|
||||||
const children = res.map(function(obj) {
|
const children = res.map(function(obj) {
|
||||||
if (!obj.leaf && !obj.children) {
|
if (!obj.leaf && !obj.children) {
|
||||||
obj.children = null
|
obj.children = null
|
||||||
|
|||||||
@@ -122,8 +122,8 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import crudRoles from '@/api/system/role'
|
import crudRoles from '@/api/system/role'
|
||||||
import { describeDeptList, describeDeptSuperiorTree } from '@/api/system/dept'
|
import { queryDeptList, queryDeptSuperiorTree } from '@/api/system/dept'
|
||||||
import { describeMenuListByPid, describeChildMenuSet } from '@/api/system/menu'
|
import { queryMenuListByPid, queryChildMenuSet } from '@/api/system/menu'
|
||||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||||
import rrOperation from '@crud/RR.operation'
|
import rrOperation from '@crud/RR.operation'
|
||||||
import crudOperation from '@crud/CRUD.operation'
|
import crudOperation from '@crud/CRUD.operation'
|
||||||
@@ -168,7 +168,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
getMenuDatas(node, resolve) {
|
getMenuDatas(node, resolve) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
describeMenuListByPid(node.data.id ? node.data.id : 0).then(res => {
|
queryMenuListByPid(node.data.id ? node.data.id : 0).then(res => {
|
||||||
resolve(res)
|
resolve(res)
|
||||||
})
|
})
|
||||||
}, 100)
|
}, 100)
|
||||||
@@ -232,7 +232,7 @@ export default {
|
|||||||
},
|
},
|
||||||
menuChange(menu) {
|
menuChange(menu) {
|
||||||
// 获取该节点的所有子节点,id 包含自身
|
// 获取该节点的所有子节点,id 包含自身
|
||||||
describeChildMenuSet(menu.id).then(childIds => {
|
queryChildMenuSet(menu.id).then(childIds => {
|
||||||
// 判断是否在 menuIds 中,如果存在则删除,否则添加
|
// 判断是否在 menuIds 中,如果存在则删除,否则添加
|
||||||
if (this.menuIds.indexOf(menu.id) !== -1) {
|
if (this.menuIds.indexOf(menu.id) !== -1) {
|
||||||
for (let i = 0; i < childIds.length; i++) {
|
for (let i = 0; i < childIds.length; i++) {
|
||||||
@@ -284,7 +284,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 获取部门数据
|
// 获取部门数据
|
||||||
getDepts() {
|
getDepts() {
|
||||||
describeDeptList({ enabled: true }).then(res => {
|
queryDeptList({ enabled: true }).then(res => {
|
||||||
this.depts = res.content.map(function(obj) {
|
this.depts = res.content.map(function(obj) {
|
||||||
if (obj.hasChildren) {
|
if (obj.hasChildren) {
|
||||||
obj.children = null
|
obj.children = null
|
||||||
@@ -298,7 +298,7 @@ export default {
|
|||||||
depts.forEach(dept => {
|
depts.forEach(dept => {
|
||||||
ids.push(dept.id)
|
ids.push(dept.id)
|
||||||
})
|
})
|
||||||
describeDeptSuperiorTree(ids).then(res => {
|
queryDeptSuperiorTree(ids).then(res => {
|
||||||
const date = res.content
|
const date = res.content
|
||||||
this.buildDepts(date)
|
this.buildDepts(date)
|
||||||
this.depts = date
|
this.depts = date
|
||||||
@@ -317,7 +317,7 @@ export default {
|
|||||||
// 获取弹窗内部门数据
|
// 获取弹窗内部门数据
|
||||||
loadDepts({ action, parentNode, callback }) {
|
loadDepts({ action, parentNode, callback }) {
|
||||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||||
describeDeptList({ enabled: true, pid: parentNode.id }).then(res => {
|
queryDeptList({ enabled: true, pid: parentNode.id }).then(res => {
|
||||||
parentNode.children = res.content.map(function(obj) {
|
parentNode.children = res.content.map(function(obj) {
|
||||||
if (obj.hasChildren) {
|
if (obj.hasChildren) {
|
||||||
obj.children = null
|
obj.children = null
|
||||||
|
|||||||
@@ -183,8 +183,8 @@
|
|||||||
<script>
|
<script>
|
||||||
import crudUser from '@/api/system/user'
|
import crudUser from '@/api/system/user'
|
||||||
import { isvalidPhone } from '@/utils/validate'
|
import { isvalidPhone } from '@/utils/validate'
|
||||||
import { describeDeptList, describeDeptSuperiorTree } from '@/api/system/dept'
|
import { queryDeptList, queryDeptSuperiorTree } from '@/api/system/dept'
|
||||||
import { describeRoleList, getLevel } from '@/api/system/role'
|
import { queryRoleList, getLevel } from '@/api/system/role'
|
||||||
import { getAllJob } from '@/api/system/job'
|
import { getAllJob } from '@/api/system/job'
|
||||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||||
import rrOperation from '@crud/RR.operation'
|
import rrOperation from '@crud/RR.operation'
|
||||||
@@ -376,7 +376,7 @@ export default {
|
|||||||
this.crud.toQuery()
|
this.crud.toQuery()
|
||||||
},
|
},
|
||||||
getDepts() {
|
getDepts() {
|
||||||
describeDeptList({ enabled: true }).then(res => {
|
queryDeptList({ enabled: true }).then(res => {
|
||||||
this.depts = res.content.map(function(obj) {
|
this.depts = res.content.map(function(obj) {
|
||||||
if (obj.hasChildren) {
|
if (obj.hasChildren) {
|
||||||
obj.children = null
|
obj.children = null
|
||||||
@@ -386,7 +386,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
getSupDepts(deptId) {
|
getSupDepts(deptId) {
|
||||||
describeDeptSuperiorTree(deptId).then(res => {
|
queryDeptSuperiorTree(deptId).then(res => {
|
||||||
const date = res.content
|
const date = res.content
|
||||||
this.buildDepts(date)
|
this.buildDepts(date)
|
||||||
this.depts = date
|
this.depts = date
|
||||||
@@ -405,7 +405,7 @@ export default {
|
|||||||
// 获取弹窗内部门数据
|
// 获取弹窗内部门数据
|
||||||
loadDepts({ action, parentNode, callback }) {
|
loadDepts({ action, parentNode, callback }) {
|
||||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||||
describeDeptList({ enabled: true, pid: parentNode.id }).then(res => {
|
queryDeptList({ enabled: true, pid: parentNode.id }).then(res => {
|
||||||
parentNode.children = res.content.map(function(obj) {
|
parentNode.children = res.content.map(function(obj) {
|
||||||
if (obj.hasChildren) {
|
if (obj.hasChildren) {
|
||||||
obj.children = null
|
obj.children = null
|
||||||
@@ -436,7 +436,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 获取弹窗内角色数据
|
// 获取弹窗内角色数据
|
||||||
getRoles() {
|
getRoles() {
|
||||||
describeRoleList().then(res => {
|
queryRoleList().then(res => {
|
||||||
this.roles = res
|
this.roles = res
|
||||||
}).catch(() => { })
|
}).catch(() => { })
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { describeEmailConfig, modifyEmailConfig } from '@/api/tools/email'
|
import { queryEmailConfig, modifyEmailConfig } from '@/api/tools/email'
|
||||||
export default {
|
export default {
|
||||||
name: 'Config',
|
name: 'Config',
|
||||||
data() {
|
data() {
|
||||||
@@ -58,7 +58,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {
|
||||||
describeEmailConfig().then(res => {
|
queryEmailConfig().then(res => {
|
||||||
this.form = res
|
this.form = res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { describeQiniuConfig, modifyQiniuConfig } from '@/api/tools/qiniu'
|
import { queryQiniuConfig, modifyQiniuConfig } from '@/api/tools/qiniu'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -63,7 +63,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {
|
||||||
describeQiniuConfig().then(res => {
|
queryQiniuConfig().then(res => {
|
||||||
this.form = res
|
this.form = res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ spring:
|
|||||||
druid:
|
druid:
|
||||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||||
driverClassName: com.p6spy.engine.spy.P6SpyDriver
|
driverClassName: com.p6spy.engine.spy.P6SpyDriver
|
||||||
url: jdbc:p6spy:mysql://127.0.0.1:3306/cutejava?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
|
url: jdbc:p6spy:mysql://127.0.0.1:3306/cutejava?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&allowPublicKeyRetrieval=true
|
||||||
username: root
|
username: root
|
||||||
password: root123456
|
password: root123456
|
||||||
# 初始连接数,建议设置为与最小空闲连接数相同
|
# 初始连接数,建议设置为与最小空闲连接数相同
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ spring:
|
|||||||
druid:
|
druid:
|
||||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||||
driverClassName: com.p6spy.engine.spy.P6SpyDriver
|
driverClassName: com.p6spy.engine.spy.P6SpyDriver
|
||||||
url: jdbc:p6spy:mysql://127.0.0.1:3306/cutejava?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
|
url: jdbc:p6spy:mysql://127.0.0.1:3306/cutejava?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&allowPublicKeyRetrieval=true
|
||||||
username: root
|
username: root
|
||||||
password: root123456
|
password: root123456
|
||||||
# 初始连接数,建议设置为与最小空闲连接数相同
|
# 初始连接数,建议设置为与最小空闲连接数相同
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ spring:
|
|||||||
dataSource:
|
dataSource:
|
||||||
jobStoreDataSource:
|
jobStoreDataSource:
|
||||||
driver: com.mysql.cj.jdbc.Driver
|
driver: com.mysql.cj.jdbc.Driver
|
||||||
URL: jdbc:mysql://127.0.0.1:3306/cutejava?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
|
url: jdbc:p6spy:mysql://127.0.0.1:3306/cutejava?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&allowPublicKeyRetrieval=true
|
||||||
user: root
|
user: root
|
||||||
password: root123456
|
password: root123456
|
||||||
maxConnections: 10
|
maxConnections: 10
|
||||||
|
|||||||
+3
-3
@@ -58,7 +58,7 @@ public class SystemAuthController {
|
|||||||
|
|
||||||
@ApiOperation("登录授权")
|
@ApiOperation("登录授权")
|
||||||
@AnonymousPostMapping(value = "/login")
|
@AnonymousPostMapping(value = "/login")
|
||||||
public ResponseEntity<Object> login(@Validated @RequestBody SystemUserLoginArgs loginRequest, HttpServletRequest request) throws Exception {
|
public ResponseEntity<Map<String, Object>> login(@Validated @RequestBody SystemUserLoginArgs loginRequest, HttpServletRequest request) throws Exception {
|
||||||
// 密码解密
|
// 密码解密
|
||||||
String password = RsaEncryptUtil.decryptByPrivateKey(properties.getRsa().getPrivateKey(), loginRequest.getPassword());
|
String password = RsaEncryptUtil.decryptByPrivateKey(properties.getRsa().getPrivateKey(), loginRequest.getPassword());
|
||||||
// 查询验证码
|
// 查询验证码
|
||||||
@@ -106,7 +106,7 @@ public class SystemAuthController {
|
|||||||
|
|
||||||
@ApiOperation("获取验证码")
|
@ApiOperation("获取验证码")
|
||||||
@AnonymousPostMapping(value = "/code")
|
@AnonymousPostMapping(value = "/code")
|
||||||
public ResponseEntity<Object> getCode() {
|
public ResponseEntity<Map<String, Object>> getCode() {
|
||||||
// 获取运算的结果
|
// 获取运算的结果
|
||||||
Captcha captcha = properties.getLogin().getCaptchaSetting().getCaptcha();
|
Captcha captcha = properties.getLogin().getCaptchaSetting().getCaptcha();
|
||||||
String uuid = SystemRedisKey.CAPTCHA_LOGIN + IdUtil.simpleUUID();
|
String uuid = SystemRedisKey.CAPTCHA_LOGIN + IdUtil.simpleUUID();
|
||||||
@@ -127,7 +127,7 @@ public class SystemAuthController {
|
|||||||
|
|
||||||
@ApiOperation("退出登录")
|
@ApiOperation("退出登录")
|
||||||
@AnonymousPostMapping(value = "/logout")
|
@AnonymousPostMapping(value = "/logout")
|
||||||
public ResponseEntity<Object> logout(HttpServletRequest request) {
|
public ResponseEntity<Void> logout(HttpServletRequest request) {
|
||||||
String token = tokenProvider.getToken(request);
|
String token = tokenProvider.getToken(request);
|
||||||
onlineUserService.logoutByToken(token);
|
onlineUserService.logoutByToken(token);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
|||||||
+3
-3
@@ -30,21 +30,21 @@ public class SystemCaptchaController {
|
|||||||
*/
|
*/
|
||||||
@ApiOperation("重置邮箱,发送验证码")
|
@ApiOperation("重置邮箱,发送验证码")
|
||||||
@PostMapping(value = "/sendResetEmailCaptcha")
|
@PostMapping(value = "/sendResetEmailCaptcha")
|
||||||
public ResponseEntity<Object> sendResetEmailCaptcha(@RequestParam String email) {
|
public ResponseEntity<Void> sendResetEmailCaptcha(@RequestParam String email) {
|
||||||
emailService.sendEmail(captchaService.renderCodeTemplate(email, SystemCaptchaBizEnum.EMAIL_RESET_EMAIL_CODE.getRedisKey()));
|
emailService.sendEmail(captchaService.renderCodeTemplate(email, SystemCaptchaBizEnum.EMAIL_RESET_EMAIL_CODE.getRedisKey()));
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("重置密码,发送验证码")
|
@ApiOperation("重置密码,发送验证码")
|
||||||
@PostMapping(value = "/sendResetPasswordCaptcha")
|
@PostMapping(value = "/sendResetPasswordCaptcha")
|
||||||
public ResponseEntity<Object> sendResetPasswordCaptcha(@RequestParam String email) {
|
public ResponseEntity<Void> sendResetPasswordCaptcha(@RequestParam String email) {
|
||||||
emailService.sendEmail(captchaService.renderCodeTemplate(email, SystemCaptchaBizEnum.EMAIL_RESET_PWD_CODE.getRedisKey()));
|
emailService.sendEmail(captchaService.renderCodeTemplate(email, SystemCaptchaBizEnum.EMAIL_RESET_PWD_CODE.getRedisKey()));
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("验证码验证")
|
@ApiOperation("验证码验证")
|
||||||
@PostMapping(value = "/checkCodeAvailable")
|
@PostMapping(value = "/checkCodeAvailable")
|
||||||
public ResponseEntity<Object> checkCodeAvailable(@RequestParam String email, @RequestParam String code, @RequestParam String codeBi) {
|
public ResponseEntity<Void> checkCodeAvailable(@RequestParam String email, @RequestParam String code, @RequestParam String codeBi) {
|
||||||
SystemCaptchaBizEnum biEnum = SystemCaptchaBizEnum.getByBizCode(codeBi);
|
SystemCaptchaBizEnum biEnum = SystemCaptchaBizEnum.getByBizCode(codeBi);
|
||||||
switch (Objects.requireNonNull(biEnum)) {
|
switch (Objects.requireNonNull(biEnum)) {
|
||||||
case EMAIL_RESET_EMAIL_CODE:
|
case EMAIL_RESET_EMAIL_CODE:
|
||||||
|
|||||||
+6
-4
@@ -44,10 +44,12 @@ public class SystemDeptController {
|
|||||||
@ApiOperation("查询部门:根据ID获取同级与上级数据")
|
@ApiOperation("查询部门:根据ID获取同级与上级数据")
|
||||||
@PostMapping("/queryDeptSuperiorTree")
|
@PostMapping("/queryDeptSuperiorTree")
|
||||||
@PreAuthorize("@el.check('user:list','dept:list')")
|
@PreAuthorize("@el.check('user:list','dept:list')")
|
||||||
public ResponseEntity<Object> queryDeptSuperiorTree(@RequestBody List<Long> ids, @RequestParam(defaultValue = "false") Boolean exclude) {
|
public ResponseEntity<CsResultVo<Set<SystemDeptTb>>> queryDeptSuperiorTree(@RequestBody List<Long> ids, @RequestParam(defaultValue = "false") Boolean exclude) {
|
||||||
Set<SystemDeptTb> deptSet = new LinkedHashSet<>();
|
Set<SystemDeptTb> deptSet = new LinkedHashSet<>();
|
||||||
for (Long id : ids) {
|
for (Long id : ids) {
|
||||||
|
// 同级数据
|
||||||
SystemDeptTb dept = systemDeptService.queryDeptById(id);
|
SystemDeptTb dept = systemDeptService.queryDeptById(id);
|
||||||
|
// 上级数据
|
||||||
List<SystemDeptTb> depts = systemDeptService.querySuperiorDeptListByPid(dept, new ArrayList<>());
|
List<SystemDeptTb> depts = systemDeptService.querySuperiorDeptListByPid(dept, new ArrayList<>());
|
||||||
if (exclude) {
|
if (exclude) {
|
||||||
for (SystemDeptTb data : depts) {
|
for (SystemDeptTb data : depts) {
|
||||||
@@ -66,7 +68,7 @@ public class SystemDeptController {
|
|||||||
@ApiOperation("新增部门")
|
@ApiOperation("新增部门")
|
||||||
@PostMapping(value = "/saveDept")
|
@PostMapping(value = "/saveDept")
|
||||||
@PreAuthorize("@el.check('dept:add')")
|
@PreAuthorize("@el.check('dept:add')")
|
||||||
public ResponseEntity<Object> saveDept(@Validated @RequestBody CreateSystemDeptArgs resources) {
|
public ResponseEntity<Void> saveDept(@Validated @RequestBody CreateSystemDeptArgs resources) {
|
||||||
systemDeptService.saveDept(resources);
|
systemDeptService.saveDept(resources);
|
||||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||||
}
|
}
|
||||||
@@ -74,7 +76,7 @@ public class SystemDeptController {
|
|||||||
@ApiOperation("修改部门")
|
@ApiOperation("修改部门")
|
||||||
@PostMapping(value = "/modifyDept")
|
@PostMapping(value = "/modifyDept")
|
||||||
@PreAuthorize("@el.check('dept:edit')")
|
@PreAuthorize("@el.check('dept:edit')")
|
||||||
public ResponseEntity<Object> modifyDept(@Validated(SystemDeptTb.Update.class) @RequestBody SystemDeptTb resources) {
|
public ResponseEntity<Void> modifyDept(@Validated(SystemDeptTb.Update.class) @RequestBody SystemDeptTb resources) {
|
||||||
systemDeptService.modifyDept(resources);
|
systemDeptService.modifyDept(resources);
|
||||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
@@ -82,7 +84,7 @@ public class SystemDeptController {
|
|||||||
@ApiOperation("删除部门")
|
@ApiOperation("删除部门")
|
||||||
@PostMapping(value = "/removeDeptByIds")
|
@PostMapping(value = "/removeDeptByIds")
|
||||||
@PreAuthorize("@el.check('dept:del')")
|
@PreAuthorize("@el.check('dept:del')")
|
||||||
public ResponseEntity<Object> removeDeptByIds(@RequestBody Set<Long> ids) {
|
public ResponseEntity<Void> removeDeptByIds(@RequestBody Set<Long> ids) {
|
||||||
// 获取部门,和其所有子部门
|
// 获取部门,和其所有子部门
|
||||||
Set<SystemDeptTb> depts = systemDeptService.traverseDeptByIdWithPids(ids);
|
Set<SystemDeptTb> depts = systemDeptService.traverseDeptByIdWithPids(ids);
|
||||||
// 验证是否被角色或用户关联
|
// 验证是否被角色或用户关联
|
||||||
|
|||||||
+3
-3
@@ -52,7 +52,7 @@ public class SystemDictController {
|
|||||||
@ApiOperation("新增字典")
|
@ApiOperation("新增字典")
|
||||||
@PostMapping(value = "/saveDict")
|
@PostMapping(value = "/saveDict")
|
||||||
@PreAuthorize("@el.check('dict:add')")
|
@PreAuthorize("@el.check('dict:add')")
|
||||||
public ResponseEntity<Object> saveDict(@Validated @RequestBody CreateSystemDictArgs resources) {
|
public ResponseEntity<Void> saveDict(@Validated @RequestBody CreateSystemDictArgs resources) {
|
||||||
systemDictService.saveDict(resources);
|
systemDictService.saveDict(resources);
|
||||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||||
}
|
}
|
||||||
@@ -60,7 +60,7 @@ public class SystemDictController {
|
|||||||
@ApiOperation("修改字典")
|
@ApiOperation("修改字典")
|
||||||
@PostMapping(value = "/modifyDictById")
|
@PostMapping(value = "/modifyDictById")
|
||||||
@PreAuthorize("@el.check('dict:edit')")
|
@PreAuthorize("@el.check('dict:edit')")
|
||||||
public ResponseEntity<Object> modifyDictById(@Validated(SystemDictTb.Update.class) @RequestBody SystemDictTb resources) {
|
public ResponseEntity<Void> modifyDictById(@Validated(SystemDictTb.Update.class) @RequestBody SystemDictTb resources) {
|
||||||
systemDictService.modifyDictById(resources);
|
systemDictService.modifyDictById(resources);
|
||||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
@@ -68,7 +68,7 @@ public class SystemDictController {
|
|||||||
@ApiOperation("删除字典")
|
@ApiOperation("删除字典")
|
||||||
@PostMapping(value = "/removeDictByIds")
|
@PostMapping(value = "/removeDictByIds")
|
||||||
@PreAuthorize("@el.check('dict:del')")
|
@PreAuthorize("@el.check('dict:del')")
|
||||||
public ResponseEntity<Object> removeDictByIds(@RequestBody Set<Long> ids) {
|
public ResponseEntity<Void> removeDictByIds(@RequestBody Set<Long> ids) {
|
||||||
systemDictService.removeDictByIds(ids);
|
systemDictService.removeDictByIds(ids);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -35,7 +35,7 @@ public class SystemDictDetailController {
|
|||||||
|
|
||||||
@ApiOperation("查询多个字典详情")
|
@ApiOperation("查询多个字典详情")
|
||||||
@GetMapping(value = "/getDictDetailMaps")
|
@GetMapping(value = "/getDictDetailMaps")
|
||||||
public ResponseEntity<Object> getDictDetailMaps(@RequestParam String dictName) {
|
public ResponseEntity<Map<String, List<SystemDictDetailTb>>> getDictDetailMaps(@RequestParam String dictName) {
|
||||||
String[] names = dictName.split("[,,]");
|
String[] names = dictName.split("[,,]");
|
||||||
Map<String, List<SystemDictDetailTb>> dictMap = new HashMap<>(16);
|
Map<String, List<SystemDictDetailTb>> dictMap = new HashMap<>(16);
|
||||||
for (String name : names) {
|
for (String name : names) {
|
||||||
@@ -47,7 +47,7 @@ public class SystemDictDetailController {
|
|||||||
@ApiOperation("新增字典详情")
|
@ApiOperation("新增字典详情")
|
||||||
@PostMapping(value = "/saveDictDetail")
|
@PostMapping(value = "/saveDictDetail")
|
||||||
@PreAuthorize("@el.check('dict:add')")
|
@PreAuthorize("@el.check('dict:add')")
|
||||||
public ResponseEntity<Object> saveDictDetail(@Validated @RequestBody CreateSystemDictDetailArgs resources) {
|
public ResponseEntity<Void> saveDictDetail(@Validated @RequestBody CreateSystemDictDetailArgs resources) {
|
||||||
systemDictDetailService.saveDictDetail(resources);
|
systemDictDetailService.saveDictDetail(resources);
|
||||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||||
}
|
}
|
||||||
@@ -55,7 +55,7 @@ public class SystemDictDetailController {
|
|||||||
@ApiOperation("修改字典详情")
|
@ApiOperation("修改字典详情")
|
||||||
@PostMapping(value = "/modifyDictDetailById")
|
@PostMapping(value = "/modifyDictDetailById")
|
||||||
@PreAuthorize("@el.check('dict:edit')")
|
@PreAuthorize("@el.check('dict:edit')")
|
||||||
public ResponseEntity<Object> modifyDictDetailById(@Validated(SystemDictDetailTb.Update.class) @RequestBody SystemDictDetailTb resources) {
|
public ResponseEntity<Void> modifyDictDetailById(@Validated(SystemDictDetailTb.Update.class) @RequestBody SystemDictDetailTb resources) {
|
||||||
systemDictDetailService.modifyDictDetailById(resources);
|
systemDictDetailService.modifyDictDetailById(resources);
|
||||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
@@ -63,7 +63,7 @@ public class SystemDictDetailController {
|
|||||||
@ApiOperation("删除字典详情")
|
@ApiOperation("删除字典详情")
|
||||||
@PostMapping(value = "/removeDictDetailById")
|
@PostMapping(value = "/removeDictDetailById")
|
||||||
@PreAuthorize("@el.check('dict:del')")
|
@PreAuthorize("@el.check('dict:del')")
|
||||||
public ResponseEntity<Object> removeDictDetailById(@RequestBody SystemDictDetailTb args) {
|
public ResponseEntity<Void> removeDictDetailById(@RequestBody SystemDictDetailTb args) {
|
||||||
systemDictDetailService.removeDictDetailById(args.getId());
|
systemDictDetailService.removeDictDetailById(args.getId());
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -32,14 +32,14 @@ public class SystemEmailController {
|
|||||||
|
|
||||||
@ApiOperation("配置邮件")
|
@ApiOperation("配置邮件")
|
||||||
@PostMapping(value = "/modifyEmailConfig")
|
@PostMapping(value = "/modifyEmailConfig")
|
||||||
public ResponseEntity<Object> modifyEmailConfig(@Validated @RequestBody SystemEmailConfigTb emailConfig) throws Exception {
|
public ResponseEntity<Void> modifyEmailConfig(@Validated @RequestBody SystemEmailConfigTb emailConfig) throws Exception {
|
||||||
systemEmailService.modifyEmailConfigOnPassChange(emailConfig);
|
systemEmailService.modifyEmailConfigOnPassChange(emailConfig);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("发送邮件")
|
@ApiOperation("发送邮件")
|
||||||
@PostMapping(value = "/sendEmail")
|
@PostMapping(value = "/sendEmail")
|
||||||
public ResponseEntity<Object> sendEmail(@Validated @RequestBody SendSystemEmailArgs sendEmailRequest) {
|
public ResponseEntity<Void> sendEmail(@Validated @RequestBody SendSystemEmailArgs sendEmailRequest) {
|
||||||
systemEmailService.sendEmail(sendEmailRequest);
|
systemEmailService.sendEmail(sendEmailRequest);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -46,7 +46,7 @@ public class SystemJobController {
|
|||||||
@ApiOperation("新增岗位")
|
@ApiOperation("新增岗位")
|
||||||
@PostMapping(value = "/saveJob")
|
@PostMapping(value = "/saveJob")
|
||||||
@PreAuthorize("@el.check('job:add')")
|
@PreAuthorize("@el.check('job:add')")
|
||||||
public ResponseEntity<Object> saveJob(@Validated @RequestBody CreateSystemJobArgs resources) {
|
public ResponseEntity<Void> saveJob(@Validated @RequestBody CreateSystemJobArgs resources) {
|
||||||
systemJobService.saveJob(resources);
|
systemJobService.saveJob(resources);
|
||||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||||
}
|
}
|
||||||
@@ -54,7 +54,7 @@ public class SystemJobController {
|
|||||||
@ApiOperation("修改岗位")
|
@ApiOperation("修改岗位")
|
||||||
@PostMapping(value = "/modifyJobById")
|
@PostMapping(value = "/modifyJobById")
|
||||||
@PreAuthorize("@el.check('job:edit')")
|
@PreAuthorize("@el.check('job:edit')")
|
||||||
public ResponseEntity<Object> modifyJobById(@Validated(SystemJobTb.Update.class) @RequestBody SystemJobTb resources) {
|
public ResponseEntity<Void> modifyJobById(@Validated(SystemJobTb.Update.class) @RequestBody SystemJobTb resources) {
|
||||||
systemJobService.modifyJobById(resources);
|
systemJobService.modifyJobById(resources);
|
||||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
@@ -62,7 +62,7 @@ public class SystemJobController {
|
|||||||
@ApiOperation("删除岗位")
|
@ApiOperation("删除岗位")
|
||||||
@PostMapping(value = "/removeJobByIds")
|
@PostMapping(value = "/removeJobByIds")
|
||||||
@PreAuthorize("@el.check('job:del')")
|
@PreAuthorize("@el.check('job:del')")
|
||||||
public ResponseEntity<Object> removeJobByIds(@RequestBody Set<Long> ids) {
|
public ResponseEntity<Void> removeJobByIds(@RequestBody Set<Long> ids) {
|
||||||
// 验证是否被用户关联
|
// 验证是否被用户关联
|
||||||
systemJobService.verifyBindRelationByIds(ids);
|
systemJobService.verifyBindRelationByIds(ids);
|
||||||
systemJobService.removeJobByIds(ids);
|
systemJobService.removeJobByIds(ids);
|
||||||
|
|||||||
+3
-3
@@ -47,7 +47,7 @@ public class SystemLocalStorageController {
|
|||||||
@ApiOperation("上传文件")
|
@ApiOperation("上传文件")
|
||||||
@PostMapping(value = "/uploadFile")
|
@PostMapping(value = "/uploadFile")
|
||||||
@PreAuthorize("@el.check('storage:add')")
|
@PreAuthorize("@el.check('storage:add')")
|
||||||
public ResponseEntity<Object> uploadFile(@RequestParam String name, @RequestParam("file") MultipartFile file) {
|
public ResponseEntity<Void> uploadFile(@RequestParam String name, @RequestParam("file") MultipartFile file) {
|
||||||
localStorageService.uploadFile(name, file);
|
localStorageService.uploadFile(name, file);
|
||||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||||
}
|
}
|
||||||
@@ -67,14 +67,14 @@ public class SystemLocalStorageController {
|
|||||||
@ApiOperation("修改文件")
|
@ApiOperation("修改文件")
|
||||||
@PostMapping(value = "/modifyLocalStorageById")
|
@PostMapping(value = "/modifyLocalStorageById")
|
||||||
@PreAuthorize("@el.check('storage:edit')")
|
@PreAuthorize("@el.check('storage:edit')")
|
||||||
public ResponseEntity<Object> modifyLocalStorageById(@Validated @RequestBody SystemLocalStorageTb resources) {
|
public ResponseEntity<Void> modifyLocalStorageById(@Validated @RequestBody SystemLocalStorageTb resources) {
|
||||||
localStorageService.modifyLocalStorageById(resources);
|
localStorageService.modifyLocalStorageById(resources);
|
||||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("多选删除")
|
@ApiOperation("多选删除")
|
||||||
@PostMapping(value = "/removeFileByIds")
|
@PostMapping(value = "/removeFileByIds")
|
||||||
public ResponseEntity<Object> deleteFileByIds(@RequestBody Long[] ids) {
|
public ResponseEntity<Void> deleteFileByIds(@RequestBody Long[] ids) {
|
||||||
localStorageService.removeFileByIds(ids);
|
localStorageService.removeFileByIds(ids);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -56,7 +56,7 @@ public class SystemMenuController {
|
|||||||
@ApiOperation("根据菜单ID返回所有子节点ID,包含自身ID")
|
@ApiOperation("根据菜单ID返回所有子节点ID,包含自身ID")
|
||||||
@PostMapping(value = "/queryChildMenuSet")
|
@PostMapping(value = "/queryChildMenuSet")
|
||||||
@PreAuthorize("@el.check('menu:list','roles:list')")
|
@PreAuthorize("@el.check('menu:list','roles:list')")
|
||||||
public ResponseEntity<Object> queryChildMenuSet(@RequestParam Long id) {
|
public ResponseEntity<Set<Long>> queryChildMenuSet(@RequestParam Long id) {
|
||||||
Set<SystemMenuTb> menuSet = new HashSet<>();
|
Set<SystemMenuTb> menuSet = new HashSet<>();
|
||||||
List<SystemMenuTb> menuList = systemMenuService.queryMenuListByPid(id);
|
List<SystemMenuTb> menuList = systemMenuService.queryMenuListByPid(id);
|
||||||
menuSet.add(systemMenuService.queryMenuById(id));
|
menuSet.add(systemMenuService.queryMenuById(id));
|
||||||
@@ -99,7 +99,7 @@ public class SystemMenuController {
|
|||||||
@ApiOperation("新增菜单")
|
@ApiOperation("新增菜单")
|
||||||
@PostMapping(value = "/saveMenu")
|
@PostMapping(value = "/saveMenu")
|
||||||
@PreAuthorize("@el.check('menu:add')")
|
@PreAuthorize("@el.check('menu:add')")
|
||||||
public ResponseEntity<Object> saveMenu(@Validated @RequestBody SystemMenuTb resources) {
|
public ResponseEntity<Void> saveMenu(@Validated @RequestBody SystemMenuTb resources) {
|
||||||
if (resources.getId() != null) {
|
if (resources.getId() != null) {
|
||||||
throw new BadRequestException("A new " + ENTITY_NAME + " cannot already have an ID");
|
throw new BadRequestException("A new " + ENTITY_NAME + " cannot already have an ID");
|
||||||
}
|
}
|
||||||
@@ -110,7 +110,7 @@ public class SystemMenuController {
|
|||||||
@ApiOperation("修改菜单")
|
@ApiOperation("修改菜单")
|
||||||
@PostMapping(value = "/modifyMenuById")
|
@PostMapping(value = "/modifyMenuById")
|
||||||
@PreAuthorize("@el.check('menu:edit')")
|
@PreAuthorize("@el.check('menu:edit')")
|
||||||
public ResponseEntity<Object> modifyMenuById(@Validated(SystemMenuTb.Update.class) @RequestBody SystemMenuTb resources) {
|
public ResponseEntity<Void> modifyMenuById(@Validated(SystemMenuTb.Update.class) @RequestBody SystemMenuTb resources) {
|
||||||
systemMenuService.modifyMenuById(resources);
|
systemMenuService.modifyMenuById(resources);
|
||||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
@@ -118,7 +118,7 @@ public class SystemMenuController {
|
|||||||
@ApiOperation("删除菜单")
|
@ApiOperation("删除菜单")
|
||||||
@PostMapping(value = "/removeMenuByIds")
|
@PostMapping(value = "/removeMenuByIds")
|
||||||
@PreAuthorize("@el.check('menu:del')")
|
@PreAuthorize("@el.check('menu:del')")
|
||||||
public ResponseEntity<Object> removeMenuByIds(@RequestBody Set<Long> ids) {
|
public ResponseEntity<Void> removeMenuByIds(@RequestBody Set<Long> ids) {
|
||||||
Set<SystemMenuTb> menuSet = new HashSet<>();
|
Set<SystemMenuTb> menuSet = new HashSet<>();
|
||||||
for (Long id : ids) {
|
for (Long id : ids) {
|
||||||
List<SystemMenuTb> menuList = systemMenuService.queryMenuListByPid(id);
|
List<SystemMenuTb> menuList = systemMenuService.queryMenuListByPid(id);
|
||||||
|
|||||||
+2
-1
@@ -10,6 +10,7 @@ import org.springframework.security.access.prepost.PreAuthorize;
|
|||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@@ -22,7 +23,7 @@ public class SystemMonitorController {
|
|||||||
@PostMapping(value = "/queryServerMonitorInfo")
|
@PostMapping(value = "/queryServerMonitorInfo")
|
||||||
@ApiOperation("查询服务监控")
|
@ApiOperation("查询服务监控")
|
||||||
@PreAuthorize("@el.check('monitor:list')")
|
@PreAuthorize("@el.check('monitor:list')")
|
||||||
public ResponseEntity<Object> queryServerMonitorInfo() {
|
public ResponseEntity<Map<String, Object>> queryServerMonitorInfo() {
|
||||||
return new ResponseEntity<>(serverService.queryServerMonitorInfo(), HttpStatus.OK);
|
return new ResponseEntity<>(serverService.queryServerMonitorInfo(), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -45,7 +45,7 @@ public class SystemOnlineController {
|
|||||||
@ApiOperation("踢出用户")
|
@ApiOperation("踢出用户")
|
||||||
@PostMapping(value = "/kickOutUser")
|
@PostMapping(value = "/kickOutUser")
|
||||||
@PreAuthorize("@el.check()")
|
@PreAuthorize("@el.check()")
|
||||||
public ResponseEntity<Object> kickOutUser(@RequestBody Set<String> keys) throws Exception {
|
public ResponseEntity<Void> kickOutUser(@RequestBody Set<String> keys) throws Exception {
|
||||||
for (String token : keys) {
|
for (String token : keys) {
|
||||||
// 解密Key
|
// 解密Key
|
||||||
token = DesEncryptUtil.desDecrypt(token);
|
token = DesEncryptUtil.desDecrypt(token);
|
||||||
|
|||||||
+6
-6
@@ -43,7 +43,7 @@ public class SystemQiniuController {
|
|||||||
|
|
||||||
@ApiOperation("配置七牛云存储")
|
@ApiOperation("配置七牛云存储")
|
||||||
@PostMapping(value = "/modifyQiniuConfig")
|
@PostMapping(value = "/modifyQiniuConfig")
|
||||||
public ResponseEntity<Object> modifyQiniuConfig(@Validated @RequestBody SystemQiniuConfigTb qiniuConfig) {
|
public ResponseEntity<Void> modifyQiniuConfig(@Validated @RequestBody SystemQiniuConfigTb qiniuConfig) {
|
||||||
qiNiuConfigService.saveQiniuConfig(qiniuConfig);
|
qiNiuConfigService.saveQiniuConfig(qiniuConfig);
|
||||||
qiNiuConfigService.modifyQiniuConfigType(qiniuConfig.getType());
|
qiNiuConfigService.modifyQiniuConfigType(qiniuConfig.getType());
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
@@ -64,7 +64,7 @@ public class SystemQiniuController {
|
|||||||
|
|
||||||
@ApiOperation("上传文件")
|
@ApiOperation("上传文件")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public ResponseEntity<Object> uploadQiNiu(@RequestParam MultipartFile file) {
|
public ResponseEntity<Map<String, Object>> uploadQiNiu(@RequestParam MultipartFile file) {
|
||||||
SystemQiniuContentTb qiniuContent = qiniuContentService.uploadFile(file);
|
SystemQiniuContentTb qiniuContent = qiniuContentService.uploadFile(file);
|
||||||
Map<String, Object> map = new HashMap<>(3);
|
Map<String, Object> map = new HashMap<>(3);
|
||||||
map.put("id", qiniuContent.getId());
|
map.put("id", qiniuContent.getId());
|
||||||
@@ -75,14 +75,14 @@ public class SystemQiniuController {
|
|||||||
|
|
||||||
@ApiOperation("同步七牛云数据")
|
@ApiOperation("同步七牛云数据")
|
||||||
@PostMapping(value = "/synchronize")
|
@PostMapping(value = "/synchronize")
|
||||||
public ResponseEntity<Object> synchronizeQiNiu() {
|
public ResponseEntity<Void> synchronizeQiNiu() {
|
||||||
qiniuContentService.synchronize();
|
qiniuContentService.synchronize();
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("下载文件")
|
@ApiOperation("下载文件")
|
||||||
@GetMapping(value = "/createFilePreviewUrl/{id}")
|
@GetMapping(value = "/createFilePreviewUrl/{id}")
|
||||||
public ResponseEntity<Object> createFilePreviewUrl(@PathVariable Long id) {
|
public ResponseEntity<Map<String, Object>> createFilePreviewUrl(@PathVariable Long id) {
|
||||||
Map<String, Object> map = new HashMap<>(1);
|
Map<String, Object> map = new HashMap<>(1);
|
||||||
map.put("url", qiniuContentService.createFilePreviewUrl(qiniuContentService.getById(id)));
|
map.put("url", qiniuContentService.createFilePreviewUrl(qiniuContentService.getById(id)));
|
||||||
return new ResponseEntity<>(map, HttpStatus.OK);
|
return new ResponseEntity<>(map, HttpStatus.OK);
|
||||||
@@ -90,14 +90,14 @@ public class SystemQiniuController {
|
|||||||
|
|
||||||
@ApiOperation("删除文件")
|
@ApiOperation("删除文件")
|
||||||
@DeleteMapping(value = "/{id}")
|
@DeleteMapping(value = "/{id}")
|
||||||
public ResponseEntity<Object> deleteQiNiu(@PathVariable Long id) {
|
public ResponseEntity<Void> deleteQiNiu(@PathVariable Long id) {
|
||||||
qiniuContentService.removeFileById(id);
|
qiniuContentService.removeFileById(id);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("删除多张图片")
|
@ApiOperation("删除多张图片")
|
||||||
@DeleteMapping
|
@DeleteMapping
|
||||||
public ResponseEntity<Object> deleteAllQiNiu(@RequestBody Long[] ids) {
|
public ResponseEntity<Void> deleteAllQiNiu(@RequestBody Long[] ids) {
|
||||||
qiniuContentService.removeFileByIds(ids);
|
qiniuContentService.removeFileByIds(ids);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-5
@@ -67,7 +67,7 @@ public class SystemQuartzJobController {
|
|||||||
@ApiOperation("新增定时任务")
|
@ApiOperation("新增定时任务")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
@PreAuthorize("@el.check('timing:add')")
|
@PreAuthorize("@el.check('timing:add')")
|
||||||
public ResponseEntity<Object> createQuartzJob(@Validated @RequestBody SystemQuartzJobTb resources) {
|
public ResponseEntity<Void> createQuartzJob(@Validated @RequestBody SystemQuartzJobTb resources) {
|
||||||
if (resources.getId() != null) {
|
if (resources.getId() != null) {
|
||||||
throw new BadRequestException("A new " + ENTITY_NAME + " cannot already have an ID");
|
throw new BadRequestException("A new " + ENTITY_NAME + " cannot already have an ID");
|
||||||
}
|
}
|
||||||
@@ -80,7 +80,7 @@ public class SystemQuartzJobController {
|
|||||||
@ApiOperation("修改定时任务")
|
@ApiOperation("修改定时任务")
|
||||||
@PutMapping
|
@PutMapping
|
||||||
@PreAuthorize("@el.check('timing:edit')")
|
@PreAuthorize("@el.check('timing:edit')")
|
||||||
public ResponseEntity<Object> updateQuartzJob(@Validated(SystemQuartzJobTb.Update.class) @RequestBody UpdateSystemQuartzJobArgs resources) {
|
public ResponseEntity<Void> updateQuartzJob(@Validated(SystemQuartzJobTb.Update.class) @RequestBody UpdateSystemQuartzJobArgs resources) {
|
||||||
// 验证Bean是不是合法的,合法的定时任务 Bean 需要用 @Service 定义
|
// 验证Bean是不是合法的,合法的定时任务 Bean 需要用 @Service 定义
|
||||||
checkBean(resources.getBeanName());
|
checkBean(resources.getBeanName());
|
||||||
systemQuartzJobService.modifyQuartzJobResumeCron(resources);
|
systemQuartzJobService.modifyQuartzJobResumeCron(resources);
|
||||||
@@ -90,7 +90,7 @@ public class SystemQuartzJobController {
|
|||||||
@ApiOperation("更改定时任务状态")
|
@ApiOperation("更改定时任务状态")
|
||||||
@PostMapping(value = "/switchQuartzJobStatus/{id}")
|
@PostMapping(value = "/switchQuartzJobStatus/{id}")
|
||||||
@PreAuthorize("@el.check('timing:edit')")
|
@PreAuthorize("@el.check('timing:edit')")
|
||||||
public ResponseEntity<Object> switchQuartzJobStatus(@PathVariable Long id) {
|
public ResponseEntity<Void> switchQuartzJobStatus(@PathVariable Long id) {
|
||||||
systemQuartzJobService.switchQuartzJobStatus(systemQuartzJobService.getById(id));
|
systemQuartzJobService.switchQuartzJobStatus(systemQuartzJobService.getById(id));
|
||||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
@@ -98,7 +98,7 @@ public class SystemQuartzJobController {
|
|||||||
@ApiOperation("执行定时任务")
|
@ApiOperation("执行定时任务")
|
||||||
@PostMapping(value = "/startQuartzJob/{id}")
|
@PostMapping(value = "/startQuartzJob/{id}")
|
||||||
@PreAuthorize("@el.check('timing:edit')")
|
@PreAuthorize("@el.check('timing:edit')")
|
||||||
public ResponseEntity<Object> startQuartzJob(@PathVariable Long id) {
|
public ResponseEntity<Void> startQuartzJob(@PathVariable Long id) {
|
||||||
systemQuartzJobService.startQuartzJob(systemQuartzJobService.getById(id));
|
systemQuartzJobService.startQuartzJob(systemQuartzJobService.getById(id));
|
||||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
@@ -106,7 +106,7 @@ public class SystemQuartzJobController {
|
|||||||
@ApiOperation("删除定时任务")
|
@ApiOperation("删除定时任务")
|
||||||
@DeleteMapping
|
@DeleteMapping
|
||||||
@PreAuthorize("@el.check('timing:del')")
|
@PreAuthorize("@el.check('timing:del')")
|
||||||
public ResponseEntity<Object> removeJobByIds(@RequestBody Set<Long> ids) {
|
public ResponseEntity<Void> removeJobByIds(@RequestBody Set<Long> ids) {
|
||||||
systemQuartzJobService.removeJobByIds(ids);
|
systemQuartzJobService.removeJobByIds(ids);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-9
@@ -3,10 +3,10 @@ package cn.odboy.core.controller.system;
|
|||||||
import cn.hutool.core.lang.Dict;
|
import cn.hutool.core.lang.Dict;
|
||||||
import cn.odboy.base.CsResultVo;
|
import cn.odboy.base.CsResultVo;
|
||||||
import cn.odboy.core.dal.dataobject.system.SystemRoleTb;
|
import cn.odboy.core.dal.dataobject.system.SystemRoleTb;
|
||||||
import cn.odboy.core.framework.permission.core.SecurityHelper;
|
|
||||||
import cn.odboy.core.service.system.SystemRoleService;
|
|
||||||
import cn.odboy.core.dal.model.system.CreateSystemRoleArgs;
|
import cn.odboy.core.dal.model.system.CreateSystemRoleArgs;
|
||||||
import cn.odboy.core.dal.model.system.QuerySystemRoleArgs;
|
import cn.odboy.core.dal.model.system.QuerySystemRoleArgs;
|
||||||
|
import cn.odboy.core.framework.permission.core.SecurityHelper;
|
||||||
|
import cn.odboy.core.service.system.SystemRoleService;
|
||||||
import cn.odboy.exception.BadRequestException;
|
import cn.odboy.exception.BadRequestException;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
@@ -16,8 +16,11 @@ import org.springframework.http.HttpStatus;
|
|||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@@ -64,14 +67,14 @@ public class SystemRoleController {
|
|||||||
|
|
||||||
@ApiOperation("获取用户级别")
|
@ApiOperation("获取用户级别")
|
||||||
@PostMapping(value = "/queryRoleLevel")
|
@PostMapping(value = "/queryRoleLevel")
|
||||||
public ResponseEntity<Object> queryRoleLevel() {
|
public ResponseEntity<Dict> queryRoleLevel() {
|
||||||
return new ResponseEntity<>(Dict.create().set("level", checkRoleLevels(null)), HttpStatus.OK);
|
return new ResponseEntity<>(Dict.create().set("level", checkRoleLevels(null)), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("新增角色")
|
@ApiOperation("新增角色")
|
||||||
@PostMapping(value = "/saveRole")
|
@PostMapping(value = "/saveRole")
|
||||||
@PreAuthorize("@el.check('roles:add')")
|
@PreAuthorize("@el.check('roles:add')")
|
||||||
public ResponseEntity<Object> saveRole(@Validated @RequestBody CreateSystemRoleArgs resources) {
|
public ResponseEntity<Void> saveRole(@Validated @RequestBody CreateSystemRoleArgs resources) {
|
||||||
checkRoleLevels(resources.getLevel());
|
checkRoleLevels(resources.getLevel());
|
||||||
systemRoleService.saveRole(resources);
|
systemRoleService.saveRole(resources);
|
||||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||||
@@ -80,7 +83,7 @@ public class SystemRoleController {
|
|||||||
@ApiOperation("修改角色")
|
@ApiOperation("修改角色")
|
||||||
@PostMapping(value = "/modifyRoleById")
|
@PostMapping(value = "/modifyRoleById")
|
||||||
@PreAuthorize("@el.check('roles:edit')")
|
@PreAuthorize("@el.check('roles:edit')")
|
||||||
public ResponseEntity<Object> modifyRoleById(@Validated(SystemRoleTb.Update.class) @RequestBody SystemRoleTb resources) {
|
public ResponseEntity<Void> modifyRoleById(@Validated(SystemRoleTb.Update.class) @RequestBody SystemRoleTb resources) {
|
||||||
checkRoleLevels(resources.getLevel());
|
checkRoleLevels(resources.getLevel());
|
||||||
systemRoleService.modifyRoleById(resources);
|
systemRoleService.modifyRoleById(resources);
|
||||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
@@ -89,7 +92,7 @@ public class SystemRoleController {
|
|||||||
@ApiOperation("修改角色菜单")
|
@ApiOperation("修改角色菜单")
|
||||||
@PostMapping(value = "/modifyBindMenuById")
|
@PostMapping(value = "/modifyBindMenuById")
|
||||||
@PreAuthorize("@el.check('roles:edit')")
|
@PreAuthorize("@el.check('roles:edit')")
|
||||||
public ResponseEntity<Object> modifyBindMenuById(@RequestBody SystemRoleTb resources) {
|
public ResponseEntity<Void> modifyBindMenuById(@RequestBody SystemRoleTb resources) {
|
||||||
SystemRoleTb role = systemRoleService.getById(resources.getId());
|
SystemRoleTb role = systemRoleService.getById(resources.getId());
|
||||||
checkRoleLevels(role.getLevel());
|
checkRoleLevels(role.getLevel());
|
||||||
systemRoleService.modifyBindMenuById(resources);
|
systemRoleService.modifyBindMenuById(resources);
|
||||||
@@ -99,7 +102,7 @@ public class SystemRoleController {
|
|||||||
@ApiOperation("删除角色")
|
@ApiOperation("删除角色")
|
||||||
@PostMapping(value = "/removeRoleByIds")
|
@PostMapping(value = "/removeRoleByIds")
|
||||||
@PreAuthorize("@el.check('roles:del')")
|
@PreAuthorize("@el.check('roles:del')")
|
||||||
public ResponseEntity<Object> removeRoleByIds(@RequestBody Set<Long> ids) {
|
public ResponseEntity<Void> removeRoleByIds(@RequestBody Set<Long> ids) {
|
||||||
for (Long id : ids) {
|
for (Long id : ids) {
|
||||||
SystemRoleTb role = systemRoleService.getById(id);
|
SystemRoleTb role = systemRoleService.getById(id);
|
||||||
checkRoleLevels(role.getLevel());
|
checkRoleLevels(role.getLevel());
|
||||||
|
|||||||
+1
-1
@@ -70,7 +70,7 @@ public class SystemUserController {
|
|||||||
criteria.getDeptIds().addAll(systemDeptService.queryChildDeptIdListByDeptIds(data));
|
criteria.getDeptIds().addAll(systemDeptService.queryChildDeptIdListByDeptIds(data));
|
||||||
}
|
}
|
||||||
// 数据权限
|
// 数据权限
|
||||||
List<Long> dataScopes = systemDataService.queryDeptIdListByUserIdWithDeptId(systemUserService.queryUserByUsername(SecurityHelper.getCurrentUsername()));
|
List<Long> dataScopes = systemDataService.queryDeptIdListByArgs(systemUserService.queryUserByUsername(SecurityHelper.getCurrentUsername()));
|
||||||
// criteria.getDeptIds() 不为空并且数据权限不为空则取交集
|
// criteria.getDeptIds() 不为空并且数据权限不为空则取交集
|
||||||
if (!CollectionUtils.isEmpty(criteria.getDeptIds()) && !CollectionUtils.isEmpty(dataScopes)) {
|
if (!CollectionUtils.isEmpty(criteria.getDeptIds()) && !CollectionUtils.isEmpty(dataScopes)) {
|
||||||
// 取交集
|
// 取交集
|
||||||
|
|||||||
+1
-1
@@ -40,7 +40,7 @@ public class UserDetailsHandler implements UserDetailsService {
|
|||||||
// 获取用户的权限
|
// 获取用户的权限
|
||||||
List<SystemRoleCodeVo> authorities = systemRoleService.buildUserRolePermissions(user);
|
List<SystemRoleCodeVo> authorities = systemRoleService.buildUserRolePermissions(user);
|
||||||
// 初始化JwtUserDto
|
// 初始化JwtUserDto
|
||||||
userJwtVo = new SystemUserJwtVo(user, systemDataService.queryDeptIdListByUserIdWithDeptId(user), authorities);
|
userJwtVo = new SystemUserJwtVo(user, systemDataService.queryDeptIdListByArgs(user), authorities);
|
||||||
// 添加缓存数据
|
// 添加缓存数据
|
||||||
systemUserJwtService.saveUserJwtModelByUserName(username, userJwtVo);
|
systemUserJwtService.saveUserJwtModelByUserName(username, userJwtVo);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -16,5 +16,5 @@ public interface SystemDataService {
|
|||||||
* @param user /
|
* @param user /
|
||||||
* @return /
|
* @return /
|
||||||
*/
|
*/
|
||||||
List<Long> queryDeptIdListByUserIdWithDeptId(SystemUserTb user);
|
List<Long> queryDeptIdListByArgs(SystemUserTb user);
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -30,7 +30,7 @@ public class SystemDataServiceImpl implements SystemDataService {
|
|||||||
* @return /
|
* @return /
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<Long> queryDeptIdListByUserIdWithDeptId(SystemUserTb user) {
|
public List<Long> queryDeptIdListByArgs(SystemUserTb user) {
|
||||||
Set<Long> deptIds = new HashSet<>();
|
Set<Long> deptIds = new HashSet<>();
|
||||||
// 查询用户角色
|
// 查询用户角色
|
||||||
List<SystemRoleTb> roleList = systemRoleService.queryRoleListByUsersId(user.getId());
|
List<SystemRoleTb> roleList = systemRoleService.queryRoleListByUsersId(user.getId());
|
||||||
@@ -42,7 +42,7 @@ public class SystemDataServiceImpl implements SystemDataService {
|
|||||||
deptIds.add(user.getDept().getId());
|
deptIds.add(user.getDept().getId());
|
||||||
break;
|
break;
|
||||||
case CUSTOMIZE:
|
case CUSTOMIZE:
|
||||||
deptIds.addAll(getCustomize(deptIds, role));
|
deptIds.addAll(queryCustomDataPermissionList(deptIds, role));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
@@ -58,7 +58,7 @@ public class SystemDataServiceImpl implements SystemDataService {
|
|||||||
* @param role 角色
|
* @param role 角色
|
||||||
* @return 数据权限ID
|
* @return 数据权限ID
|
||||||
*/
|
*/
|
||||||
public Set<Long> getCustomize(Set<Long> deptIds, SystemRoleTb role) {
|
public Set<Long> queryCustomDataPermissionList(Set<Long> deptIds, SystemRoleTb role) {
|
||||||
Set<SystemDeptTb> deptList = systemDeptService.queryDeptByRoleId(role.getId());
|
Set<SystemDeptTb> deptList = systemDeptService.queryDeptByRoleId(role.getId());
|
||||||
for (SystemDeptTb dept : deptList) {
|
for (SystemDeptTb dept : deptList) {
|
||||||
deptIds.add(dept.getId());
|
deptIds.add(dept.getId());
|
||||||
|
|||||||
+1
-1
@@ -100,7 +100,7 @@ public interface SystemDeptService extends IService<SystemDeptTb> {
|
|||||||
* @param depts /
|
* @param depts /
|
||||||
* @return /
|
* @return /
|
||||||
*/
|
*/
|
||||||
CsResultVo<Object> buildDeptTree(List<SystemDeptTb> depts);
|
CsResultVo<Set<SystemDeptTb>> buildDeptTree(List<SystemDeptTb> depts);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取
|
* 获取
|
||||||
|
|||||||
+2
-2
@@ -200,7 +200,7 @@ public class SystemDeptServiceImpl extends ServiceImpl<SystemDeptMapper, SystemD
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CsResultVo<Object> buildDeptTree(List<SystemDeptTb> deptList) {
|
public CsResultVo<Set<SystemDeptTb>> buildDeptTree(List<SystemDeptTb> deptList) {
|
||||||
Set<SystemDeptTb> trees = new LinkedHashSet<>();
|
Set<SystemDeptTb> trees = new LinkedHashSet<>();
|
||||||
Set<SystemDeptTb> deptSet = new LinkedHashSet<>();
|
Set<SystemDeptTb> deptSet = new LinkedHashSet<>();
|
||||||
List<String> deptNames = deptList.stream().map(SystemDeptTb::getName).collect(Collectors.toList());
|
List<String> deptNames = deptList.stream().map(SystemDeptTb::getName).collect(Collectors.toList());
|
||||||
@@ -228,7 +228,7 @@ public class SystemDeptServiceImpl extends ServiceImpl<SystemDeptMapper, SystemD
|
|||||||
if (CollectionUtil.isEmpty(trees)) {
|
if (CollectionUtil.isEmpty(trees)) {
|
||||||
trees = deptSet;
|
trees = deptSet;
|
||||||
}
|
}
|
||||||
CsResultVo<Object> baseResult = new CsResultVo<>();
|
CsResultVo<Set<SystemDeptTb>> baseResult = new CsResultVo<>();
|
||||||
baseResult.setContent(CollectionUtil.isEmpty(trees) ? deptSet : trees);
|
baseResult.setContent(CollectionUtil.isEmpty(trees) ? deptSet : trees);
|
||||||
baseResult.setTotalElements(deptSet.size());
|
baseResult.setTotalElements(deptSet.size());
|
||||||
return baseResult;
|
return baseResult;
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@
|
|||||||
<select id="queryLocalStoragePageByArgs" resultType="cn.odboy.core.dal.dataobject.system.SystemLocalStorageTb">
|
<select id="queryLocalStoragePageByArgs" resultType="cn.odboy.core.dal.dataobject.system.SystemLocalStorageTb">
|
||||||
select
|
select
|
||||||
*
|
*
|
||||||
from tool_local_storage
|
from system_local_storage
|
||||||
<where>
|
<where>
|
||||||
<if test="criteria.blurry != null and criteria.blurry != ''">
|
<if test="criteria.blurry != null and criteria.blurry != ''">
|
||||||
AND (
|
AND (
|
||||||
|
|||||||
+2
-2
@@ -3,14 +3,14 @@
|
|||||||
<mapper namespace="cn.odboy.core.dal.mysql.system.SystemQiniuContentMapper">
|
<mapper namespace="cn.odboy.core.dal.mysql.system.SystemQiniuContentMapper">
|
||||||
<select id="getQiniuContentByName" resultType="cn.odboy.core.dal.dataobject.system.SystemQiniuContentTb">
|
<select id="getQiniuContentByName" resultType="cn.odboy.core.dal.dataobject.system.SystemQiniuContentTb">
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM tool_qiniu_content
|
FROM system_qiniu_content
|
||||||
WHERE name = #{name}
|
WHERE name = #{name}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="queryQiniuContentPageByArgs" resultType="cn.odboy.core.dal.dataobject.system.SystemQiniuContentTb">
|
<select id="queryQiniuContentPageByArgs" resultType="cn.odboy.core.dal.dataobject.system.SystemQiniuContentTb">
|
||||||
SELECT
|
SELECT
|
||||||
*
|
*
|
||||||
FROM tool_qiniu_content
|
FROM system_qiniu_content
|
||||||
<where>
|
<where>
|
||||||
<if test="criteria.key != null and criteria.key != ''">
|
<if test="criteria.key != null and criteria.key != ''">
|
||||||
AND name LIKE CONCAT('%',#{criteria.key},'%')
|
AND name LIKE CONCAT('%',#{criteria.key},'%')
|
||||||
|
|||||||
@@ -56,6 +56,11 @@
|
|||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-undertow</artifactId>
|
<artifactId>spring-boot-starter-undertow</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.undertow</groupId>
|
||||||
|
<artifactId>undertow-core</artifactId>
|
||||||
|
<version>2.3.18.Final</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- Spring boot 测试 -->
|
<!-- Spring boot 测试 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
Reference in New Issue
Block a user