refactor(project): 重构项目模块和包名
- 新增 cutejava-module-devops模块 - 新增半成品通用流水线
This commit is contained in:
@@ -22,7 +22,7 @@ export function getInfo() {
|
|||||||
|
|
||||||
export function getCodeImg() {
|
export function getCodeImg() {
|
||||||
return request({
|
return request({
|
||||||
url: 'auth/code',
|
url: 'auth/captcha/getImage',
|
||||||
method: 'post'
|
method: 'post'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,14 +2,14 @@ import request from '@/utils/request'
|
|||||||
|
|
||||||
export function sendResetEmailCaptcha(email) {
|
export function sendResetEmailCaptcha(email) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/code/sendResetEmailCaptcha?email=' + email,
|
url: 'api/captcha/sendResetEmailCaptcha?email=' + email,
|
||||||
method: 'post'
|
method: 'post'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function sendResetPasswordCaptcha(email) {
|
export function sendResetPasswordCaptcha(email) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/code/sendResetPasswordCaptcha?email=' + email,
|
url: 'api/captcha/sendResetPasswordCaptcha?email=' + email,
|
||||||
method: 'post'
|
method: 'post'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -21,7 +21,7 @@ export function checkEmailCaptcha(email, code, bizCode) {
|
|||||||
bizCode: bizCode
|
bizCode: bizCode
|
||||||
}
|
}
|
||||||
return request({
|
return request({
|
||||||
url: 'api/code/checkEmailCaptcha',
|
url: 'api/captcha/checkEmailCaptcha',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -2,14 +2,14 @@ import request from '@/utils/request'
|
|||||||
|
|
||||||
export function queryMenuListByPid(pid) {
|
export function queryMenuListByPid(pid) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/menus/queryMenuListByPid?pid=' + pid,
|
url: 'api/menu/queryMenuListByPid?pid=' + pid,
|
||||||
method: 'post'
|
method: 'post'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function queryMenuByArgs(params) {
|
export function queryMenuByArgs(params) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/menus/queryMenuByArgs',
|
url: 'api/menu/queryMenuByArgs',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
@@ -18,7 +18,7 @@ export function queryMenuByArgs(params) {
|
|||||||
export function queryMenuSuperior(ids) {
|
export function queryMenuSuperior(ids) {
|
||||||
const data = Array.isArray(ids) ? ids : [ids]
|
const data = Array.isArray(ids) ? ids : [ids]
|
||||||
return request({
|
return request({
|
||||||
url: 'api/menus/queryMenuSuperior',
|
url: 'api/menu/queryMenuSuperior',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
@@ -26,21 +26,21 @@ export function queryMenuSuperior(ids) {
|
|||||||
|
|
||||||
export function queryChildMenuSet(id) {
|
export function queryChildMenuSet(id) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/menus/queryChildMenuSet?id=' + id,
|
url: 'api/menu/queryChildMenuSet?id=' + id,
|
||||||
method: 'post'
|
method: 'post'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function buildMenus() {
|
export function buildMenus() {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/menus/buildMenus',
|
url: 'api/menu/buildMenus',
|
||||||
method: 'post'
|
method: 'post'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function add(data) {
|
export function add(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/menus/saveMenu',
|
url: 'api/menu/saveMenu',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
@@ -48,7 +48,7 @@ export function add(data) {
|
|||||||
|
|
||||||
export function del(ids) {
|
export function del(ids) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/menus/removeMenuByIds',
|
url: 'api/menu/removeMenuByIds',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: ids
|
data: ids
|
||||||
})
|
})
|
||||||
@@ -56,7 +56,7 @@ export function del(ids) {
|
|||||||
|
|
||||||
export function edit(data) {
|
export function edit(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/menus/modifyMenuById',
|
url: 'api/menu/modifyMenuById',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import request from '@/utils/request'
|
|||||||
|
|
||||||
export function kickOutUser(keys) {
|
export function kickOutUser(keys) {
|
||||||
return request({
|
return request({
|
||||||
url: 'auth/online/kickOutUser',
|
url: 'api/user/online/kickOutUser',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: keys
|
data: keys
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -3,14 +3,14 @@ import request from '@/utils/request'
|
|||||||
// 获取所有的Role
|
// 获取所有的Role
|
||||||
export function queryRoleList() {
|
export function queryRoleList() {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/roles/queryRoleList',
|
url: 'api/role/queryRoleList',
|
||||||
method: 'post'
|
method: 'post'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function add(data) {
|
export function add(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/roles/saveRole',
|
url: 'api/role/saveRole',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
@@ -18,7 +18,7 @@ export function add(data) {
|
|||||||
|
|
||||||
export function get(id) {
|
export function get(id) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/roles/queryRoleById',
|
url: 'api/role/queryRoleById',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: { id: id }
|
data: { id: id }
|
||||||
})
|
})
|
||||||
@@ -26,14 +26,14 @@ export function get(id) {
|
|||||||
|
|
||||||
export function getLevel() {
|
export function getLevel() {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/roles/queryRoleLevel',
|
url: 'api/role/queryRoleLevel',
|
||||||
method: 'post'
|
method: 'post'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function del(ids) {
|
export function del(ids) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/roles/removeRoleByIds',
|
url: 'api/role/removeRoleByIds',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: ids
|
data: ids
|
||||||
})
|
})
|
||||||
@@ -41,7 +41,7 @@ export function del(ids) {
|
|||||||
|
|
||||||
export function edit(data) {
|
export function edit(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/roles/modifyRoleById',
|
url: 'api/role/modifyRoleById',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
@@ -49,7 +49,7 @@ export function edit(data) {
|
|||||||
|
|
||||||
export function editMenu(data) {
|
export function editMenu(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/roles/modifyBindMenuById',
|
url: 'api/role/modifyBindMenuById',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data
|
data
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { encrypt } from '@/utils/rsaEncrypt'
|
|||||||
|
|
||||||
export function add(data) {
|
export function add(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/users/saveUser',
|
url: 'api/user/saveUser',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
@@ -11,7 +11,7 @@ export function add(data) {
|
|||||||
|
|
||||||
export function del(ids) {
|
export function del(ids) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/users/removeUserByIds',
|
url: 'api/user/removeUserByIds',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: ids
|
data: ids
|
||||||
})
|
})
|
||||||
@@ -19,7 +19,7 @@ export function del(ids) {
|
|||||||
|
|
||||||
export function resetPwd(ids) {
|
export function resetPwd(ids) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/users/resetUserPasswordByIds',
|
url: 'api/user/resetUserPasswordByIds',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: ids
|
data: ids
|
||||||
})
|
})
|
||||||
@@ -27,7 +27,7 @@ export function resetPwd(ids) {
|
|||||||
|
|
||||||
export function edit(data) {
|
export function edit(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/users/modifyUserById',
|
url: 'api/user/modifyUserById',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
@@ -35,7 +35,7 @@ export function edit(data) {
|
|||||||
|
|
||||||
export function editUser(data) {
|
export function editUser(data) {
|
||||||
return request({
|
return request({
|
||||||
url: 'api/users/modifyUserCenterInfoById',
|
url: 'api/user/modifyUserCenterInfoById',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
@@ -47,7 +47,7 @@ export function updatePass(user) {
|
|||||||
newPass: encrypt(user.newPass)
|
newPass: encrypt(user.newPass)
|
||||||
}
|
}
|
||||||
return request({
|
return request({
|
||||||
url: 'api/users/modifyUserPasswordByUsername',
|
url: 'api/user/modifyUserPasswordByUsername',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
@@ -59,7 +59,7 @@ export function updateEmail(form) {
|
|||||||
email: form.email
|
email: form.email
|
||||||
}
|
}
|
||||||
return request({
|
return request({
|
||||||
url: 'api/users/modifyUserEmailByUsername/' + form.code,
|
url: 'api/user/modifyUserEmailByUsername/' + form.code,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
@@ -74,7 +74,7 @@ export function queryUserMetaPage(query) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return request({
|
return request({
|
||||||
url: 'api/users/queryUserMetadataOptions',
|
url: 'api/user/queryUserMetadataOptions',
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: params
|
data: params
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ const api = {
|
|||||||
// 图片上传
|
// 图片上传
|
||||||
imagesUploadApi: baseUrl + '/api/localStorage/uploadPicture',
|
imagesUploadApi: baseUrl + '/api/localStorage/uploadPicture',
|
||||||
// 修改头像
|
// 修改头像
|
||||||
updateAvatarApi: baseUrl + '/api/users/modifyUserAvatar',
|
updateAvatarApi: baseUrl + '/api/user/modifyUserAvatar',
|
||||||
// 上传文件到七牛云
|
// 上传文件到七牛云
|
||||||
qiNiuUploadApi: baseUrl + '/api/qiNiuContent',
|
qiNiuUploadApi: baseUrl + '/api/qiNiuContent/uploadFile',
|
||||||
// Sql 监控
|
// Sql 监控
|
||||||
druidSqlApi: baseUrl + '/druid/index.html',
|
druidSqlApi: baseUrl + '/druid/index.html',
|
||||||
// websocket
|
// websocket
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ export default {
|
|||||||
name: 'Menu',
|
name: 'Menu',
|
||||||
components: { Treeselect, IconSelect, crudOperation, rrOperation, udOperation, DateRangePicker },
|
components: { Treeselect, IconSelect, crudOperation, rrOperation, udOperation, DateRangePicker },
|
||||||
cruds() {
|
cruds() {
|
||||||
return CRUD({ title: '菜单', url: 'api/menus', crudMethod: { ...crudMenu }})
|
return CRUD({ title: '菜单', url: 'api/menu', crudMethod: { ...crudMenu }})
|
||||||
},
|
},
|
||||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||||
data() {
|
data() {
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ export default {
|
|||||||
name: 'Role',
|
name: 'Role',
|
||||||
components: { Treeselect, pagination, crudOperation, rrOperation, udOperation, DateRangePicker },
|
components: { Treeselect, pagination, crudOperation, rrOperation, udOperation, DateRangePicker },
|
||||||
cruds() {
|
cruds() {
|
||||||
return CRUD({ title: '角色', url: 'api/roles', crudMethod: { ...crudRoles }})
|
return CRUD({ title: '角色', url: 'api/role', crudMethod: { ...crudRoles }})
|
||||||
},
|
},
|
||||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||||
data() {
|
data() {
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ export default {
|
|||||||
name: 'User',
|
name: 'User',
|
||||||
components: { CuteDeptTree, Treeselect, crudOperation, rrOperation, udOperation, pagination, DateRangePicker },
|
components: { CuteDeptTree, Treeselect, crudOperation, rrOperation, udOperation, pagination, DateRangePicker },
|
||||||
cruds() {
|
cruds() {
|
||||||
return CRUD({ title: '用户', url: 'api/users', crudMethod: { ...crudUser }})
|
return CRUD({ title: '用户', url: 'api/user', crudMethod: { ...crudUser }})
|
||||||
},
|
},
|
||||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||||
// 数据字典
|
// 数据字典
|
||||||
|
|||||||
@@ -52,6 +52,11 @@ https://github.com/odboy-tianjun/cutejava
|
|||||||
- 七牛云存储:可同步七牛云存储的数据到系统,无需登录七牛云直接操作云数据
|
- 七牛云存储:可同步七牛云存储的数据到系统,无需登录七牛云直接操作云数据
|
||||||
- 服务监控:监控服务器的负载情况
|
- 服务监控:监控服务器的负载情况
|
||||||
|
|
||||||
|
#### 系统模块
|
||||||
|
- cutejava-framework:系统基础框架,提供核心功能,如:权限、数据权限、异常处理、日志、缓存、工具类、代码生成器、接口限流、接口防重、接口幂等。
|
||||||
|
- cutejava-system:系统功能模块,提供用户、角色、菜单、部门、岗位、字典、日志、定时任务、邮件、七牛云存储、服务监控等功能
|
||||||
|
- cutejava-pipeline:流水线模块,参考阿里云云效,提供流水线功能,可配置流水线任务,并支持任务依赖、任务参数、任务参数校验、任务参数回填。
|
||||||
|
|
||||||
#### 特别鸣谢
|
#### 特别鸣谢
|
||||||
|
|
||||||
- 感谢 [PanJiaChen](https://github.com/PanJiaChen/vue-element-admin) 大佬提供的前端模板
|
- 感谢 [PanJiaChen](https://github.com/PanJiaChen/vue-element-admin) 大佬提供的前端模板
|
||||||
|
|||||||
@@ -1,37 +0,0 @@
|
|||||||
package cn.odboy.constant;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 常用静态常量
|
|
||||||
*/
|
|
||||||
public class SystemConst {
|
|
||||||
/**
|
|
||||||
* win 系统
|
|
||||||
*/
|
|
||||||
public static final String WIN = "win";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* mac 系统
|
|
||||||
*/
|
|
||||||
public static final String MAC = "mac";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 请求头名称
|
|
||||||
*/
|
|
||||||
public static final String HEADER_NAME = "Authorization";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Token前缀
|
|
||||||
*/
|
|
||||||
public static final String TOKEN_PREFIX = "Bearer";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 小数点
|
|
||||||
*/
|
|
||||||
public static final String SYMBOL_DOT = ".";
|
|
||||||
public static final String SYMBOL_EQUAL = "=";
|
|
||||||
public static final String SYMBOL_ADD = "+";
|
|
||||||
public static final String SYMBOL_SUBTRACT = "-";
|
|
||||||
public static final String SYMBOL_AT = "@";
|
|
||||||
public static final String PROPERTY_OS_NAME = "os.name";
|
|
||||||
public static final String OS_NAME_WINDOWS = "Windows";
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<parent>
|
||||||
|
<artifactId>cutejava</artifactId>
|
||||||
|
<groupId>cn.odboy</groupId>
|
||||||
|
<version>1.4.1</version>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<artifactId>cutejava-framework</artifactId>
|
||||||
|
<name>公共模块</name>
|
||||||
|
</project>
|
||||||
+1
@@ -1,6 +1,7 @@
|
|||||||
package cn.odboy.annotation;
|
package cn.odboy.annotation;
|
||||||
|
|
||||||
import org.springframework.core.annotation.AliasFor;
|
import org.springframework.core.annotation.AliasFor;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
|
|
||||||
+1
-1
@@ -21,7 +21,7 @@ import java.util.Date;
|
|||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public class CsBaseUserTimeLogicTb extends CsSerializeObject {
|
public class CsBaseUserTimeLogicTb extends CsObject {
|
||||||
@CreatedBy
|
@CreatedBy
|
||||||
@TableField(value = "create_by", fill = FieldFill.INSERT)
|
@TableField(value = "create_by", fill = FieldFill.INSERT)
|
||||||
@ApiModelProperty(value = "创建人", hidden = true)
|
@ApiModelProperty(value = "创建人", hidden = true)
|
||||||
+1
-1
@@ -17,7 +17,7 @@ import java.util.Date;
|
|||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
public class CsBaseUserTimeTb extends CsSerializeObject {
|
public class CsBaseUserTimeTb extends CsObject {
|
||||||
|
|
||||||
@CreatedBy
|
@CreatedBy
|
||||||
@TableField(fill = FieldFill.INSERT)
|
@TableField(fill = FieldFill.INSERT)
|
||||||
+1
-1
@@ -8,6 +8,6 @@ import java.io.Serializable;
|
|||||||
* @author odboy
|
* @author odboy
|
||||||
* @date 2022-01-12
|
* @date 2022-01-12
|
||||||
*/
|
*/
|
||||||
public class CsSerializeObject implements Serializable {
|
public class CsObject implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
}
|
}
|
||||||
+1
-1
@@ -15,7 +15,7 @@ import java.util.List;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
public class CsResultVo<T> extends CsSerializeObject {
|
public class CsResultVo<T> extends CsObject {
|
||||||
private T content;
|
private T content;
|
||||||
private long totalElements;
|
private long totalElements;
|
||||||
|
|
||||||
+1
-1
@@ -30,7 +30,7 @@ import java.util.Map;
|
|||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
public class CsSelectOptionItemVo extends CsSerializeObject {
|
public class CsSelectOptionItemVo extends CsObject {
|
||||||
private String label;
|
private String label;
|
||||||
private String value;
|
private String value;
|
||||||
private Map<String, Object> ext;
|
private Map<String, Object> ext;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package cn.odboy.core.constant;
|
package cn.odboy.constant;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 验证码配置枚举
|
* 验证码配置枚举
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package cn.odboy.constant;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 常用静态常量
|
||||||
|
*/
|
||||||
|
public interface SystemConst {
|
||||||
|
/**
|
||||||
|
* win 系统
|
||||||
|
*/
|
||||||
|
String WIN = "win";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* mac 系统
|
||||||
|
*/
|
||||||
|
String MAC = "mac";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 请求头名称
|
||||||
|
*/
|
||||||
|
String HEADER_NAME = "Authorization";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Token前缀
|
||||||
|
*/
|
||||||
|
String TOKEN_PREFIX = "Bearer";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 小数点
|
||||||
|
*/
|
||||||
|
String SYMBOL_DOT = ".";
|
||||||
|
String SYMBOL_EQUAL = "=";
|
||||||
|
String SYMBOL_ADD = "+";
|
||||||
|
String SYMBOL_SUBTRACT = "-";
|
||||||
|
String SYMBOL_AT = "@";
|
||||||
|
String PROPERTY_OS_NAME = "os.name";
|
||||||
|
String OS_NAME_WINDOWS = "Windows";
|
||||||
|
}
|
||||||
+1
-1
@@ -13,7 +13,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package cn.odboy.context;
|
package cn.odboy.framework.context;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.context.ApplicationListener;
|
import org.springframework.context.ApplicationListener;
|
||||||
+2
-2
@@ -13,7 +13,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package cn.odboy.context;
|
package cn.odboy.framework.context;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -33,7 +33,7 @@ import java.net.UnknownHostException;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
public class CsBootApplication {
|
public class CsBootApplication {
|
||||||
@Bean
|
@Bean
|
||||||
public SpringBeanHolder springContextHolder() {
|
public SpringBeanHolder springBeanHolder() {
|
||||||
return new SpringBeanHolder();
|
return new SpringBeanHolder();
|
||||||
}
|
}
|
||||||
|
|
||||||
+2
-2
@@ -13,11 +13,11 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package cn.odboy.context;
|
package cn.odboy.framework.context;
|
||||||
|
|
||||||
import cn.hutool.core.util.ReflectUtil;
|
import cn.hutool.core.util.ReflectUtil;
|
||||||
import cn.hutool.script.ScriptRuntimeException;
|
import cn.hutool.script.ScriptRuntimeException;
|
||||||
import cn.odboy.exception.BadRequestException;
|
import cn.odboy.framework.exception.BadRequestException;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.script.*;
|
import javax.script.*;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package cn.odboy.context;
|
package cn.odboy.framework.context;
|
||||||
|
|
||||||
import org.springframework.web.context.request.RequestContextHolder;
|
import org.springframework.web.context.request.RequestContextHolder;
|
||||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||||
+4
-7
@@ -1,4 +1,4 @@
|
|||||||
package cn.odboy.context;
|
package cn.odboy.framework.context;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.BeansException;
|
import org.springframework.beans.BeansException;
|
||||||
@@ -95,8 +95,7 @@ public class SpringBeanHolder implements ApplicationContextAware, DisposableBean
|
|||||||
*/
|
*/
|
||||||
private static void assertContextInjected() {
|
private static void assertContextInjected() {
|
||||||
if (applicationContext == null) {
|
if (applicationContext == null) {
|
||||||
throw new IllegalStateException("applicaitonContext属性未注入, 请在applicationContext" +
|
throw new IllegalStateException("applicaitonContext属性未注入, 请在applicationContext" + ".xml中定义SpringContextHolder或在SpringBoot启动类中注册SpringContextHolder.");
|
||||||
".xml中定义SpringContextHolder或在SpringBoot启动类中注册SpringContextHolder.");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,8 +103,7 @@ public class SpringBeanHolder implements ApplicationContextAware, DisposableBean
|
|||||||
* 清除SpringContextHolder中的ApplicationContext为Null.
|
* 清除SpringContextHolder中的ApplicationContext为Null.
|
||||||
*/
|
*/
|
||||||
private static void clearHolder() {
|
private static void clearHolder() {
|
||||||
log.debug("清除SpringContextHolder中的ApplicationContext:"
|
log.debug("清除SpringContextHolder中的ApplicationContext:" + applicationContext);
|
||||||
+ applicationContext);
|
|
||||||
applicationContext = null;
|
applicationContext = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,8 +133,7 @@ public class SpringBeanHolder implements ApplicationContextAware, DisposableBean
|
|||||||
* @return /
|
* @return /
|
||||||
*/
|
*/
|
||||||
public static List<String> getAllServiceBeanName() {
|
public static List<String> getAllServiceBeanName() {
|
||||||
return new ArrayList<>(Arrays.asList(applicationContext
|
return new ArrayList<>(Arrays.asList(applicationContext.getBeanNamesForAnnotation(Service.class)));
|
||||||
.getBeanNamesForAnnotation(Service.class)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface CallBack {
|
interface CallBack {
|
||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
package cn.odboy.core.framework.doc;
|
package cn.odboy.framework.doc;
|
||||||
|
|
||||||
import cn.odboy.constant.SystemConst;
|
import cn.odboy.constant.SystemConst;
|
||||||
import cn.odboy.util.AnonTagUtil;
|
import cn.odboy.util.AnonTagUtil;
|
||||||
@@ -63,7 +63,7 @@ public class SwaggerConfig {
|
|||||||
return new ApiInfoBuilder()
|
return new ApiInfoBuilder()
|
||||||
.description("一个简单且易上手的 Spring boot 后台管理框架")
|
.description("一个简单且易上手的 Spring boot 后台管理框架")
|
||||||
.title("CuteJava 接口文档")
|
.title("CuteJava 接口文档")
|
||||||
.version("1.4.0")
|
.version("1.4.1")
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package cn.odboy.exception;
|
package cn.odboy.framework.exception;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package cn.odboy.exception;
|
package cn.odboy.framework.exception;
|
||||||
|
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package cn.odboy.exception;
|
package cn.odboy.framework.exception;
|
||||||
|
|
||||||
import org.springframework.util.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package cn.odboy.exception.handler;
|
package cn.odboy.framework.exception.handler;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
+4
-4
@@ -1,9 +1,9 @@
|
|||||||
package cn.odboy.exception.handler;
|
package cn.odboy.framework.exception.handler;
|
||||||
|
|
||||||
import cn.hutool.core.exceptions.ExceptionUtil;
|
import cn.hutool.core.exceptions.ExceptionUtil;
|
||||||
import cn.odboy.exception.BadRequestException;
|
import cn.odboy.framework.exception.BadRequestException;
|
||||||
import cn.odboy.exception.EntityExistException;
|
import cn.odboy.framework.exception.EntityExistException;
|
||||||
import cn.odboy.exception.EntityNotFoundException;
|
import cn.odboy.framework.exception.EntityNotFoundException;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
+99
@@ -0,0 +1,99 @@
|
|||||||
|
//package cn.odboy.system.framework.flow.core;
|
||||||
|
//
|
||||||
|
//import cn.hutool.core.date.DateTime;
|
||||||
|
//import cn.hutool.core.thread.ThreadUtil;
|
||||||
|
//import cn.hutool.core.util.IdUtil;
|
||||||
|
//import cn.odboy.context.SpringBeanHolder;
|
||||||
|
//import cn.odboy.system.framework.flow.core.handler.SerialPipelineNodeHandler;
|
||||||
|
//import cn.odboy.system.framework.flow.model.PipelineNodeVo;
|
||||||
|
//import cn.odboy.exception.BadRequestException;
|
||||||
|
//import lombok.extern.slf4j.Slf4j;
|
||||||
|
//import org.springframework.stereotype.Component;
|
||||||
|
//
|
||||||
|
//import java.util.ArrayList;
|
||||||
|
//import java.util.List;
|
||||||
|
//
|
||||||
|
///**
|
||||||
|
// * 流水线管理工具
|
||||||
|
// *
|
||||||
|
// * @author odboy
|
||||||
|
// */
|
||||||
|
//@Slf4j
|
||||||
|
//@Component
|
||||||
|
//public class PipelineManager {
|
||||||
|
// private static final PipelineTaskPool pipelineTaskPool = new PipelineTaskPool("DefaultPipelineTaskPool");
|
||||||
|
//
|
||||||
|
// public void test() {
|
||||||
|
// String pipelineId = IdUtil.objectId();
|
||||||
|
// List<PipelineNodeVo> pipelineNodeVos = initialize();
|
||||||
|
// execute(pipelineId, pipelineNodeVos);
|
||||||
|
//
|
||||||
|
// ThreadUtil.safeSleep(5000);
|
||||||
|
// pipelineTaskPool.stopTaskForcibly(pipelineId);
|
||||||
|
// ThreadUtil.safeSleep(1000000);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public void execute(String pipelineId, List<PipelineNodeVo> pipelineNodeVos) {
|
||||||
|
// pipelineTaskPool.submitTask(pipelineId, () -> {
|
||||||
|
// for (PipelineNodeVo pipelineNodeVo : pipelineNodeVos) {
|
||||||
|
// executePipeline(pipelineId, pipelineNodeVo);
|
||||||
|
// // 要么成功,要么失败
|
||||||
|
// boolean interrupted = Thread.currentThread().isInterrupted();
|
||||||
|
// while (!interrupted && "running".equals(pipelineNodeVo.getExecuteStatus())) {
|
||||||
|
// log.info("流水线执行中...");
|
||||||
|
// ThreadUtil.safeSleep(2000);
|
||||||
|
// }
|
||||||
|
// if (interrupted) {
|
||||||
|
// log.info("流水线被中断...");
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// private void executePipeline(String pipelineId, PipelineNodeVo pipelineNodeVo) {
|
||||||
|
// String pipelineServiceName = String.format("pipeline:%s", pipelineNodeVo.getBizCode());
|
||||||
|
// SerialPipelineNodeHandler<Object, Object> pipelineNodeHandler = SpringBeanHolder.getBean(pipelineServiceName);
|
||||||
|
// try {
|
||||||
|
// Object o = pipelineNodeHandler.doProcess(pipelineId, pipelineNodeVo);
|
||||||
|
// log.info("运行结果, {}", o);
|
||||||
|
// } catch (BadRequestException e) {
|
||||||
|
// log.error("运行流水线异常", e);
|
||||||
|
// if (pipelineTaskPool.isTaskRunning(pipelineId)) {
|
||||||
|
// pipelineTaskPool.stopTaskForcibly(pipelineId);
|
||||||
|
// }
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// log.error("其他异常", e);
|
||||||
|
// if (pipelineTaskPool.isTaskRunning(pipelineId)) {
|
||||||
|
// pipelineTaskPool.stopTaskForcibly(pipelineId);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public List<PipelineNodeVo> initialize() {
|
||||||
|
// List<PipelineNodeVo> pipelineNodeVos = new ArrayList<>();
|
||||||
|
// PipelineNodeVo createReleaseBranchNodeVo = new PipelineNodeVo();
|
||||||
|
// createReleaseBranchNodeVo.setName("初始化");
|
||||||
|
// createReleaseBranchNodeVo.setClick(true);
|
||||||
|
// createReleaseBranchNodeVo.setButtonList(null);
|
||||||
|
// createReleaseBranchNodeVo.setBizCode("create_release_branch");
|
||||||
|
// createReleaseBranchNodeVo.setStartTimeMillis(DateTime.now().getTime());
|
||||||
|
// createReleaseBranchNodeVo.setDurationMillis(0L);
|
||||||
|
// createReleaseBranchNodeVo.setExecuteStatus("running");
|
||||||
|
// createReleaseBranchNodeVo.setResultDesc(null);
|
||||||
|
// pipelineNodeVos.add(createReleaseBranchNodeVo);
|
||||||
|
//
|
||||||
|
// PipelineNodeVo createReleaseBranchNodeVo1 = new PipelineNodeVo();
|
||||||
|
// createReleaseBranchNodeVo1.setName("代码构建");
|
||||||
|
// createReleaseBranchNodeVo1.setClick(true);
|
||||||
|
// createReleaseBranchNodeVo1.setButtonList(null);
|
||||||
|
// createReleaseBranchNodeVo1.setBizCode("build_code");
|
||||||
|
// createReleaseBranchNodeVo1.setStartTimeMillis(DateTime.now().getTime());
|
||||||
|
// createReleaseBranchNodeVo1.setDurationMillis(0L);
|
||||||
|
// createReleaseBranchNodeVo1.setExecuteStatus("running");
|
||||||
|
// createReleaseBranchNodeVo1.setResultDesc(null);
|
||||||
|
// pipelineNodeVos.add(createReleaseBranchNodeVo1);
|
||||||
|
//
|
||||||
|
// return pipelineNodeVos;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
+212
@@ -0,0 +1,212 @@
|
|||||||
|
//package cn.odboy.system.framework.flow.core;
|
||||||
|
//
|
||||||
|
//import cn.hutool.core.date.DateTime;
|
||||||
|
//import cn.hutool.core.thread.ThreadUtil;
|
||||||
|
//import cn.hutool.core.util.IdUtil;
|
||||||
|
//import cn.odboy.context.SpringBeanHolder;
|
||||||
|
//import cn.odboy.system.framework.flow.core.handler.SerialPipelineNodeHandler;
|
||||||
|
//import cn.odboy.system.framework.flow.model.PipelineNodeVo;
|
||||||
|
//import cn.odboy.exception.BadRequestException;
|
||||||
|
//import lombok.extern.slf4j.Slf4j;
|
||||||
|
//import org.springframework.stereotype.Component;
|
||||||
|
//
|
||||||
|
//import java.util.ArrayList;
|
||||||
|
//import java.util.List;
|
||||||
|
//import java.util.Map;
|
||||||
|
//import java.util.Optional;
|
||||||
|
//import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
//import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
//
|
||||||
|
///**
|
||||||
|
// * 流水线进程管理工具
|
||||||
|
// *
|
||||||
|
// * @author odboy
|
||||||
|
// */
|
||||||
|
//@Slf4j
|
||||||
|
//@Component
|
||||||
|
//public class PipelineProcessManager {
|
||||||
|
// // 使用ConcurrentHashMap保证线程安全
|
||||||
|
// private final Map<String, Thread> runningTasks = new ConcurrentHashMap<>();
|
||||||
|
// // 使用AtomicBoolean作为停止标志,保证原子性操作
|
||||||
|
// private final Map<String, AtomicBoolean> stopFlags = new ConcurrentHashMap<>();
|
||||||
|
// // 常量定义
|
||||||
|
// private static final String PIPELINE_THREAD_PREFIX = "pipeline-";
|
||||||
|
// private static final String PIPELINE_SERVICE_PREFIX = "pipeline:";
|
||||||
|
// private static final String RUNNING_STATUS = "running";
|
||||||
|
// private static final long DEFAULT_SLEEP_MS = 2000L;
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 测试方法
|
||||||
|
// */
|
||||||
|
// public void test() {
|
||||||
|
// String pipelineId = IdUtil.objectId();
|
||||||
|
// List<PipelineNodeVo> pipelineNodes = initialize();
|
||||||
|
// execute(pipelineId, pipelineNodes);
|
||||||
|
//
|
||||||
|
// ThreadUtil.safeSleep(5000);
|
||||||
|
// stopForcibly(pipelineId);
|
||||||
|
// ThreadUtil.safeSleep(1000000);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 执行流水线
|
||||||
|
// *
|
||||||
|
// * @param pipelineId 流水线ID
|
||||||
|
// * @param pipelineNodes 流水线节点列表
|
||||||
|
// */
|
||||||
|
// public void execute(String pipelineId, List<PipelineNodeVo> pipelineNodes) {
|
||||||
|
// if (runningTasks.containsKey(pipelineId)) {
|
||||||
|
// log.warn("Pipeline [{}] is already running", pipelineId);
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// stopFlags.put(pipelineId, new AtomicBoolean(false));
|
||||||
|
//
|
||||||
|
// Thread pipelineThread = new Thread(() -> processPipeline(pipelineId, pipelineNodes));
|
||||||
|
// pipelineThread.setDaemon(true);
|
||||||
|
// pipelineThread.setName(PIPELINE_THREAD_PREFIX + pipelineId);
|
||||||
|
//
|
||||||
|
// runningTasks.put(pipelineId, pipelineThread);
|
||||||
|
// pipelineThread.start();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 处理流水线任务
|
||||||
|
// */
|
||||||
|
// private void processPipeline(String pipelineId, List<PipelineNodeVo> pipelineNodes) {
|
||||||
|
// try {
|
||||||
|
// for (PipelineNodeVo node : pipelineNodes) {
|
||||||
|
// if (shouldStop(pipelineId)) {
|
||||||
|
// log.info("Pipeline [{}] was interrupted", pipelineId);
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// executePipelineNode(pipelineId, node);
|
||||||
|
//
|
||||||
|
// while (!shouldStop(pipelineId) && RUNNING_STATUS.equals(node.getExecuteStatus())) {
|
||||||
|
// log.debug("Pipeline [{}] is running...", pipelineId);
|
||||||
|
// sleepInterruptibly(DEFAULT_SLEEP_MS, pipelineId);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (shouldStop(pipelineId)) {
|
||||||
|
// log.info("Pipeline [{}] was interrupted", pipelineId);
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// log.error("流水线异常", e);
|
||||||
|
// } finally {
|
||||||
|
// cleanup(pipelineId);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 检查是否应该停止
|
||||||
|
// */
|
||||||
|
// private boolean shouldStop(String pipelineId) {
|
||||||
|
// return Optional.ofNullable(stopFlags.get(pipelineId))
|
||||||
|
// .map(AtomicBoolean::get)
|
||||||
|
// .orElse(true);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 可中断的睡眠
|
||||||
|
// */
|
||||||
|
// private void sleepInterruptibly(long millis, String pipelineId) {
|
||||||
|
// try {
|
||||||
|
// Thread.sleep(millis);
|
||||||
|
// } catch (InterruptedException e) {
|
||||||
|
// log.info("Pipeline [{}] sleep interrupted", pipelineId);
|
||||||
|
// Thread.currentThread().interrupt();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 清理资源
|
||||||
|
// */
|
||||||
|
// private void cleanup(String pipelineId) {
|
||||||
|
// runningTasks.remove(pipelineId);
|
||||||
|
// stopFlags.remove(pipelineId);
|
||||||
|
// log.info("Pipeline [{}] resources cleaned up", pipelineId);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 检查流水线是否在运行
|
||||||
|
// */
|
||||||
|
// public boolean isRunning(String pipelineId) {
|
||||||
|
// return Optional.ofNullable(runningTasks.get(pipelineId))
|
||||||
|
// .map(Thread::isAlive)
|
||||||
|
// .orElse(false);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 执行单个流水线节点
|
||||||
|
// */
|
||||||
|
// private void executePipelineNode(String pipelineId, PipelineNodeVo node) {
|
||||||
|
// String serviceName = PIPELINE_SERVICE_PREFIX + node.getBizCode();
|
||||||
|
// SerialPipelineNodeHandler<Object, Object> handler = SpringBeanHolder.getBean(serviceName);
|
||||||
|
// try {
|
||||||
|
// Object result = handler.doProcess(pipelineId, node);
|
||||||
|
// log.info("Pipeline [{}] node [{}] executed, result: {}", pipelineId, node.getName(), result);
|
||||||
|
// } catch (BadRequestException e) {
|
||||||
|
// handlePipelineError(pipelineId, "Business error in pipeline", e);
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// handlePipelineError(pipelineId, "Unexpected error in pipeline", e);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 处理流水线错误
|
||||||
|
// */
|
||||||
|
// private void handlePipelineError(String pipelineId, String message, Exception e) {
|
||||||
|
// log.error(message, e);
|
||||||
|
// if (isRunning(pipelineId)) {
|
||||||
|
// stopForcibly(pipelineId);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 强制停止流水线
|
||||||
|
// */
|
||||||
|
// public void stopForcibly(String pipelineId) {
|
||||||
|
// Optional.ofNullable(stopFlags.get(pipelineId))
|
||||||
|
// .ifPresent(flag -> flag.set(true));
|
||||||
|
//
|
||||||
|
// Optional.ofNullable(runningTasks.get(pipelineId))
|
||||||
|
// .ifPresent(thread -> {
|
||||||
|
// try {
|
||||||
|
// thread.interrupt();
|
||||||
|
// } catch (SecurityException e) {
|
||||||
|
// log.error("Failed to interrupt pipeline [{}]", pipelineId, e);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 初始化测试流水线节点
|
||||||
|
// */
|
||||||
|
// public List<PipelineNodeVo> initialize() {
|
||||||
|
// List<PipelineNodeVo> nodes = new ArrayList<>();
|
||||||
|
//
|
||||||
|
// nodes.add(createNode("初始化", "create_release_branch"));
|
||||||
|
// nodes.add(createNode("代码构建", "build_code"));
|
||||||
|
//
|
||||||
|
// return nodes;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 创建流水线节点
|
||||||
|
// */
|
||||||
|
// private PipelineNodeVo createNode(String name, String bizCode) {
|
||||||
|
// PipelineNodeVo node = new PipelineNodeVo();
|
||||||
|
// node.setName(name);
|
||||||
|
// node.setClick(true);
|
||||||
|
// node.setButtonList(null);
|
||||||
|
// node.setBizCode(bizCode);
|
||||||
|
// node.setStartTimeMillis(DateTime.now().getTime());
|
||||||
|
// node.setDurationMillis(0L);
|
||||||
|
// node.setExecuteStatus(RUNNING_STATUS);
|
||||||
|
// node.setResultDesc(null);
|
||||||
|
// return node;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
+245
@@ -0,0 +1,245 @@
|
|||||||
|
//package cn.odboy.system.framework.flow.core;
|
||||||
|
//
|
||||||
|
//import java.util.Map;
|
||||||
|
//import java.util.concurrent.*;
|
||||||
|
//import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
//import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
//
|
||||||
|
///**
|
||||||
|
// * 流水线任务池
|
||||||
|
// *
|
||||||
|
// * @author odboy
|
||||||
|
// */
|
||||||
|
//public class PipelineTaskPool {
|
||||||
|
// // 默认线程池参数
|
||||||
|
// private static final int DEFAULT_CORE_POOL_SIZE = 5;
|
||||||
|
// private static final int DEFAULT_MAX_POOL_SIZE = 10;
|
||||||
|
// private static final long DEFAULT_KEEP_ALIVE_TIME = 60L;
|
||||||
|
// private static final TimeUnit DEFAULT_TIME_UNIT = TimeUnit.SECONDS;
|
||||||
|
// private static final int DEFAULT_QUEUE_CAPACITY = 100;
|
||||||
|
//
|
||||||
|
// // 线程池实例
|
||||||
|
// private final ThreadPoolExecutor executor;
|
||||||
|
// // 存储正在运行的任务
|
||||||
|
// private final Map<String, ManagedTask> runningTasks = new ConcurrentHashMap<>();
|
||||||
|
// // 线程池管理器名称
|
||||||
|
// private final String name;
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 使用默认参数创建线程池管理器
|
||||||
|
// */
|
||||||
|
// public PipelineTaskPool(String name) {
|
||||||
|
// this(name, DEFAULT_CORE_POOL_SIZE, DEFAULT_MAX_POOL_SIZE,
|
||||||
|
// DEFAULT_KEEP_ALIVE_TIME, DEFAULT_TIME_UNIT,
|
||||||
|
// new LinkedBlockingQueue<>(DEFAULT_QUEUE_CAPACITY));
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 自定义参数创建线程池管理器
|
||||||
|
// */
|
||||||
|
// public PipelineTaskPool(String name, int corePoolSize, int maxPoolSize,
|
||||||
|
// long keepAliveTime, TimeUnit unit,
|
||||||
|
// BlockingQueue<Runnable> workQueue) {
|
||||||
|
// this.name = name;
|
||||||
|
// this.executor = new ThreadPoolExecutor(
|
||||||
|
// corePoolSize,
|
||||||
|
// maxPoolSize,
|
||||||
|
// keepAliveTime,
|
||||||
|
// unit,
|
||||||
|
// workQueue,
|
||||||
|
// new ThreadFactory() {
|
||||||
|
// private final AtomicInteger threadNumber = new AtomicInteger(1);
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public Thread newThread(Runnable r) {
|
||||||
|
// return new Thread(r, name + "-thread-" + threadNumber.getAndIncrement());
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// new ThreadPoolExecutor.AbortPolicy()
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 提交任务并管理
|
||||||
|
// *
|
||||||
|
// * @param taskId 任务ID
|
||||||
|
// * @param task 任务逻辑
|
||||||
|
// * @return true表示提交成功,false表示任务已存在
|
||||||
|
// */
|
||||||
|
// public boolean submitTask(String taskId, Runnable task) {
|
||||||
|
// if (runningTasks.containsKey(taskId)) {
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// ManagedTask managedTask = new ManagedTask(taskId, task);
|
||||||
|
// runningTasks.put(taskId, managedTask);
|
||||||
|
// executor.execute(managedTask);
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 正常停止任务
|
||||||
|
// *
|
||||||
|
// * @param taskId 任务ID
|
||||||
|
// * @return true表示停止成功,false表示任务不存在或已停止
|
||||||
|
// */
|
||||||
|
// public boolean stopTaskGracefully(String taskId) {
|
||||||
|
// ManagedTask task = runningTasks.get(taskId);
|
||||||
|
// if (task != null) {
|
||||||
|
// return task.stopGracefully();
|
||||||
|
// }
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 强制停止任务
|
||||||
|
// *
|
||||||
|
// * @param taskId 任务ID
|
||||||
|
// * @return true表示停止成功,false表示任务不存在
|
||||||
|
// */
|
||||||
|
// public boolean stopTaskForcibly(String taskId) {
|
||||||
|
// ManagedTask task = runningTasks.remove(taskId);
|
||||||
|
// if (task != null) {
|
||||||
|
// return task.stopForcibly();
|
||||||
|
// }
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 检查任务是否正在运行
|
||||||
|
// *
|
||||||
|
// * @param taskId 任务ID
|
||||||
|
// * @return true表示正在运行
|
||||||
|
// */
|
||||||
|
// public boolean isTaskRunning(String taskId) {
|
||||||
|
// ManagedTask task = runningTasks.get(taskId);
|
||||||
|
// return task != null && !task.isStopped();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 获取正在运行的任务数量
|
||||||
|
// *
|
||||||
|
// * @return 运行中任务数
|
||||||
|
// */
|
||||||
|
// public int getRunningTaskCount() {
|
||||||
|
// return runningTasks.size();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 关闭线程池(等待所有任务完成)
|
||||||
|
// */
|
||||||
|
// public void shutdown() {
|
||||||
|
// executor.shutdown();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 立即关闭线程池(尝试停止所有任务)
|
||||||
|
// */
|
||||||
|
// public void shutdownNow() {
|
||||||
|
// executor.shutdownNow();
|
||||||
|
// runningTasks.clear();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 获取线程池状态信息
|
||||||
|
// *
|
||||||
|
// * @return 状态信息字符串
|
||||||
|
// */
|
||||||
|
// public String getPoolStatus() {
|
||||||
|
// return String.format(
|
||||||
|
// "[%s] PoolStatus: Active=%d, Completed=%d, Task=%d, Queue=%d/%d",
|
||||||
|
// name,
|
||||||
|
// executor.getActiveCount(),
|
||||||
|
// executor.getCompletedTaskCount(),
|
||||||
|
// executor.getTaskCount(),
|
||||||
|
// executor.getQueue().size(),
|
||||||
|
// executor.getQueue().remainingCapacity()
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 被管理的任务包装类
|
||||||
|
// */
|
||||||
|
// private class ManagedTask implements Runnable {
|
||||||
|
// private final String taskId;
|
||||||
|
// private final Runnable task;
|
||||||
|
// private final AtomicBoolean running = new AtomicBoolean(true);
|
||||||
|
// private final AtomicBoolean stopped = new AtomicBoolean(false);
|
||||||
|
// private Thread currentThread;
|
||||||
|
//
|
||||||
|
// public ManagedTask(String taskId, Runnable task) {
|
||||||
|
// this.taskId = taskId;
|
||||||
|
// this.task = task;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void run() {
|
||||||
|
// currentThread = Thread.currentThread();
|
||||||
|
// try {
|
||||||
|
// // 执行前检查是否已被停止
|
||||||
|
// if (running.get()) {
|
||||||
|
// task.run();
|
||||||
|
// }
|
||||||
|
// } finally {
|
||||||
|
// // 任务完成后从运行列表中移除
|
||||||
|
// runningTasks.remove(taskId);
|
||||||
|
// stopped.set(true);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 正常停止任务
|
||||||
|
// *
|
||||||
|
// * @return 是否成功停止
|
||||||
|
// */
|
||||||
|
// public boolean stopGracefully() {
|
||||||
|
// if (running.compareAndSet(true, false)) {
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 强制停止任务
|
||||||
|
// *
|
||||||
|
// * @return 是否成功停止
|
||||||
|
// */
|
||||||
|
// public boolean stopForcibly() {
|
||||||
|
// if (stopped.get()) {
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (running.compareAndSet(true, false)) {
|
||||||
|
// if (currentThread != null) {
|
||||||
|
// // 暴力停止线程
|
||||||
|
// // currentThread.stop();
|
||||||
|
// try {
|
||||||
|
// /**
|
||||||
|
// * Thread.interrupt只支持终止线程的阻塞状态(wait、join、sleep),
|
||||||
|
// * 在阻塞出抛出InterruptedException异常,但是并不会终止运行的线程本身;
|
||||||
|
// * 所以需要注意,此处彻底销毁本线程,需要通过共享变量方式;
|
||||||
|
// */
|
||||||
|
// currentThread.interrupt();
|
||||||
|
// currentThread.join();
|
||||||
|
// } catch (InterruptedException e) {
|
||||||
|
// currentThread.interrupt();
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// // ignore
|
||||||
|
// // currentThread.stop();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 检查任务是否已停止
|
||||||
|
// *
|
||||||
|
// * @return true表示已停止
|
||||||
|
// */
|
||||||
|
// public boolean isStopped() {
|
||||||
|
// return stopped.get();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//}
|
||||||
+129
@@ -0,0 +1,129 @@
|
|||||||
|
//package cn.odboy.system.framework.flow.core.handler;
|
||||||
|
//
|
||||||
|
//import cn.hutool.core.thread.ThreadUtil;
|
||||||
|
//import cn.odboy.exception.BadRequestException;
|
||||||
|
//import com.alibaba.fastjson2.JSON;
|
||||||
|
//import lombok.extern.slf4j.Slf4j;
|
||||||
|
//
|
||||||
|
///**
|
||||||
|
// * 串行流水线节点处理器
|
||||||
|
// *
|
||||||
|
// * @author odboy
|
||||||
|
// */
|
||||||
|
//@Slf4j
|
||||||
|
//public abstract class SerialPipelineNodeHandler<I, T> {
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 预处理
|
||||||
|
// *
|
||||||
|
// * @param pipelineId 流水线id
|
||||||
|
// * @param inputModel 输入参数
|
||||||
|
// */
|
||||||
|
// protected abstract void preProcess(String pipelineId, I inputModel);
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 预处理异常
|
||||||
|
// *
|
||||||
|
// * @param pipelineId 流水线id
|
||||||
|
// * @param inputModel 输入参数
|
||||||
|
// * @param e 异常信息
|
||||||
|
// */
|
||||||
|
// protected abstract void preProcessException(String pipelineId, I inputModel, Exception e);
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 处理业务
|
||||||
|
// *
|
||||||
|
// * @param pipelineId 流水线id
|
||||||
|
// * @param inputModel 输入参数
|
||||||
|
// */
|
||||||
|
// protected abstract T process(String pipelineId, I inputModel);
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 处理业务异常
|
||||||
|
// *
|
||||||
|
// * @param pipelineId 流水线id
|
||||||
|
// * @param inputModel 输入参数
|
||||||
|
// * @param e 异常信息
|
||||||
|
// */
|
||||||
|
// protected abstract void processException(String pipelineId, I inputModel, Exception e);
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 业务后置处理
|
||||||
|
// *
|
||||||
|
// * @param pipelineId 流水线id
|
||||||
|
// * @param inputModel 输入参数
|
||||||
|
// */
|
||||||
|
// protected abstract void postProcess(String pipelineId, I inputModel, T processResult);
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 业务后置处理异常
|
||||||
|
// *
|
||||||
|
// * @param pipelineId 流水线id
|
||||||
|
// * @param inputModel 输入参数
|
||||||
|
// */
|
||||||
|
// protected abstract void postProcessException(String pipelineId, I inputModel, T processResult, Exception e);
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 当前节点是否被锁住(卡点功能),返回false解锁
|
||||||
|
// *
|
||||||
|
// * @param pipelineId 流水线id
|
||||||
|
// * @param inputModel 输入参数
|
||||||
|
// */
|
||||||
|
// protected abstract boolean isLocked(String pipelineId, I inputModel);
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 当进程被中断时
|
||||||
|
// *
|
||||||
|
// * @param pipelineId 流水线id
|
||||||
|
// * @param inputModel 输入参数
|
||||||
|
// */
|
||||||
|
// protected abstract void onProcessInterrupted(String pipelineId, I inputModel);
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 业务处理
|
||||||
|
// *
|
||||||
|
// * @param pipelineId 流水线id
|
||||||
|
// * @param inputModel 输入参数
|
||||||
|
// * @return T
|
||||||
|
// */
|
||||||
|
// public T doProcess(String pipelineId, I inputModel) throws BadRequestException {
|
||||||
|
// try {
|
||||||
|
// if (Thread.currentThread().isInterrupted()) {
|
||||||
|
// onProcessInterrupted(pipelineId, inputModel);
|
||||||
|
// throw new InterruptedException("业务被中断");
|
||||||
|
// }
|
||||||
|
// preProcess(pipelineId, inputModel);
|
||||||
|
// log.info("preProcess,pipelineId={},inputModel={}", pipelineId, JSON.toJSONString(inputModel));
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// preProcessException(pipelineId, inputModel, e);
|
||||||
|
// log.error("preProcessException,pipelineId={},inputModel={}", pipelineId, JSON.toJSONString(inputModel), e);
|
||||||
|
// throw new BadRequestException(e.getMessage());
|
||||||
|
// }
|
||||||
|
// if (Thread.currentThread().isInterrupted()) {
|
||||||
|
// throw new BadRequestException("业务被中断");
|
||||||
|
// }
|
||||||
|
// while (isLocked(pipelineId, inputModel)) {
|
||||||
|
// ThreadUtil.safeSleep(2000);
|
||||||
|
// }
|
||||||
|
// try {
|
||||||
|
// if (Thread.currentThread().isInterrupted()) {
|
||||||
|
// throw new BadRequestException("业务被中断");
|
||||||
|
// }
|
||||||
|
// T processResult = process(pipelineId, inputModel);
|
||||||
|
// log.info("process,pipelineId={},inputModel={}", pipelineId, JSON.toJSONString(inputModel));
|
||||||
|
// try {
|
||||||
|
// postProcess(pipelineId, inputModel, processResult);
|
||||||
|
// log.info("postProcess,pipelineId={},inputModel={},processResult={}", pipelineId, JSON.toJSONString(inputModel), JSON.toJSONString(processResult));
|
||||||
|
// return processResult;
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// postProcessException(pipelineId, inputModel, processResult, e);
|
||||||
|
// log.error("postProcessException,pipelineId={},inputModel={},processResult={}", pipelineId, JSON.toJSONString(inputModel), JSON.toJSONString(processResult));
|
||||||
|
// throw new BadRequestException(e.getMessage());
|
||||||
|
// }
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// processException(pipelineId, inputModel, e);
|
||||||
|
// log.error("processException,pipelineId={},inputModel={}", pipelineId, JSON.toJSONString(inputModel), e);
|
||||||
|
// throw new BadRequestException(e.getMessage());
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//}
|
||||||
+44
@@ -0,0 +1,44 @@
|
|||||||
|
//package cn.odboy.system.framework.flow.core.handler.impl;
|
||||||
|
//
|
||||||
|
//import cn.odboy.system.framework.flow.core.handler.SerialPipelineNodeHandler;
|
||||||
|
//import lombok.extern.slf4j.Slf4j;
|
||||||
|
//import org.springframework.stereotype.Service;
|
||||||
|
//
|
||||||
|
//@Slf4j
|
||||||
|
//@Service("pipeline:create_release_branch")
|
||||||
|
//public class PipelineAppCreateReleaseBranchHandlerServiceImpl extends SerialPipelineNodeHandler<Object, Object> {
|
||||||
|
// @Override
|
||||||
|
// public void preProcess(String pipelineId, Object inputModel) {
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void preProcessException(String pipelineId, Object inputModel, Exception e) {
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public Object process(String pipelineId, Object inputModel) {
|
||||||
|
// return "Hello World";
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void processException(String pipelineId, Object inputModel, Exception e) {
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void postProcess(String pipelineId, Object inputModel, Object processResult) {
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void postProcessException(String pipelineId, Object inputModel, Object processResult, Exception e) {
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public boolean isLocked(String pipelineId, Object inputModel) {
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// protected void onProcessInterrupted(String pipelineId, Object inputModel) {
|
||||||
|
// log.error("pipeline is stopping");
|
||||||
|
// }
|
||||||
|
//}
|
||||||
+68
@@ -0,0 +1,68 @@
|
|||||||
|
//package cn.odboy.system.framework.flow.model;
|
||||||
|
//
|
||||||
|
//import cn.odboy.base.CsSerializeObject;
|
||||||
|
//import lombok.Data;
|
||||||
|
//import lombok.EqualsAndHashCode;
|
||||||
|
//
|
||||||
|
//import java.util.List;
|
||||||
|
//
|
||||||
|
//@Data
|
||||||
|
//@EqualsAndHashCode(callSuper = false)
|
||||||
|
//public class PipelineNodeVo extends CsSerializeObject {
|
||||||
|
// /**
|
||||||
|
// * 业务节点名称
|
||||||
|
// */
|
||||||
|
// private String name;
|
||||||
|
// /**
|
||||||
|
// * 是否可以点击
|
||||||
|
// */
|
||||||
|
// private Boolean click = false;
|
||||||
|
// /**
|
||||||
|
// * 功能按钮列表,与click互斥
|
||||||
|
// */
|
||||||
|
// private List<PipelineNodeOperationButton> buttonList;
|
||||||
|
// /**
|
||||||
|
// * 业务编码(createReleaseBranch、mergeCode)
|
||||||
|
// */
|
||||||
|
// private String bizCode;
|
||||||
|
// /**
|
||||||
|
// * 业务节点开始时间
|
||||||
|
// */
|
||||||
|
// private Long startTimeMillis;
|
||||||
|
// /**
|
||||||
|
// * 业务节点耗时
|
||||||
|
// */
|
||||||
|
// private Long durationMillis;
|
||||||
|
// /**
|
||||||
|
// * 业务节点执行状态(success 成功, error 失败, running 运行中)
|
||||||
|
// */
|
||||||
|
// private String executeStatus;
|
||||||
|
// /**
|
||||||
|
// * 业务节点结果描述(执行成功)
|
||||||
|
// */
|
||||||
|
// private String resultDesc;
|
||||||
|
//
|
||||||
|
// /**
|
||||||
|
// * 流水线节点功能按钮
|
||||||
|
// */
|
||||||
|
// @Data
|
||||||
|
// @EqualsAndHashCode(callSuper = false)
|
||||||
|
// public static class PipelineNodeOperationButton extends CsSerializeObject {
|
||||||
|
// /**
|
||||||
|
// * 请求方式(get、post)
|
||||||
|
// */
|
||||||
|
// private String method;
|
||||||
|
// /**
|
||||||
|
// * 请求路径(/api/doCheck?id=1&bizCode=)
|
||||||
|
// */
|
||||||
|
// private String requestUrl;
|
||||||
|
// /**
|
||||||
|
// * 按钮名称(通过、打回)
|
||||||
|
// */
|
||||||
|
// private String text;
|
||||||
|
// /**
|
||||||
|
// * 按钮类型(execute 请求url、link 跳转三方)
|
||||||
|
// */
|
||||||
|
// private String type;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
+2
-2
@@ -13,10 +13,10 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package cn.odboy.monitor.controller;
|
package cn.odboy.framework.monitor.controller;
|
||||||
|
|
||||||
import cn.odboy.annotation.AnonymousGetMapping;
|
import cn.odboy.annotation.AnonymousGetMapping;
|
||||||
import cn.odboy.monitor.service.CsHealthCheckPointService;
|
import cn.odboy.framework.monitor.service.CsHealthCheckPointService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package cn.odboy.monitor.service;
|
package cn.odboy.framework.monitor.service;
|
||||||
|
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package cn.odboy.core.framework.mybatisplus.config;
|
package cn.odboy.framework.mybatisplus.config;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 动态查询 枚举
|
* 动态查询 枚举
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package cn.odboy.core.framework.mybatisplus.config;
|
package cn.odboy.framework.mybatisplus.config;
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
import java.lang.annotation.ElementType;
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package cn.odboy.core.framework.mybatisplus.config;
|
package cn.odboy.framework.mybatisplus.config;
|
||||||
|
|
||||||
import cn.odboy.exception.BadRequestException;
|
import cn.odboy.framework.exception.BadRequestException;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package cn.odboy.core.framework.mybatisplus.config;
|
package cn.odboy.framework.mybatisplus.config;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.p6spy.engine.spy.appender.MessageFormattingStrategy;
|
import com.p6spy.engine.spy.appender.MessageFormattingStrategy;
|
||||||
+1
-1
@@ -13,7 +13,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package cn.odboy.core.framework.mybatisplus.config;
|
package cn.odboy.framework.mybatisplus.config;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||||
import com.baomidou.mybatisplus.core.injector.AbstractMethod;
|
import com.baomidou.mybatisplus.core.injector.AbstractMethod;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package cn.odboy.core.framework.mybatisplus.config;
|
package cn.odboy.framework.mybatisplus.config;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.DbType;
|
import com.baomidou.mybatisplus.annotation.DbType;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package cn.odboy.core.framework.mybatisplus.config;
|
package cn.odboy.framework.mybatisplus.config;
|
||||||
|
|
||||||
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
|
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
|
||||||
import com.alibaba.druid.spring.boot.autoconfigure.properties.DruidStatProperties;
|
import com.alibaba.druid.spring.boot.autoconfigure.properties.DruidStatProperties;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package cn.odboy.core.framework.mybatisplus.core;
|
package cn.odboy.framework.mybatisplus.core;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
+8
-3
@@ -13,8 +13,9 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package cn.odboy.core.framework.mybatisplus.core;
|
package cn.odboy.framework.mybatisplus.core;
|
||||||
|
|
||||||
|
import cn.odboy.util.FileUtil;
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.generator.FastAutoGenerator;
|
import com.baomidou.mybatisplus.generator.FastAutoGenerator;
|
||||||
import com.baomidou.mybatisplus.generator.config.*;
|
import com.baomidou.mybatisplus.generator.config.*;
|
||||||
@@ -26,6 +27,7 @@ import com.baomidou.mybatisplus.generator.engine.AbstractTemplateEngine;
|
|||||||
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
|
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
|
||||||
import com.baomidou.mybatisplus.generator.keywords.MySqlKeyWordsHandler;
|
import com.baomidou.mybatisplus.generator.keywords.MySqlKeyWordsHandler;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
import java.sql.Types;
|
import java.sql.Types;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@@ -144,6 +146,7 @@ public class CsMpCmdGenUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Consumer<PackageConfig.Builder> getPackageConfigConsumer() {
|
private Consumer<PackageConfig.Builder> getPackageConfigConsumer() {
|
||||||
|
String mapperPath = FileUtil.getTmpDirPath() + "CodeGen/resources/mapper";
|
||||||
return packageConfigBuilder -> packageConfigBuilder
|
return packageConfigBuilder -> packageConfigBuilder
|
||||||
.parent(this.parentPackageName == null ? "cn.codegen" : this.parentPackageName)
|
.parent(this.parentPackageName == null ? "cn.codegen" : this.parentPackageName)
|
||||||
.moduleName(this.parentPackageModuleName == null ? "moduleName" : this.parentPackageModuleName)
|
.moduleName(this.parentPackageModuleName == null ? "moduleName" : this.parentPackageModuleName)
|
||||||
@@ -152,13 +155,14 @@ public class CsMpCmdGenUtil {
|
|||||||
.mapper("mapper")
|
.mapper("mapper")
|
||||||
.serviceImpl("service.impl")
|
.serviceImpl("service.impl")
|
||||||
.controller("rest")
|
.controller("rest")
|
||||||
.pathInfo(Collections.singletonMap(OutputFile.xml, (System.getProperty("os.name").toLowerCase().contains("win") ? "C:\\CodeGen\\resources\\mapper" : "/tmp/CodeGen/resources/mapper")));
|
.pathInfo(Collections.singletonMap(OutputFile.xml, mapperPath));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Consumer<GlobalConfig.Builder> getGlobalConfigConsumer() {
|
private static Consumer<GlobalConfig.Builder> getGlobalConfigConsumer() {
|
||||||
|
String outputDir = FileUtil.getTmpDirPath() + "CodeGen";
|
||||||
return globalConfigBuilder -> globalConfigBuilder
|
return globalConfigBuilder -> globalConfigBuilder
|
||||||
.enableSwagger()
|
.enableSwagger()
|
||||||
.outputDir((System.getProperty("os.name").toLowerCase().contains("win") ? "C:\\CodeGen" : "/tmp/CodeGen"))
|
.outputDir(outputDir)
|
||||||
.author("codegen")
|
.author("codegen")
|
||||||
.commentDate("yyyy-MM-dd")
|
.commentDate("yyyy-MM-dd")
|
||||||
.dateType(DateType.TIME_PACK);
|
.dateType(DateType.TIME_PACK);
|
||||||
@@ -167,6 +171,7 @@ public class CsMpCmdGenUtil {
|
|||||||
private static Consumer<StrategyConfig.Builder> getStrategyConfigConsumer() {
|
private static Consumer<StrategyConfig.Builder> getStrategyConfigConsumer() {
|
||||||
return strategyConfigBuilder -> strategyConfigBuilder
|
return strategyConfigBuilder -> strategyConfigBuilder
|
||||||
.mapperBuilder()
|
.mapperBuilder()
|
||||||
|
.mapperAnnotation(Mapper.class)
|
||||||
.formatMapperFileName("%sMapper")
|
.formatMapperFileName("%sMapper")
|
||||||
.formatXmlFileName("%sMapper");
|
.formatXmlFileName("%sMapper");
|
||||||
}
|
}
|
||||||
+3
-3
@@ -1,11 +1,11 @@
|
|||||||
package cn.odboy.core.framework.mybatisplus.core;
|
package cn.odboy.framework.mybatisplus.core;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.odboy.base.CsBaseUserTimeTb;
|
import cn.odboy.base.CsBaseUserTimeTb;
|
||||||
import cn.odboy.core.framework.mybatisplus.config.CsMpQuery;
|
import cn.odboy.framework.mybatisplus.config.CsMpQuery;
|
||||||
import cn.odboy.exception.BadRequestException;
|
import cn.odboy.framework.exception.BadRequestException;
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
+1
-1
@@ -13,7 +13,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package cn.odboy.core.framework.mybatisplus.core.interfaces;
|
package cn.odboy.framework.mybatisplus.core.interfaces;
|
||||||
|
|
||||||
import cn.odboy.base.CsResultVo;
|
import cn.odboy.base.CsResultVo;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
+1
-1
@@ -13,7 +13,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package cn.odboy.core.framework.mybatisplus.core.interfaces;
|
package cn.odboy.framework.mybatisplus.core.interfaces;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
+3
-3
@@ -13,13 +13,13 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package cn.odboy.core.framework.mybatisplus.core.interfaces;
|
package cn.odboy.framework.mybatisplus.core.interfaces;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.odboy.base.CsResultVo;
|
import cn.odboy.base.CsResultVo;
|
||||||
import cn.odboy.core.framework.mybatisplus.core.CsMpQUtil;
|
import cn.odboy.framework.mybatisplus.core.CsMpQUtil;
|
||||||
import cn.odboy.exception.BadRequestException;
|
import cn.odboy.framework.exception.BadRequestException;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.enums.SqlMethod;
|
import com.baomidou.mybatisplus.core.enums.SqlMethod;
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package cn.odboy.core.framework.properties;
|
package cn.odboy.framework.properties;
|
||||||
|
|
||||||
import cn.odboy.core.framework.properties.model.*;
|
import cn.odboy.framework.properties.model.*;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package cn.odboy.core.framework.properties.model;
|
package cn.odboy.framework.properties.model;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package cn.odboy.core.framework.properties.model;
|
package cn.odboy.framework.properties.model;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package cn.odboy.core.framework.properties.model;
|
package cn.odboy.framework.properties.model;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package cn.odboy.core.framework.properties.model;
|
package cn.odboy.framework.properties.model;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
package cn.odboy.core.framework.properties.model;
|
package cn.odboy.framework.properties.model;
|
||||||
|
|
||||||
import cn.odboy.core.constant.CaptchaCodeEnum;
|
import cn.odboy.constant.CaptchaCodeEnum;
|
||||||
import cn.odboy.exception.BadRequestException;
|
import cn.odboy.framework.exception.BadRequestException;
|
||||||
import cn.odboy.util.StringUtil;
|
import cn.odboy.util.StringUtil;
|
||||||
import com.wf.captcha.*;
|
import com.wf.captcha.*;
|
||||||
import com.wf.captcha.base.Captcha;
|
import com.wf.captcha.base.Captcha;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package cn.odboy.core.framework.properties.model;
|
package cn.odboy.framework.properties.model;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package cn.odboy.core.framework.quartz.config;
|
package cn.odboy.framework.quartz.config;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.quartz.spi.TriggerFiredBundle;
|
import org.quartz.spi.TriggerFiredBundle;
|
||||||
+3
-3
@@ -1,6 +1,6 @@
|
|||||||
package cn.odboy.core.framework.quartz.core;
|
package cn.odboy.framework.quartz.core;
|
||||||
|
|
||||||
import cn.odboy.context.SpringBeanHolder;
|
import cn.odboy.framework.context.SpringBeanHolder;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.util.ReflectionUtils;
|
import org.springframework.util.ReflectionUtils;
|
||||||
@@ -17,7 +17,7 @@ public class QuartzRunnable implements Callable<Object> {
|
|||||||
private final Method method;
|
private final Method method;
|
||||||
private final String params;
|
private final String params;
|
||||||
|
|
||||||
protected QuartzRunnable(String beanName, String methodName, String params) throws NoSuchMethodException, SecurityException {
|
public QuartzRunnable(String beanName, String methodName, String params) throws NoSuchMethodException, SecurityException {
|
||||||
this.target = SpringBeanHolder.getBean(beanName);
|
this.target = SpringBeanHolder.getBean(beanName);
|
||||||
this.params = params;
|
this.params = params;
|
||||||
if (StringUtils.isNotBlank(params)) {
|
if (StringUtils.isNotBlank(params)) {
|
||||||
+6
-8
@@ -1,4 +1,4 @@
|
|||||||
package cn.odboy.redis;
|
package cn.odboy.framework.redis;
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
import com.alibaba.fastjson2.JSONFactory;
|
import com.alibaba.fastjson2.JSONFactory;
|
||||||
@@ -41,13 +41,11 @@ public class RedisConfiguration extends CachingConfigurerSupport {
|
|||||||
*/
|
*/
|
||||||
private static final String[] WHITELIST_STR = {
|
private static final String[] WHITELIST_STR = {
|
||||||
"org.springframework",
|
"org.springframework",
|
||||||
"cn.odboy.core.dal.dataobject.job",
|
"cn.odboy.system.dal.dataobject",
|
||||||
"cn.odboy.core.dal.dataobject.system",
|
"cn.odboy.system.dal.model",
|
||||||
"cn.odboy.core.dal.dataobject.tools",
|
"cn.odboy.pipeline.dal.dataobject",
|
||||||
"cn.odboy.core.dal.model",
|
"cn.odboy.pipeline.dal.model",
|
||||||
"cn.odboy.core.framework.flow.dto",
|
"cn.odboy.devops.framework.pipeline.model",
|
||||||
"cn.odboy.core.service.system.dto",
|
|
||||||
"cn.odboy.core.service.tools.dto",
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package cn.odboy.redis;
|
package cn.odboy.framework.redis;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package cn.odboy.redis;
|
package cn.odboy.framework.redis;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
+4
-4
@@ -1,7 +1,7 @@
|
|||||||
package cn.odboy.core.framework.threadpool;
|
package cn.odboy.framework.server.config;
|
||||||
|
|
||||||
import cn.odboy.core.framework.properties.AppProperties;
|
import cn.odboy.framework.properties.AppProperties;
|
||||||
import cn.odboy.core.framework.properties.model.ThreadPoolSettingModel;
|
import cn.odboy.framework.properties.model.ThreadPoolSettingModel;
|
||||||
import com.alibaba.ttl.TtlRunnable;
|
import com.alibaba.ttl.TtlRunnable;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
@@ -18,7 +18,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||||||
*/
|
*/
|
||||||
@EnableAsync
|
@EnableAsync
|
||||||
@Configuration
|
@Configuration
|
||||||
public class AsyncExecutor implements AsyncConfigurer {
|
public class AsyncTheadPoolConfig implements AsyncConfigurer {
|
||||||
@Autowired
|
@Autowired
|
||||||
private AppProperties properties;
|
private AppProperties properties;
|
||||||
|
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package cn.odboy.core.framework.server.config;
|
package cn.odboy.framework.server.config;
|
||||||
|
|
||||||
import cn.odboy.core.framework.server.core.FileUploadPathHelper;
|
import cn.odboy.framework.server.core.FileUploadPathHelper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package cn.odboy.core.framework.server.converters;
|
package cn.odboy.framework.server.converters;
|
||||||
|
|
||||||
import org.springframework.core.convert.converter.Converter;
|
import org.springframework.core.convert.converter.Converter;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package cn.odboy.core.framework.server.converters;
|
package cn.odboy.framework.server.converters;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import org.springframework.core.convert.converter.Converter;
|
import org.springframework.core.convert.converter.Converter;
|
||||||
+4
-4
@@ -1,8 +1,8 @@
|
|||||||
package cn.odboy.core.framework.server.core;
|
package cn.odboy.framework.server.core;
|
||||||
|
|
||||||
import cn.odboy.core.framework.properties.AppProperties;
|
import cn.odboy.framework.properties.AppProperties;
|
||||||
import cn.odboy.core.framework.server.converters.DateStringArraysToListDateConverter;
|
import cn.odboy.framework.server.converters.DateStringArraysToListDateConverter;
|
||||||
import cn.odboy.core.framework.server.converters.DateStringToDateConverter;
|
import cn.odboy.framework.server.converters.DateStringToDateConverter;
|
||||||
import com.alibaba.fastjson2.JSONWriter;
|
import com.alibaba.fastjson2.JSONWriter;
|
||||||
import com.alibaba.fastjson2.support.config.FastJsonConfig;
|
import com.alibaba.fastjson2.support.config.FastJsonConfig;
|
||||||
import com.alibaba.fastjson2.support.spring.http.converter.FastJsonHttpMessageConverter;
|
import com.alibaba.fastjson2.support.spring.http.converter.FastJsonHttpMessageConverter;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package cn.odboy.core.framework.server.core;
|
package cn.odboy.framework.server.core;
|
||||||
|
|
||||||
import cn.odboy.constant.SystemConst;
|
import cn.odboy.constant.SystemConst;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
package cn.odboy.websocket.config;
|
package cn.odboy.framework.websocket.config;
|
||||||
|
|
||||||
import io.undertow.server.DefaultByteBufferPool;
|
import io.undertow.server.DefaultByteBufferPool;
|
||||||
import io.undertow.websockets.jsr.WebSocketDeploymentInfo;
|
import io.undertow.websockets.jsr.WebSocketDeploymentInfo;
|
||||||
@@ -13,7 +13,7 @@ import org.springframework.stereotype.Component;
|
|||||||
* @date 2024-06-07
|
* @date 2024-06-07
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
public class CsWebSocketServerFactory implements WebServerFactoryCustomizer<UndertowServletWebServerFactory> {
|
public class CsWebSocketFactory implements WebServerFactoryCustomizer<UndertowServletWebServerFactory> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void customize(UndertowServletWebServerFactory factory) {
|
public void customize(UndertowServletWebServerFactory factory) {
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package cn.odboy.websocket.config;
|
package cn.odboy.framework.websocket.config;
|
||||||
|
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package cn.odboy.websocket.constant;
|
package cn.odboy.framework.websocket.constant;
|
||||||
|
|
||||||
|
|
||||||
public enum CsWebSocketBizTypeEnum {
|
public enum CsWebSocketBizTypeEnum {
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package cn.odboy.websocket.context;
|
package cn.odboy.framework.websocket.context;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
package cn.odboy.websocket.context;
|
package cn.odboy.framework.websocket.context;
|
||||||
|
|
||||||
import cn.odboy.websocket.constant.CsWebSocketBizTypeEnum;
|
import cn.odboy.framework.websocket.constant.CsWebSocketBizTypeEnum;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
package cn.odboy.websocket.context;
|
package cn.odboy.framework.websocket.context;
|
||||||
|
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -93,7 +93,7 @@ public class WebSocketServer {
|
|||||||
} else {
|
} else {
|
||||||
CsWebSocketClientManager.getClientBySid(sid).innerSendMessage(message);
|
CsWebSocketClientManager.getClientBySid(sid).innerSendMessage(message);
|
||||||
}
|
}
|
||||||
} catch (IOException ignored) {
|
} catch (Exception ignored) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
+15
-11
@@ -2,9 +2,11 @@ package cn.odboy.util;
|
|||||||
|
|
||||||
import cn.odboy.annotation.AnonymousAccess;
|
import cn.odboy.annotation.AnonymousAccess;
|
||||||
import cn.odboy.constant.RequestMethodEnum;
|
import cn.odboy.constant.RequestMethodEnum;
|
||||||
|
import lombok.experimental.UtilityClass;
|
||||||
import org.springframework.context.ApplicationContext;
|
import org.springframework.context.ApplicationContext;
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.method.HandlerMethod;
|
import org.springframework.web.method.HandlerMethod;
|
||||||
|
import org.springframework.web.servlet.mvc.condition.PatternsRequestCondition;
|
||||||
import org.springframework.web.servlet.mvc.method.RequestMappingInfo;
|
import org.springframework.web.servlet.mvc.method.RequestMappingInfo;
|
||||||
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
|
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
|
||||||
|
|
||||||
@@ -13,7 +15,8 @@ import java.util.*;
|
|||||||
/**
|
/**
|
||||||
* 匿名标记工具
|
* 匿名标记工具
|
||||||
*/
|
*/
|
||||||
public final class AnonTagUtil {
|
@UtilityClass
|
||||||
|
public class AnonTagUtil {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取匿名标记的URL
|
* 获取匿名标记的URL
|
||||||
@@ -35,28 +38,29 @@ public final class AnonTagUtil {
|
|||||||
for (Map.Entry<RequestMappingInfo, HandlerMethod> infoEntry : handlerMethodMap.entrySet()) {
|
for (Map.Entry<RequestMappingInfo, HandlerMethod> infoEntry : handlerMethodMap.entrySet()) {
|
||||||
HandlerMethod handlerMethod = infoEntry.getValue();
|
HandlerMethod handlerMethod = infoEntry.getValue();
|
||||||
AnonymousAccess anonymousAccess = handlerMethod.getMethodAnnotation(AnonymousAccess.class);
|
AnonymousAccess anonymousAccess = handlerMethod.getMethodAnnotation(AnonymousAccess.class);
|
||||||
if (null != anonymousAccess) {
|
if (null != anonymousAccess && infoEntry.getKey() != null) {
|
||||||
List<RequestMethod> requestMethods = new ArrayList<>(infoEntry.getKey().getMethodsCondition().getMethods());
|
List<RequestMethod> requestMethods = new ArrayList<>(infoEntry.getKey().getMethodsCondition().getMethods());
|
||||||
RequestMethodEnum request = RequestMethodEnum.find(requestMethods.isEmpty() ? RequestMethodEnum.ALL.getType() : requestMethods.get(0).name());
|
RequestMethodEnum request = RequestMethodEnum.find(requestMethods.isEmpty() ? RequestMethodEnum.ALL.getType() : requestMethods.get(0).name());
|
||||||
if (infoEntry.getKey().getPatternsCondition() != null) {
|
PatternsRequestCondition patternsCondition = infoEntry.getKey().getPatternsCondition();
|
||||||
|
if (patternsCondition != null) {
|
||||||
switch (Objects.requireNonNull(request)) {
|
switch (Objects.requireNonNull(request)) {
|
||||||
case GET:
|
case GET:
|
||||||
get.addAll(infoEntry.getKey().getPatternsCondition().getPatterns());
|
get.addAll(patternsCondition.getPatterns());
|
||||||
break;
|
break;
|
||||||
case POST:
|
case POST:
|
||||||
post.addAll(infoEntry.getKey().getPatternsCondition().getPatterns());
|
post.addAll(patternsCondition.getPatterns());
|
||||||
break;
|
break;
|
||||||
case PUT:
|
case PUT:
|
||||||
put.addAll(infoEntry.getKey().getPatternsCondition().getPatterns());
|
put.addAll(patternsCondition.getPatterns());
|
||||||
break;
|
break;
|
||||||
case PATCH:
|
case PATCH:
|
||||||
patch.addAll(infoEntry.getKey().getPatternsCondition().getPatterns());
|
patch.addAll(patternsCondition.getPatterns());
|
||||||
break;
|
break;
|
||||||
case DELETE:
|
case DELETE:
|
||||||
delete.addAll(infoEntry.getKey().getPatternsCondition().getPatterns());
|
delete.addAll(patternsCondition.getPatterns());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
all.addAll(infoEntry.getKey().getPatternsCondition().getPatterns());
|
all.addAll(patternsCondition.getPatterns());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -80,8 +84,8 @@ public final class AnonTagUtil {
|
|||||||
public static Set<String> getAllAnonymousUrl(final ApplicationContext applicationContext) {
|
public static Set<String> getAllAnonymousUrl(final ApplicationContext applicationContext) {
|
||||||
Set<String> allUrl = new HashSet<>();
|
Set<String> allUrl = new HashSet<>();
|
||||||
Map<String, Set<String>> anonymousUrls = getAnonymousUrl(applicationContext);
|
Map<String, Set<String>> anonymousUrls = getAnonymousUrl(applicationContext);
|
||||||
for (String key : anonymousUrls.keySet()) {
|
for (Map.Entry<String, Set<String>> entry : anonymousUrls.entrySet()) {
|
||||||
allUrl.addAll(anonymousUrls.get(key));
|
allUrl.addAll(anonymousUrls.get(entry.getKey()));
|
||||||
}
|
}
|
||||||
return allUrl;
|
return allUrl;
|
||||||
}
|
}
|
||||||
+3
@@ -1,11 +1,14 @@
|
|||||||
package cn.odboy.util;
|
package cn.odboy.util;
|
||||||
|
|
||||||
|
import lombok.experimental.UtilityClass;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 计算类
|
* 计算类
|
||||||
*/
|
*/
|
||||||
|
@UtilityClass
|
||||||
public final class BigDecimalUtil {
|
public final class BigDecimalUtil {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
+2
@@ -2,6 +2,7 @@ package cn.odboy.util;
|
|||||||
|
|
||||||
import cn.hutool.http.useragent.UserAgent;
|
import cn.hutool.http.useragent.UserAgent;
|
||||||
import cn.hutool.http.useragent.UserAgentUtil;
|
import cn.hutool.http.useragent.UserAgentUtil;
|
||||||
|
import lombok.experimental.UtilityClass;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
@@ -12,6 +13,7 @@ import java.net.UnknownHostException;
|
|||||||
* 浏览器 相关
|
* 浏览器 相关
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
@UtilityClass
|
||||||
public final class BrowserUtil {
|
public final class BrowserUtil {
|
||||||
private static final String UNKNOWN = "unknown";
|
private static final String UNKNOWN = "unknown";
|
||||||
|
|
||||||
+3
@@ -1,5 +1,7 @@
|
|||||||
package cn.odboy.util;
|
package cn.odboy.util;
|
||||||
|
|
||||||
|
import lombok.experimental.UtilityClass;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -7,6 +9,7 @@ import java.util.List;
|
|||||||
/**
|
/**
|
||||||
* 类 相关
|
* 类 相关
|
||||||
*/
|
*/
|
||||||
|
@UtilityClass
|
||||||
public final class ClassUtil {
|
public final class ClassUtil {
|
||||||
@SuppressWarnings({"unchecked", "all"})
|
@SuppressWarnings({"unchecked", "all"})
|
||||||
public static List<Field> getAllFields(Class clazz, List<Field> fields) {
|
public static List<Field> getAllFields(Class clazz, List<Field> fields) {
|
||||||
+3
@@ -1,10 +1,13 @@
|
|||||||
package cn.odboy.util;
|
package cn.odboy.util;
|
||||||
|
|
||||||
|
import lombok.experimental.UtilityClass;
|
||||||
|
|
||||||
import java.io.Closeable;
|
import java.io.Closeable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用于关闭各种连接,缺啥补啥
|
* 用于关闭各种连接,缺啥补啥
|
||||||
*/
|
*/
|
||||||
|
@UtilityClass
|
||||||
public final class CloseUtil {
|
public final class CloseUtil {
|
||||||
|
|
||||||
public static void close(Closeable closeable) {
|
public static void close(Closeable closeable) {
|
||||||
+2
-2
@@ -17,6 +17,7 @@ package cn.odboy.util;
|
|||||||
|
|
||||||
import cn.hutool.core.codec.Base64Encoder;
|
import cn.hutool.core.codec.Base64Encoder;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import lombok.experimental.UtilityClass;
|
||||||
|
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
@@ -26,9 +27,8 @@ import java.nio.charset.StandardCharsets;
|
|||||||
* @author odboy
|
* @author odboy
|
||||||
* @date 2022-11-16
|
* @date 2022-11-16
|
||||||
*/
|
*/
|
||||||
|
@UtilityClass
|
||||||
public final class CsBase64SecretUtil {
|
public final class CsBase64SecretUtil {
|
||||||
private CsBase64SecretUtil() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String build() {
|
public static String build() {
|
||||||
// 128位uuid
|
// 128位uuid
|
||||||
+2
@@ -17,6 +17,7 @@ package cn.odboy.util;
|
|||||||
|
|
||||||
import cn.odboy.base.CsSelectOptionItemVo;
|
import cn.odboy.base.CsSelectOptionItemVo;
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
|
import lombok.experimental.UtilityClass;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
@@ -32,6 +33,7 @@ import java.util.stream.Collectors;
|
|||||||
* @author odboy
|
* @author odboy
|
||||||
* @date 2022-11-09
|
* @date 2022-11-09
|
||||||
*/
|
*/
|
||||||
|
@UtilityClass
|
||||||
public final class CsCollUtil extends cn.hutool.core.collection.CollUtil {
|
public final class CsCollUtil extends cn.hutool.core.collection.CollUtil {
|
||||||
private static <T, K> Predicate<T> distinctPredicate(Function<? super T, ? extends K> keyMapper) {
|
private static <T, K> Predicate<T> distinctPredicate(Function<? super T, ? extends K> keyMapper) {
|
||||||
Map<Object, Boolean> map = new HashMap<>(3);
|
Map<Object, Boolean> map = new HashMap<>(3);
|
||||||
+2
@@ -17,6 +17,7 @@ package cn.odboy.util;
|
|||||||
|
|
||||||
import com.alibaba.fastjson2.JSON;
|
import com.alibaba.fastjson2.JSON;
|
||||||
import com.alibaba.fastjson2.TypeReference;
|
import com.alibaba.fastjson2.TypeReference;
|
||||||
|
import lombok.experimental.UtilityClass;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -27,6 +28,7 @@ import java.util.Map;
|
|||||||
* @author odboy
|
* @author odboy
|
||||||
* @date 2024-10-01
|
* @date 2024-10-01
|
||||||
*/
|
*/
|
||||||
|
@UtilityClass
|
||||||
public final class CsJsonUtil {
|
public final class CsJsonUtil {
|
||||||
public static <K, V> Map<K, V> toMap(String jsonStr, Class<K> kClass, Class<V> vClass) {
|
public static <K, V> Map<K, V> toMap(String jsonStr, Class<K> kClass, Class<V> vClass) {
|
||||||
return JSON.parseObject(jsonStr, new TypeReference<Map<K, V>>() {
|
return JSON.parseObject(jsonStr, new TypeReference<Map<K, V>>() {
|
||||||
+2
@@ -17,6 +17,7 @@ package cn.odboy.util;
|
|||||||
|
|
||||||
import cn.hutool.core.date.DateTime;
|
import cn.hutool.core.date.DateTime;
|
||||||
import cn.odboy.base.CsBaseUserTimeTb;
|
import cn.odboy.base.CsBaseUserTimeTb;
|
||||||
|
import lombok.experimental.UtilityClass;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -29,6 +30,7 @@ import java.util.stream.Collectors;
|
|||||||
* @author odboy
|
* @author odboy
|
||||||
* @date 2024-10-01
|
* @date 2024-10-01
|
||||||
*/
|
*/
|
||||||
|
@UtilityClass
|
||||||
public final class CsListUtil {
|
public final class CsListUtil {
|
||||||
/**
|
/**
|
||||||
* 根据对象T的属性去重
|
* 根据对象T的属性去重
|
||||||
+3
@@ -15,12 +15,15 @@
|
|||||||
*/
|
*/
|
||||||
package cn.odboy.util;
|
package cn.odboy.util;
|
||||||
|
|
||||||
|
import lombok.experimental.UtilityClass;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 适配 logger 占位符
|
* 适配 logger 占位符
|
||||||
*
|
*
|
||||||
* @author odboy
|
* @author odboy
|
||||||
* @date 2025-01-13
|
* @date 2025-01-13
|
||||||
*/
|
*/
|
||||||
|
@UtilityClass
|
||||||
public final class CsLogFmtUtil {
|
public final class CsLogFmtUtil {
|
||||||
/**
|
/**
|
||||||
* 替换字符串中的占位符 {} 为传入的参数
|
* 替换字符串中的占位符 {} 为传入的参数
|
||||||
+2
@@ -4,6 +4,7 @@ import cn.odboy.base.CsResultVo;
|
|||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.experimental.UtilityClass;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@@ -14,6 +15,7 @@ import java.util.List;
|
|||||||
*
|
*
|
||||||
* @author odboy
|
* @author odboy
|
||||||
*/
|
*/
|
||||||
|
@UtilityClass
|
||||||
public final class CsPageUtil extends cn.hutool.core.util.PageUtil {
|
public final class CsPageUtil extends cn.hutool.core.util.PageUtil {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
+3
-1
@@ -1,4 +1,4 @@
|
|||||||
package cn.odboy.core.framework.templatefile;
|
package cn.odboy.util;
|
||||||
|
|
||||||
import cn.hutool.core.lang.Dict;
|
import cn.hutool.core.lang.Dict;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
@@ -6,6 +6,7 @@ import cn.hutool.extra.template.Template;
|
|||||||
import cn.hutool.extra.template.TemplateConfig;
|
import cn.hutool.extra.template.TemplateConfig;
|
||||||
import cn.hutool.extra.template.TemplateEngine;
|
import cn.hutool.extra.template.TemplateEngine;
|
||||||
import cn.hutool.extra.template.TemplateUtil;
|
import cn.hutool.extra.template.TemplateUtil;
|
||||||
|
import lombok.experimental.UtilityClass;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resources模版工具
|
* Resources模版工具
|
||||||
@@ -13,6 +14,7 @@ import cn.hutool.extra.template.TemplateUtil;
|
|||||||
* @author odboy
|
* @author odboy
|
||||||
* @date 2025-06-22
|
* @date 2025-06-22
|
||||||
*/
|
*/
|
||||||
|
@UtilityClass
|
||||||
public class CsResourceTemplateUtil {
|
public class CsResourceTemplateUtil {
|
||||||
public static String render(String moduleName, String filename, Dict params) {
|
public static String render(String moduleName, String filename, Dict params) {
|
||||||
String path = StrUtil.isBlank(moduleName) ? "template" : "template/" + moduleName;
|
String path = StrUtil.isBlank(moduleName) ? "template" : "template/" + moduleName;
|
||||||
+3
@@ -15,6 +15,8 @@
|
|||||||
*/
|
*/
|
||||||
package cn.odboy.util;
|
package cn.odboy.util;
|
||||||
|
|
||||||
|
import lombok.experimental.UtilityClass;
|
||||||
|
|
||||||
import javax.validation.ConstraintViolation;
|
import javax.validation.ConstraintViolation;
|
||||||
import javax.validation.Validation;
|
import javax.validation.Validation;
|
||||||
import javax.validation.Validator;
|
import javax.validation.Validator;
|
||||||
@@ -27,6 +29,7 @@ import java.util.Set;
|
|||||||
* @author odboy
|
* @author odboy
|
||||||
* @date 2025-01-15
|
* @date 2025-01-15
|
||||||
*/
|
*/
|
||||||
|
@UtilityClass
|
||||||
public final class CsValidUtil {
|
public final class CsValidUtil {
|
||||||
private static final Validator VALIDATOR = Validation.buildDefaultValidatorFactory().getValidator();
|
private static final Validator VALIDATOR = Validation.buildDefaultValidatorFactory().getValidator();
|
||||||
|
|
||||||
+3
@@ -1,5 +1,7 @@
|
|||||||
package cn.odboy.util;
|
package cn.odboy.util;
|
||||||
|
|
||||||
|
import lombok.experimental.UtilityClass;
|
||||||
|
|
||||||
import javax.crypto.Cipher;
|
import javax.crypto.Cipher;
|
||||||
import javax.crypto.SecretKey;
|
import javax.crypto.SecretKey;
|
||||||
import javax.crypto.SecretKeyFactory;
|
import javax.crypto.SecretKeyFactory;
|
||||||
@@ -10,6 +12,7 @@ import java.nio.charset.StandardCharsets;
|
|||||||
/**
|
/**
|
||||||
* DES加密
|
* DES加密
|
||||||
*/
|
*/
|
||||||
|
@UtilityClass
|
||||||
public final class DesEncryptUtil {
|
public final class DesEncryptUtil {
|
||||||
|
|
||||||
private static final String STR_PARAM = "Passw0rd";
|
private static final String STR_PARAM = "Passw0rd";
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user