Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
98830dfdc7 | ||
|
|
1c10dc2ce2 | ||
|
|
65699dcab4 | ||
|
|
b0a57c778b | ||
|
|
8a38e532e2 | ||
|
|
df43cd2333 | ||
|
|
65e94a204c | ||
|
|
da255fa7e0 | ||
|
|
d413ea4469 | ||
|
|
4eaa383717 | ||
|
|
d113ebfa2f | ||
|
|
f2898da525 | ||
|
|
462abff607 | ||
|
|
89803b3908 | ||
|
|
df6dc89b96 | ||
|
|
5989b8bc78 | ||
|
|
d41333c766 | ||
|
|
83c4e28527 | ||
|
|
1053669077 | ||
|
|
96647a055b | ||
|
|
02bff29f94 | ||
|
|
aaf3d5fa1c | ||
|
|
9e306aadc5 | ||
|
|
8918ce781b | ||
|
|
a93a44c3d4 | ||
|
|
ff723a6044 | ||
|
|
0c57ef3d84 | ||
|
|
bb664df62f | ||
|
|
40f4657d6f | ||
|
|
6c79c5a0d0 | ||
|
|
4fc51fa0b5 | ||
|
|
bba40ae048 | ||
|
|
252ae3765f | ||
|
|
7425577126 | ||
|
|
4d773797cd | ||
|
|
5178be95b3 | ||
|
|
4684b8ea5e | ||
|
|
5875ce0349 | ||
|
|
31c4c3c0e1 | ||
|
|
cf65b4f5ab | ||
|
|
c008daaaa1 | ||
|
|
85e4557376 | ||
|
|
c9db1e58f3 | ||
|
|
8e4e783871 | ||
|
|
64a9dd2a4f | ||
|
|
7f72553ddd | ||
|
|
c11fd19351 | ||
|
|
3b3bfff2c5 | ||
|
|
0685e3ba28 | ||
|
|
f41f436dd8 | ||
|
|
5aa5624350 | ||
|
|
8aa0830213 | ||
|
|
b88254084d | ||
|
|
a55fbe0f06 | ||
|
|
ff22d3072c | ||
|
|
46bb831dea | ||
|
|
e511ccdd6d | ||
|
|
4c7d250500 | ||
|
|
42b9adc5bd | ||
|
|
2ece7de4de | ||
|
|
e5f11bb452 | ||
|
|
00c3fddbf1 | ||
|
|
01761ebf91 | ||
|
|
a071953398 | ||
|
|
b8183844cd | ||
|
|
20fb90b373 | ||
|
|
67d2170eda | ||
|
|
547421ad44 | ||
|
|
da6fe40960 | ||
|
|
394d1409e1 | ||
|
|
6364b0f577 | ||
|
|
e88d535153 | ||
|
|
54cae0855b | ||
|
|
b2cae22719 | ||
|
|
1165eabb4b | ||
|
|
595ab093b9 | ||
|
|
2182e4bd66 | ||
|
|
467b2a7d93 | ||
|
|
bab3ea1a15 | ||
|
|
cddb0cff08 | ||
|
|
373a23159d | ||
|
|
48e6e9298a | ||
|
|
5248d75a6e | ||
|
|
4a4b3f1690 | ||
|
|
aa77eaf1b6 | ||
|
|
46ba8b966e | ||
|
|
6e778ff337 | ||
|
|
b15182afde | ||
|
|
88fbe36145 | ||
|
|
83f75831f0 | ||
|
|
377b0989f8 | ||
|
|
79b847f9a4 | ||
|
|
866e689ad3 | ||
|
|
4097e1801f | ||
|
|
c1521dcb9a | ||
|
|
5a9dfcbe4d | ||
|
|
830e122b79 | ||
|
|
765b993101 | ||
|
|
3a48388dec | ||
|
|
05914f1548 | ||
|
|
79cb44c522 | ||
|
|
fc951973a4 | ||
|
|
8113539fc6 | ||
|
|
e31d9d7be8 | ||
|
|
137a35ee28 | ||
|
|
69800ef5c7 | ||
|
|
6ca6fdd567 |
@@ -24,6 +24,7 @@
|
||||
- ~~常用的辅助类的类名, 以`Cs`开头~~
|
||||
- 常用的辅助类的类名, 以`Kit`开头。Kit有套件、装备等意思。
|
||||
- 枚举类名,以`Enum`结尾
|
||||
- 内部调用一律声明this
|
||||
- 拒绝过度包装
|
||||
- 命名规则(Mapper or Service)
|
||||
- 简单查询:get + 名词
|
||||
@@ -32,6 +33,7 @@
|
||||
- 搜索(分页)功能:search + 名词
|
||||
- 统计计数:count + By + 条件
|
||||
- 存在检查:exists + By + 条件
|
||||
- 增删改:save/delete/update
|
||||
- 例子: 查询分页、查询列表的方法
|
||||
- 分页:searchUser(args, page)
|
||||
- 列表:listUser + (args)
|
||||
@@ -44,6 +46,47 @@
|
||||
- 单个:getUser + by + (args)
|
||||
- 统计计数:count + By + (args)
|
||||
|
||||
#### 编码规范:举例说明
|
||||
|
||||
1. getUser - 简单查询
|
||||
核心: 获取单个特定实体。
|
||||
|
||||
- 输入: 通常是一个唯一标识符(如ID 123)。
|
||||
- 筛选: 非常精确,只匹配一个。
|
||||
- 返回: 单个对象或文档,包含该用户的完整/详细信息。
|
||||
- 示例: getUser(123) -> 返回 {id: 123, name: “Alice”, email: “...”}
|
||||
|
||||
2. listUsers - 列表查询
|
||||
核心: 获取一个符合简单条件的实体集合,通常是有限的、预定义的。
|
||||
|
||||
- 输入: 可能没有参数,或只有非常简单的过滤条件(如 status=‘active’)。
|
||||
- 筛选: 简单、常规。
|
||||
- 返回: 一个数组/列表,包含多个用户的基本信息(通常是摘要字段,非完整详情)。
|
||||
- 通常不分页,或隐式返回所有符合条件的(数据量预期不大)。
|
||||
- 示例: listUsers() -> 返回 [{id: 1, name: “Alice”}, {id: 2, name: “Bob”}]
|
||||
- 示例: listUsers({role: ‘admin’}) -> 返回所有管理员用户的列表。
|
||||
|
||||
3. queryUsersByCondition - 复杂查询
|
||||
核心: 基于多个、可能较复杂的条件进行筛选。
|
||||
|
||||
- 输入: 一个组合条件对象,可能涉及多个字段的比较(如 age > 18 AND department = ‘Sales’ AND joinDate < ‘2023-01-01’)。
|
||||
- 筛选: 复杂、灵活,类似数据库的WHERE子句。
|
||||
- 返回: 一个匹配条件的数组/列表。
|
||||
- 分页: 可能分页,也可能不分页。关键是它的侧重点在于复杂的“筛选”能力,而非分页机制。(这是标准,但是对于此项目来说,定为不分页的,复杂条件的,列表查询服务)
|
||||
- 示例: queryUsersByCondition({minAge: 18, department: ‘Sales’, hasCertification: true})
|
||||
|
||||
4. searchUsers - 搜索(分页)功能
|
||||
核心: 针对大量数据进行模糊匹配、全文检索,并强制包含分页机制以管理性能。
|
||||
|
||||
- 输入:
|
||||
- 搜索关键词(可能对多个字段进行模糊匹配)。
|
||||
- 分页参数(pageNumber, pageSize 或 limit, offset)。
|
||||
- 可能附加的其他过滤条件。
|
||||
- 筛选: 通常包含文本搜索(如 name LIKE ‘%Al%’),结果可能按相关性排序。
|
||||
- 返回: 一个分页响应对象,而不仅仅是数组。
|
||||
- 包含:data(当前页的数据列表)、total(总匹配数)、page(当前页)、pageSize(每页大小)等元数据。
|
||||
- 示例: searchUsers({keyword: ‘Al’, page: 1, pageSize: 20}) -> 返回 {data: […], total: 45, page: 1, pageSize: 20}
|
||||
|
||||
#### 主要特性
|
||||
|
||||
- 使用最新技术栈,社区资源丰富。
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cutejava-front",
|
||||
"version": "1.4.1",
|
||||
"version": "1.5.0",
|
||||
"description": "CuteJava 前端源码",
|
||||
"author": "Odboy",
|
||||
"license": "Apache-2.0",
|
||||
@@ -38,7 +38,7 @@
|
||||
"@riophae/vue-treeselect": "^0.4.0",
|
||||
"@wangeditor/editor": "^5.1.23",
|
||||
"@wangeditor/editor-for-vue": "^1.0.2",
|
||||
"axios": "1.8.2",
|
||||
"axios": "1.12.0",
|
||||
"clipboard": "2.0.4",
|
||||
"codemirror": "^5.49.2",
|
||||
"core-js": "^2.6.12",
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function listMetadata(query) {
|
||||
return request({
|
||||
url: 'api/component/CuteDeptTree/listMetadata',
|
||||
method: 'post',
|
||||
data: query
|
||||
})
|
||||
}
|
||||
|
||||
export default { listMetadata }
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function listMetadata() {
|
||||
return request({
|
||||
url: 'api/component/CuteProductLineSelectPro/listMetadata',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function listMetadata() {
|
||||
return request({
|
||||
url: 'api/component/CuteProductLineSelect/listMetadata',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function listMetadata(query) {
|
||||
return request({
|
||||
url: 'api/component/CuteUserSelect/listMetadata',
|
||||
method: 'post',
|
||||
data: {
|
||||
blurry: query
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export function listMetadataByUsernames(usernameList = []) {
|
||||
return request({
|
||||
url: 'api/component/CuteUserSelect/listMetadataByUsernames',
|
||||
method: 'post',
|
||||
data: usernameList
|
||||
})
|
||||
}
|
||||
|
||||
export default { listMetadata, listMetadataByUsernames }
|
||||
|
||||
@@ -15,14 +15,14 @@ export function login(username, password, code, uuid) {
|
||||
|
||||
export function getInfo() {
|
||||
return request({
|
||||
url: 'auth/info',
|
||||
url: 'api/user/getCurrentUserInfo',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function getCodeImg() {
|
||||
return request({
|
||||
url: 'auth/captcha/getImage',
|
||||
url: 'captcha/getCode',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function sendResetEmailCaptcha(email) {
|
||||
export function sendResetEmailCode(email) {
|
||||
return request({
|
||||
url: 'api/captcha/sendResetEmailCaptcha?email=' + email,
|
||||
url: 'api/captcha/sendResetEmailCode?email=' + email,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function sendResetPasswordCaptcha(email) {
|
||||
export function sendResetPasswordCode(email) {
|
||||
return request({
|
||||
url: 'api/captcha/sendResetPasswordCaptcha?email=' + email,
|
||||
url: 'api/captcha/sendResetPasswordCode?email=' + email,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function checkEmailCaptcha(email, code, bizCode) {
|
||||
export function verifyCode(email, code, bizCode) {
|
||||
const params = {
|
||||
email: email,
|
||||
code: code,
|
||||
bizCode: bizCode
|
||||
}
|
||||
return request({
|
||||
url: 'api/captcha/checkEmailCaptcha',
|
||||
url: 'api/captcha/verifyCode',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function queryDeptSelectDataSource() {
|
||||
return request({
|
||||
url: 'api/component/queryDeptSelectDataSource',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function queryDeptSelectProDataSource() {
|
||||
return request({
|
||||
url: 'api/component/queryDeptSelectProDataSource',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
@@ -1,23 +1,8 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function queryDeptList(params) {
|
||||
return request({
|
||||
url: 'api/dept',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
export function queryDeptSuperiorTree(ids, exclude) {
|
||||
exclude = exclude !== undefined ? exclude : false
|
||||
const data = Array.isArray(ids) ? ids : [ids]
|
||||
return request({
|
||||
url: 'api/dept/queryDeptSuperiorTree?exclude=' + exclude,
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认入口:add、del、edit、get
|
||||
*/
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/dept/saveDept',
|
||||
@@ -28,7 +13,7 @@ export function add(data) {
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/dept/removeDeptByIds',
|
||||
url: 'api/dept/deleteDeptByIds',
|
||||
method: 'post',
|
||||
data: ids
|
||||
})
|
||||
@@ -36,10 +21,28 @@ export function del(ids) {
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/dept/modifyDept',
|
||||
url: 'api/dept/updateDeptById',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, queryDeptList, queryDeptSuperiorTree }
|
||||
export function searchDept(params) {
|
||||
return request({
|
||||
url: 'api/dept/searchDept',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
export function searchDeptTree(ids, exclude) {
|
||||
exclude = exclude !== undefined ? exclude : false
|
||||
const data = Array.isArray(ids) ? ids : [ids]
|
||||
return request({
|
||||
url: 'api/dept/searchDeptTree?exclude=' + exclude,
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, searchDept, searchDeptTree }
|
||||
|
||||
+6
-4
@@ -1,5 +1,7 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* 默认入口:add、del、edit、get
|
||||
*/
|
||||
export function get(dictName) {
|
||||
const params = {
|
||||
page: 1,
|
||||
@@ -9,7 +11,7 @@ export function get(dictName) {
|
||||
}
|
||||
}
|
||||
return request({
|
||||
url: 'api/dictDetail/queryDictDetailByArgs',
|
||||
url: 'api/dictDetail/searchDictDetail',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
@@ -25,7 +27,7 @@ export function add(data) {
|
||||
|
||||
export function del(id) {
|
||||
return request({
|
||||
url: 'api/dictDetail/removeDictDetailById',
|
||||
url: 'api/dictDetail/deleteDictDetailById',
|
||||
method: 'post',
|
||||
data: { id: id }
|
||||
})
|
||||
@@ -33,7 +35,7 @@ export function del(id) {
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/dictDetail/modifyDictDetailById',
|
||||
url: 'api/dictDetail/updateDictDetailById',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
@@ -1,5 +1,7 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* 默认入口:add、del、edit、get
|
||||
*/
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/dict/saveDict',
|
||||
@@ -10,7 +12,7 @@ export function add(data) {
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/dict/removeDictByIds',
|
||||
url: 'api/dict/deleteDictByIds',
|
||||
method: 'post',
|
||||
data: ids
|
||||
})
|
||||
@@ -18,18 +20,18 @@ export function del(ids) {
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/dict/modifyDictById',
|
||||
url: 'api/dict/updateDictById',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function queryPageDict(data) {
|
||||
export function searchDict(data) {
|
||||
return request({
|
||||
url: 'api/dict',
|
||||
url: 'api/dict/searchDict',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, queryPageDict }
|
||||
export default { add, edit, del, searchDict }
|
||||
|
||||
@@ -7,17 +7,17 @@ export function getLastEmailConfig() {
|
||||
})
|
||||
}
|
||||
|
||||
export function modifyEmailConfig(data) {
|
||||
export function updateEmailConfigById(data) {
|
||||
return request({
|
||||
url: 'api/email/modifyEmailConfig',
|
||||
url: 'api/email/updateEmailConfigById',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function sendEmail(data) {
|
||||
export function send(data) {
|
||||
return request({
|
||||
url: 'api/email/sendEmail',
|
||||
url: 'api/email/send',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
|
||||
@@ -1,20 +1,7 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function queryAllEnableJob() {
|
||||
const params = {
|
||||
page: 1,
|
||||
size: 9999999,
|
||||
args: {
|
||||
enabled: true
|
||||
}
|
||||
}
|
||||
return request({
|
||||
url: 'api/job/queryAllEnableJob',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认入口:add、del、edit、get
|
||||
*/
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/job/saveJob',
|
||||
@@ -25,7 +12,7 @@ export function add(data) {
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/job/removeJobByIds',
|
||||
url: 'api/job/deleteJobByIds',
|
||||
method: 'post',
|
||||
data: ids
|
||||
})
|
||||
@@ -33,10 +20,24 @@ export function del(ids) {
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/job/modifyJobById',
|
||||
url: 'api/job/updateJobById',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
export function searchJob() {
|
||||
const params = {
|
||||
page: 1,
|
||||
size: 9999999,
|
||||
args: {
|
||||
enabled: true
|
||||
}
|
||||
}
|
||||
return request({
|
||||
url: 'api/job/searchJob',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
||||
|
||||
+5
-3
@@ -1,5 +1,7 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* 默认入口:add、del、edit、get
|
||||
*/
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/localStorage/uploadFile',
|
||||
@@ -10,7 +12,7 @@ export function add(data) {
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/localStorage/removeFileByIds',
|
||||
url: 'api/localStorage/deleteFileByIds',
|
||||
method: 'post',
|
||||
data: ids
|
||||
})
|
||||
@@ -18,7 +20,7 @@ export function del(ids) {
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/localStorage/modifyLocalStorageById',
|
||||
url: 'api/localStorage/updateLocalStorageById',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
@@ -1,15 +1,42 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function queryMenuListByPid(pid) {
|
||||
/**
|
||||
* 默认入口:add、del、edit、get
|
||||
*/
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/menu/queryMenuListByPid?pid=' + pid,
|
||||
url: 'api/menu/saveMenu',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/menu/deleteMenuByIds',
|
||||
method: 'post',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/menu/updateMenuById',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function listMenuByPid(pid) {
|
||||
return request({
|
||||
url: 'api/menu/listMenuByPid?pid=' + pid,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function queryMenuByArgs(params) {
|
||||
export function searchMenu(params) {
|
||||
return request({
|
||||
url: 'api/menu/queryMenuByArgs',
|
||||
url: 'api/menu/searchMenu',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
@@ -24,9 +51,9 @@ export function queryMenuSuperior(ids) {
|
||||
})
|
||||
}
|
||||
|
||||
export function queryChildMenuSet(id) {
|
||||
export function listChildMenuSetByMenuId(id) {
|
||||
return request({
|
||||
url: 'api/menu/queryChildMenuSet?id=' + id,
|
||||
url: 'api/menu/listChildMenuSetByMenuId?id=' + id,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
@@ -38,28 +65,4 @@ export function buildMenus() {
|
||||
})
|
||||
}
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/menu/saveMenu',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/menu/removeMenuByIds',
|
||||
method: 'post',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/menu/modifyMenuById',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, queryMenuListByPid, queryMenuSuperior, queryMenuByArgs, queryChildMenuSet }
|
||||
export default { add, edit, del, listMenuByPid, queryMenuSuperior, searchMenu, listChildMenuSetByMenuId }
|
||||
|
||||
+4
-2
@@ -1,5 +1,7 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* 默认入口:add、del、edit、get
|
||||
*/
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/ossStorage/uploadFile',
|
||||
@@ -10,7 +12,7 @@ export function add(data) {
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/ossStorage/removeFileByIds',
|
||||
url: 'api/ossStorage/deleteFileByIds',
|
||||
method: 'post',
|
||||
data: ids
|
||||
})
|
||||
+6
-4
@@ -1,5 +1,7 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* 默认入口:add、del、edit、get
|
||||
*/
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/quartzJob/createQuartzJob',
|
||||
@@ -10,7 +12,7 @@ export function add(data) {
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/quartzJob/removeJobByIds',
|
||||
url: 'api/quartzJob/deleteJobByIds',
|
||||
method: 'post',
|
||||
data: ids
|
||||
})
|
||||
@@ -18,8 +20,8 @@ export function del(ids) {
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/quartzJob',
|
||||
method: 'put',
|
||||
url: 'api/quartzJob/updateQuartzJobResumeCron',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
@@ -1,13 +1,7 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 获取所有的Role
|
||||
export function queryRoleList() {
|
||||
return request({
|
||||
url: 'api/role/queryRoleList',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认入口:add、del、edit、get
|
||||
*/
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/role/saveRole',
|
||||
@@ -18,22 +12,15 @@ export function add(data) {
|
||||
|
||||
export function get(id) {
|
||||
return request({
|
||||
url: 'api/role/queryRoleById',
|
||||
url: 'api/role/getRoleById',
|
||||
method: 'post',
|
||||
data: { id: id }
|
||||
})
|
||||
}
|
||||
|
||||
export function getLevel() {
|
||||
return request({
|
||||
url: 'api/role/queryRoleLevel',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/role/removeRoleByIds',
|
||||
url: 'api/role/deleteRoleByIds',
|
||||
method: 'post',
|
||||
data: ids
|
||||
})
|
||||
@@ -41,18 +28,33 @@ export function del(ids) {
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/role/modifyRoleById',
|
||||
url: 'api/role/updateRoleById',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 获取所有的Role
|
||||
export function listAllRole() {
|
||||
return request({
|
||||
url: 'api/role/listAllRole',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function getCurrentUserRoleLevel() {
|
||||
return request({
|
||||
url: 'api/role/getCurrentUserRoleLevel',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
export function editMenu(data) {
|
||||
return request({
|
||||
url: 'api/role/modifyBindMenuById',
|
||||
url: 'api/role/updateBindMenuById',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, get, editMenu, getLevel }
|
||||
export default { add, edit, del, get, editMenu, getCurrentUserRoleLevel }
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import request from '@/utils/request'
|
||||
import { encrypt } from '@/utils/CsRsaUtil'
|
||||
|
||||
/**
|
||||
* 默认入口:add、del、edit、get
|
||||
*/
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/user/saveUser',
|
||||
@@ -11,15 +14,7 @@ export function add(data) {
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/user/removeUserByIds',
|
||||
method: 'post',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function resetPwd(ids) {
|
||||
return request({
|
||||
url: 'api/user/resetUserPasswordByIds',
|
||||
url: 'api/user/deleteUserByIds',
|
||||
method: 'post',
|
||||
data: ids
|
||||
})
|
||||
@@ -27,58 +22,51 @@ export function resetPwd(ids) {
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/user/modifyUserById',
|
||||
url: 'api/user/updateUserById',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function editUser(data) {
|
||||
export function resetUserPasswordByIds(ids) {
|
||||
return request({
|
||||
url: 'api/user/modifyUserCenterInfoById',
|
||||
url: 'api/user/resetUserPasswordByIds',
|
||||
method: 'post',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function updateUserCenterInfoById(data) {
|
||||
return request({
|
||||
url: 'api/user/updateUserCenterInfoById',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function updatePass(user) {
|
||||
export function updateUserPasswordByUsername(user) {
|
||||
const data = {
|
||||
oldPass: encrypt(user.oldPass),
|
||||
newPass: encrypt(user.newPass)
|
||||
}
|
||||
return request({
|
||||
url: 'api/user/modifyUserPasswordByUsername',
|
||||
url: 'api/user/updateUserPasswordByUsername',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function updateEmail(form) {
|
||||
export function updateUserEmailByUsername(form) {
|
||||
const data = {
|
||||
password: encrypt(form.pass),
|
||||
email: form.email
|
||||
}
|
||||
return request({
|
||||
url: 'api/user/modifyUserEmailByUsername/' + form.code,
|
||||
url: 'api/user/updateUserEmailByUsername/' + form.code,
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
export function queryUserMetaPage(query) {
|
||||
const params = {
|
||||
page: 1,
|
||||
size: 50,
|
||||
args: {
|
||||
blurry: query
|
||||
}
|
||||
}
|
||||
return request({
|
||||
url: 'api/user/queryUserMetadataOptions',
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, resetPwd, queryUserMetaPage }
|
||||
export default { add, edit, del, resetUserPasswordByIds }
|
||||
|
||||
|
||||
@@ -17,8 +17,10 @@ function CRUD(options) {
|
||||
idField: 'id',
|
||||
// 标题
|
||||
title: '',
|
||||
// 请求数据的url
|
||||
// 请求数据的url, @Controller注解的路径
|
||||
url: '',
|
||||
// 分页查询路由,@PostMapping注解的路径
|
||||
searchRouter: '',
|
||||
// 表格数据
|
||||
data: [],
|
||||
// 选择项
|
||||
@@ -134,7 +136,7 @@ function CRUD(options) {
|
||||
return new Promise((resolve, reject) => {
|
||||
crud.loading = true
|
||||
// 请求数据
|
||||
initData(crud.url, crud.getQueryParams()).then(data => {
|
||||
initData(crud.url + crud.searchRouter, crud.getQueryParams()).then(data => {
|
||||
const table = crud.getTable()
|
||||
if (table && table.lazy) { // 懒加载子节点数据,清掉已加载的数据
|
||||
table.store.states.treeData = {}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Vue from 'vue'
|
||||
import { get as getDictDetail } from '@/api/system/dictDetail'
|
||||
import { get as getDictDetail } from '@/api/system/dict-detail'
|
||||
|
||||
export default class Dict {
|
||||
constructor(dict) {
|
||||
|
||||
@@ -19,6 +19,8 @@ export default {
|
||||
url: '',
|
||||
// 查询数据的参数
|
||||
params: {},
|
||||
// 是否自定义参数
|
||||
isCustomParams: false,
|
||||
// 待查询的对象
|
||||
query: {},
|
||||
// 等待时间
|
||||
@@ -76,12 +78,22 @@ export default {
|
||||
Object.keys(this.params).length !== 0 && Object.keys(this.params).forEach(item => {
|
||||
if (this.params[item] === null || this.params[item] === '') this.params[item] = undefined
|
||||
})
|
||||
if (this.isCustomParams) {
|
||||
return {
|
||||
page: this.page,
|
||||
size: this.size,
|
||||
args: {
|
||||
...this.params
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
page: this.page,
|
||||
size: this.size,
|
||||
...this.query,
|
||||
...this.params
|
||||
}
|
||||
}
|
||||
},
|
||||
// 改变页码
|
||||
pageChange(e) {
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
* @type {any}
|
||||
*/
|
||||
const getters = {
|
||||
deployUploadApi: state => state.api.deployUploadApi,
|
||||
databaseUploadApi: state => state.api.databaseUploadApi,
|
||||
size: state => state.app.size,
|
||||
sidebar: state => state.app.sidebar,
|
||||
device: state => state.app.device,
|
||||
@@ -24,6 +22,9 @@ const getters = {
|
||||
swaggerApi: state => state.api.swaggerApi,
|
||||
websocketApi: state => state.api.websocketApi,
|
||||
sidebarRouters: state => state.permission.sidebarRouters,
|
||||
statusConst: state => state.pipeline.statusConst
|
||||
statusConst: state => state.pipeline.statusConst,
|
||||
// 上传组件专用
|
||||
fileUploadApplicationApi: state => state.api.fileUploadApplicationApi,
|
||||
ossUploadApplicationApi: state => state.api.ossUploadApplicationApi
|
||||
}
|
||||
export default getters
|
||||
|
||||
@@ -5,7 +5,7 @@ const api = {
|
||||
// 图片上传
|
||||
imagesUploadApi: baseUrl + '/api/localStorage/uploadPicture',
|
||||
// 修改头像
|
||||
updateAvatarApi: baseUrl + '/api/user/modifyUserAvatar',
|
||||
updateAvatarApi: baseUrl + '/api/user/updateUserAvatar',
|
||||
// Sql 监控
|
||||
druidSqlApi: baseUrl + '/druid/index.html',
|
||||
// websocket
|
||||
@@ -16,6 +16,9 @@ const api = {
|
||||
fileUploadApi: baseUrl + '/api/localStorage/uploadFile',
|
||||
// oss上传
|
||||
ossUploadApi: baseUrl + '/api/ossStorage/uploadFile',
|
||||
// 上传组件专用
|
||||
fileUploadApplicationApi: baseUrl + '/api/component/CuteFileUpload/uploadLocal',
|
||||
ossUploadApplicationApi: baseUrl + '/api/component/CuteFileUpload/uploadOSS',
|
||||
// baseUrl,
|
||||
baseApi: baseUrl
|
||||
}
|
||||
|
||||
@@ -2,8 +2,11 @@ import JSEncrypt from 'jsencrypt/bin/jsencrypt.min'
|
||||
|
||||
// 密钥对生成 http://web.chacuo.net/netrsakeypair
|
||||
|
||||
const publicKey = 'MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBANL378k3RiZHWx5AfJqdH9xRNBmD9wGD\n' +
|
||||
'2iRe41HdTNF8RUhNnHit5NpMNtGL0NPTSSpPjjI1kJfVorRvaQerUgkCAwEAAQ=='
|
||||
const publicKey = 'MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAg975XAOL1zg5EOcSSGPIcxwx5DxcvPD2rBRQa0/o1HTF25cnsU9uSHfzP+qohkDG76kDk+1FA/cuQda4CDAmK2fWW' +
|
||||
'q7KgglKd08hRkByjLuRsXu5WVApAAG15ItNM0CrXI7P47aOan+6YPU0Ni1+4WYQnwxfRYdUaKgY5G5gb3S+hx6VO1iN1KuRMBJ7y5FMh1WNJOM9bQb3X1pvaJ73drTpy1wJHAvfP80iG2+sSh0FfcOxCoRNEff' +
|
||||
'CUsU2bYNH6dG6mXIDvo6XZStspwUfSitfgOER207uvBCCVyFlas+2Xs09yyAoJNjaWmeCPfA7uJvJrXUft/SMy8JNIXBY40vlwk4d4FE6OKOG9Wn0oRlofRKZ7NGvpUxEA5zOW6g2LsHKUUXpgOfu59M6ZHxviGM' +
|
||||
't26WxJiq/ifVKJE3yVgx0MVIGEFTrG+spOCVsDYMSHnVsPEUdL6g5FV2YLyqNHljBqUqwyOEfUinp7hPRxrLJDMyX6GWy7y48Djg0wyh2hXro/ygVrZ6jcSd7MUAd2lYueUKK8Bey7OzIcOJ6GveHdLzGrspbbkn' +
|
||||
'DuRsbcInR5bD6l7YA4vpnLsbiOH2wbKJWXNnxRwN5KuWSpwHDHhARB8f4wWrewUKIOxcFI/eJ6ke6D52JMOKhiGeZKn+2/giHwrPGkTREe47Ose6UvTMCAwEAAQ=='
|
||||
|
||||
// 加密
|
||||
export function encrypt(txt) {
|
||||
|
||||
@@ -30,13 +30,13 @@
|
||||
|
||||
<script>
|
||||
|
||||
import { queryDeptList } from '@/api/system/dept'
|
||||
import CuteDeptTreeApi from '@/api/application/cute-dept-tree'
|
||||
|
||||
export default {
|
||||
name: 'CuteDeptTree',
|
||||
props: {
|
||||
value: {
|
||||
type: [Number, String],
|
||||
type: String,
|
||||
required: false,
|
||||
default: null
|
||||
}
|
||||
@@ -61,15 +61,11 @@ export default {
|
||||
params['pid'] = node.data.id
|
||||
}
|
||||
setTimeout(() => {
|
||||
queryDeptList({
|
||||
page: 1,
|
||||
size: 9999999,
|
||||
args: params
|
||||
}).then(res => {
|
||||
CuteDeptTreeApi.listMetadata(params).then(res => {
|
||||
if (resolve) {
|
||||
resolve(res.content)
|
||||
resolve(res)
|
||||
} else {
|
||||
this.deptData = res.content
|
||||
this.deptData = res
|
||||
}
|
||||
})
|
||||
}, 100)
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
:headers="headers"
|
||||
:on-success="handleSuccess"
|
||||
:on-error="handleError"
|
||||
:action="ossUploadApi"
|
||||
:action="mode === 'oss' ? ossUploadApplicationApi: fileUploadApplicationApi"
|
||||
>
|
||||
<i class="el-icon-upload" />
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
@@ -34,6 +34,14 @@ export default {
|
||||
type: Object,
|
||||
required: true,
|
||||
default: null
|
||||
},
|
||||
/**
|
||||
* 上传方式:local、oss
|
||||
*/
|
||||
mode: {
|
||||
type: String,
|
||||
required: true,
|
||||
default: 'oss'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -44,7 +52,8 @@ export default {
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'baseApi',
|
||||
'ossUploadApi'
|
||||
'fileUploadApplicationApi',
|
||||
'ossUploadApplicationApi'
|
||||
])
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
:headers="headers"
|
||||
:on-success="handleSuccess"
|
||||
:on-error="handleError"
|
||||
:action="ossUploadApi"
|
||||
:action="mode === 'oss' ? ossUploadApplicationApi: fileUploadApplicationApi"
|
||||
>
|
||||
<el-button size="small" type="primary">点击上传</el-button>
|
||||
<div slot="tip" class="el-upload__tip">只能上传不超过100MB的文件</div>
|
||||
@@ -32,6 +32,14 @@ export default {
|
||||
type: Object,
|
||||
required: true,
|
||||
default: null
|
||||
},
|
||||
/**
|
||||
* 上传方式:local、oss
|
||||
*/
|
||||
mode: {
|
||||
type: String,
|
||||
required: true,
|
||||
default: 'oss'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -42,7 +50,8 @@ export default {
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'baseApi',
|
||||
'ossUploadApi'
|
||||
'fileUploadApplicationApi',
|
||||
'ossUploadApplicationApi'
|
||||
])
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -25,14 +25,14 @@
|
||||
|
||||
<script>
|
||||
|
||||
import { queryDeptSelectDataSource } from '@/api/system/component'
|
||||
import { listMetadata } from '@/api/application/cute-product-line-select'
|
||||
import CsMessage from '@/utils/elementui/CsMessage'
|
||||
|
||||
export default {
|
||||
name: 'CuteProductLineSelect',
|
||||
props: {
|
||||
value: {
|
||||
type: [Number, String],
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
disabled: {
|
||||
@@ -56,7 +56,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
fetchDeptData() {
|
||||
queryDeptSelectDataSource().then(data => {
|
||||
listMetadata().then(data => {
|
||||
this.deptOptions = data
|
||||
}).catch(error => {
|
||||
console.error('获取部门数据失败:', error)
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
<script>
|
||||
|
||||
import { queryDeptSelectProDataSource } from '@/api/system/component'
|
||||
import { listMetadata } from '@/api/application/cute-product-line-select-pro'
|
||||
import CsMessage from '@/utils/elementui/CsMessage'
|
||||
|
||||
export default {
|
||||
@@ -62,7 +62,7 @@ export default {
|
||||
})
|
||||
},
|
||||
fetchDeptData() {
|
||||
queryDeptSelectProDataSource().then(data => {
|
||||
listMetadata().then(data => {
|
||||
this.deptOptions = this.cleanEmptyChildren(data)
|
||||
// console.error('deptOptions', this.deptOptions)
|
||||
}).catch(error => {
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
<script>
|
||||
|
||||
import UserService from '@/api/system/user'
|
||||
import CuteUserSelectApi from '@/api/application/cute-user-select'
|
||||
|
||||
export default {
|
||||
name: 'CuteSingleUserSelect',
|
||||
@@ -41,7 +41,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
user: this.value,
|
||||
user: [],
|
||||
loading: false,
|
||||
options: []
|
||||
}
|
||||
@@ -51,21 +51,28 @@ export default {
|
||||
this.user = newVal
|
||||
}
|
||||
},
|
||||
async mounted() {
|
||||
const that = this
|
||||
if (that.value && that.value.length > 0) {
|
||||
that.options = await CuteUserSelectApi.listMetadataByUsernames(that.value)
|
||||
that.users = that.value
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
remoteMethod(query) {
|
||||
if (query !== '') {
|
||||
this.loading = true
|
||||
setTimeout(() => {
|
||||
this.loading = false
|
||||
this.queryUserMetaPage(query)
|
||||
this.listMetadata(query)
|
||||
}, 200)
|
||||
} else {
|
||||
this.options = []
|
||||
}
|
||||
},
|
||||
queryUserMetaPage(query, options) {
|
||||
listMetadata(query, options) {
|
||||
const that = this
|
||||
UserService.queryUserMetaPage(query).then(res => {
|
||||
CuteUserSelectApi.listMetadata(query).then(res => {
|
||||
that.options = res
|
||||
})
|
||||
},
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
<script>
|
||||
|
||||
import UserService from '@/api/system/user'
|
||||
import CuteUserSelectApi from '@/api/application/cute-user-select'
|
||||
|
||||
export default {
|
||||
name: 'CuteUserSelect',
|
||||
@@ -37,16 +37,11 @@ export default {
|
||||
type: Array,
|
||||
required: false,
|
||||
default: null
|
||||
},
|
||||
dataSource: {
|
||||
type: Array,
|
||||
required: false,
|
||||
default: null
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
users: this.value,
|
||||
users: [],
|
||||
loading: false,
|
||||
options: []
|
||||
}
|
||||
@@ -56,9 +51,11 @@ export default {
|
||||
this.users = newVal
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.dataSource && this.dataSource.length > 0) {
|
||||
this.options = this.dataSource
|
||||
async mounted() {
|
||||
const that = this
|
||||
if (that.value && that.value.length > 0) {
|
||||
that.options = await CuteUserSelectApi.listMetadataByUsernames(that.value)
|
||||
that.users = that.value
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -67,15 +64,15 @@ export default {
|
||||
this.loading = true
|
||||
setTimeout(() => {
|
||||
this.loading = false
|
||||
this.queryUserMetaPage(query)
|
||||
this.listMetadata(query)
|
||||
}, 200)
|
||||
} else {
|
||||
this.options = []
|
||||
}
|
||||
},
|
||||
queryUserMetaPage(query, options) {
|
||||
listMetadata(query, options) {
|
||||
const that = this
|
||||
UserService.queryUserMetaPage(query).then(res => {
|
||||
CuteUserSelectApi.listMetadata(query).then(res => {
|
||||
that.options = res
|
||||
})
|
||||
},
|
||||
|
||||
@@ -65,7 +65,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
user: null,
|
||||
user: [],
|
||||
dept: null,
|
||||
productLine: null,
|
||||
productLinePro: null
|
||||
|
||||
@@ -78,7 +78,7 @@ export default {
|
||||
}
|
||||
},
|
||||
fetch: async(queryParams) => {
|
||||
return DictService.queryPageDict(queryParams)
|
||||
return DictService.searchDict(queryParams)
|
||||
},
|
||||
pageProps: {
|
||||
current: 1,
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="文件上传" prop="fileUrl">
|
||||
<cute-file-drag-upload v-model="form" />
|
||||
<cute-file-drag-upload v-model="form" mode="local" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="submitForm('form')">提 交</el-button>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="文件上传" prop="fileUrl">
|
||||
<cute-file-upload v-model="form" />
|
||||
<cute-file-upload v-model="form" mode="local" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="submitForm('form')">提 交</el-button>
|
||||
|
||||
@@ -105,7 +105,7 @@ export default {
|
||||
}
|
||||
},
|
||||
fetch: async(queryParams) => {
|
||||
return DictService.queryPageDict(queryParams)
|
||||
return DictService.searchDict(queryParams)
|
||||
},
|
||||
columns: [
|
||||
{ prop: 'name', label: '名称' },
|
||||
|
||||
@@ -140,7 +140,7 @@ export default {
|
||||
name: 'Dept',
|
||||
components: { Treeselect, crudOperation, rrOperation, udOperation, DateRangePicker },
|
||||
cruds() {
|
||||
return CRUD({ title: '部门', url: 'api/dept', crudMethod: { ...crudDept }})
|
||||
return CRUD({ title: '部门', url: 'api/dept', searchRouter: '/searchDept', crudMethod: { ...crudDept }})
|
||||
},
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
// 设置数据字典
|
||||
@@ -175,7 +175,7 @@ export default {
|
||||
args: { pid: tree.id }
|
||||
}
|
||||
setTimeout(() => {
|
||||
crudDept.queryDeptList(params).then(res => {
|
||||
crudDept.searchDept(params).then(res => {
|
||||
resolve(res.content)
|
||||
})
|
||||
}, 100)
|
||||
@@ -195,7 +195,7 @@ export default {
|
||||
}
|
||||
},
|
||||
getSupDepts(id) {
|
||||
crudDept.queryDeptSuperiorTree(id, true).then(res => {
|
||||
crudDept.searchDeptTree(id, true).then(res => {
|
||||
const data = res.content
|
||||
this.buildDepts(data)
|
||||
this.depts = data
|
||||
@@ -212,7 +212,7 @@ export default {
|
||||
})
|
||||
},
|
||||
getDepts() {
|
||||
crudDept.queryDeptList({
|
||||
crudDept.searchDept({
|
||||
page: 1,
|
||||
size: 9999999,
|
||||
args: { enabled: true }
|
||||
@@ -228,7 +228,7 @@ export default {
|
||||
// 获取弹窗内部门数据
|
||||
loadDepts({ action, parentNode, callback }) {
|
||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||
crudDept.queryDeptList({
|
||||
crudDept.searchDept({
|
||||
page: 1,
|
||||
size: 9999999,
|
||||
args: { enabled: true, pid: parentNode.id }
|
||||
|
||||
@@ -4,22 +4,6 @@
|
||||
<div class="my-code">点击字典查看详情</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-input
|
||||
v-model="query.label"
|
||||
clearable
|
||||
size="small"
|
||||
placeholder="输入字典标签查询"
|
||||
style="width: 200px;"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="toQuery"
|
||||
/>
|
||||
<rrOperation />
|
||||
</div>
|
||||
</div>
|
||||
<!--表单组件-->
|
||||
<el-dialog
|
||||
append-to-body
|
||||
@@ -88,20 +72,19 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudDictDetail from '@/api/system/dictDetail'
|
||||
import crudDictDetail from '@/api/system/dict-detail'
|
||||
import CRUD, { form, header, presenter } from '@crud/crud'
|
||||
import pagination from '@crud/Pagination'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
|
||||
const defaultForm = { id: null, label: null, value: null, dictSort: 999 }
|
||||
|
||||
export default {
|
||||
components: { pagination, rrOperation, udOperation },
|
||||
components: { pagination, udOperation },
|
||||
cruds() {
|
||||
return [
|
||||
CRUD({
|
||||
title: '字典详情', url: 'api/dictDetail', query: { dictName: '' },
|
||||
title: '字典详情', url: 'api/dictDetail', searchRouter: '/searchDictDetail', query: { dictName: '' },
|
||||
crudMethod: { ...crudDictDetail },
|
||||
optShow: {
|
||||
add: true,
|
||||
|
||||
@@ -114,7 +114,7 @@ export default {
|
||||
components: { crudOperation, pagination, rrOperation, udOperation, dictDetail },
|
||||
cruds() {
|
||||
return [
|
||||
CRUD({ title: '字典', url: 'api/dict', crudMethod: { ...crudDict }})
|
||||
CRUD({ title: '字典', url: 'api/dict', searchRouter: '/searchDict', crudMethod: { ...crudDict }})
|
||||
]
|
||||
},
|
||||
mixins: [presenter(), header(), form(defaultForm)],
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getLastEmailConfig, modifyEmailConfig } from '@/api/system/email'
|
||||
import { getLastEmailConfig, updateEmailConfigById } from '@/api/system/email'
|
||||
|
||||
export default {
|
||||
name: 'Config',
|
||||
@@ -67,7 +67,7 @@ export default {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true
|
||||
modifyEmailConfig(this.form).then(res => {
|
||||
updateEmailConfigById(this.form).then(res => {
|
||||
this.$notify({
|
||||
title: '修改成功',
|
||||
type: 'success',
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { sendEmail } from '@/api/system/email'
|
||||
import { send } from '@/api/system/email'
|
||||
import { mapGetters } from 'vuex'
|
||||
import E from 'wangeditor'
|
||||
import { UploadFile } from '@/utils/CsDomUtil'
|
||||
@@ -74,7 +74,7 @@ export default {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true
|
||||
sendEmail(this.form).then(res => {
|
||||
send(this.form).then(res => {
|
||||
this.$notify({
|
||||
title: '发送成功',
|
||||
type: 'success',
|
||||
|
||||
@@ -70,6 +70,7 @@ export default {
|
||||
return CRUD({
|
||||
title: '岗位',
|
||||
url: 'api/job',
|
||||
searchRouter: '/searchJob',
|
||||
crudMethod: { ...crudJob }
|
||||
})
|
||||
},
|
||||
|
||||
@@ -137,7 +137,7 @@
|
||||
ref="table"
|
||||
v-loading="crud.loading"
|
||||
lazy
|
||||
:load="queryMenuByArgs"
|
||||
:load="searchMenu"
|
||||
:data="crud.data"
|
||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
||||
row-key="id"
|
||||
@@ -239,7 +239,7 @@ export default {
|
||||
name: 'Menu',
|
||||
components: { Treeselect, IconSelect, crudOperation, rrOperation, udOperation, DateRangePicker },
|
||||
cruds() {
|
||||
return CRUD({ title: '菜单', url: 'api/menu', crudMethod: { ...crudMenu }})
|
||||
return CRUD({ title: '菜单', url: 'api/menu', searchRouter: '/searchMenu', crudMethod: { ...crudMenu }})
|
||||
},
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
data() {
|
||||
@@ -273,14 +273,14 @@ export default {
|
||||
this.menus.push({ id: 0, label: '顶级类目', children: null })
|
||||
}
|
||||
},
|
||||
queryMenuByArgs(tree, treeNode, resolve) {
|
||||
searchMenu(tree, treeNode, resolve) {
|
||||
const params = {
|
||||
page: 1,
|
||||
size: 9999999,
|
||||
args: { pid: tree.id }
|
||||
}
|
||||
setTimeout(() => {
|
||||
crudMenu.queryMenuByArgs(params).then(res => {
|
||||
crudMenu.searchMenu(params).then(res => {
|
||||
resolve(res.content)
|
||||
})
|
||||
}, 100)
|
||||
@@ -298,7 +298,7 @@ export default {
|
||||
},
|
||||
loadMenus({ action, parentNode, callback }) {
|
||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||
crudMenu.queryMenuListByPid(parentNode.id).then(res => {
|
||||
crudMenu.listMenuByPid(parentNode.id).then(res => {
|
||||
parentNode.children = res.map(function(obj) {
|
||||
if (!obj.leaf) {
|
||||
obj.children = null
|
||||
|
||||
@@ -85,7 +85,7 @@ export default {
|
||||
name: 'OnlineUser',
|
||||
components: { pagination, crudOperation, rrOperation },
|
||||
cruds() {
|
||||
return CRUD({ url: 'api/user/online', title: '在线用户' })
|
||||
return CRUD({ url: 'api/user/online', searchRouter: '/searchOnlineUser', title: '在线用户' })
|
||||
},
|
||||
mixins: [presenter(), header(), crud()],
|
||||
data() {
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
>日志
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<el-link type="primary" href="https://cron.ciding.cc/" target="_blank">Cron在线表达式生成</el-link>
|
||||
<Log ref="log" />
|
||||
</div>
|
||||
<!--Form表单-->
|
||||
@@ -166,7 +167,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudJob from '@/api/system/quartzJob'
|
||||
import crudJob from '@/api/system/quartz-job'
|
||||
import Log from './log'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
@@ -192,7 +193,7 @@ export default {
|
||||
name: 'QuartzJob',
|
||||
components: { Log, pagination, crudOperation, rrOperation, DateRangePicker },
|
||||
cruds() {
|
||||
return CRUD({ title: '定时任务', url: 'api/quartzJob', crudMethod: { ...crudJob }})
|
||||
return CRUD({ title: '定时任务', url: 'api/quartzJob', searchRouter: '/searchQuartzJob', crudMethod: { ...crudJob }})
|
||||
},
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
data() {
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
<el-pagination
|
||||
:total="total"
|
||||
:current-page="page"
|
||||
:page-size="6"
|
||||
:page-size="size"
|
||||
style="margin-top:8px;"
|
||||
layout="total, prev, pager, next"
|
||||
@size-change="sizeChange"
|
||||
@@ -109,8 +109,14 @@ export default {
|
||||
},
|
||||
// 获取数据前设置好接口地址
|
||||
beforeInit() {
|
||||
this.url = 'api/quartzJob/logs'
|
||||
this.size = 6
|
||||
this.url = 'api/quartzJob/searchQuartzLog'
|
||||
this.page = 1
|
||||
this.isCustomParams = true
|
||||
this.params = {
|
||||
jobName: this.query.jobName,
|
||||
createTime: this.query.createTime,
|
||||
isSuccess: this.query.isSuccess
|
||||
}
|
||||
return true
|
||||
},
|
||||
// 异常详情
|
||||
|
||||
@@ -152,8 +152,8 @@
|
||||
|
||||
<script>
|
||||
import crudRoles from '@/api/system/role'
|
||||
import { queryDeptList, queryDeptSuperiorTree } from '@/api/system/dept'
|
||||
import { queryChildMenuSet, queryMenuListByPid } from '@/api/system/menu'
|
||||
import { searchDept, searchDeptTree } from '@/api/system/dept'
|
||||
import { listChildMenuSetByMenuId, listMenuByPid } from '@/api/system/menu'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
@@ -168,7 +168,7 @@ export default {
|
||||
name: 'Role',
|
||||
components: { Treeselect, pagination, crudOperation, rrOperation, udOperation, DateRangePicker },
|
||||
cruds() {
|
||||
return CRUD({ title: '角色', url: 'api/role', crudMethod: { ...crudRoles }})
|
||||
return CRUD({ title: '角色', url: 'api/role', searchRouter: '/searchRole', crudMethod: { ...crudRoles }})
|
||||
},
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
data() {
|
||||
@@ -190,14 +190,14 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudRoles.getLevel().then(data => {
|
||||
crudRoles.getCurrentUserRoleLevel().then(data => {
|
||||
this.level = data.level
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
getMenuDatas(node, resolve) {
|
||||
setTimeout(() => {
|
||||
queryMenuListByPid(node.data.id ? node.data.id : 0).then(res => {
|
||||
listMenuByPid(node.data.id ? node.data.id : 0).then(res => {
|
||||
resolve(res)
|
||||
})
|
||||
}, 100)
|
||||
@@ -261,7 +261,7 @@ export default {
|
||||
},
|
||||
menuChange(menu) {
|
||||
// 获取该节点的所有子节点,id 包含自身
|
||||
queryChildMenuSet(menu.id).then(childIds => {
|
||||
listChildMenuSetByMenuId(menu.id).then(childIds => {
|
||||
// 判断是否在 menuIds 中,如果存在则删除,否则添加
|
||||
if (this.menuIds.indexOf(menu.id) !== -1) {
|
||||
for (let i = 0; i < childIds.length; i++) {
|
||||
@@ -313,7 +313,7 @@ export default {
|
||||
},
|
||||
// 获取部门数据
|
||||
getDepts() {
|
||||
queryDeptList({
|
||||
searchDept({
|
||||
page: 1,
|
||||
size: 9999999,
|
||||
args: { enabled: true }
|
||||
@@ -331,7 +331,7 @@ export default {
|
||||
depts.forEach(dept => {
|
||||
ids.push(dept.id)
|
||||
})
|
||||
queryDeptSuperiorTree(ids).then(res => {
|
||||
searchDeptTree(ids).then(res => {
|
||||
const date = res.content
|
||||
this.buildDepts(date)
|
||||
this.depts = date
|
||||
@@ -350,7 +350,7 @@ export default {
|
||||
// 获取弹窗内部门数据
|
||||
loadDepts({ action, parentNode, callback }) {
|
||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||
queryDeptList({
|
||||
searchDept({
|
||||
page: 1,
|
||||
size: 9999999,
|
||||
args: { enabled: true, pid: parentNode.id }
|
||||
|
||||
@@ -154,7 +154,7 @@ export default {
|
||||
return {
|
||||
show: false,
|
||||
monitor: null,
|
||||
url: 'api/monitor/queryServerMonitorInfo',
|
||||
url: 'api/monitor/getServerMonitorInfo',
|
||||
data: {},
|
||||
cpuInfo: {
|
||||
tooltip: {
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import crudFile from '@/api/system/localStorage'
|
||||
import crudFile from '@/api/system/local-storage'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
@@ -136,7 +136,7 @@ const defaultForm = { id: null, name: '' }
|
||||
export default {
|
||||
components: { pagination, crudOperation, rrOperation, DateRangePicker },
|
||||
cruds() {
|
||||
return CRUD({ title: '文件', url: 'api/localStorage', crudMethod: { ...crudFile }})
|
||||
return CRUD({ title: '文件', url: 'api/localStorage', searchRouter: '/searchLocalStorage', crudMethod: { ...crudFile }})
|
||||
},
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
data() {
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import crudFile from '@/api/system/ossStorage'
|
||||
import crudFile from '@/api/system/oss-storage'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
@@ -107,7 +107,7 @@ const defaultForm = { id: null }
|
||||
export default {
|
||||
components: { pagination, crudOperation, rrOperation, DateRangePicker },
|
||||
cruds() {
|
||||
return CRUD({ title: '文件', url: 'api/ossStorage', crudMethod: { ...crudFile }})
|
||||
return CRUD({ title: '文件', url: 'api/ossStorage', searchRouter: '/searchOssStorage', crudMethod: { ...crudFile }})
|
||||
},
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
data() {
|
||||
|
||||
@@ -98,15 +98,15 @@
|
||||
<!-- 操作日志 -->
|
||||
<el-tab-pane label="操作日志" name="second">
|
||||
<el-table v-loading="loading" :data="data" style="width: 100%;">
|
||||
<el-table-column prop="description" label="行为" />
|
||||
<el-table-column prop="bizName" label="业务名称" />
|
||||
<el-table-column prop="requestIp" label="IP" />
|
||||
<el-table-column :show-overflow-tooltip="true" prop="address" label="IP来源" />
|
||||
<el-table-column prop="browser" label="浏览器" />
|
||||
<el-table-column prop="time" label="请求耗时" align="center">
|
||||
<el-table-column prop="browserInfo" label="浏览器" />
|
||||
<el-table-column prop="executeTime" label="请求耗时" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.time <= 300">{{ scope.row.time }}ms</el-tag>
|
||||
<el-tag v-else-if="scope.row.time <= 1000" type="warning">{{ scope.row.time }}ms</el-tag>
|
||||
<el-tag v-else type="danger">{{ scope.row.time }}ms</el-tag>
|
||||
<el-tag v-if="scope.row.executeTime <= 300">{{ scope.row.time || 0 }}ms</el-tag>
|
||||
<el-tag v-else-if="scope.row.executeTime <= 1000" type="warning">{{ scope.row.executeTime || 0 }}ms</el-tag>
|
||||
<el-tag v-else type="danger">{{ scope.row.executeTime || 0 }}ms</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
@@ -151,7 +151,7 @@ import { getToken } from '@/utils/auth'
|
||||
import store from '@/store'
|
||||
import { IsValidPhone } from '@/utils/CsValidateUtil'
|
||||
import crud from '@/mixins/crud'
|
||||
import { editUser } from '@/api/system/user'
|
||||
import { updateUserCenterInfoById } from '@/api/system/user'
|
||||
import Avatar from '@/assets/images/avatar.png'
|
||||
|
||||
export default {
|
||||
@@ -211,7 +211,7 @@ export default {
|
||||
}
|
||||
},
|
||||
beforeInit() {
|
||||
this.url = 'api/logs/user'
|
||||
this.url = 'api/logs/searchUserLog'
|
||||
return true
|
||||
},
|
||||
cropUploadSuccess(jsonData, field) {
|
||||
@@ -223,7 +223,7 @@ export default {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.saveLoading = true
|
||||
editUser(this.form).then(() => {
|
||||
updateUserCenterInfoById(this.form).then(() => {
|
||||
this.editSuccessNotify()
|
||||
store.dispatch('GetInfo').then(() => {
|
||||
})
|
||||
|
||||
@@ -34,9 +34,9 @@
|
||||
|
||||
<script>
|
||||
import store from '@/store'
|
||||
import { validEmail } from '@/utils/CsValidateUtil'
|
||||
import { updateEmail } from '@/api/system/user'
|
||||
import { sendResetEmailCaptcha } from '@/api/system/code'
|
||||
import { IsValidEmail } from '@/utils/CsValidateUtil'
|
||||
import { updateUserEmailByUsername } from '@/api/system/user'
|
||||
import { sendResetEmailCode } from '@/api/system/code'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
@@ -51,7 +51,7 @@ export default {
|
||||
callback(new Error('新邮箱不能为空'))
|
||||
} else if (value === this.email) {
|
||||
callback(new Error('新邮箱不能与旧邮箱相同'))
|
||||
} else if (validEmail(value)) {
|
||||
} else if (IsValidEmail(value)) {
|
||||
callback()
|
||||
} else {
|
||||
callback(new Error('邮箱格式错误'))
|
||||
@@ -83,7 +83,7 @@ export default {
|
||||
this.codeLoading = true
|
||||
this.buttonName = '验证码发送中'
|
||||
const _this = this
|
||||
sendResetEmailCaptcha(this.form.email).then(res => {
|
||||
sendResetEmailCode(this.form.email).then(res => {
|
||||
this.$message({
|
||||
showClose: true,
|
||||
message: '发送成功,验证码有效期5分钟',
|
||||
@@ -113,7 +113,7 @@ export default {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true
|
||||
updateEmail(this.form).then(res => {
|
||||
updateUserEmailByUsername(this.form).then(res => {
|
||||
this.loading = false
|
||||
this.resetForm()
|
||||
this.$notify({
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
<script>
|
||||
import store from '@/store'
|
||||
import { updatePass } from '@/api/system/user'
|
||||
import { updateUserPasswordByUsername } from '@/api/system/user'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@@ -69,7 +69,7 @@ export default {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true
|
||||
updatePass(this.form).then(res => {
|
||||
updateUserPasswordByUsername(this.form).then(res => {
|
||||
this.resetForm()
|
||||
this.$notify({
|
||||
title: '密码修改成功,请重新登录',
|
||||
|
||||
@@ -196,9 +196,9 @@
|
||||
<script>
|
||||
import crudUser from '@/api/system/user'
|
||||
import { IsValidPhone } from '@/utils/CsValidateUtil'
|
||||
import { queryDeptList, queryDeptSuperiorTree } from '@/api/system/dept'
|
||||
import { getLevel, queryRoleList } from '@/api/system/role'
|
||||
import { queryAllEnableJob } from '@/api/system/job'
|
||||
import { searchDept, searchDeptTree } from '@/api/system/dept'
|
||||
import { getCurrentUserRoleLevel, listAllRole } from '@/api/system/role'
|
||||
import { searchJob } from '@/api/system/job'
|
||||
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
@@ -228,7 +228,7 @@ export default {
|
||||
name: 'User',
|
||||
components: { CuteDeptTree, Treeselect, crudOperation, rrOperation, udOperation, pagination, DateRangePicker },
|
||||
cruds() {
|
||||
return CRUD({ title: '用户', url: 'api/user', crudMethod: { ...crudUser }})
|
||||
return CRUD({ title: '用户', url: 'api/user', searchRouter: '/aggregationSearchUser', crudMethod: { ...crudUser }})
|
||||
},
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
// 数据字典
|
||||
@@ -401,7 +401,7 @@ export default {
|
||||
this.crud.toQuery()
|
||||
},
|
||||
getDepts() {
|
||||
queryDeptList({
|
||||
searchDept({
|
||||
page: 1,
|
||||
size: 9999999,
|
||||
args: { enabled: true }
|
||||
@@ -415,7 +415,7 @@ export default {
|
||||
})
|
||||
},
|
||||
getSupDepts(deptId) {
|
||||
queryDeptSuperiorTree(deptId).then(res => {
|
||||
searchDeptTree(deptId).then(res => {
|
||||
const date = res.content
|
||||
this.buildDepts(date)
|
||||
this.depts = date
|
||||
@@ -434,7 +434,7 @@ export default {
|
||||
// 获取弹窗内部门数据
|
||||
loadDepts({ action, parentNode, callback }) {
|
||||
if (action === LOAD_CHILDREN_OPTIONS) {
|
||||
queryDeptList({
|
||||
searchDept({
|
||||
page: 1,
|
||||
size: 9999999,
|
||||
args: { enabled: true, pid: parentNode.id }
|
||||
@@ -469,21 +469,21 @@ export default {
|
||||
},
|
||||
// 获取弹窗内角色数据
|
||||
getRoles() {
|
||||
queryRoleList().then(res => {
|
||||
listAllRole().then(res => {
|
||||
this.roles = res
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
// 获取弹窗内岗位数据
|
||||
getJobs() {
|
||||
queryAllEnableJob().then(res => {
|
||||
searchJob().then(res => {
|
||||
this.jobs = res.content
|
||||
}).catch(() => {
|
||||
})
|
||||
},
|
||||
// 获取权限级别
|
||||
getRoleLevel() {
|
||||
getLevel().then(res => {
|
||||
getCurrentUserRoleLevel().then(res => {
|
||||
this.level = res.level
|
||||
}).catch(() => {
|
||||
})
|
||||
@@ -502,7 +502,7 @@ export default {
|
||||
ids.push(val.id)
|
||||
})
|
||||
console.log(ids)
|
||||
crudUser.resetPwd(ids).then(() => {
|
||||
crudUser.resetUserPasswordByIds(ids).then(() => {
|
||||
this.crud.notify('重置成功, 用户新密码:123456', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
}).catch(() => {
|
||||
})
|
||||
|
||||
@@ -41,6 +41,13 @@ module.exports = {
|
||||
pathRewrite: {
|
||||
'^/auth': 'auth'
|
||||
}
|
||||
},
|
||||
'/captcha': {
|
||||
target: process.env.VUE_APP_BASE_API,
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
'^/captcha': 'captcha'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<artifactId>cutejava</artifactId>
|
||||
<groupId>cn.odboy</groupId>
|
||||
<version>1.4.1</version>
|
||||
<version>1.5.2</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>cutejava-framework</artifactId>
|
||||
|
||||
+7
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -15,7 +15,12 @@
|
||||
*/
|
||||
package cn.odboy.annotation;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Inherited;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* 用于标记匿名访问方法
|
||||
|
||||
+6
-4
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,15 +13,17 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.odboy.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import org.springframework.core.annotation.AliasFor;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* Annotation for mapping HTTP {@code DELETE} requests onto specific handler methods. 支持匿名访问 DeleteMapping
|
||||
*
|
||||
|
||||
+6
-4
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,15 +13,17 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.odboy.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import org.springframework.core.annotation.AliasFor;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* Annotation for mapping HTTP {@code GET} requests onto specific handler methods.
|
||||
* <p>
|
||||
|
||||
+6
-4
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,15 +13,17 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.odboy.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import org.springframework.core.annotation.AliasFor;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* Annotation for mapping HTTP {@code PATCH} requests onto specific handler methods. 支持匿名访问 PatchMapping
|
||||
*
|
||||
|
||||
+6
-4
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,15 +13,17 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.odboy.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import org.springframework.core.annotation.AliasFor;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* Annotation for mapping HTTP {@code POST} requests onto specific handler methods. 支持匿名访问 PostMapping
|
||||
*
|
||||
|
||||
+6
-4
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,15 +13,17 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.odboy.annotation;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import org.springframework.core.annotation.AliasFor;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* Annotation for mapping HTTP {@code PUT} requests onto specific handler methods. 支持匿名访问 PutMapping
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,6 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.odboy.base;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
@@ -27,9 +26,11 @@ import lombok.Setter;
|
||||
* @date 2025-07-23
|
||||
*/
|
||||
public class KitArgs {
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
public static class FindByLongId extends KitObject {
|
||||
|
||||
@NotNull(message = "id必填")
|
||||
private Long id;
|
||||
}
|
||||
@@ -37,6 +38,7 @@ public class KitArgs {
|
||||
@Getter
|
||||
@Setter
|
||||
public static class DeleteById extends KitObject {
|
||||
|
||||
@NotNull(message = "id必填")
|
||||
private Long id;
|
||||
}
|
||||
|
||||
+5
-6
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,23 +13,22 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.odboy.base;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.Date;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class KitBaseCreateTimeTb extends KitObject {
|
||||
@Schema(name = "创建时间: yyyy-MM-dd HH:mm:ss", hidden = true)
|
||||
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "创建时间: yyyy-MM-dd HH:mm:ss", hidden = true)
|
||||
private Date createTime;
|
||||
}
|
||||
|
||||
+7
-9
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,27 +13,25 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.odboy.base;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.Date;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class KitBaseTimeTb extends KitObject {
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(name = "创建时间: yyyy-MM-dd HH:mm:ss", hidden = true)
|
||||
private Date createTime;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@ApiModelProperty(value = "创建时间: yyyy-MM-dd HH:mm:ss", hidden = true)
|
||||
private Date createTime;
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(name = "更新时间: yyyy-MM-dd HH:mm:ss", hidden = true)
|
||||
@ApiModelProperty(value = "更新时间: yyyy-MM-dd HH:mm:ss", hidden = true)
|
||||
private Date updateTime;
|
||||
}
|
||||
|
||||
+5
-6
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,23 +13,22 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.odboy.base;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.Date;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class KitBaseUpdateTimeTb extends KitObject {
|
||||
@Schema(name = "更新时间: yyyy-MM-dd HH:mm:ss", hidden = true)
|
||||
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@ApiModelProperty(value = "更新时间: yyyy-MM-dd HH:mm:ss", hidden = true)
|
||||
private Date updateTime;
|
||||
}
|
||||
|
||||
+10
-10
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,21 +13,19 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.odboy.base;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Date;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.springframework.data.annotation.CreatedBy;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Date;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@@ -35,11 +33,11 @@ public class KitBaseUserCreateTimeTb extends KitObject {
|
||||
|
||||
@CreatedBy
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(name = "创建人", hidden = true)
|
||||
private String createBy;
|
||||
|
||||
@ApiModelProperty(value = "创建人", hidden = true)
|
||||
private String
|
||||
createBy;
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(name = "创建时间: yyyy-MM-dd HH:mm:ss", hidden = true)
|
||||
@ApiModelProperty(value = "创建时间: yyyy-MM-dd HH:mm:ss", hidden = true)
|
||||
private Date createTime;
|
||||
|
||||
@Override
|
||||
@@ -59,9 +57,11 @@ public class KitBaseUserCreateTimeTb extends KitObject {
|
||||
|
||||
/* 分组校验 */
|
||||
public @interface Create {
|
||||
|
||||
}
|
||||
|
||||
/* 分组校验 */
|
||||
public @interface Update {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+11
-11
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,20 +13,18 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.odboy.base;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.util.Date;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.data.annotation.CreatedBy;
|
||||
import org.springframework.data.annotation.LastModifiedBy;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 逻辑删除通用模型
|
||||
*
|
||||
@@ -36,22 +34,24 @@ import java.util.Date;
|
||||
@Getter
|
||||
@Setter
|
||||
public class KitBaseUserTimeLogicTb extends KitObject {
|
||||
|
||||
@CreatedBy
|
||||
@TableField(value = "create_by", fill = FieldFill.INSERT)
|
||||
@Schema(name = "创建人", hidden = true)
|
||||
@ApiModelProperty(value = "创建人", hidden = true)
|
||||
private String createBy;
|
||||
@LastModifiedBy
|
||||
@TableField(value = "update_by", fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(name = "更新人", hidden = true)
|
||||
@ApiModelProperty(value = "更新人", hidden = true)
|
||||
private String updateBy;
|
||||
@TableField(value = "create_time", fill = FieldFill.INSERT)
|
||||
@Schema(name = "创建时间", hidden = true)
|
||||
@ApiModelProperty(value = "创建时间", hidden = true)
|
||||
private Date createTime;
|
||||
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(name = "更新时间", hidden = true)
|
||||
@ApiModelProperty(value = "更新时间", hidden = true)
|
||||
private Date updateTime;
|
||||
@Schema(name = "数据有效性", hidden = true)
|
||||
@ApiModelProperty(value = "数据有效性", hidden = true)
|
||||
@TableLogic
|
||||
@TableField("available")
|
||||
private Integer available;
|
||||
private Integer
|
||||
available;
|
||||
}
|
||||
|
||||
+12
-14
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,12 +13,13 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.odboy.base;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Date;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
@@ -26,9 +27,6 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.springframework.data.annotation.CreatedBy;
|
||||
import org.springframework.data.annotation.LastModifiedBy;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Date;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@@ -36,20 +34,18 @@ public class KitBaseUserTimeTb extends KitObject {
|
||||
|
||||
@CreatedBy
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(name = "创建人", hidden = true)
|
||||
private String createBy;
|
||||
|
||||
@ApiModelProperty(value = "创建人", hidden = true)
|
||||
private String
|
||||
createBy;
|
||||
@LastModifiedBy
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(name = "更新人", hidden = true)
|
||||
@ApiModelProperty(value = "更新人", hidden = true)
|
||||
private String updateBy;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(name = "创建时间: yyyy-MM-dd HH:mm:ss", hidden = true)
|
||||
@ApiModelProperty(value = "创建时间: yyyy-MM-dd HH:mm:ss", hidden = true)
|
||||
private Date createTime;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(name = "更新时间: yyyy-MM-dd HH:mm:ss", hidden = true)
|
||||
@ApiModelProperty(value = "更新时间: yyyy-MM-dd HH:mm:ss", hidden = true)
|
||||
private Date updateTime;
|
||||
|
||||
@Override
|
||||
@@ -69,9 +65,11 @@ public class KitBaseUserTimeTb extends KitObject {
|
||||
|
||||
/* 分组校验 */
|
||||
public @interface Create {
|
||||
|
||||
}
|
||||
|
||||
/* 分组校验 */
|
||||
public @interface Update {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,10 +13,8 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.odboy.base;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
@@ -26,6 +24,6 @@ import java.io.Serializable;
|
||||
* @date 2022-01-12
|
||||
*/
|
||||
public class KitObject implements Serializable {
|
||||
@Serial
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
}
|
||||
|
||||
+6
-7
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,18 +13,16 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.odboy.base;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import java.io.Serializable;
|
||||
import jakarta.validation.constraints.Min;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 数据分页参数
|
||||
*
|
||||
@@ -35,13 +33,14 @@ import java.io.Serializable;
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class KitPageArgs<T> implements Serializable {
|
||||
|
||||
@NotNull(message = "参数page不能为空")
|
||||
@Min(value = 1, message = "参数page最小值为1")
|
||||
@Schema(name = "页码", example = "1")
|
||||
@ApiModelProperty(value = "页码", example = "1")
|
||||
private Integer page;
|
||||
@NotNull(message = "参数size不能为空")
|
||||
@Min(value = 1, message = "参数size最小值为1")
|
||||
@Schema(name = "每页数据量", example = "10")
|
||||
@ApiModelProperty(value = "每页数据量", example = "10")
|
||||
private Integer size;
|
||||
private T args;
|
||||
}
|
||||
|
||||
+4
-5
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,18 +13,16 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.odboy.base;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 结果封装类
|
||||
*/
|
||||
@@ -33,6 +31,7 @@ import java.util.List;
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class KitPageResult<T> extends KitObject {
|
||||
|
||||
private List<T> content;
|
||||
private long totalElements;
|
||||
|
||||
|
||||
+7
-4
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,12 +13,14 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.odboy.base;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.util.Map;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 元数据选项
|
||||
@@ -32,6 +34,7 @@ import java.util.Map;
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class KitSelectOptionVo extends KitObject {
|
||||
|
||||
private String label;
|
||||
private String value;
|
||||
private Map<String, Object> ext;
|
||||
|
||||
+1
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,6 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.odboy.constant;
|
||||
|
||||
/**
|
||||
|
||||
+1
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,6 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.odboy.constant;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -24,7 +23,6 @@ import lombok.Getter;
|
||||
public enum FileTypeEnum {
|
||||
/* 文件类型 */
|
||||
IMAGE("image", "图片"), DOC("doc", "文档"), VOICE("voice", "音频"), VIDEO("video", "视频"), OTHER("other", "其他");
|
||||
|
||||
private final String code;
|
||||
private final String description;
|
||||
}
|
||||
|
||||
+1
-9
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,7 +13,6 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.odboy.constant;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -22,37 +21,30 @@ import lombok.Getter;
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum RequestMethodEnum {
|
||||
|
||||
/**
|
||||
* 搜寻 @AnonymousGetMapping
|
||||
*/
|
||||
GET("GET"),
|
||||
|
||||
/**
|
||||
* 搜寻 @AnonymousPostMapping
|
||||
*/
|
||||
POST("POST"),
|
||||
|
||||
/**
|
||||
* 搜寻 @AnonymousPutMapping
|
||||
*/
|
||||
PUT("PUT"),
|
||||
|
||||
/**
|
||||
* 搜寻 @AnonymousPatchMapping
|
||||
*/
|
||||
PATCH("PATCH"),
|
||||
|
||||
/**
|
||||
* 搜寻 @AnonymousDeleteMapping
|
||||
*/
|
||||
DELETE("DELETE"),
|
||||
|
||||
/**
|
||||
* 否则就是所有 Request 接口都放行
|
||||
*/
|
||||
ALL("All");
|
||||
|
||||
/**
|
||||
* Request 类型
|
||||
*/
|
||||
|
||||
+4
-6
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,33 +13,29 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.odboy.constant;
|
||||
|
||||
/**
|
||||
* 常用静态常量
|
||||
*/
|
||||
public interface SystemConst {
|
||||
|
||||
/**
|
||||
* win 系统
|
||||
*/
|
||||
String WIN = "win";
|
||||
|
||||
/**
|
||||
* mac 系统
|
||||
*/
|
||||
String MAC = "mac";
|
||||
|
||||
/**
|
||||
* 请求头名称
|
||||
*/
|
||||
String HEADER_NAME = "Authorization";
|
||||
|
||||
/**
|
||||
* Token前缀
|
||||
*/
|
||||
String TOKEN_PREFIX = "Bearer";
|
||||
|
||||
/**
|
||||
* 小数点
|
||||
*/
|
||||
@@ -50,4 +46,6 @@ public interface SystemConst {
|
||||
String SYMBOL_AT = "@";
|
||||
String PROPERTY_OS_NAME = "os.name";
|
||||
String OS_NAME_WINDOWS = "Windows";
|
||||
String CURRENT_APP_NAME = "cutejava";
|
||||
String CURRENT_APP_TITLE = "CuteJava";
|
||||
}
|
||||
|
||||
+2
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -30,6 +30,7 @@ import org.springframework.stereotype.Component;
|
||||
@Slf4j
|
||||
@Component
|
||||
public class BeanLoadFinishListener implements ApplicationListener<ContextRefreshedEvent> {
|
||||
|
||||
@Override
|
||||
public void onApplicationEvent(ContextRefreshedEvent event) {
|
||||
log.info("所有的Bean都加载完毕了");
|
||||
|
||||
+6
-5
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -17,14 +17,13 @@
|
||||
package cn.odboy.framework.context;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.context.ConfigurableApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.core.env.Environment;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
|
||||
/**
|
||||
* 主要目的是输出应用的服务地址
|
||||
*
|
||||
@@ -33,11 +32,13 @@ import java.net.UnknownHostException;
|
||||
*/
|
||||
@Slf4j
|
||||
public class BootApplication {
|
||||
|
||||
protected static void inited(ConfigurableApplicationContext application) throws UnknownHostException {
|
||||
Environment env = application.getEnvironment();
|
||||
String ip = InetAddress.getLocalHost().getHostAddress();
|
||||
String port = env.getProperty("server.port");
|
||||
String path = StrUtil.isEmpty(env.getProperty("config.servlet.context-path")) ? "" : env.getProperty("config.servlet.context-path");
|
||||
String path = StrUtil.isEmpty(env.getProperty("config.servlet.context-path")) ? ""
|
||||
: env.getProperty("config.servlet.context-path");
|
||||
log.info("""
|
||||
----------------------------------------------------------
|
||||
\tApplication is running! Access URLs:
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -18,17 +18,17 @@
|
||||
package cn.odboy.framework.context;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import java.util.Objects;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 获取 HttpServletRequest
|
||||
*/
|
||||
public class KitRequestHolder {
|
||||
|
||||
public static HttpServletRequest getHttpServletRequest() {
|
||||
return ((ServletRequestAttributes)Objects.requireNonNull(RequestContextHolder.getRequestAttributes())).getRequest();
|
||||
return ((ServletRequestAttributes) Objects.requireNonNull(
|
||||
RequestContextHolder.getRequestAttributes())).getRequest();
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,13 +16,12 @@
|
||||
|
||||
package cn.odboy.framework.context;
|
||||
|
||||
import java.util.Map;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.mozilla.javascript.Context;
|
||||
import org.mozilla.javascript.Scriptable;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 脚本工具
|
||||
*
|
||||
@@ -32,6 +31,7 @@ import java.util.Map;
|
||||
@Slf4j
|
||||
@Component
|
||||
public class KitScriptHelper {
|
||||
|
||||
public Object evalObj(String script, Map<String, Object> args) {
|
||||
try (Context rhino = Context.enter()) {
|
||||
Scriptable scope = rhino.initStandardObjects();
|
||||
|
||||
+13
-15
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,9 +13,12 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.odboy.framework.context;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import lombok.NonNull;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeansException;
|
||||
import org.springframework.beans.factory.DisposableBean;
|
||||
@@ -24,12 +27,7 @@ import org.springframework.context.ApplicationContextAware;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@SuppressWarnings({"unchecked", "all"})
|
||||
public class KitSpringBeanHolder implements ApplicationContextAware, DisposableBean {
|
||||
|
||||
private static final List<CallBack> CALL_BACKS = new ArrayList<>();
|
||||
@@ -43,7 +41,7 @@ public class KitSpringBeanHolder implements ApplicationContextAware, DisposableB
|
||||
*/
|
||||
public synchronized static void addCallBacks(CallBack callBack) {
|
||||
if (addCallback) {
|
||||
KitSpringBeanHolder.CALL_BACKS.add(callBack);
|
||||
CALL_BACKS.add(callBack);
|
||||
} else {
|
||||
log.warn("CallBack:{} 已无法添加!立即执行", callBack.getCallBackName());
|
||||
callBack.executor();
|
||||
@@ -55,7 +53,7 @@ public class KitSpringBeanHolder implements ApplicationContextAware, DisposableB
|
||||
*/
|
||||
public static <T> T getBean(String name) {
|
||||
assertContextInjected();
|
||||
return (T)applicationContext.getBean(name);
|
||||
return (T) applicationContext.getBean(name);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -109,8 +107,8 @@ public class KitSpringBeanHolder implements ApplicationContextAware, DisposableB
|
||||
*/
|
||||
private static void assertContextInjected() {
|
||||
if (applicationContext == null) {
|
||||
throw new IllegalStateException(
|
||||
"applicaitonContext属性未注入, 请在applicationContext" + ".xml中定义SpringContextHolder或在SpringBoot启动类中注册SpringContextHolder.");
|
||||
throw new IllegalStateException("applicaitonContext属性未注入, 请在applicationContext" +
|
||||
".xml中定义SpringContextHolder或在SpringBoot启动类中注册SpringContextHolder.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,7 +116,7 @@ public class KitSpringBeanHolder implements ApplicationContextAware, DisposableB
|
||||
* 清除SpringContextHolder中的ApplicationContext为Null.
|
||||
*/
|
||||
private static void clearHolder() {
|
||||
log.debug("清除SpringContextHolder中的ApplicationContext:" + applicationContext);
|
||||
log.debug("清除SpringContextHolder中的ApplicationContext:{}", applicationContext);
|
||||
applicationContext = null;
|
||||
}
|
||||
|
||||
@@ -137,9 +135,9 @@ public class KitSpringBeanHolder implements ApplicationContextAware, DisposableB
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
|
||||
public void setApplicationContext(@NonNull ApplicationContext applicationContext) throws BeansException {
|
||||
if (KitSpringBeanHolder.applicationContext != null) {
|
||||
log.warn("SpringContextHolder中的ApplicationContext被覆盖, 原有ApplicationContext为:" + KitSpringBeanHolder.applicationContext);
|
||||
log.warn("SpringContextHolder中的ApplicationContext被覆盖, 原有ApplicationContext为:{}", KitSpringBeanHolder.applicationContext);
|
||||
}
|
||||
KitSpringBeanHolder.applicationContext = applicationContext;
|
||||
if (addCallback) {
|
||||
@@ -151,7 +149,7 @@ public class KitSpringBeanHolder implements ApplicationContextAware, DisposableB
|
||||
KitSpringBeanHolder.addCallback = false;
|
||||
}
|
||||
|
||||
interface CallBack {
|
||||
public interface CallBack {
|
||||
|
||||
/**
|
||||
* 回调执行方法
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,11 +16,11 @@
|
||||
|
||||
package cn.odboy.framework.exception;
|
||||
|
||||
import static org.springframework.http.HttpStatus.BAD_REQUEST;
|
||||
|
||||
import lombok.Getter;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
||||
import static org.springframework.http.HttpStatus.BAD_REQUEST;
|
||||
|
||||
/**
|
||||
* 统一异常处理
|
||||
*/
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,11 +16,11 @@
|
||||
|
||||
package cn.odboy.framework.exception;
|
||||
|
||||
import static org.springframework.http.HttpStatus.INTERNAL_SERVER_ERROR;
|
||||
|
||||
import lombok.Getter;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
||||
import static org.springframework.http.HttpStatus.INTERNAL_SERVER_ERROR;
|
||||
|
||||
@Getter
|
||||
public class ServerException extends RuntimeException {
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+9
-4
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,13 +13,17 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.odboy.framework.logging;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Inherited;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* 统计执行时长
|
||||
* 统计执行时长(仅对代理方法有效)
|
||||
*
|
||||
* @author odboy
|
||||
*/
|
||||
@@ -28,6 +32,7 @@ import java.lang.annotation.*;
|
||||
@Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface ExecutionTimeStatisticsFace {
|
||||
|
||||
/**
|
||||
* 接口描述
|
||||
*/
|
||||
|
||||
+8
-4
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -33,16 +33,20 @@ import org.springframework.stereotype.Component;
|
||||
@Aspect
|
||||
@Component
|
||||
public class ExecutionTimeStatisticsFaceAspect {
|
||||
|
||||
@Around("@annotation(executionTimeStatisticsFace)")
|
||||
public Object aroundFace(ProceedingJoinPoint joinPoint, ExecutionTimeStatisticsFace executionTimeStatisticsFace) throws Throwable {
|
||||
public Object aroundFace(ProceedingJoinPoint joinPoint, ExecutionTimeStatisticsFace executionTimeStatisticsFace)
|
||||
throws Throwable {
|
||||
TimeInterval timeInterval = new TimeInterval();
|
||||
try {
|
||||
Object proceed = joinPoint.proceed();
|
||||
log.info("[{}] 接口执行成功,耗时: {} ms", executionTimeStatisticsFace.description(), timeInterval.intervalMs());
|
||||
log.info("[{}] 接口执行成功,耗时: {} ms", executionTimeStatisticsFace.description(),
|
||||
timeInterval.intervalMs());
|
||||
return proceed;
|
||||
} catch (Exception e) {
|
||||
if (executionTimeStatisticsFace.showErrLog()) {
|
||||
log.error("[{}] 接口执行失败,耗时: {} ms", executionTimeStatisticsFace.description(), timeInterval.intervalMs(), e);
|
||||
log.error("[{}] 接口执行失败,耗时: {} ms", executionTimeStatisticsFace.description(),
|
||||
timeInterval.intervalMs(), e);
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
|
||||
+2
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -31,6 +31,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@RequestMapping("/healthCheck")
|
||||
@Tag(name = "系统:健康检查接口")
|
||||
public class HealthCheckController {
|
||||
|
||||
@Autowired
|
||||
private KitHealthCheckPointService kitHealthCheckPointService;
|
||||
|
||||
|
||||
+2
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -19,6 +19,7 @@ package cn.odboy.framework.monitor.service;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
|
||||
public interface KitHealthCheckPointService {
|
||||
|
||||
/**
|
||||
* 就绪检查
|
||||
*/
|
||||
|
||||
+13
-45
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,17 +13,14 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.odboy.framework.mybatisplus.config;
|
||||
|
||||
import cn.odboy.framework.exception.BadRequestException;
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* @author /
|
||||
*/
|
||||
@Getter
|
||||
@Slf4j
|
||||
@SuppressWarnings({"unchecked", "all"})
|
||||
public enum DataTypeEnum {
|
||||
/**
|
||||
* mysql
|
||||
@@ -86,15 +83,16 @@ public enum DataTypeEnum {
|
||||
*/
|
||||
IMPALA("impala", "impala", "com.cloudera.impala.jdbc41.Driver", "", "", "'", "'");
|
||||
private static final String JDBC_URL_PREFIX = "jdbc:";
|
||||
private String feature;
|
||||
private String desc;
|
||||
private String driver;
|
||||
private String keywordPrefix;
|
||||
private String keywordSuffix;
|
||||
private String aliasPrefix;
|
||||
private String aliasSuffix;
|
||||
private final String feature;
|
||||
private final String desc;
|
||||
private final String driver;
|
||||
private final String keywordPrefix;
|
||||
private final String keywordSuffix;
|
||||
private final String aliasPrefix;
|
||||
private final String aliasSuffix;
|
||||
|
||||
DataTypeEnum(String feature, String desc, String driver, String keywordPrefix, String keywordSuffix, String aliasPrefix, String aliasSuffix) {
|
||||
DataTypeEnum(String feature, String desc, String driver, String keywordPrefix, String keywordSuffix,
|
||||
String aliasPrefix, String aliasSuffix) {
|
||||
this.feature = feature;
|
||||
this.desc = desc;
|
||||
this.driver = driver;
|
||||
@@ -109,10 +107,7 @@ public enum DataTypeEnum {
|
||||
for (DataTypeEnum dataTypeEnum : values()) {
|
||||
if (url.startsWith(JDBC_URL_PREFIX + dataTypeEnum.feature)) {
|
||||
try {
|
||||
Class<?> aClass = Class.forName(dataTypeEnum.getDriver());
|
||||
if (null == aClass) {
|
||||
throw new BadRequestException("Unable to get driver instance for jdbcUrl: " + jdbcUrl);
|
||||
}
|
||||
Class.forName(dataTypeEnum.getDriver());
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new BadRequestException("Unable to get driver instance: " + jdbcUrl);
|
||||
}
|
||||
@@ -122,31 +117,4 @@ public enum DataTypeEnum {
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getFeature() {
|
||||
return feature;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public String getDriver() {
|
||||
return driver;
|
||||
}
|
||||
|
||||
public String getKeywordPrefix() {
|
||||
return keywordPrefix;
|
||||
}
|
||||
|
||||
public String getKeywordSuffix() {
|
||||
return keywordSuffix;
|
||||
}
|
||||
|
||||
public String getAliasPrefix() {
|
||||
return aliasPrefix;
|
||||
}
|
||||
|
||||
public String getAliasSuffix() {
|
||||
return aliasSuffix;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
||||
+2
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -29,6 +29,7 @@ import java.lang.annotation.Target;
|
||||
@Target(ElementType.FIELD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface KitMpQuery {
|
||||
|
||||
/**
|
||||
* 基本对象的属性名
|
||||
*/
|
||||
|
||||
+6
-4
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -25,6 +25,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
*/
|
||||
@Slf4j
|
||||
public class MpCustomP6SpyLogger implements MessageFormattingStrategy {
|
||||
|
||||
/**
|
||||
* 重置颜色
|
||||
*/
|
||||
@@ -55,13 +56,14 @@ public class MpCustomP6SpyLogger implements MessageFormattingStrategy {
|
||||
* @return 格式化后的sql
|
||||
*/
|
||||
@Override
|
||||
public String formatMessage(int connectionId, String now, long elapsed, String category, String prepared, String sql, String url) {
|
||||
public String formatMessage(int connectionId, String now, long elapsed, String category, String prepared,
|
||||
String sql, String url) {
|
||||
// 去掉换行和多余空格
|
||||
if (StrUtil.isNotBlank(sql)) {
|
||||
sql = sql.replaceAll("\\s+", " ").trim();
|
||||
}
|
||||
// 格式化并加上颜色
|
||||
return String.format("CuteJava - %s%s%s %s[%s] %sREVIEW_SQL [Interval: %dms]%s -> %s;", RED, now, RESET, GREEN, Thread.currentThread().getName(), BLUE,
|
||||
elapsed, RESET, sql);
|
||||
return String.format("CuteJava - %s%s%s %s[%s] %sREVIEW_SQL [Interval: %dms]%s -> %s;", RED, now, RESET, GREEN,
|
||||
Thread.currentThread().getName(), BLUE, elapsed, RESET, sql);
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -22,9 +22,8 @@ import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
|
||||
import com.baomidou.mybatisplus.core.metadata.TableInfo;
|
||||
import com.baomidou.mybatisplus.extension.injector.methods.AlwaysUpdateSomeColumnById;
|
||||
import com.baomidou.mybatisplus.extension.injector.methods.InsertBatchSomeColumn;
|
||||
import org.apache.ibatis.session.Configuration;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.session.Configuration;
|
||||
|
||||
/**
|
||||
* 批量插入SQL注入器
|
||||
@@ -33,6 +32,7 @@ import java.util.List;
|
||||
* @date 2025-01-11
|
||||
*/
|
||||
public class MpInsertBatchSqlInjector extends DefaultSqlInjector {
|
||||
|
||||
@Override
|
||||
public List<AbstractMethod> getMethodList(Configuration configuration, Class<?> mapperClass, TableInfo tableInfo) {
|
||||
List<AbstractMethod> methodList = super.getMethodList(configuration, mapperClass, tableInfo);
|
||||
|
||||
+2
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -28,6 +28,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
@Configuration
|
||||
@EnableTransactionManagement
|
||||
public class MybatisPlusConfig {
|
||||
|
||||
@Bean
|
||||
public MybatisPlusInterceptor paginationInterceptor() {
|
||||
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
||||
|
||||
+16
-11
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -19,9 +19,15 @@ package cn.odboy.framework.mybatisplus.config;
|
||||
import com.alibaba.druid.spring.boot3.autoconfigure.DruidDataSourceAutoConfigure;
|
||||
import com.alibaba.druid.spring.boot3.autoconfigure.properties.DruidStatProperties;
|
||||
import com.alibaba.druid.util.Utils;
|
||||
import jakarta.servlet.*;
|
||||
import jakarta.servlet.Filter;
|
||||
import jakarta.servlet.FilterChain;
|
||||
import jakarta.servlet.FilterConfig;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.ServletRequest;
|
||||
import jakarta.servlet.ServletResponse;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
|
||||
@@ -29,13 +35,11 @@ import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@Configuration
|
||||
@SuppressWarnings({"unchecked", "all"})
|
||||
@ConditionalOnWebApplication
|
||||
@AutoConfigureAfter(DruidDataSourceAutoConfigure.class)
|
||||
@ConditionalOnProperty(name = "spring.datasource.druid.stat-view-servlet.enabled", havingValue = "true", matchIfMissing = true)
|
||||
@ConditionalOnProperty(name = "spring.datasource.druid.stat-view-servlet.enabled", havingValue = "true",
|
||||
matchIfMissing = true)
|
||||
public class RemoveDruidAdConfig {
|
||||
|
||||
/**
|
||||
@@ -45,7 +49,7 @@ public class RemoveDruidAdConfig {
|
||||
* @return org.springframework.boot.web.servlet.FilterRegistrationBean
|
||||
*/
|
||||
@Bean
|
||||
public FilterRegistrationBean removeDruidAdFilterRegistrationBean(DruidStatProperties properties) {
|
||||
public FilterRegistrationBean<Filter> removeDruidAdFilterRegistrationBean(DruidStatProperties properties) {
|
||||
|
||||
// 获取web监控页面的参数
|
||||
DruidStatProperties.StatViewServlet config = properties.getStatViewServlet();
|
||||
@@ -62,9 +66,10 @@ public class RemoveDruidAdConfig {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
|
||||
HttpServletRequest httpRequest = (HttpServletRequest)request;
|
||||
HttpServletResponse httpResponse = (HttpServletResponse)response;
|
||||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
|
||||
throws IOException, ServletException {
|
||||
HttpServletRequest httpRequest = (HttpServletRequest) request;
|
||||
HttpServletResponse httpResponse = (HttpServletResponse) response;
|
||||
if (httpRequest.getRequestURI().endsWith("js/common.js")) {
|
||||
// 获取common.js
|
||||
String text = Utils.readFromResource(filePath);
|
||||
@@ -83,7 +88,7 @@ public class RemoveDruidAdConfig {
|
||||
public void destroy() {
|
||||
}
|
||||
};
|
||||
FilterRegistrationBean registrationBean = new FilterRegistrationBean();
|
||||
FilterRegistrationBean<Filter> registrationBean = new FilterRegistrationBean();
|
||||
registrationBean.setFilter(filter);
|
||||
registrationBean.addUrlPatterns(commonJsPattern);
|
||||
return registrationBean;
|
||||
|
||||
+8
-8
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2021-2025 Odboy
|
||||
* Copyright 2021-2026 Odboy
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -13,14 +13,12 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.odboy.framework.mybatisplus.core;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.odboy.util.KitBeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -31,6 +29,7 @@ import java.util.List;
|
||||
* @date 2025-05-15
|
||||
*/
|
||||
public class KitMpAnyQUtil {
|
||||
|
||||
public static <T> T selectOne(BaseMapper<T> baseMapper, Object queryParams) {
|
||||
QueryWrapper<T> queryWrapper = KitMpQUtil.build(queryParams);
|
||||
return baseMapper.selectOne(queryWrapper);
|
||||
@@ -42,7 +41,7 @@ public class KitMpAnyQUtil {
|
||||
if (mapperTarget == null) {
|
||||
return null;
|
||||
}
|
||||
return BeanUtil.copyProperties(mapperTarget, mapperClazz);
|
||||
return KitBeanUtil.copyToClass(mapperTarget, mapperClazz);
|
||||
}
|
||||
|
||||
public static <T> List<T> selectList(BaseMapper<T> baseMapper, Object queryParams) {
|
||||
@@ -56,7 +55,7 @@ public class KitMpAnyQUtil {
|
||||
if (mapperTarget == null) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
return BeanUtil.copyToList(mapperTarget, mapperClazz);
|
||||
return KitBeanUtil.copyToList(mapperTarget, mapperClazz);
|
||||
}
|
||||
|
||||
public static <T> Long selectCount(BaseMapper<T> baseMapper, Object queryParams) {
|
||||
@@ -69,11 +68,12 @@ public class KitMpAnyQUtil {
|
||||
return baseMapper.selectPage(page, queryWrapper);
|
||||
}
|
||||
|
||||
public static <T, M> Page<M> selectPage(BaseMapper<T> baseMapper, Page<T> page, Object queryParams, Class<M> mapperClazz) {
|
||||
public static <T, M> Page<M> selectPage(BaseMapper<T> baseMapper, Page<T> page, Object queryParams,
|
||||
Class<M> mapperClazz) {
|
||||
QueryWrapper<T> queryWrapper = KitMpQUtil.build(queryParams);
|
||||
Page<T> tPage = baseMapper.selectPage(page, queryWrapper);
|
||||
Page<M> mapperTarget = new Page<>();
|
||||
mapperTarget.setRecords(BeanUtil.copyToList(tPage.getRecords(), mapperClazz));
|
||||
mapperTarget.setRecords(KitBeanUtil.copyToList(tPage.getRecords(), mapperClazz));
|
||||
mapperTarget.setTotal(tPage.getTotal());
|
||||
mapperTarget.setSize(tPage.getSize());
|
||||
mapperTarget.setCurrent(tPage.getCurrent());
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user