feat:编码规范
This commit is contained in:
@@ -8,6 +8,14 @@ export function initData(url, params) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function initDataByPost(url, params) {
|
||||||
|
return request({
|
||||||
|
url: url,
|
||||||
|
method: 'post',
|
||||||
|
data: params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
export function download(url, params) {
|
export function download(url, params) {
|
||||||
return request({
|
return request({
|
||||||
url: url + '?' + qs.stringify(params, { indices: false }),
|
url: url + '?' + qs.stringify(params, { indices: false }),
|
||||||
|
|||||||
@@ -24,18 +24,18 @@ export function edit(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function switchJobPauseStatus(id) {
|
export function switchQuartzJobStatus(id) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/jobs/switchJobPauseStatus/' + id,
|
url: 'api/jobs/switchQuartzJobStatus/' + id,
|
||||||
method: 'post'
|
method: 'post'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function executionQuartzJob(id) {
|
export function startQuartzJob(id) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/jobs/executionQuartzJob/' + id,
|
url: 'api/jobs/startQuartzJob/' + id,
|
||||||
method: 'post'
|
method: 'post'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export default { add, edit, del, switchJobPauseStatus, executionQuartzJob }
|
export default { add, edit, del, switchQuartzJobStatus, startQuartzJob }
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ export function sendResetPasswordCaptcha(data) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function validatedCaptcha(email, code, codeBi) {
|
export function checkCodeAvailable(email, code, codeBi) {
|
||||||
return request({
|
return request({
|
||||||
url: `api/code/validatedCaptcha?email=${email}&code=${code}&codeBi=${codeBi}`,
|
url: `api/code/checkCodeAvailable?email=${email}&code=${code}&codeBi=${codeBi}`,
|
||||||
method: 'post'
|
method: 'post'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
export function getDepts(params) {
|
export function describeDeptList(params) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/dept',
|
url: 'api/dept',
|
||||||
method: 'get',
|
method: 'get',
|
||||||
@@ -8,11 +8,11 @@ export function getDepts(params) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getDeptSuperior(ids, exclude) {
|
export function describeDeptSuperiorTree(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/getDeptSuperior?exclude=' + exclude,
|
url: 'api/dept/describeDeptSuperiorTree?exclude=' + exclude,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -20,7 +20,7 @@ export function getDeptSuperior(ids, exclude) {
|
|||||||
|
|
||||||
export function add(data) {
|
export function add(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/dept/createDept',
|
url: 'api/dept/saveDept',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -28,7 +28,7 @@ export function add(data) {
|
|||||||
|
|
||||||
export function del(ids) {
|
export function del(ids) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/dept/deleteDept',
|
url: 'api/dept/removeDeptByIds',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: ids
|
data: ids
|
||||||
})
|
})
|
||||||
@@ -36,10 +36,10 @@ export function del(ids) {
|
|||||||
|
|
||||||
export function edit(data) {
|
export function edit(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/dept/updateDept',
|
url: 'api/dept/modifyDept',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export default { add, edit, del, getDepts, getDeptSuperior }
|
export default { add, edit, del, describeDeptList, describeDeptSuperiorTree }
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
export function getDicts() {
|
// export function getDicts() {
|
||||||
return request({
|
// return request({
|
||||||
url: 'api/dict/queryAllDict',
|
// url: 'api/dict/queryAllDict',
|
||||||
method: 'post'
|
// method: 'post'
|
||||||
})
|
// })
|
||||||
}
|
// }
|
||||||
|
|
||||||
export function add(data) {
|
export function add(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/dict/createDict',
|
url: 'api/dict/saveDict',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -17,7 +17,7 @@ export function add(data) {
|
|||||||
|
|
||||||
export function del(ids) {
|
export function del(ids) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/dict/deleteDict',
|
url: 'api/dict/removeDictByIds',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: ids
|
data: ids
|
||||||
})
|
})
|
||||||
@@ -25,7 +25,7 @@ export function del(ids) {
|
|||||||
|
|
||||||
export function edit(data) {
|
export function edit(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/dict/updateDict',
|
url: 'api/dict/modifyDictById',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -13,22 +13,22 @@ export function get(dictName) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getDictMap(dictName) {
|
// export function getDictMap(dictName) {
|
||||||
const params = {
|
// const params = {
|
||||||
dictName,
|
// dictName,
|
||||||
page: 0,
|
// page: 0,
|
||||||
size: 9999
|
// size: 9999
|
||||||
}
|
// }
|
||||||
return request({
|
// return request({
|
||||||
url: 'api/dictDetail/getDictDetailMaps',
|
// url: 'api/dictDetail/getDictDetailMaps',
|
||||||
method: 'get',
|
// method: 'get',
|
||||||
params
|
// params
|
||||||
})
|
// })
|
||||||
}
|
// }
|
||||||
|
|
||||||
export function add(data) {
|
export function add(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/dictDetail',
|
url: 'api/dictDetail/saveDictDetail',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -36,15 +36,16 @@ export function add(data) {
|
|||||||
|
|
||||||
export function del(id) {
|
export function del(id) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/dictDetail/' + id,
|
url: 'api/dictDetail/removeDictDetailById',
|
||||||
method: 'delete'
|
method: 'post',
|
||||||
|
data: { id: id }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function edit(data) {
|
export function edit(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/dictDetail',
|
url: 'api/dictDetail/modifyDictDetailById',
|
||||||
method: 'put',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export function getAllJob() {
|
|||||||
|
|
||||||
export function add(data) {
|
export function add(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/job/createJob',
|
url: 'api/job/saveJob',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -23,7 +23,7 @@ export function add(data) {
|
|||||||
|
|
||||||
export function del(ids) {
|
export function del(ids) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/job/deleteJob',
|
url: 'api/job/removeJobByIds',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: ids
|
data: ids
|
||||||
})
|
})
|
||||||
@@ -31,7 +31,7 @@ export function del(ids) {
|
|||||||
|
|
||||||
export function edit(data) {
|
export function edit(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/job/updateJob',
|
url: 'api/job/modifyJobById',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
export function getMenusTree(pid) {
|
export function describeMenuListByPid(pid) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/menus/queryAllMenu?pid=' + pid,
|
url: 'api/menus/describeMenuListByPid?pid=' + pid,
|
||||||
method: 'post'
|
method: 'post'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -15,18 +15,18 @@ export function getMenus(params) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getMenuSuperior(ids) {
|
export function describeMenuSuperior(ids) {
|
||||||
const data = Array.isArray(ids) ? ids : [ids]
|
const data = Array.isArray(ids) ? ids : [ids]
|
||||||
return request({
|
return request({
|
||||||
url: 'api/menus/queryMenuSuperior',
|
url: 'api/menus/describeMenuSuperior',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getChild(id) {
|
export function describeChildMenuSet(id) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/menus/queryChildMenu?id=' + id,
|
url: 'api/menus/describeChildMenuSet?id=' + id,
|
||||||
method: 'post'
|
method: 'post'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -40,7 +40,7 @@ export function buildMenus() {
|
|||||||
|
|
||||||
export function add(data) {
|
export function add(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/menus/createMenu',
|
url: 'api/menus/saveMenu',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -48,7 +48,7 @@ export function add(data) {
|
|||||||
|
|
||||||
export function del(ids) {
|
export function del(ids) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/menus/deleteMenu',
|
url: 'api/menus/removeMenuByIds',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: ids
|
data: ids
|
||||||
})
|
})
|
||||||
@@ -56,10 +56,10 @@ export function del(ids) {
|
|||||||
|
|
||||||
export function edit(data) {
|
export function edit(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/menus/updateMenu',
|
url: 'api/menus/modifyMenuById',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export default { add, edit, del, getMenusTree, getMenuSuperior, getMenus, getChild }
|
export default { add, edit, del, describeMenuListByPid, describeMenuSuperior, getMenus, describeChildMenuSet }
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
// 获取所有的Role
|
// 获取所有的Role
|
||||||
export function getAll() {
|
export function describeRoleList() {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/roles/queryAllRole',
|
url: 'api/roles/describeRoleList',
|
||||||
method: 'post'
|
method: 'post'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function add(data) {
|
export function add(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/roles/createRole',
|
url: 'api/roles/saveRole',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -18,21 +18,22 @@ export function add(data) {
|
|||||||
|
|
||||||
export function get(id) {
|
export function get(id) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/roles/getRoleById/' + id,
|
url: 'api/roles/describeRoleById',
|
||||||
method: 'post'
|
method: 'post',
|
||||||
|
data: { id: id }
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getLevel() {
|
export function getLevel() {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/roles/getRoleLevel',
|
url: 'api/roles/describeRoleLevel',
|
||||||
method: 'post'
|
method: 'post'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function del(ids) {
|
export function del(ids) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/roles/deleteRole',
|
url: 'api/roles/removeRoleByIds',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: ids
|
data: ids
|
||||||
})
|
})
|
||||||
@@ -40,7 +41,7 @@ export function del(ids) {
|
|||||||
|
|
||||||
export function edit(data) {
|
export function edit(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/roles/updateRole',
|
url: 'api/roles/modifyRoleById',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -48,7 +49,7 @@ export function edit(data) {
|
|||||||
|
|
||||||
export function editMenu(data) {
|
export function editMenu(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/roles/updateRoleMenu',
|
url: 'api/roles/modifyBindMenuById',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { encrypt } from '@/utils/rsaEncrypt'
|
|||||||
|
|
||||||
export function add(data) {
|
export function add(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/users/createUser',
|
url: 'api/users/saveUser',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -11,7 +11,7 @@ export function add(data) {
|
|||||||
|
|
||||||
export function del(ids) {
|
export function del(ids) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/users/deleteUser',
|
url: 'api/users/removeUserByIds',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: ids
|
data: ids
|
||||||
})
|
})
|
||||||
@@ -19,7 +19,7 @@ export function del(ids) {
|
|||||||
|
|
||||||
export function resetPwd(ids) {
|
export function resetPwd(ids) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/users/resetPwd',
|
url: 'api/users/resetUserPasswordByIds',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: ids
|
data: ids
|
||||||
})
|
})
|
||||||
@@ -27,7 +27,7 @@ export function resetPwd(ids) {
|
|||||||
|
|
||||||
export function edit(data) {
|
export function edit(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/users/updateUser',
|
url: 'api/users/modifyUserById',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -35,7 +35,7 @@ export function edit(data) {
|
|||||||
|
|
||||||
export function editUser(data) {
|
export function editUser(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/users/updateCenterInfo',
|
url: 'api/users/modifyUserCenterInfoById',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -47,7 +47,7 @@ export function updatePass(user) {
|
|||||||
newPass: encrypt(user.newPass)
|
newPass: encrypt(user.newPass)
|
||||||
}
|
}
|
||||||
return request({
|
return request({
|
||||||
url: 'api/users/updatePassword/',
|
url: 'api/users/modifyUserPasswordByUsername',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -59,7 +59,7 @@ export function updateEmail(form) {
|
|||||||
email: form.email
|
email: form.email
|
||||||
}
|
}
|
||||||
return request({
|
return request({
|
||||||
url: 'api/users/updateEmail/' + form.code,
|
url: 'api/users/modifyUserEmailByUsername/' + form.code,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -67,7 +67,7 @@ export function updateEmail(form) {
|
|||||||
|
|
||||||
export function queryUserMetaPage(query) {
|
export function queryUserMetaPage(query) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/users/queryUserMetaPage',
|
url: 'api/users/describeUserMetadataOptions',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: {
|
data: {
|
||||||
page: 1,
|
page: 1,
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
export function queryEmailConfig() {
|
export function describeEmailConfig() {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/email/queryEmailConfig',
|
url: 'api/email/describeEmailConfig',
|
||||||
method: 'post'
|
method: 'post'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function updateEmailConfig(data) {
|
export function modifyEmailConfig(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/email/updateEmailConfig',
|
url: 'api/email/modifyEmailConfig',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import request from '@/utils/request'
|
|||||||
|
|
||||||
export function add(data) {
|
export function add(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/localStorage',
|
url: 'api/localStorage/uploadFile',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
@@ -10,16 +10,16 @@ export function add(data) {
|
|||||||
|
|
||||||
export function del(ids) {
|
export function del(ids) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/localStorage/',
|
url: 'api/localStorage/removeFileByIds',
|
||||||
method: 'delete',
|
method: 'post',
|
||||||
data: ids
|
data: ids
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function edit(data) {
|
export function edit(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/localStorage',
|
url: 'api/localStorage/modifyLocalStorageById',
|
||||||
method: 'put',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,23 +1,23 @@
|
|||||||
import request from '@/utils/request'
|
import request from '@/utils/request'
|
||||||
|
|
||||||
export function queryQiNiuConfig() {
|
export function describeQiniuConfig() {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/qiNiuContent/queryQiNiuConfig',
|
url: 'api/qiNiuContent/describeQiniuConfig',
|
||||||
method: 'post'
|
method: 'post'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function update(data) {
|
export function modifyQiniuConfig(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/qiNiuContent/updateQiNiuConfig',
|
url: 'api/qiNiuContent/modifyQiniuConfig',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function download(id) {
|
export function createFilePreviewUrl(id) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/qiNiuContent/download/' + id,
|
url: 'api/qiNiuContent/createFilePreviewUrl/' + id,
|
||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -36,5 +36,4 @@ export function del(ids) {
|
|||||||
data: ids
|
data: ids
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
export default { del, createFilePreviewUrl, sync }
|
||||||
export default { del, download, sync }
|
|
||||||
|
|||||||
@@ -3,9 +3,9 @@ const baseUrl = process.env.VUE_APP_BASE_API === '/' ? '' : process.env.VUE_APP_
|
|||||||
const api = {
|
const api = {
|
||||||
state: {
|
state: {
|
||||||
// 图片上传
|
// 图片上传
|
||||||
imagesUploadApi: baseUrl + '/api/localStorage/pictures',
|
imagesUploadApi: baseUrl + '/api/localStorage/uploadPicture',
|
||||||
// 修改头像
|
// 修改头像
|
||||||
updateAvatarApi: baseUrl + '/api/users/updateAvatar',
|
updateAvatarApi: baseUrl + '/api/users/modifyUserAvatar',
|
||||||
// 上传文件到七牛云
|
// 上传文件到七牛云
|
||||||
qiNiuUploadApi: baseUrl + '/api/qiNiuContent',
|
qiNiuUploadApi: baseUrl + '/api/qiNiuContent',
|
||||||
// Sql 监控
|
// Sql 监控
|
||||||
@@ -15,7 +15,7 @@ const api = {
|
|||||||
// swagger
|
// swagger
|
||||||
swaggerApi: baseUrl + '/doc.html',
|
swaggerApi: baseUrl + '/doc.html',
|
||||||
// 文件上传
|
// 文件上传
|
||||||
fileUploadApi: baseUrl + '/api/localStorage',
|
fileUploadApi: baseUrl + '/api/localStorage/uploadFile',
|
||||||
// baseUrl,
|
// baseUrl,
|
||||||
baseApi: baseUrl
|
baseApi: baseUrl
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import { getDepts } from '@/api/system/dept'
|
import { describeDeptList } 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(() => {
|
||||||
getDepts(params).then(res => {
|
describeDeptList(params).then(res => {
|
||||||
if (resolve) {
|
if (resolve) {
|
||||||
resolve(res.content)
|
resolve(res.content)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -138,7 +138,7 @@
|
|||||||
import ECharts from 'vue-echarts'
|
import ECharts from 'vue-echarts'
|
||||||
import 'echarts/lib/chart/line'
|
import 'echarts/lib/chart/line'
|
||||||
import 'echarts/lib/component/polar'
|
import 'echarts/lib/component/polar'
|
||||||
import { initData } from '@/api/data'
|
import { initDataByPost } from '@/api/data'
|
||||||
export default {
|
export default {
|
||||||
name: 'ServerMonitor',
|
name: 'ServerMonitor',
|
||||||
components: {
|
components: {
|
||||||
@@ -148,7 +148,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
show: false,
|
show: false,
|
||||||
monitor: null,
|
monitor: null,
|
||||||
url: 'api/monitor',
|
url: 'api/monitor/describeServerMonitorInfo',
|
||||||
data: {},
|
data: {},
|
||||||
cpuInfo: {
|
cpuInfo: {
|
||||||
tooltip: {
|
tooltip: {
|
||||||
@@ -231,7 +231,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {
|
||||||
initData(this.url, {}).then(data => {
|
initDataByPost(this.url, {}).then(data => {
|
||||||
this.data = data
|
this.data = data
|
||||||
this.show = true
|
this.show = true
|
||||||
if (this.cpuInfo.xAxis.data.length >= 8) {
|
if (this.cpuInfo.xAxis.data.length >= 8) {
|
||||||
|
|||||||
@@ -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.getDepts(params).then(res => {
|
crudDept.describeDeptList(params).then(res => {
|
||||||
resolve(res.content)
|
resolve(res.content)
|
||||||
})
|
})
|
||||||
}, 100)
|
}, 100)
|
||||||
@@ -161,7 +161,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
getSupDepts(id) {
|
getSupDepts(id) {
|
||||||
crudDept.getDeptSuperior(id, true).then(res => {
|
crudDept.describeDeptSuperiorTree(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.getDepts({ enabled: true }).then(res => {
|
crudDept.describeDeptList({ 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.getDepts({ enabled: true, pid: parentNode.id }).then(res => {
|
crudDept.describeDeptList({ 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.getMenuSuperior(id).then(res => {
|
crudMenu.describeMenuSuperior(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 { getDepts, getDeptSuperior } from '@/api/system/dept'
|
import { describeDeptList, describeDeptSuperiorTree } from '@/api/system/dept'
|
||||||
import { getMenusTree, getChild } from '@/api/system/menu'
|
import { describeMenuListByPid, describeChildMenuSet } 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(() => {
|
||||||
getMenusTree(node.data.id ? node.data.id : 0).then(res => {
|
describeMenuListByPid(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 包含自身
|
||||||
getChild(menu.id).then(childIds => {
|
describeChildMenuSet(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() {
|
||||||
getDepts({ enabled: true }).then(res => {
|
describeDeptList({ 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)
|
||||||
})
|
})
|
||||||
getDeptSuperior(ids).then(res => {
|
describeDeptSuperiorTree(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) {
|
||||||
getDepts({ enabled: true, pid: parentNode.id }).then(res => {
|
describeDeptList({ 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
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
// 执行
|
// 执行
|
||||||
execute(id) {
|
execute(id) {
|
||||||
crudJob.executionQuartzJob(id).then(res => {
|
crudJob.startQuartzJob(id).then(res => {
|
||||||
this.crud.notify('执行成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
this.crud.notify('执行成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log(err.response.data.message)
|
console.log(err.response.data.message)
|
||||||
@@ -174,7 +174,7 @@ export default {
|
|||||||
if (status === '恢复') {
|
if (status === '恢复') {
|
||||||
this.updateParams(id)
|
this.updateParams(id)
|
||||||
}
|
}
|
||||||
crudJob.switchJobPauseStatus(id).then(res => {
|
crudJob.switchQuartzJobStatus(id).then(res => {
|
||||||
this.crud.toQuery()
|
this.crud.toQuery()
|
||||||
this.crud.notify(status + '成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
this.crud.notify(status + '成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<el-input v-model="query.jobName" clearable size="small" placeholder="输入任务名称搜索" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" />
|
<el-input v-model="query.jobName" clearable size="small" placeholder="输入任务名称搜索" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" />
|
||||||
<date-range-picker v-model="query.createTime" class="date-item" />
|
<date-range-picker v-model="query.createTime" class="date-item" />
|
||||||
<el-select v-model="query.isSuccess" placeholder="日志状态" clearable size="small" class="filter-item" style="width: 110px" @change="toQuery">
|
<el-select v-model="query.isSuccess" placeholder="日志状态" clearable size="small" class="filter-item" style="width: 110px" @change="toQuery">
|
||||||
<el-option v-for="item in enabledTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
|
<el-option v-for="item in enabledTypeOptions" :key="item.key" :label="item.displayName" :value="item.key" />
|
||||||
</el-select>
|
</el-select>
|
||||||
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
|
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
|
||||||
<!-- 导出 -->
|
<!-- 导出 -->
|
||||||
@@ -61,14 +61,16 @@ import crud from '@/mixins/crud'
|
|||||||
import DateRangePicker from '@/components/DateRangePicker'
|
import DateRangePicker from '@/components/DateRangePicker'
|
||||||
export default {
|
export default {
|
||||||
components: { DateRangePicker },
|
components: { DateRangePicker },
|
||||||
|
// Mixins 是一种包含多个组件选项的对象。可以将 mixin 作为组件的一个选项引入,从而在该组件中“混入”这个对象的选项。通过这种方式,mixins 可以帮助你实现功能复用,减少重复代码。
|
||||||
|
// 这里混入了crud,也就是说当前页面可以使用crud中的属性和方法
|
||||||
mixins: [crud],
|
mixins: [crud],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
title: '任务日志',
|
title: '任务日志',
|
||||||
errorInfo: '', errorDialog: false,
|
errorInfo: '', errorDialog: false,
|
||||||
enabledTypeOptions: [
|
enabledTypeOptions: [
|
||||||
{ key: 'true', display_name: '成功' },
|
{ key: 'true', displayName: '成功' },
|
||||||
{ key: 'false', display_name: '失败' }
|
{ key: 'false', displayName: '失败' }
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -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 { getDepts, getDeptSuperior } from '@/api/system/dept'
|
import { describeDeptList, describeDeptSuperiorTree } from '@/api/system/dept'
|
||||||
import { getAll, getLevel } from '@/api/system/role'
|
import { describeRoleList, 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() {
|
||||||
getDepts({ enabled: true }).then(res => {
|
describeDeptList({ 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) {
|
||||||
getDeptSuperior(deptId).then(res => {
|
describeDeptSuperiorTree(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) {
|
||||||
getDepts({ enabled: true, pid: parentNode.id }).then(res => {
|
describeDeptList({ 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() {
|
||||||
getAll().then(res => {
|
describeRoleList().then(res => {
|
||||||
this.roles = res
|
this.roles = res
|
||||||
}).catch(() => { })
|
}).catch(() => { })
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { queryEmailConfig, updateEmailConfig } from '@/api/tools/email'
|
import { describeEmailConfig, 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() {
|
||||||
queryEmailConfig().then(res => {
|
describeEmailConfig().then(res => {
|
||||||
this.form = res
|
this.form = res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -66,7 +66,7 @@ export default {
|
|||||||
this.$refs['form'].validate((valid) => {
|
this.$refs['form'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
updateEmailConfig(this.form).then(res => {
|
modifyEmailConfig(this.form).then(res => {
|
||||||
this.$notify({
|
this.$notify({
|
||||||
title: '修改成功',
|
title: '修改成功',
|
||||||
type: 'success',
|
type: 'success',
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { queryQiNiuConfig, update } from '@/api/tools/qiniu'
|
import { describeQiniuConfig, modifyQiniuConfig } from '@/api/tools/qiniu'
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -63,7 +63,7 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
init() {
|
init() {
|
||||||
queryQiNiuConfig().then(res => {
|
describeQiniuConfig().then(res => {
|
||||||
this.form = res
|
this.form = res
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -71,7 +71,7 @@ export default {
|
|||||||
this.$refs['form'].validate((valid) => {
|
this.$refs['form'].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
update(this.form).then(res => {
|
modifyQiniuConfig(this.form).then(res => {
|
||||||
this.$notify({
|
this.$notify({
|
||||||
title: '修改成功',
|
title: '修改成功',
|
||||||
type: 'success',
|
type: 'success',
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ export default {
|
|||||||
this.downloadLoading = true
|
this.downloadLoading = true
|
||||||
// 先打开一个空的新窗口,再请求
|
// 先打开一个空的新窗口,再请求
|
||||||
this.newWin = window.open()
|
this.newWin = window.open()
|
||||||
crudQiNiu.download(id).then(res => {
|
crudQiNiu.createFilePreviewUrl(id).then(res => {
|
||||||
this.downloadLoading = false
|
this.downloadLoading = false
|
||||||
this.url = res.url
|
this.url = res.url
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
|
|||||||
+6
-6
@@ -93,17 +93,17 @@ public class QuartzJobController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("更改定时任务状态")
|
@ApiOperation("更改定时任务状态")
|
||||||
@PostMapping(value = "/switchJobPauseStatus/{id}")
|
@PostMapping(value = "/switchQuartzJobStatus/{id}")
|
||||||
@PreAuthorize("@el.check('timing:edit')")
|
@PreAuthorize("@el.check('timing:edit')")
|
||||||
public ResponseEntity<Object> switchJobPauseStatus(@PathVariable Long id) {
|
public ResponseEntity<Object> switchQuartzJobStatus(@PathVariable Long id) {
|
||||||
quartzJobService.switchQuartzJobStatus(quartzJobService.getById(id));
|
quartzJobService.switchQuartzJobStatus(quartzJobService.getById(id));
|
||||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("执行定时任务")
|
@ApiOperation("执行定时任务")
|
||||||
@PostMapping(value = "/executionQuartzJob/{id}")
|
@PostMapping(value = "/startQuartzJob/{id}")
|
||||||
@PreAuthorize("@el.check('timing:edit')")
|
@PreAuthorize("@el.check('timing:edit')")
|
||||||
public ResponseEntity<Object> executionQuartzJob(@PathVariable Long id) {
|
public ResponseEntity<Object> startQuartzJob(@PathVariable Long id) {
|
||||||
quartzJobService.startQuartzJob(quartzJobService.getById(id));
|
quartzJobService.startQuartzJob(quartzJobService.getById(id));
|
||||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
@@ -111,8 +111,8 @@ public class QuartzJobController {
|
|||||||
@ApiOperation("删除定时任务")
|
@ApiOperation("删除定时任务")
|
||||||
@DeleteMapping
|
@DeleteMapping
|
||||||
@PreAuthorize("@el.check('timing:del')")
|
@PreAuthorize("@el.check('timing:del')")
|
||||||
public ResponseEntity<Object> deleteQuartzJob(@RequestBody Set<Long> ids) {
|
public ResponseEntity<Object> removeJobByIds(@RequestBody Set<Long> ids) {
|
||||||
quartzJobService.deleteJobByIds(ids);
|
quartzJobService.removeJobByIds(ids);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -68,7 +68,7 @@ public interface QuartzJobService extends IService<QuartzJob> {
|
|||||||
*
|
*
|
||||||
* @param ids /
|
* @param ids /
|
||||||
*/
|
*/
|
||||||
void deleteJobByIds(Set<Long> ids);
|
void removeJobByIds(Set<Long> ids);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更改定时任务状态
|
* 更改定时任务状态
|
||||||
|
|||||||
+6
-2
@@ -11,8 +11,8 @@ import cn.odboy.base.PageResult;
|
|||||||
import cn.odboy.exception.BadRequestException;
|
import cn.odboy.exception.BadRequestException;
|
||||||
import cn.odboy.model.job.domain.QuartzJob;
|
import cn.odboy.model.job.domain.QuartzJob;
|
||||||
import cn.odboy.model.job.domain.QuartzLog;
|
import cn.odboy.model.job.domain.QuartzLog;
|
||||||
import cn.odboy.model.job.request.UpdateQuartzJobRequest;
|
|
||||||
import cn.odboy.model.job.request.QueryQuartzJobRequest;
|
import cn.odboy.model.job.request.QueryQuartzJobRequest;
|
||||||
|
import cn.odboy.model.job.request.UpdateQuartzJobRequest;
|
||||||
import cn.odboy.redis.RedisHelper;
|
import cn.odboy.redis.RedisHelper;
|
||||||
import cn.odboy.util.FileUtil;
|
import cn.odboy.util.FileUtil;
|
||||||
import cn.odboy.util.PageUtil;
|
import cn.odboy.util.PageUtil;
|
||||||
@@ -109,7 +109,7 @@ public class QuartzJobServiceImpl extends ServiceImpl<QuartzJobMapper, QuartzJob
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void deleteJobByIds(Set<Long> ids) {
|
public void removeJobByIds(Set<Long> ids) {
|
||||||
for (Long id : ids) {
|
for (Long id : ids) {
|
||||||
QuartzJob quartzJob = getById(id);
|
QuartzJob quartzJob = getById(id);
|
||||||
quartzManage.deleteJob(quartzJob);
|
quartzManage.deleteJob(quartzJob);
|
||||||
@@ -126,6 +126,10 @@ public class QuartzJobServiceImpl extends ServiceImpl<QuartzJobMapper, QuartzJob
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
QuartzJob quartzJob = getById(Long.parseLong(id));
|
QuartzJob quartzJob = getById(Long.parseLong(id));
|
||||||
|
if (quartzJob == null) {
|
||||||
|
// 防止子任务不存在
|
||||||
|
continue;
|
||||||
|
}
|
||||||
// 执行任务
|
// 执行任务
|
||||||
String uuid = IdUtil.simpleUUID();
|
String uuid = IdUtil.simpleUUID();
|
||||||
quartzJob.setUuid(uuid);
|
quartzJob.setUuid(uuid);
|
||||||
|
|||||||
+5
@@ -7,13 +7,16 @@ import cn.odboy.application.core.config.CaptchaProperties;
|
|||||||
import cn.odboy.application.core.config.LoginProperties;
|
import cn.odboy.application.core.config.LoginProperties;
|
||||||
import cn.odboy.application.core.constant.LoginCodeEnum;
|
import cn.odboy.application.core.constant.LoginCodeEnum;
|
||||||
import cn.odboy.application.core.context.TokenProvider;
|
import cn.odboy.application.core.context.TokenProvider;
|
||||||
|
import cn.odboy.application.core.service.UserOnlineService;
|
||||||
import cn.odboy.application.core.service.impl.UserDetailsServiceImpl;
|
import cn.odboy.application.core.service.impl.UserDetailsServiceImpl;
|
||||||
import cn.odboy.application.core.service.impl.UserOnlineServiceImpl;
|
import cn.odboy.application.core.service.impl.UserOnlineServiceImpl;
|
||||||
|
import cn.odboy.base.PageResult;
|
||||||
import cn.odboy.constant.SystemConst;
|
import cn.odboy.constant.SystemConst;
|
||||||
import cn.odboy.constant.SystemRedisKey;
|
import cn.odboy.constant.SystemRedisKey;
|
||||||
import cn.odboy.context.SecurityHelper;
|
import cn.odboy.context.SecurityHelper;
|
||||||
import cn.odboy.exception.BadRequestException;
|
import cn.odboy.exception.BadRequestException;
|
||||||
import cn.odboy.model.system.model.UserJwtModel;
|
import cn.odboy.model.system.model.UserJwtModel;
|
||||||
|
import cn.odboy.model.system.model.UserOnlineModel;
|
||||||
import cn.odboy.model.system.request.UserLoginRequest;
|
import cn.odboy.model.system.request.UserLoginRequest;
|
||||||
import cn.odboy.model.system.response.UserInfoResponse;
|
import cn.odboy.model.system.response.UserInfoResponse;
|
||||||
import cn.odboy.properties.RsaProperties;
|
import cn.odboy.properties.RsaProperties;
|
||||||
@@ -25,8 +28,10 @@ import io.swagger.annotations.Api;
|
|||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.http.HttpStatus;
|
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.authentication.UsernamePasswordAuthenticationToken;
|
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||||
import org.springframework.security.core.Authentication;
|
import org.springframework.security.core.Authentication;
|
||||||
import org.springframework.security.core.context.SecurityContextHolder;
|
import org.springframework.security.core.context.SecurityContextHolder;
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@ public interface UserCacheService {
|
|||||||
* @param userName 用户名
|
* @param userName 用户名
|
||||||
*/
|
*/
|
||||||
@Async
|
@Async
|
||||||
void cacheUserJwtModelByUserName(String userName, UserJwtModel user);
|
void saveUserJwtModelByUserName(String userName, UserJwtModel user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 清理用户缓存信息
|
* 清理用户缓存信息
|
||||||
|
|||||||
+1
-1
@@ -30,7 +30,7 @@ public class UserCacheServiceImpl implements UserCacheService {
|
|||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void cacheUserJwtModelByUserName(String userName, UserJwtModel user) {
|
public void saveUserJwtModelByUserName(String userName, UserJwtModel user) {
|
||||||
// 转小写
|
// 转小写
|
||||||
userName = StringUtil.lowerCase(userName);
|
userName = StringUtil.lowerCase(userName);
|
||||||
if (StringUtil.isNotEmpty(userName)) {
|
if (StringUtil.isNotEmpty(userName)) {
|
||||||
|
|||||||
+1
-1
@@ -39,7 +39,7 @@ public class UserDetailsServiceImpl implements UserDetailsService {
|
|||||||
// 初始化JwtUserDto
|
// 初始化JwtUserDto
|
||||||
userJwtModel = new UserJwtModel(user, dataService.describeDeptIdListByUserIdWithDeptId(user), authorities);
|
userJwtModel = new UserJwtModel(user, dataService.describeDeptIdListByUserIdWithDeptId(user), authorities);
|
||||||
// 添加缓存数据
|
// 添加缓存数据
|
||||||
userCacheService.cacheUserJwtModelByUserName(username, userJwtModel);
|
userCacheService.saveUserJwtModelByUserName(username, userJwtModel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return userJwtModel;
|
return userJwtModel;
|
||||||
|
|||||||
+4
-4
@@ -31,20 +31,20 @@ public class CaptchaController {
|
|||||||
@ApiOperation("重置邮箱,发送验证码")
|
@ApiOperation("重置邮箱,发送验证码")
|
||||||
@PostMapping(value = "/sendResetEmailCaptcha")
|
@PostMapping(value = "/sendResetEmailCaptcha")
|
||||||
public ResponseEntity<Object> sendResetEmailCaptcha(@RequestParam String email) {
|
public ResponseEntity<Object> sendResetEmailCaptcha(@RequestParam String email) {
|
||||||
emailService.sendEmailCaptcha(email, CodeEnum.EMAIL_RESET_EMAIL_CODE.getKey());
|
emailService.sendEmail(captchaService.renderCodeTemplate(email, CodeEnum.EMAIL_RESET_EMAIL_CODE.getKey()));
|
||||||
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<Object> sendResetPasswordCaptcha(@RequestParam String email) {
|
||||||
emailService.sendEmailCaptcha(email, CodeEnum.EMAIL_RESET_PWD_CODE.getKey());
|
emailService.sendEmail(captchaService.renderCodeTemplate(email, CodeEnum.EMAIL_RESET_PWD_CODE.getKey()));
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("验证码验证")
|
@ApiOperation("验证码验证")
|
||||||
@PostMapping(value = "/validatedCaptcha")
|
@PostMapping(value = "/checkCodeAvailable")
|
||||||
public ResponseEntity<Object> validatedCaptcha(@RequestParam String email, @RequestParam String code, @RequestParam Integer codeBi) {
|
public ResponseEntity<Object> checkCodeAvailable(@RequestParam String email, @RequestParam String code, @RequestParam Integer codeBi) {
|
||||||
CodeBiEnum biEnum = CodeBiEnum.find(codeBi);
|
CodeBiEnum biEnum = CodeBiEnum.find(codeBi);
|
||||||
switch (Objects.requireNonNull(biEnum)) {
|
switch (Objects.requireNonNull(biEnum)) {
|
||||||
case ONE:
|
case ONE:
|
||||||
|
|||||||
+11
-11
@@ -44,15 +44,15 @@ public class DeptController {
|
|||||||
@ApiOperation("查询部门")
|
@ApiOperation("查询部门")
|
||||||
@GetMapping
|
@GetMapping
|
||||||
@PreAuthorize("@el.check('user:list','dept:list')")
|
@PreAuthorize("@el.check('user:list','dept:list')")
|
||||||
public ResponseEntity<PageResult<Dept>> queryDept(QueryDeptRequest criteria) throws Exception {
|
public ResponseEntity<PageResult<Dept>> describeDeptPage(QueryDeptRequest criteria) throws Exception {
|
||||||
List<Dept> depts = deptService.describeDeptList(criteria, true);
|
List<Dept> depts = deptService.describeDeptList(criteria, true);
|
||||||
return new ResponseEntity<>(PageUtil.toPage(depts), HttpStatus.OK);
|
return new ResponseEntity<>(PageUtil.toPage(depts), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("查询部门:根据ID获取同级与上级数据")
|
@ApiOperation("查询部门:根据ID获取同级与上级数据")
|
||||||
@PostMapping("/getDeptSuperior")
|
@PostMapping("/describeDeptSuperiorTree")
|
||||||
@PreAuthorize("@el.check('user:list','dept:list')")
|
@PreAuthorize("@el.check('user:list','dept:list')")
|
||||||
public ResponseEntity<Object> getDeptSuperior(@RequestBody List<Long> ids, @RequestParam(defaultValue = "false") Boolean exclude) {
|
public ResponseEntity<Object> describeDeptSuperiorTree(@RequestBody List<Long> ids, @RequestParam(defaultValue = "false") Boolean exclude) {
|
||||||
Set<Dept> deptSet = new LinkedHashSet<>();
|
Set<Dept> deptSet = new LinkedHashSet<>();
|
||||||
for (Long id : ids) {
|
for (Long id : ids) {
|
||||||
Dept dept = deptService.describeDeptById(id);
|
Dept dept = deptService.describeDeptById(id);
|
||||||
@@ -72,31 +72,31 @@ public class DeptController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("新增部门")
|
@ApiOperation("新增部门")
|
||||||
@PostMapping(value = "/createDept")
|
@PostMapping(value = "/saveDept")
|
||||||
@PreAuthorize("@el.check('dept:add')")
|
@PreAuthorize("@el.check('dept:add')")
|
||||||
public ResponseEntity<Object> createDept(@Validated @RequestBody CreateDeptRequest resources) {
|
public ResponseEntity<Object> saveDept(@Validated @RequestBody CreateDeptRequest resources) {
|
||||||
deptService.createDept(resources);
|
deptService.saveDept(resources);
|
||||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("修改部门")
|
@ApiOperation("修改部门")
|
||||||
@PostMapping(value = "/updateDept")
|
@PostMapping(value = "/modifyDept")
|
||||||
@PreAuthorize("@el.check('dept:edit')")
|
@PreAuthorize("@el.check('dept:edit')")
|
||||||
public ResponseEntity<Object> updateDept(@Validated(Dept.Update.class) @RequestBody Dept resources) {
|
public ResponseEntity<Object> modifyDept(@Validated(Dept.Update.class) @RequestBody Dept resources) {
|
||||||
deptService.modifyDept(resources);
|
deptService.modifyDept(resources);
|
||||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("删除部门")
|
@ApiOperation("删除部门")
|
||||||
@PostMapping(value = "/deleteDept")
|
@PostMapping(value = "/removeDeptByIds")
|
||||||
@PreAuthorize("@el.check('dept:del')")
|
@PreAuthorize("@el.check('dept:del')")
|
||||||
public ResponseEntity<Object> deleteDept(@RequestBody Set<Long> ids) {
|
public ResponseEntity<Object> removeDeptByIds(@RequestBody Set<Long> ids) {
|
||||||
Set<Dept> depts = new HashSet<>();
|
Set<Dept> depts = new HashSet<>();
|
||||||
// 获取部门,和其所有子部门
|
// 获取部门,和其所有子部门
|
||||||
deptService.traverseDeptByIdWithPids(ids, depts);
|
deptService.traverseDeptByIdWithPids(ids, depts);
|
||||||
// 验证是否被角色或用户关联
|
// 验证是否被角色或用户关联
|
||||||
deptService.verifyBindRelationByIds(depts);
|
deptService.verifyBindRelationByIds(depts);
|
||||||
deptService.deleteDeptByIds(depts);
|
deptService.removeDeptByIds(depts);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+8
-8
@@ -53,26 +53,26 @@ public class DictController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("新增字典")
|
@ApiOperation("新增字典")
|
||||||
@PostMapping(value = "/createDict")
|
@PostMapping(value = "/saveDict")
|
||||||
@PreAuthorize("@el.check('dict:add')")
|
@PreAuthorize("@el.check('dict:add')")
|
||||||
public ResponseEntity<Object> createDict(@Validated @RequestBody CreateDictRequest resources) {
|
public ResponseEntity<Object> saveDict(@Validated @RequestBody CreateDictRequest resources) {
|
||||||
dictService.createDict(resources);
|
dictService.saveDict(resources);
|
||||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("修改字典")
|
@ApiOperation("修改字典")
|
||||||
@PostMapping(value = "/updateDict")
|
@PostMapping(value = "/modifyDictById")
|
||||||
@PreAuthorize("@el.check('dict:edit')")
|
@PreAuthorize("@el.check('dict:edit')")
|
||||||
public ResponseEntity<Object> updateDict(@Validated(Dict.Update.class) @RequestBody Dict resources) {
|
public ResponseEntity<Object> modifyDictById(@Validated(Dict.Update.class) @RequestBody Dict resources) {
|
||||||
dictService.modifyDictById(resources);
|
dictService.modifyDictById(resources);
|
||||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("删除字典")
|
@ApiOperation("删除字典")
|
||||||
@PostMapping(value = "/deleteDict")
|
@PostMapping(value = "/removeDictByIds")
|
||||||
@PreAuthorize("@el.check('dict:del')")
|
@PreAuthorize("@el.check('dict:del')")
|
||||||
public ResponseEntity<Object> deleteDict(@RequestBody Set<Long> ids) {
|
public ResponseEntity<Object> removeDictByIds(@RequestBody Set<Long> ids) {
|
||||||
dictService.deleteDictByIds(ids);
|
dictService.removeDictByIds(ids);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+8
-11
@@ -13,11 +13,8 @@ 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.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
@@ -35,7 +32,7 @@ public class DictDetailController {
|
|||||||
|
|
||||||
@ApiOperation("查询字典详情")
|
@ApiOperation("查询字典详情")
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public ResponseEntity<PageResult<DictDetail>> queryDictDetail(QueryDictDetailRequest criteria) {
|
public ResponseEntity<PageResult<DictDetail>> describeDictDetailPage(QueryDictDetailRequest criteria) {
|
||||||
Page<Object> page = new Page<>(criteria.getPage(), criteria.getSize());
|
Page<Object> page = new Page<>(criteria.getPage(), criteria.getSize());
|
||||||
return new ResponseEntity<>(dictDetailService.describeDictDetailPage(criteria, page), HttpStatus.OK);
|
return new ResponseEntity<>(dictDetailService.describeDictDetailPage(criteria, page), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
@@ -52,26 +49,26 @@ public class DictDetailController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("新增字典详情")
|
@ApiOperation("新增字典详情")
|
||||||
@PostMapping
|
@PostMapping(value = "/saveDictDetail")
|
||||||
@PreAuthorize("@el.check('dict:add')")
|
@PreAuthorize("@el.check('dict:add')")
|
||||||
public ResponseEntity<Object> createDictDetail(@Validated @RequestBody CreateDictDetailRequest resources) {
|
public ResponseEntity<Object> saveDictDetail(@Validated @RequestBody CreateDictDetailRequest resources) {
|
||||||
dictDetailService.saveDictDetail(resources);
|
dictDetailService.saveDictDetail(resources);
|
||||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("修改字典详情")
|
@ApiOperation("修改字典详情")
|
||||||
@PutMapping
|
@PostMapping(value = "/modifyDictDetailById")
|
||||||
@PreAuthorize("@el.check('dict:edit')")
|
@PreAuthorize("@el.check('dict:edit')")
|
||||||
public ResponseEntity<Object> updateDictDetail(@Validated(DictDetail.Update.class) @RequestBody DictDetail resources) {
|
public ResponseEntity<Object> modifyDictDetailById(@Validated(DictDetail.Update.class) @RequestBody DictDetail resources) {
|
||||||
dictDetailService.modifyDictDetailById(resources);
|
dictDetailService.modifyDictDetailById(resources);
|
||||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("删除字典详情")
|
@ApiOperation("删除字典详情")
|
||||||
@DeleteMapping(value = "/{id}")
|
@PostMapping(value = "/removeDictDetailById")
|
||||||
@PreAuthorize("@el.check('dict:del')")
|
@PreAuthorize("@el.check('dict:del')")
|
||||||
public ResponseEntity<Object> deleteDictDetail(@PathVariable Long id) {
|
public ResponseEntity<Object> removeDictDetailById(@RequestBody DictDetail args) {
|
||||||
dictDetailService.deleteDictDetailById(id);
|
dictDetailService.removeDictDetailById(args.getId());
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+8
-8
@@ -46,28 +46,28 @@ public class JobController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("新增岗位")
|
@ApiOperation("新增岗位")
|
||||||
@PostMapping(value = "/createJob")
|
@PostMapping(value = "/saveJob")
|
||||||
@PreAuthorize("@el.check('job:add')")
|
@PreAuthorize("@el.check('job:add')")
|
||||||
public ResponseEntity<Object> createJob(@Validated @RequestBody CreateJobRequest resources) {
|
public ResponseEntity<Object> saveJob(@Validated @RequestBody CreateJobRequest resources) {
|
||||||
jobService.createJob(resources);
|
jobService.saveJob(resources);
|
||||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("修改岗位")
|
@ApiOperation("修改岗位")
|
||||||
@PostMapping(value = "/updateJob")
|
@PostMapping(value = "/modifyJobById")
|
||||||
@PreAuthorize("@el.check('job:edit')")
|
@PreAuthorize("@el.check('job:edit')")
|
||||||
public ResponseEntity<Object> updateJob(@Validated(Job.Update.class) @RequestBody Job resources) {
|
public ResponseEntity<Object> modifyJobById(@Validated(Job.Update.class) @RequestBody Job resources) {
|
||||||
jobService.modifyJobById(resources);
|
jobService.modifyJobById(resources);
|
||||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("删除岗位")
|
@ApiOperation("删除岗位")
|
||||||
@PostMapping(value = "/deleteJob")
|
@PostMapping(value = "/removeJobByIds")
|
||||||
@PreAuthorize("@el.check('job:del')")
|
@PreAuthorize("@el.check('job:del')")
|
||||||
public ResponseEntity<Object> deleteJob(@RequestBody Set<Long> ids) {
|
public ResponseEntity<Object> removeJobByIds(@RequestBody Set<Long> ids) {
|
||||||
// 验证是否被用户关联
|
// 验证是否被用户关联
|
||||||
jobService.verifyBindRelationByIds(ids);
|
jobService.verifyBindRelationByIds(ids);
|
||||||
jobService.deleteJobByIds(ids);
|
jobService.removeJobByIds(ids);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+14
-14
@@ -56,16 +56,16 @@ public class MenuController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("返回全部的菜单")
|
@ApiOperation("返回全部的菜单")
|
||||||
@PostMapping(value = "/queryAllMenu")
|
@PostMapping(value = "/describeMenuListByPid")
|
||||||
@PreAuthorize("@el.check('menu:list','roles:list')")
|
@PreAuthorize("@el.check('menu:list','roles:list')")
|
||||||
public ResponseEntity<List<Menu>> queryAllMenu(@RequestParam Long pid) {
|
public ResponseEntity<List<Menu>> describeMenuListByPid(@RequestParam Long pid) {
|
||||||
return new ResponseEntity<>(menuService.describeMenuListByPid(pid), HttpStatus.OK);
|
return new ResponseEntity<>(menuService.describeMenuListByPid(pid), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("根据菜单ID返回所有子节点ID,包含自身ID")
|
@ApiOperation("根据菜单ID返回所有子节点ID,包含自身ID")
|
||||||
@PostMapping(value = "/queryChildMenu")
|
@PostMapping(value = "/describeChildMenuSet")
|
||||||
@PreAuthorize("@el.check('menu:list','roles:list')")
|
@PreAuthorize("@el.check('menu:list','roles:list')")
|
||||||
public ResponseEntity<Object> queryChildMenu(@RequestParam Long id) {
|
public ResponseEntity<Object> describeChildMenuSet(@RequestParam Long id) {
|
||||||
Set<Menu> menuSet = new HashSet<>();
|
Set<Menu> menuSet = new HashSet<>();
|
||||||
List<Menu> menuList = menuService.describeMenuListByPid(id);
|
List<Menu> menuList = menuService.describeMenuListByPid(id);
|
||||||
menuSet.add(menuService.getById(id));
|
menuSet.add(menuService.getById(id));
|
||||||
@@ -83,9 +83,9 @@ public class MenuController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("查询菜单:根据ID获取同级与上级数据")
|
@ApiOperation("查询菜单:根据ID获取同级与上级数据")
|
||||||
@PostMapping("/queryMenuSuperior")
|
@PostMapping("/describeMenuSuperior")
|
||||||
@PreAuthorize("@el.check('menu:list')")
|
@PreAuthorize("@el.check('menu:list')")
|
||||||
public ResponseEntity<List<Menu>> queryMenuSuperior(@RequestBody List<Long> ids) {
|
public ResponseEntity<List<Menu>> describeMenuSuperior(@RequestBody List<Long> ids) {
|
||||||
Set<Menu> menus = new LinkedHashSet<>();
|
Set<Menu> menus = new LinkedHashSet<>();
|
||||||
if (CollectionUtil.isNotEmpty(ids)) {
|
if (CollectionUtil.isNotEmpty(ids)) {
|
||||||
for (Long id : ids) {
|
for (Long id : ids) {
|
||||||
@@ -106,35 +106,35 @@ public class MenuController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("新增菜单")
|
@ApiOperation("新增菜单")
|
||||||
@PostMapping(value = "/createMenu")
|
@PostMapping(value = "/saveMenu")
|
||||||
@PreAuthorize("@el.check('menu:add')")
|
@PreAuthorize("@el.check('menu:add')")
|
||||||
public ResponseEntity<Object> createMenu(@Validated @RequestBody Menu resources) {
|
public ResponseEntity<Object> saveMenu(@Validated @RequestBody Menu 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");
|
||||||
}
|
}
|
||||||
menuService.createMenu(resources);
|
menuService.saveMenu(resources);
|
||||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("修改菜单")
|
@ApiOperation("修改菜单")
|
||||||
@PostMapping(value = "/updateMenu")
|
@PostMapping(value = "/modifyMenuById")
|
||||||
@PreAuthorize("@el.check('menu:edit')")
|
@PreAuthorize("@el.check('menu:edit')")
|
||||||
public ResponseEntity<Object> updateMenu(@Validated(Menu.Update.class) @RequestBody Menu resources) {
|
public ResponseEntity<Object> modifyMenuById(@Validated(Menu.Update.class) @RequestBody Menu resources) {
|
||||||
menuService.modifyMenuById(resources);
|
menuService.modifyMenuById(resources);
|
||||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("删除菜单")
|
@ApiOperation("删除菜单")
|
||||||
@PostMapping(value = "/deleteMenu")
|
@PostMapping(value = "/removeMenuByIds")
|
||||||
@PreAuthorize("@el.check('menu:del')")
|
@PreAuthorize("@el.check('menu:del')")
|
||||||
public ResponseEntity<Object> deleteMenu(@RequestBody Set<Long> ids) {
|
public ResponseEntity<Object> removeMenuByIds(@RequestBody Set<Long> ids) {
|
||||||
Set<Menu> menuSet = new HashSet<>();
|
Set<Menu> menuSet = new HashSet<>();
|
||||||
for (Long id : ids) {
|
for (Long id : ids) {
|
||||||
List<Menu> menuList = menuService.describeMenuListByPid(id);
|
List<Menu> menuList = menuService.describeMenuListByPid(id);
|
||||||
menuSet.add(menuService.getById(id));
|
menuSet.add(menuService.getById(id));
|
||||||
menuSet = menuService.describeChildMenuSet(menuList, menuSet);
|
menuSet = menuService.describeChildMenuSet(menuList, menuSet);
|
||||||
}
|
}
|
||||||
menuService.deleteMenuByIds(menuSet);
|
menuService.removeMenuByIds(menuSet);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -7,7 +7,7 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import org.springframework.http.HttpStatus;
|
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.web.bind.annotation.GetMapping;
|
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;
|
||||||
|
|
||||||
@@ -19,10 +19,10 @@ public class MonitorController {
|
|||||||
|
|
||||||
private final MonitorService serverService;
|
private final MonitorService serverService;
|
||||||
|
|
||||||
@GetMapping
|
@PostMapping(value = "/describeServerMonitorInfo")
|
||||||
@ApiOperation("查询服务监控")
|
@ApiOperation("查询服务监控")
|
||||||
@PreAuthorize("@el.check('monitor:list')")
|
@PreAuthorize("@el.check('monitor:list')")
|
||||||
public ResponseEntity<Object> queryMonitor() {
|
public ResponseEntity<Object> describeServerMonitorInfo() {
|
||||||
return new ResponseEntity<>(serverService.describeServerMonitorInfo(), HttpStatus.OK);
|
return new ResponseEntity<>(serverService.describeServerMonitorInfo(), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+18
-19
@@ -17,7 +17,6 @@ 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.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
@@ -38,10 +37,10 @@ public class RoleController {
|
|||||||
private final RoleService roleService;
|
private final RoleService roleService;
|
||||||
|
|
||||||
@ApiOperation("获取单个role")
|
@ApiOperation("获取单个role")
|
||||||
@PostMapping(value = "/getRoleById/{id}")
|
@PostMapping(value = "/describeRoleById")
|
||||||
@PreAuthorize("@el.check('roles:list')")
|
@PreAuthorize("@el.check('roles:list')")
|
||||||
public ResponseEntity<Role> getRoleById(@PathVariable Long id) {
|
public ResponseEntity<Role> describeRoleById(@RequestBody Role args) {
|
||||||
return new ResponseEntity<>(roleService.describeRoleById(id), HttpStatus.OK);
|
return new ResponseEntity<>(roleService.describeRoleById(args.getId()), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("导出角色数据")
|
@ApiOperation("导出角色数据")
|
||||||
@@ -52,48 +51,48 @@ public class RoleController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("返回全部的角色")
|
@ApiOperation("返回全部的角色")
|
||||||
@PostMapping(value = "/queryAllRole")
|
@PostMapping(value = "/describeRoleList")
|
||||||
@PreAuthorize("@el.check('roles:list','user:add','user:edit')")
|
@PreAuthorize("@el.check('roles:list','user:add','user:edit')")
|
||||||
public ResponseEntity<List<Role>> queryAllRole() {
|
public ResponseEntity<List<Role>> describeRoleList() {
|
||||||
return new ResponseEntity<>(roleService.describeRoleList(), HttpStatus.OK);
|
return new ResponseEntity<>(roleService.describeRoleList(), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("查询角色")
|
@ApiOperation("查询角色")
|
||||||
@GetMapping
|
@GetMapping
|
||||||
@PreAuthorize("@el.check('roles:list')")
|
@PreAuthorize("@el.check('roles:list')")
|
||||||
public ResponseEntity<PageResult<Role>> queryRole(QueryRoleRequest criteria) {
|
public ResponseEntity<PageResult<Role>> describeRolePage(QueryRoleRequest criteria) {
|
||||||
Page<Object> page = new Page<>(criteria.getPage(), criteria.getSize());
|
Page<Object> page = new Page<>(criteria.getPage(), criteria.getSize());
|
||||||
return new ResponseEntity<>(roleService.describeRolePage(criteria, page), HttpStatus.OK);
|
return new ResponseEntity<>(roleService.describeRolePage(criteria, page), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("获取用户级别")
|
@ApiOperation("获取用户级别")
|
||||||
@PostMapping(value = "/getRoleLevel")
|
@PostMapping(value = "/describeRoleLevel")
|
||||||
public ResponseEntity<Object> getRoleLevel() {
|
public ResponseEntity<Object> describeRoleLevel() {
|
||||||
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 = "/createRole")
|
@PostMapping(value = "/saveRole")
|
||||||
@PreAuthorize("@el.check('roles:add')")
|
@PreAuthorize("@el.check('roles:add')")
|
||||||
public ResponseEntity<Object> createRole(@Validated @RequestBody CreateRoleRequest resources) {
|
public ResponseEntity<Object> saveRole(@Validated @RequestBody CreateRoleRequest resources) {
|
||||||
checkRoleLevels(resources.getLevel());
|
checkRoleLevels(resources.getLevel());
|
||||||
roleService.createRole(resources);
|
roleService.saveRole(resources);
|
||||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("修改角色")
|
@ApiOperation("修改角色")
|
||||||
@PostMapping(value = "/updateRole")
|
@PostMapping(value = "/modifyRoleById")
|
||||||
@PreAuthorize("@el.check('roles:edit')")
|
@PreAuthorize("@el.check('roles:edit')")
|
||||||
public ResponseEntity<Object> updateRole(@Validated(Role.Update.class) @RequestBody Role resources) {
|
public ResponseEntity<Object> modifyRoleById(@Validated(Role.Update.class) @RequestBody Role resources) {
|
||||||
checkRoleLevels(resources.getLevel());
|
checkRoleLevels(resources.getLevel());
|
||||||
roleService.modifyRoleById(resources);
|
roleService.modifyRoleById(resources);
|
||||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("修改角色菜单")
|
@ApiOperation("修改角色菜单")
|
||||||
@PostMapping(value = "/updateRoleMenu")
|
@PostMapping(value = "/modifyBindMenuById")
|
||||||
@PreAuthorize("@el.check('roles:edit')")
|
@PreAuthorize("@el.check('roles:edit')")
|
||||||
public ResponseEntity<Object> updateRoleMenu(@RequestBody Role resources) {
|
public ResponseEntity<Object> modifyBindMenuById(@RequestBody Role resources) {
|
||||||
Role role = roleService.getById(resources.getId());
|
Role role = roleService.getById(resources.getId());
|
||||||
checkRoleLevels(role.getLevel());
|
checkRoleLevels(role.getLevel());
|
||||||
roleService.modifyBindMenuById(resources);
|
roleService.modifyBindMenuById(resources);
|
||||||
@@ -101,16 +100,16 @@ public class RoleController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("删除角色")
|
@ApiOperation("删除角色")
|
||||||
@PostMapping(value = "/deleteRole")
|
@PostMapping(value = "/removeRoleByIds")
|
||||||
@PreAuthorize("@el.check('roles:del')")
|
@PreAuthorize("@el.check('roles:del')")
|
||||||
public ResponseEntity<Object> deleteRole(@RequestBody Set<Long> ids) {
|
public ResponseEntity<Object> removeRoleByIds(@RequestBody Set<Long> ids) {
|
||||||
for (Long id : ids) {
|
for (Long id : ids) {
|
||||||
Role role = roleService.getById(id);
|
Role role = roleService.getById(id);
|
||||||
checkRoleLevels(role.getLevel());
|
checkRoleLevels(role.getLevel());
|
||||||
}
|
}
|
||||||
// 验证是否被用户关联
|
// 验证是否被用户关联
|
||||||
roleService.verifyBindRelationByIds(ids);
|
roleService.verifyBindRelationByIds(ids);
|
||||||
roleService.deleteRoleByIds(ids);
|
roleService.removeRoleByIds(ids);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+21
-21
@@ -63,7 +63,7 @@ public class UserController {
|
|||||||
@ApiOperation("导出用户数据")
|
@ApiOperation("导出用户数据")
|
||||||
@GetMapping(value = "/download")
|
@GetMapping(value = "/download")
|
||||||
@PreAuthorize("@el.check('user:list')")
|
@PreAuthorize("@el.check('user:list')")
|
||||||
public void exportUser(HttpServletResponse response, QueryUserRequest criteria) throws IOException {
|
public void downloadUserExcel(HttpServletResponse response, QueryUserRequest criteria) throws IOException {
|
||||||
userService.downloadUserExcel(userService.describeUserList(criteria), response);
|
userService.downloadUserExcel(userService.describeUserList(criteria), response);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,28 +97,28 @@ public class UserController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("新增用户")
|
@ApiOperation("新增用户")
|
||||||
@PostMapping(value = "/createUser")
|
@PostMapping(value = "/saveUser")
|
||||||
@PreAuthorize("@el.check('user:add')")
|
@PreAuthorize("@el.check('user:add')")
|
||||||
public ResponseEntity<Object> createUser(@Validated @RequestBody User resources) {
|
public ResponseEntity<Object> saveUser(@Validated @RequestBody User resources) {
|
||||||
checkLevel(resources);
|
checkLevel(resources);
|
||||||
// 默认密码 123456
|
// 默认密码 123456
|
||||||
resources.setPassword(passwordEncoder.encode("123456"));
|
resources.setPassword(passwordEncoder.encode("123456"));
|
||||||
userService.createUser(resources);
|
userService.saveUser(resources);
|
||||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("修改用户")
|
@ApiOperation("修改用户")
|
||||||
@PostMapping(value = "/updateUser")
|
@PostMapping(value = "/modifyUserById")
|
||||||
@PreAuthorize("@el.check('user:edit')")
|
@PreAuthorize("@el.check('user:edit')")
|
||||||
public ResponseEntity<Object> updateUser(@Validated(User.Update.class) @RequestBody User resources) throws Exception {
|
public ResponseEntity<Object> modifyUserById(@Validated(User.Update.class) @RequestBody User resources) throws Exception {
|
||||||
checkLevel(resources);
|
checkLevel(resources);
|
||||||
userService.modifyUserById(resources);
|
userService.modifyUserById(resources);
|
||||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("修改用户:个人中心")
|
@ApiOperation("修改用户:个人中心")
|
||||||
@PostMapping(value = "updateCenterInfo")
|
@PostMapping(value = "modifyUserCenterInfoById")
|
||||||
public ResponseEntity<Object> updateCenterInfo(@Validated(User.Update.class) @RequestBody User resources) {
|
public ResponseEntity<Object> modifyUserCenterInfoById(@Validated(User.Update.class) @RequestBody User resources) {
|
||||||
if (!resources.getId().equals(SecurityHelper.getCurrentUserId())) {
|
if (!resources.getId().equals(SecurityHelper.getCurrentUserId())) {
|
||||||
throw new BadRequestException("不能修改他人资料");
|
throw new BadRequestException("不能修改他人资料");
|
||||||
}
|
}
|
||||||
@@ -127,9 +127,9 @@ public class UserController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("删除用户")
|
@ApiOperation("删除用户")
|
||||||
@PostMapping(value = "/deleteUser")
|
@PostMapping(value = "/removeUserByIds")
|
||||||
@PreAuthorize("@el.check('user:del')")
|
@PreAuthorize("@el.check('user:del')")
|
||||||
public ResponseEntity<Object> deleteUser(@RequestBody Set<Long> ids) {
|
public ResponseEntity<Object> removeUserByIds(@RequestBody Set<Long> ids) {
|
||||||
for (Long id : ids) {
|
for (Long id : ids) {
|
||||||
Integer currentLevel = Collections.min(roleService.describeRoleListByUsersId(SecurityHelper.getCurrentUserId()).stream().map(Role::getLevel).collect(Collectors.toList()));
|
Integer currentLevel = Collections.min(roleService.describeRoleListByUsersId(SecurityHelper.getCurrentUserId()).stream().map(Role::getLevel).collect(Collectors.toList()));
|
||||||
Integer optLevel = Collections.min(roleService.describeRoleListByUsersId(id).stream().map(Role::getLevel).collect(Collectors.toList()));
|
Integer optLevel = Collections.min(roleService.describeRoleListByUsersId(id).stream().map(Role::getLevel).collect(Collectors.toList()));
|
||||||
@@ -137,13 +137,13 @@ public class UserController {
|
|||||||
throw new BadRequestException("角色权限不足,不能删除:" + userService.describeUserById(id).getUsername());
|
throw new BadRequestException("角色权限不足,不能删除:" + userService.describeUserById(id).getUsername());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
userService.deleteUserByIds(ids);
|
userService.removeUserByIds(ids);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("修改密码")
|
@ApiOperation("修改密码")
|
||||||
@PostMapping(value = "/updatePassword")
|
@PostMapping(value = "/modifyUserPasswordByUsername")
|
||||||
public ResponseEntity<Object> updatePassword(@RequestBody UpdateUserPasswordResponse passVo) throws Exception {
|
public ResponseEntity<Object> modifyUserPasswordByUsername(@RequestBody UpdateUserPasswordResponse passVo) throws Exception {
|
||||||
String oldPass = RsaEncryptUtil.decryptByPrivateKey(RsaProperties.privateKey, passVo.getOldPass());
|
String oldPass = RsaEncryptUtil.decryptByPrivateKey(RsaProperties.privateKey, passVo.getOldPass());
|
||||||
String newPass = RsaEncryptUtil.decryptByPrivateKey(RsaProperties.privateKey, passVo.getNewPass());
|
String newPass = RsaEncryptUtil.decryptByPrivateKey(RsaProperties.privateKey, passVo.getNewPass());
|
||||||
User user = userService.describeUserByUsername(SecurityHelper.getCurrentUsername());
|
User user = userService.describeUserByUsername(SecurityHelper.getCurrentUsername());
|
||||||
@@ -158,22 +158,22 @@ public class UserController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("重置密码")
|
@ApiOperation("重置密码")
|
||||||
@PostMapping(value = "/resetPwd")
|
@PostMapping(value = "/resetUserPasswordByIds")
|
||||||
public ResponseEntity<Object> resetPwd(@RequestBody Set<Long> ids) {
|
public ResponseEntity<Object> resetUserPasswordByIds(@RequestBody Set<Long> ids) {
|
||||||
String defaultPwd = passwordEncoder.encode("123456");
|
String defaultPwd = passwordEncoder.encode("123456");
|
||||||
userService.resetUserPasswordByIds(ids, defaultPwd);
|
userService.resetUserPasswordByIds(ids, defaultPwd);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("修改头像")
|
@ApiOperation("修改头像")
|
||||||
@PostMapping(value = "/updateAvatar")
|
@PostMapping(value = "/modifyUserAvatar")
|
||||||
public ResponseEntity<Object> updateUserAvatar(@RequestParam MultipartFile avatar) {
|
public ResponseEntity<Object> modifyUserAvatar(@RequestParam MultipartFile avatar) {
|
||||||
return new ResponseEntity<>(userService.modifyUserAvatar(avatar), HttpStatus.OK);
|
return new ResponseEntity<>(userService.modifyUserAvatar(avatar), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("修改邮箱")
|
@ApiOperation("修改邮箱")
|
||||||
@PostMapping(value = "/updateEmail/{code}")
|
@PostMapping(value = "/modifyUserEmailByUsername/{code}")
|
||||||
public ResponseEntity<Object> updateUserEmail(@PathVariable String code, @RequestBody User resources) throws Exception {
|
public ResponseEntity<Object> modifyUserEmailByUsername(@PathVariable String code, @RequestBody User resources) throws Exception {
|
||||||
String password = RsaEncryptUtil.decryptByPrivateKey(RsaProperties.privateKey, resources.getPassword());
|
String password = RsaEncryptUtil.decryptByPrivateKey(RsaProperties.privateKey, resources.getPassword());
|
||||||
User user = userService.describeUserByUsername(SecurityHelper.getCurrentUsername());
|
User user = userService.describeUserByUsername(SecurityHelper.getCurrentUsername());
|
||||||
if (!passwordEncoder.matches(password, user.getPassword())) {
|
if (!passwordEncoder.matches(password, user.getPassword())) {
|
||||||
@@ -198,9 +198,9 @@ public class UserController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("查询用户基础数据")
|
@ApiOperation("查询用户基础数据")
|
||||||
@PostMapping(value = "/queryUserMetaPage")
|
@PostMapping(value = "/describeUserMetadataOptions")
|
||||||
@PreAuthorize("@el.check('user:list')")
|
@PreAuthorize("@el.check('user:list')")
|
||||||
public ResponseEntity<List<MyMetaOption>> queryUserMetaPage(@Validated @RequestBody QueryUserRequest criteria) {
|
public ResponseEntity<List<MyMetaOption>> queryUserMetadataOptions(@Validated @RequestBody QueryUserRequest criteria) {
|
||||||
int maxPageSize = 50;
|
int maxPageSize = 50;
|
||||||
return new ResponseEntity<>(userService.page(new Page<>(criteria.getPage(), maxPageSize), new LambdaQueryWrapper<User>()
|
return new ResponseEntity<>(userService.page(new Page<>(criteria.getPage(), maxPageSize), new LambdaQueryWrapper<User>()
|
||||||
.and(c -> {
|
.and(c -> {
|
||||||
|
|||||||
+2
-2
@@ -35,7 +35,7 @@ public interface DeptService extends IService<Dept> {
|
|||||||
*
|
*
|
||||||
* @param resources /
|
* @param resources /
|
||||||
*/
|
*/
|
||||||
void createDept(CreateDeptRequest resources);
|
void saveDept(CreateDeptRequest resources);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编辑
|
* 编辑
|
||||||
@@ -49,7 +49,7 @@ public interface DeptService extends IService<Dept> {
|
|||||||
*
|
*
|
||||||
* @param depts /
|
* @param depts /
|
||||||
*/
|
*/
|
||||||
void deleteDeptByIds(Set<Dept> depts);
|
void removeDeptByIds(Set<Dept> depts);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据PID查询
|
* 根据PID查询
|
||||||
|
|||||||
+1
-1
@@ -30,7 +30,7 @@ public interface DictDetailService extends IService<DictDetail> {
|
|||||||
*
|
*
|
||||||
* @param id /
|
* @param id /
|
||||||
*/
|
*/
|
||||||
void deleteDictDetailById(Long id);
|
void removeDictDetailById(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询
|
* 分页查询
|
||||||
|
|||||||
+2
-2
@@ -36,7 +36,7 @@ public interface DictService extends IService<Dict> {
|
|||||||
*
|
*
|
||||||
* @param resources /
|
* @param resources /
|
||||||
*/
|
*/
|
||||||
void createDict(CreateDictRequest resources);
|
void saveDict(CreateDictRequest resources);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编辑
|
* 编辑
|
||||||
@@ -50,7 +50,7 @@ public interface DictService extends IService<Dict> {
|
|||||||
*
|
*
|
||||||
* @param ids /
|
* @param ids /
|
||||||
*/
|
*/
|
||||||
void deleteDictByIds(Set<Long> ids);
|
void removeDictByIds(Set<Long> ids);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出数据
|
* 导出数据
|
||||||
|
|||||||
+2
-2
@@ -27,7 +27,7 @@ public interface JobService extends IService<Job> {
|
|||||||
*
|
*
|
||||||
* @param resources /
|
* @param resources /
|
||||||
*/
|
*/
|
||||||
void createJob(CreateJobRequest resources);
|
void saveJob(CreateJobRequest resources);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编辑
|
* 编辑
|
||||||
@@ -41,7 +41,7 @@ public interface JobService extends IService<Job> {
|
|||||||
*
|
*
|
||||||
* @param ids /
|
* @param ids /
|
||||||
*/
|
*/
|
||||||
void deleteJobByIds(Set<Long> ids);
|
void removeJobByIds(Set<Long> ids);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询
|
* 分页查询
|
||||||
|
|||||||
+2
-2
@@ -34,7 +34,7 @@ public interface MenuService extends IService<Menu> {
|
|||||||
*
|
*
|
||||||
* @param resources /
|
* @param resources /
|
||||||
*/
|
*/
|
||||||
void createMenu(Menu resources);
|
void saveMenu(Menu resources);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编辑
|
* 编辑
|
||||||
@@ -73,7 +73,7 @@ public interface MenuService extends IService<Menu> {
|
|||||||
*
|
*
|
||||||
* @param menuSet /
|
* @param menuSet /
|
||||||
*/
|
*/
|
||||||
void deleteMenuByIds(Set<Menu> menuSet);
|
void removeMenuByIds(Set<Menu> menuSet);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出
|
* 导出
|
||||||
|
|||||||
+2
-2
@@ -53,7 +53,7 @@ public interface RoleService extends IService<Role> {
|
|||||||
*
|
*
|
||||||
* @param resources /
|
* @param resources /
|
||||||
*/
|
*/
|
||||||
void createRole(CreateRoleRequest resources);
|
void saveRole(CreateRoleRequest resources);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编辑
|
* 编辑
|
||||||
@@ -74,7 +74,7 @@ public interface RoleService extends IService<Role> {
|
|||||||
*
|
*
|
||||||
* @param ids /
|
* @param ids /
|
||||||
*/
|
*/
|
||||||
void deleteRoleByIds(Set<Long> ids);
|
void removeRoleByIds(Set<Long> ids);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户ID查询
|
* 根据用户ID查询
|
||||||
|
|||||||
+2
-2
@@ -27,7 +27,7 @@ public interface UserService extends IService<User> {
|
|||||||
*
|
*
|
||||||
* @param resources /
|
* @param resources /
|
||||||
*/
|
*/
|
||||||
void createUser(User resources);
|
void saveUser(User resources);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编辑用户
|
* 编辑用户
|
||||||
@@ -42,7 +42,7 @@ public interface UserService extends IService<User> {
|
|||||||
*
|
*
|
||||||
* @param ids /
|
* @param ids /
|
||||||
*/
|
*/
|
||||||
void deleteUserByIds(Set<Long> ids);
|
void removeUserByIds(Set<Long> ids);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户名查询
|
* 根据用户名查询
|
||||||
|
|||||||
+2
-2
@@ -103,7 +103,7 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements De
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void createDept(CreateDeptRequest resources) {
|
public void saveDept(CreateDeptRequest resources) {
|
||||||
save(BeanUtil.copyProperties(resources, Dept.class));
|
save(BeanUtil.copyProperties(resources, Dept.class));
|
||||||
// 清理缓存
|
// 清理缓存
|
||||||
updateSubCnt(resources.getPid());
|
updateSubCnt(resources.getPid());
|
||||||
@@ -132,7 +132,7 @@ public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements De
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void deleteDeptByIds(Set<Dept> deptSet) {
|
public void removeDeptByIds(Set<Dept> deptSet) {
|
||||||
for (Dept dept : deptSet) {
|
for (Dept dept : deptSet) {
|
||||||
// 清理缓存
|
// 清理缓存
|
||||||
delCaches(dept.getId());
|
delCaches(dept.getId());
|
||||||
|
|||||||
+1
-1
@@ -67,7 +67,7 @@ public class DictDetailServiceImpl extends ServiceImpl<DictDetailMapper, DictDet
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void deleteDictDetailById(Long id) {
|
public void removeDictDetailById(Long id) {
|
||||||
DictDetail dictDetail = getById(id);
|
DictDetail dictDetail = getById(id);
|
||||||
removeById(id);
|
removeById(id);
|
||||||
// 清理缓存
|
// 清理缓存
|
||||||
|
|||||||
+2
-2
@@ -48,7 +48,7 @@ public class DictServiceImpl extends ServiceImpl<DictMapper, Dict> implements Di
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void createDict(CreateDictRequest resources) {
|
public void saveDict(CreateDictRequest resources) {
|
||||||
save(BeanUtil.copyProperties(resources, Dict.class));
|
save(BeanUtil.copyProperties(resources, Dict.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ public class DictServiceImpl extends ServiceImpl<DictMapper, Dict> implements Di
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void deleteDictByIds(Set<Long> ids) {
|
public void removeDictByIds(Set<Long> ids) {
|
||||||
// 清理缓存
|
// 清理缓存
|
||||||
List<Dict> dicts = dictMapper.selectByIds(ids);
|
List<Dict> dicts = dictMapper.selectByIds(ids);
|
||||||
for (Dict dict : dicts) {
|
for (Dict dict : dicts) {
|
||||||
|
|||||||
+2
-2
@@ -58,7 +58,7 @@ public class JobServiceImpl extends ServiceImpl<JobMapper, Job> implements JobSe
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void createJob(CreateJobRequest resources) {
|
public void saveJob(CreateJobRequest resources) {
|
||||||
Job job = jobMapper.getJobByName(resources.getName());
|
Job job = jobMapper.getJobByName(resources.getName());
|
||||||
if (job != null) {
|
if (job != null) {
|
||||||
throw new EntityExistException(Job.class, "name", resources.getName());
|
throw new EntityExistException(Job.class, "name", resources.getName());
|
||||||
@@ -82,7 +82,7 @@ public class JobServiceImpl extends ServiceImpl<JobMapper, Job> implements JobSe
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void deleteJobByIds(Set<Long> ids) {
|
public void removeJobByIds(Set<Long> ids) {
|
||||||
removeBatchByIds(ids);
|
removeBatchByIds(ids);
|
||||||
// 删除缓存
|
// 删除缓存
|
||||||
ids.forEach(this::delCaches);
|
ids.forEach(this::delCaches);
|
||||||
|
|||||||
+2
-2
@@ -106,7 +106,7 @@ public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements Me
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void createMenu(Menu resources) {
|
public void saveMenu(Menu resources) {
|
||||||
if (menuMapper.getMenuByTitle(resources.getTitle()) != null) {
|
if (menuMapper.getMenuByTitle(resources.getTitle()) != null) {
|
||||||
throw new EntityExistException(Menu.class, "title", resources.getTitle());
|
throw new EntityExistException(Menu.class, "title", resources.getTitle());
|
||||||
}
|
}
|
||||||
@@ -196,7 +196,7 @@ public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements Me
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void deleteMenuByIds(Set<Menu> menuSet) {
|
public void removeMenuByIds(Set<Menu> menuSet) {
|
||||||
for (Menu menu : menuSet) {
|
for (Menu menu : menuSet) {
|
||||||
// 清理缓存
|
// 清理缓存
|
||||||
delCaches(menu.getId());
|
delCaches(menu.getId());
|
||||||
|
|||||||
+2
-2
@@ -81,7 +81,7 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements Ro
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void createRole(CreateRoleRequest resources) {
|
public void saveRole(CreateRoleRequest resources) {
|
||||||
if (roleMapper.getRoleByName(resources.getName()) != null) {
|
if (roleMapper.getRoleByName(resources.getName()) != null) {
|
||||||
throw new EntityExistException(Role.class, "name", resources.getName());
|
throw new EntityExistException(Role.class, "name", resources.getName());
|
||||||
}
|
}
|
||||||
@@ -132,7 +132,7 @@ public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements Ro
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void deleteRoleByIds(Set<Long> ids) {
|
public void removeRoleByIds(Set<Long> ids) {
|
||||||
for (Long id : ids) {
|
for (Long id : ids) {
|
||||||
// 更新相关缓存
|
// 更新相关缓存
|
||||||
delCaches(id, null);
|
delCaches(id, null);
|
||||||
|
|||||||
+2
-2
@@ -79,7 +79,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void createUser(User resources) {
|
public void saveUser(User resources) {
|
||||||
resources.setDeptId(resources.getDept().getId());
|
resources.setDeptId(resources.getDept().getId());
|
||||||
if (userMapper.getUserByUsername(resources.getUsername()) != null) {
|
if (userMapper.getUserByUsername(resources.getUsername()) != null) {
|
||||||
throw new EntityExistException(User.class, "username", resources.getUsername());
|
throw new EntityExistException(User.class, "username", resources.getUsername());
|
||||||
@@ -167,7 +167,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void deleteUserByIds(Set<Long> ids) {
|
public void removeUserByIds(Set<Long> ids) {
|
||||||
for (Long id : ids) {
|
for (Long id : ids) {
|
||||||
// 清理缓存
|
// 清理缓存
|
||||||
User user = getById(id);
|
User user = getById(id);
|
||||||
|
|||||||
+4
-4
@@ -25,14 +25,14 @@ public class EmailController {
|
|||||||
private final EmailService emailService;
|
private final EmailService emailService;
|
||||||
|
|
||||||
@ApiOperation("查询配置")
|
@ApiOperation("查询配置")
|
||||||
@PostMapping(value = "/queryEmailConfig")
|
@PostMapping(value = "/describeEmailConfig")
|
||||||
public ResponseEntity<EmailConfig> queryEmailConfig() {
|
public ResponseEntity<EmailConfig> describeEmailConfig() {
|
||||||
return new ResponseEntity<>(emailService.describeEmailConfig(), HttpStatus.OK);
|
return new ResponseEntity<>(emailService.describeEmailConfig(), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("配置邮件")
|
@ApiOperation("配置邮件")
|
||||||
@PostMapping(value = "/updateEmailConfig")
|
@PostMapping(value = "/modifyEmailConfig")
|
||||||
public ResponseEntity<Object> updateEmailConfig(@Validated @RequestBody EmailConfig emailConfig) throws Exception {
|
public ResponseEntity<Object> modifyEmailConfig(@Validated @RequestBody EmailConfig emailConfig) throws Exception {
|
||||||
emailService.modifyEmailConfigOnPassChange(emailConfig);
|
emailService.modifyEmailConfigOnPassChange(emailConfig);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-10
@@ -15,10 +15,8 @@ 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.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
@@ -50,15 +48,15 @@ public class LocalStorageController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("上传文件")
|
@ApiOperation("上传文件")
|
||||||
@PostMapping
|
@PostMapping(value = "/uploadFile")
|
||||||
@PreAuthorize("@el.check('storage:add')")
|
@PreAuthorize("@el.check('storage:add')")
|
||||||
public ResponseEntity<Object> createFile(@RequestParam String name, @RequestParam("file") MultipartFile file) {
|
public ResponseEntity<Object> 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("上传图片")
|
@ApiOperation("上传图片")
|
||||||
@PostMapping("/pictures")
|
@PostMapping("/uploadPicture")
|
||||||
public ResponseEntity<LocalStorage> uploadPicture(@RequestParam MultipartFile file) {
|
public ResponseEntity<LocalStorage> uploadPicture(@RequestParam MultipartFile file) {
|
||||||
// 判断文件是否为图片
|
// 判断文件是否为图片
|
||||||
String suffix = FileUtil.getSuffix(file.getOriginalFilename());
|
String suffix = FileUtil.getSuffix(file.getOriginalFilename());
|
||||||
@@ -70,17 +68,17 @@ public class LocalStorageController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("修改文件")
|
@ApiOperation("修改文件")
|
||||||
@PutMapping
|
@PostMapping(value = "/modifyLocalStorageById")
|
||||||
@PreAuthorize("@el.check('storage:edit')")
|
@PreAuthorize("@el.check('storage:edit')")
|
||||||
public ResponseEntity<Object> updateFile(@Validated @RequestBody LocalStorage resources) {
|
public ResponseEntity<Object> modifyLocalStorageById(@Validated @RequestBody LocalStorage resources) {
|
||||||
localStorageService.modifyLocalStorageById(resources);
|
localStorageService.modifyLocalStorageById(resources);
|
||||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("多选删除")
|
@ApiOperation("多选删除")
|
||||||
@DeleteMapping
|
@PostMapping(value = "/removeFileByIds")
|
||||||
public ResponseEntity<Object> deleteFile(@RequestBody Long[] ids) {
|
public ResponseEntity<Object> deleteFileByIds(@RequestBody Long[] ids) {
|
||||||
localStorageService.deleteFileByIds(ids);
|
localStorageService.removeFileByIds(ids);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+8
-8
@@ -41,14 +41,14 @@ public class QiniuController {
|
|||||||
private final QiNiuConfigService qiNiuConfigService;
|
private final QiNiuConfigService qiNiuConfigService;
|
||||||
|
|
||||||
@ApiOperation("查询七牛云存储配置")
|
@ApiOperation("查询七牛云存储配置")
|
||||||
@PostMapping(value = "/queryQiNiuConfig")
|
@PostMapping(value = "/describeQiniuConfig")
|
||||||
public ResponseEntity<QiniuConfig> queryQiNiuConfig() {
|
public ResponseEntity<QiniuConfig> describeQiniuConfig() {
|
||||||
return new ResponseEntity<>(qiNiuConfigService.describeQiniuConfig(), HttpStatus.OK);
|
return new ResponseEntity<>(qiNiuConfigService.describeQiniuConfig(), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("配置七牛云存储")
|
@ApiOperation("配置七牛云存储")
|
||||||
@PostMapping(value = "/updateQiNiuConfig")
|
@PostMapping(value = "/modifyQiniuConfig")
|
||||||
public ResponseEntity<Object> updateQiNiuConfig(@Validated @RequestBody QiniuConfig qiniuConfig) {
|
public ResponseEntity<Object> modifyQiniuConfig(@Validated @RequestBody QiniuConfig 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);
|
||||||
@@ -86,8 +86,8 @@ public class QiniuController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("下载文件")
|
@ApiOperation("下载文件")
|
||||||
@GetMapping(value = "/download/{id}")
|
@GetMapping(value = "/createFilePreviewUrl/{id}")
|
||||||
public ResponseEntity<Object> downloadQiNiu(@PathVariable Long id) {
|
public ResponseEntity<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);
|
||||||
@@ -96,14 +96,14 @@ public class QiniuController {
|
|||||||
@ApiOperation("删除文件")
|
@ApiOperation("删除文件")
|
||||||
@DeleteMapping(value = "/{id}")
|
@DeleteMapping(value = "/{id}")
|
||||||
public ResponseEntity<Object> deleteQiNiu(@PathVariable Long id) {
|
public ResponseEntity<Object> deleteQiNiu(@PathVariable Long id) {
|
||||||
qiniuContentService.deleteFileById(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<Object> deleteAllQiNiu(@RequestBody Long[] ids) {
|
||||||
qiniuContentService.deleteFileByIds(ids);
|
qiniuContentService.removeFileByIds(ids);
|
||||||
return new ResponseEntity<>(HttpStatus.OK);
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
-8
@@ -29,12 +29,4 @@ public interface EmailService extends IService<EmailConfig> {
|
|||||||
* @param sendEmailRequest 邮件发送的内容
|
* @param sendEmailRequest 邮件发送的内容
|
||||||
*/
|
*/
|
||||||
void sendEmail(SendEmailRequest sendEmailRequest);
|
void sendEmail(SendEmailRequest sendEmailRequest);
|
||||||
|
|
||||||
/**
|
|
||||||
* 发送邮件验证码
|
|
||||||
*
|
|
||||||
* @param email 邮箱地址
|
|
||||||
* @param key 类型
|
|
||||||
*/
|
|
||||||
void sendEmailCaptcha(String email, String key);
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -51,7 +51,7 @@ public interface LocalStorageService extends IService<LocalStorage> {
|
|||||||
*
|
*
|
||||||
* @param ids /
|
* @param ids /
|
||||||
*/
|
*/
|
||||||
void deleteFileByIds(Long[] ids);
|
void removeFileByIds(Long[] ids);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出数据
|
* 导出数据
|
||||||
|
|||||||
+2
-2
@@ -56,7 +56,7 @@ public interface QiniuContentService extends IService<QiniuContent> {
|
|||||||
*
|
*
|
||||||
* @param ids 文件ID数组
|
* @param ids 文件ID数组
|
||||||
*/
|
*/
|
||||||
void deleteFileByIds(Long[] ids);
|
void removeFileByIds(Long[] ids);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出数据
|
* 导出数据
|
||||||
@@ -72,5 +72,5 @@ public interface QiniuContentService extends IService<QiniuContent> {
|
|||||||
*
|
*
|
||||||
* @param id 文件id
|
* @param id 文件id
|
||||||
*/
|
*/
|
||||||
void deleteFileById(Long id);
|
void removeFileById(Long id);
|
||||||
}
|
}
|
||||||
|
|||||||
-6
@@ -5,7 +5,6 @@ import cn.hutool.extra.mail.MailAccount;
|
|||||||
import cn.odboy.application.tools.mapper.EmailConfigMapper;
|
import cn.odboy.application.tools.mapper.EmailConfigMapper;
|
||||||
import cn.odboy.application.tools.service.CaptchaService;
|
import cn.odboy.application.tools.service.CaptchaService;
|
||||||
import cn.odboy.application.tools.service.EmailService;
|
import cn.odboy.application.tools.service.EmailService;
|
||||||
import cn.odboy.constant.CodeEnum;
|
|
||||||
import cn.odboy.exception.BadRequestException;
|
import cn.odboy.exception.BadRequestException;
|
||||||
import cn.odboy.model.tools.domain.EmailConfig;
|
import cn.odboy.model.tools.domain.EmailConfig;
|
||||||
import cn.odboy.model.tools.request.SendEmailRequest;
|
import cn.odboy.model.tools.request.SendEmailRequest;
|
||||||
@@ -93,9 +92,4 @@ public class EmailServiceImpl extends ServiceImpl<EmailConfigMapper, EmailConfig
|
|||||||
throw new BadRequestException("邮件发送失败");
|
throw new BadRequestException("邮件发送失败");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void sendEmailCaptcha(String email, String key) {
|
|
||||||
emailService.sendEmail(captchaService.renderCodeTemplate(email, CodeEnum.EMAIL_RESET_EMAIL_CODE.getKey()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -83,7 +83,7 @@ public class LocalStorageServiceImpl extends ServiceImpl<LocalStorageMapper, Loc
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void deleteFileByIds(Long[] ids) {
|
public void removeFileByIds(Long[] ids) {
|
||||||
for (Long id : ids) {
|
for (Long id : ids) {
|
||||||
LocalStorage storage = getById(id);
|
LocalStorage storage = getById(id);
|
||||||
FileUtil.del(storage.getPath());
|
FileUtil.del(storage.getPath());
|
||||||
|
|||||||
+3
-3
@@ -113,7 +113,7 @@ public class QiniuContentServiceImpl extends ServiceImpl<QiniuContentMapper, Qin
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void deleteFileById(Long id) {
|
public void removeFileById(Long id) {
|
||||||
QiniuConfig qiniuConfig = qiNiuConfigService.describeQiniuConfig();
|
QiniuConfig qiniuConfig = qiNiuConfigService.describeQiniuConfig();
|
||||||
QiniuContent qiniuContent = qiniuContentMapper.selectById(id);
|
QiniuContent qiniuContent = qiniuContentMapper.selectById(id);
|
||||||
if (qiniuContent == null) {
|
if (qiniuContent == null) {
|
||||||
@@ -174,11 +174,11 @@ public class QiniuContentServiceImpl extends ServiceImpl<QiniuContentMapper, Qin
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void deleteFileByIds(Long[] ids) {
|
public void removeFileByIds(Long[] ids) {
|
||||||
for (Long id : ids) {
|
for (Long id : ids) {
|
||||||
QiniuContent qiniuContent = getById(id);
|
QiniuContent qiniuContent = getById(id);
|
||||||
if (qiniuContent != null) {
|
if (qiniuContent != null) {
|
||||||
deleteFileById(id);
|
removeFileById(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user