refactor: 重构并添加版权信息

- 在多个 Java 文件中添加了版权信息的代码块
- 更新了部分文件中的导入路径
- 重命名了一些工具类,如 FileUtil 改为 CsFileUtil
- 完善流水线机制,新增重启流水线、停止流水线功能
This commit is contained in:
2025-07-28 20:18:19 +08:00
parent 4673ca356c
commit cbb5223c0e
179 changed files with 2752 additions and 751 deletions
+3 -1
View File
@@ -71,8 +71,10 @@ https://github.com/odboy-tianjun/cutejava
> 组件所在路径:cutejava-front/src/views/components/business
- CuteDeptTree 部门树
- CuteProductLineSelect 产品线选择框
- CuteProductLineSelectPro 产品线级联选择框
- CuteUserSelect 用户多选框
![CuteDeptTree](./doc/images/CuteBusiness.png)
![CuteBusiness](./doc/images/CuteBusiness.png)
- CuteFileUpload 上传文件到OSS, 必须结合Minio使用(上传完成后必须销毁组件)
![CuteFileUpload](./doc/images/CuteFileUpload.png)
- CuteFileDragUpload 支持拖拽上传文件到OSS, 必须结合Minio使用(上传完成后必须销毁组件)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

@@ -8,6 +8,14 @@ export function startPipeline(data) {
})
}
export function stopPipeline(data) {
return request({
url: 'api/devops/pipelineInstance/stop',
method: 'post',
data
})
}
export function retryPipeline(data) {
return request({
url: 'api/devops/pipelineInstance/retry',
@@ -6,3 +6,10 @@ export function queryDeptSelectDataSource() {
method: 'post'
})
}
export function queryDeptSelectProDataSource() {
return request({
url: 'api/component/queryDeptSelectProDataSource',
method: 'post'
})
}
@@ -0,0 +1,75 @@
<template>
<el-cascader
v-model="value"
:disabled="disabled"
:options="deptOptions"
@change="handleChange"
/>
</template>
<script>
import { queryDeptSelectProDataSource } from '@/api/system/component'
import CsMessage from '@/utils/elementui/CsMessage'
export default {
name: 'CuteProductLineSelectPro',
props: {
value: {
type: Array,
default: null
},
disabled: {
type: Boolean,
default: false
}
},
data() {
return {
deptOptions: [],
selectedValue: this.value
}
},
watch: {
value(newVal) {
this.selectedValue = newVal
}
},
created() {
this.fetchDeptData()
},
methods: {
// 递归清理空的children属性
cleanEmptyChildren(data) {
return data.map(item => {
const newItem = { ...item }
if (newItem.children && newItem.children.length > 0) {
// 递归处理子节点
newItem.children = this.cleanEmptyChildren(newItem.children)
} else {
// 删除空的children属性
delete newItem.children
}
return newItem
})
},
fetchDeptData() {
queryDeptSelectProDataSource().then(data => {
this.deptOptions = this.cleanEmptyChildren(data)
console.error('deptOptions', this.deptOptions)
}).catch(error => {
console.error('获取部门数据失败:', error)
CsMessage.Error('获取部门数据失败')
})
},
handleChange(value) {
this.selectedValue = value
// 绑定change事件
this.$emit('change', value)
// 绑定form value
this.$emit('input', value)
}
}
}
</script>
@@ -73,40 +73,15 @@
</el-col>
<div style="clear: both" />
</el-row>
<cute-preview-drawer ref="detailDrawer" :title="currentTemplateData.name">
<el-timeline>
<el-timeline-item timestamp="2018/4/12" placement="top">
<el-card>
<h4>更新 Github 模板</h4>
<p>王小虎 提交于 2018/4/12 20:46</p>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="2018/4/3" placement="top">
<el-card>
<h4>更新 Github 模板</h4>
<p>王小虎 提交于 2018/4/3 20:46</p>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="2018/4/2" placement="top">
<el-card>
<h4>更新 Github 模板</h4>
<p>王小虎 提交于 2018/4/2 20:46</p>
</el-card>
</el-timeline-item>
</el-timeline>
</cute-preview-drawer>
</div>
</template>
<script>
import dayjs from 'dayjs'
import CutePreviewDrawer from '@/views/components/dev/CutePreviewDrawer'
import { mapGetters } from 'vuex'
import CsMessage from '@/utils/elementui/CsMessage'
import { retryPipeline } from '@/api/devops/pipelineInstance'
export default {
name: 'CutePipelineNode',
components: { CutePreviewDrawer },
props: {
templateData: {
type: Object,
@@ -309,8 +284,7 @@ export default {
CsMessage.Warning('当前流水线节点不支持查看明细')
return
}
console.log('templateData', this.templateData)
this.$refs.detailDrawer.show()
this.$emit('node-click', this.templateData)
},
onNodeRetryClick() {
const currentTemplateData = this.currentTemplateData || { retry: false }
@@ -322,12 +296,11 @@ export default {
...this.currentInstanceData,
code: this.currentTemplateData.code
}
// console.error('data', data)
retryPipeline(data)
this.$emit('retry', data)
this.$emit('node-retry', data)
},
onNodeOperationClick(buttonInfo) {
console.log('buttonInfo', buttonInfo)
const currentTemplateData = this.currentTemplateData || {}
this.$emit('node-opera', currentTemplateData, buttonInfo)
}
}
}
@@ -15,6 +15,9 @@
<el-form-item label="产品线" prop="productLine">
<cute-product-line-select v-model="form.productLine" @detail="onProductLineDetailChange" />
</el-form-item>
<el-form-item label="产品线Pro" prop="productLinePro">
<cute-product-line-select-pro v-model="form.productLine" @detail="onProductLineDetailProChange" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit('form')">提 交</el-button>
<el-button type="danger" @click="onReset('form')">重 置</el-button>
@@ -40,6 +43,12 @@
</div>
<cute-product-line-select @change="onProductLineChange" @detail="onProductLineDetailChange" />
</el-card>
<el-card style="margin-top: 10px">
<div slot="header" class="clearfix">
<span>产品线选择框Pro</span>
</div>
<cute-product-line-select-pro @change="onProductLineDetailProChange" />
</el-card>
</div>
</template>
@@ -48,16 +57,18 @@
import CuteUserSelect from '@/views/components/business/CuteUserSelect.vue'
import CuteDeptTree from '@/views/components/business/CuteDeptTree.vue'
import CuteProductLineSelect from '@/views/components/business/CuteProductLineSelect.vue'
import CuteProductLineSelectPro from '@/views/components/business/CuteProductLineSelectPro.vue'
export default {
name: 'CuteBusinessDemo',
components: { CuteProductLineSelect, CuteDeptTree, CuteUserSelect },
components: { CuteProductLineSelectPro, CuteProductLineSelect, CuteDeptTree, CuteUserSelect },
data() {
return {
form: {
user: null,
dept: null,
productLine: null
productLine: null,
productLinePro: null
}
}
},
@@ -90,6 +101,9 @@ export default {
},
onProductLineDetailChange(data) {
console.log('onProductLineDetailChange', data)
},
onProductLineDetailProChange(data) {
console.log('onProductLineDetailProChange', data)
}
}
}
@@ -7,9 +7,17 @@
type="primary"
:loading="dynamicStartButtonLoading"
:disabled="dynamicStartButtonLoading"
@click="startPipelineTest"
@click="doStartPipeline"
>{{ dynamicStartupStatusMap[dynamicStartupStatus].label }}
</el-button>
<el-button
v-prevent-re-click
:disabled="!dynamicRunning"
style="margin-left: 10px"
type="danger"
@click="doStopPipeline"
>停止
</el-button>
</el-divider>
<div class="box-pipeline">
<div v-if="dynamicInstance.nodes && dynamicInstance.nodes.length > 0" class="box-pipeline-content">
@@ -18,7 +26,9 @@
:key="template.code"
:template-data.sync="dynamicInstance.nodes[index]"
:instance-data.sync="dynamicInstance"
@retry="onPipelineRetrySuccess"
@node-click="onPipelineNodeClick"
@node-retry="onPipelineNodeRetryClick"
@node-opera="onPipelineNodeOperationClick"
/>
</div>
<div v-else class="box-pipeline-content">
@@ -30,40 +40,28 @@
/>
</div>
</div>
<!-- <el-divider>演示:成功</el-divider>-->
<!-- <div class="box-pipeline">-->
<!-- <div v-if="dataList2 && dataList2.length > 0" class="box-pipeline-content">-->
<!-- <cute-pipeline-node-->
<!-- v-for="(template, index) in dataList2"-->
<!-- :key="template.code"-->
<!-- :template-data.sync="dataList2[index]"-->
<!-- />-->
<!-- </div>-->
<!-- <div v-else class="box-pipeline-content">-->
<!-- <cute-pipeline-node-->
<!-- v-for="(template, index) in defaultTemplate"-->
<!-- :key="template.code"-->
<!-- :template-data.sync="defaultTemplate[index]"-->
<!-- />-->
<!-- </div>-->
<!-- </div>-->
<!-- <el-divider>演示:失败或重试</el-divider>-->
<!-- <div class="box-pipeline">-->
<!-- <div v-if="dataList3 && dataList3.length > 0" class="box-pipeline-content">-->
<!-- <cute-pipeline-node-->
<!-- v-for="(template, index) in dataList3"-->
<!-- :key="template.code"-->
<!-- :template-data.sync="dataList3[index]"-->
<!-- />-->
<!-- </div>-->
<!-- <div v-else class="box-pipeline-content">-->
<!-- <cute-pipeline-node-->
<!-- v-for="(template, index) in defaultTemplate"-->
<!-- :key="template.code"-->
<!-- :template-data.sync="defaultTemplate[index]"-->
<!-- />-->
<!-- </div>-->
<!-- </div>-->
<cute-preview-drawer ref="detailDrawer" :title="currentNodeData.name">
<el-timeline>
<el-timeline-item timestamp="2018/4/12" placement="top">
<el-card>
<h4>更新 Github 模板</h4>
<p>王小虎 提交于 2018/4/12 20:46</p>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="2018/4/3" placement="top">
<el-card>
<h4>更新 Github 模板</h4>
<p>王小虎 提交于 2018/4/3 20:46</p>
</el-card>
</el-timeline-item>
<el-timeline-item timestamp="2018/4/2" placement="top">
<el-card>
<h4>更新 Github 模板</h4>
<p>王小虎 提交于 2018/4/2 20:46</p>
</el-card>
</el-timeline-item>
</el-timeline>
</cute-preview-drawer>
</div>
</template>
@@ -71,391 +69,30 @@
import CutePipelineNode from '@/views/components/dev/CutePipelineNode'
import { getPipelineTemplate } from '@/api/devops/pipelineTemplate'
import { queryLastPipelineDetailWs, startPipeline } from '@/api/devops/pipelineInstance'
import {
queryLastPipelineDetailWs,
restartPipeline,
retryPipeline,
startPipeline,
stopPipeline
} from '@/api/devops/pipelineInstance'
import { CountArraysObjectByPropKey } from '@/utils/CsUtil'
import CsMessage from '@/utils/elementui/CsMessage'
import CsWsClient from '@/utils/CsWsClient'
import { mapGetters } from 'vuex'
import CutePreviewDrawer from '@/views/components/dev/CutePreviewDrawer.vue'
export default {
name: 'CutePipelineNodeDemo',
components: { CutePipelineNode },
components: { CutePreviewDrawer, CutePipelineNode },
data() {
return {
// // 静态模板
// defaultTemplate: [
// {
// code: 'node_init',
// type: 'service',
// name: '初始化'
// },
// {
// code: 'node_merge_branch',
// type: 'service',
// name: '合并代码',
// click: true,
// retry: true
// },
// {
// code: 'node_build_java',
// type: 'service',
// name: '构建',
// click: true,
// retry: true,
// detailType: 'gitlab',
// parameters: {
// pipeline: 'pipeline-backend'
// }
// },
// {
// code: 'node_image_scan',
// type: 'service',
// name: '镜像扫描',
// click: true,
// retry: true,
// detailType: 'gitlab',
// parameters: {
// pipeline: 'pipeline-image-scan'
// }
// },
// {
// code: 'node_approve_deploy',
// type: 'service',
// name: '部署审批',
// click: false,
// retry: true,
// buttons: [{
// type: 'execute',
// title: '同意',
// code: 'agree',
// parameters: {}
// },
// {
// type: 'execute',
// title: '拒绝',
// code: 'refuse',
// parameters: {}
// }
// ]
// },
// {
// code: 'node_deploy_java',
// type: 'service',
// name: '部署',
// click: true,
// retry: false,
// buttons: [{
// type: 'link',
// title: '查看部署详情',
// code: 'success',
// parameters: {
// 'isBlank': true
// }
// }]
// },
// {
// code: 'node_merge_confirm',
// type: 'service',
// name: '合并确认',
// click: false,
// retry: false,
// buttons: [{
// type: 'execute',
// title: '通过',
// code: 'agree',
// parameters: {}
// }]
// },
// {
// code: 'node_merge_master',
// type: 'service',
// name: '合并回Master',
// click: false,
// retry: true
// }],
// // 成功
// dataList2: [
// {
// code: 'node_init',
// type: 'service',
// name: '初始化',
// createTime: '2025-07-17 21:12:01',
// updateTime: '2025-07-17 21:13:01',
// startTime: '2025-07-17 21:13:01',
// currentNodeMsg: '执行成功',
// currentNodeStatus: 'success',
// status: 'success'
// },
// {
// code: 'node_merge_branch',
// type: 'service',
// name: '合并代码',
// click: true,
// retry: true,
// createTime: '2025-07-17 21:13:01',
// updateTime: '2025-07-17 21:18:01',
// startTime: '2025-07-17 21:13:01',
// currentNodeMsg: '执行成功',
// currentNodeStatus: 'success',
// status: 'success'
// },
// {
// code: 'node_build_java',
// type: 'service',
// name: '构建',
// click: true,
// retry: true,
// detailType: 'gitlab',
// parameters: {
// pipeline: 'pipeline-backend'
// },
// createTime: '2025-07-17 21:18:01',
// updateTime: '2025-07-17 21:28:01',
// startTime: '2025-07-17 21:18:01',
// currentNodeMsg: '执行成功',
// currentNodeStatus: 'success',
// status: 'success'
// },
// {
// code: 'node_image_scan',
// type: 'service',
// name: '镜像扫描',
// click: true,
// retry: true,
// detailType: 'gitlab',
// parameters: {
// pipeline: 'pipeline-image-scan'
// },
// createTime: '2025-07-17 21:28:01',
// updateTime: '2025-07-17 21:28:21',
// startTime: '2025-07-17 21:28:01',
// currentNodeMsg: '执行成功',
// currentNodeStatus: 'success',
// status: 'success'
// },
// {
// code: 'node_approve_deploy',
// type: 'service',
// name: '部署审批',
// click: false,
// retry: true,
// buttons: [
// {
// type: 'execute',
// title: '同意',
// code: 'agree',
// parameters: {}
// },
// {
// type: 'execute',
// title: '拒绝',
// code: 'refuse',
// parameters: {}
// }
// ],
// createTime: '2025-07-17 21:28:21',
// updateTime: '2025-07-17 21:30:21',
// startTime: '2025-07-17 21:28:21',
// currentNodeMsg: '执行成功',
// currentNodeStatus: 'success',
// status: 'success'
// },
// {
// code: 'node_deploy_java',
// type: 'service',
// name: '部署',
// click: true,
// retry: false,
// buttons: [{
// type: 'link',
// title: '查看部署详情',
// code: 'success',
// parameters: {
// 'isBlank': true
// }
// }],
// createTime: '2025-07-17 21:28:21',
// updateTime: '2025-07-17 21:58:21',
// startTime: '2025-07-17 21:30:21',
// currentNodeMsg: '执行成功',
// currentNodeStatus: 'success',
// status: 'success'
// },
// {
// code: 'node_merge_confirm',
// type: 'service',
// name: '合并确认',
// click: false,
// retry: false,
// buttons: [{
// type: 'execute',
// title: '通过',
// code: 'agree',
// parameters: {}
// }],
// createTime: '2025-07-17 21:28:21',
// updateTime: '2025-07-17 22:10:21',
// startTime: '2025-07-17 21:58:21',
// currentNodeMsg: '执行成功',
// currentNodeStatus: 'success',
// status: 'success'
// },
// {
// code: 'node_merge_master',
// type: 'service',
// name: '合并回Master',
// click: false,
// retry: true,
// createTime: '2025-07-17 21:28:21',
// updateTime: '2025-07-17 22:10:58',
// startTime: '2025-07-17 22:10:21',
// currentNodeMsg: '执行成功',
// currentNodeStatus: 'success',
// status: 'success'
// }
// ],
// // 失败或重试
// dataList3: [
// {
// code: 'node_init',
// type: 'service',
// name: '初始化',
// createTime: '2025-07-17 21:12:01',
// updateTime: '2025-07-17 21:13:01',
// startTime: '2025-07-17 21:13:01',
// currentNodeMsg: '执行成功',
// currentNodeStatus: 'success',
// status: 'success'
// },
// {
// code: 'node_merge_branch',
// type: 'service',
// name: '合并代码',
// click: true,
// retry: true,
// createTime: '2025-07-17 21:13:01',
// updateTime: '2025-07-17 21:18:01',
// startTime: '2025-07-17 21:13:01',
// currentNodeMsg: '执行成功',
// currentNodeStatus: 'success',
// status: 'success'
// },
// {
// code: 'node_build_java',
// type: 'service',
// name: '构建',
// click: true,
// retry: true,
// detailType: 'gitlab',
// parameters: {
// pipeline: 'pipeline-backend'
// },
// createTime: '2025-07-17 21:18:01',
// updateTime: '2025-07-17 21:28:01',
// startTime: '2025-07-17 21:18:01',
// currentNodeMsg: '执行失败',
// currentNodeStatus: 'fail',
// status: 'fail'
// },
// {
// code: 'node_image_scan',
// type: 'service',
// name: '镜像扫描',
// click: true,
// retry: true,
// detailType: 'gitlab',
// parameters: {
// pipeline: 'pipeline-image-scan'
// },
// createTime: '2025-07-17 21:28:01',
// updateTime: '2025-07-17 21:28:21',
// startTime: null,
// currentNodeMsg: '待执行',
// currentNodeStatus: 'pending',
// status: 'pending'
// },
// {
// code: 'node_approve_deploy',
// type: 'service',
// name: '部署审批',
// click: false,
// retry: true,
// buttons: [
// {
// type: 'execute',
// title: '同意',
// code: 'agree',
// parameters: {}
// },
// {
// type: 'execute',
// title: '拒绝',
// code: 'refuse',
// parameters: {}
// }
// ],
// createTime: '2025-07-17 21:28:21',
// updateTime: '2025-07-17 21:28:21',
// startTime: null,
// currentNodeMsg: '待执行',
// currentNodeStatus: 'pending',
// status: 'pending'
// },
// {
// code: 'node_deploy_java',
// type: 'service',
// name: '部署',
// click: true,
// retry: false,
// buttons: [{
// type: 'link',
// title: '查看部署详情',
// code: 'success',
// parameters: {
// 'isBlank': true
// }
// }],
// createTime: '2025-07-17 21:28:21',
// updateTime: '2025-07-17 21:28:21',
// startTime: null,
// currentNodeMsg: '待执行',
// currentNodeStatus: 'pending',
// status: 'pending'
// },
// {
// code: 'node_merge_confirm',
// type: 'service',
// name: '合并确认',
// click: false,
// retry: false,
// buttons: [{
// type: 'execute',
// title: '通过',
// code: 'agree',
// parameters: {}
// }],
// createTime: '2025-07-17 21:28:21',
// updateTime: '2025-07-17 21:28:21',
// startTime: null,
// currentNodeMsg: '待执行',
// currentNodeStatus: 'pending',
// status: 'pending'
// },
// {
// code: 'node_merge_master',
// type: 'service',
// name: '合并回Master',
// click: false,
// retry: true,
// createTime: '2025-07-17 21:28:21',
// updateTime: '2025-07-17 21:28:21',
// startTime: null,
// currentNodeMsg: '待执行',
// currentNodeStatus: 'pending',
// status: 'pending'
// }
// ],
// 动态流水线
testAppInfo: {
appName: 'cuteops',
pipelineTemplateEnv: 'daily',
iterationName: '流水线测试'
},
// ============== 动态流水线
dynamicStartupStatusMap: {
start: { label: '启动', code: 'start' },
restart: { label: '重新启动', code: 'restart' }
@@ -473,7 +110,10 @@ export default {
// 当前流水线实例
dynamicInstance: {},
// 当前ws客户端
dynamicWsClient: null
dynamicWsClient: null,
dynamicRunning: false,
// ============== 交互变量
currentNodeData: {}
}
},
computed: {
@@ -482,31 +122,9 @@ export default {
])
},
mounted() {
// this.refreshData()
this.initPipelineTemplate(this.dynamicTemplate.id)
// const pipelineInstanceId = sessionStorage.getItem('pipelineInstanceId')
// if (pipelineInstanceId) {
// this.fetchLastDetail(pipelineInstanceId)
// }
// this.connectWebSocketServer(pipelineInstanceId)
},
methods: {
// refreshData() {
// // 成功
// for (const datum of this.dataList2) {
// if (datum.status === 'running') {
// datum.updateTime = FormatDateTimeStr(new Date())
// }
// }
// this.dataList2 = [...this.dataList2]
// // 失败或重试
// for (const datum of this.dataList3) {
// if (datum.status === 'running') {
// datum.updateTime = FormatDateTimeStr(new Date())
// }
// }
// this.dataList3 = [...this.dataList3]
// },
/**
* 初始化流水线模板
* @param templateId
@@ -530,6 +148,13 @@ export default {
const that = this
// {username}_{bizCode}_{contextParams}
const sid = `${that.user.username}_FetchPipelineLastDetail_${instanceId}`
if (that.dynamicWsClient) {
try {
that.dynamicWsClient.close()
} catch (e) {
// ignore
}
}
that.dynamicWsClient = new CsWsClient(sid)
that.dynamicWsClient.connect(that.handleWebSocketError, that.handleWebSocketMessage)
setTimeout(() => {
@@ -547,6 +172,7 @@ export default {
const data = e.data
// console.log('来自服务器的数据:data', data)
const callbackData = JSON.parse(data)
that.dynamicRunning = true
// console.log('callbackData', callbackData)
try {
that.dynamicInstance = JSON.parse(callbackData.data)
@@ -555,8 +181,9 @@ export default {
if (that.dynamicTemplateList && that.dynamicTemplateList.length === successCount) {
// 所有节点执行成功
if (that.dynamicWsClient) {
that.dynamicWsClient.close()
sessionStorage.removeItem('pipelineInstanceId')
that.dynamicWsClient.close()
that.dynamicRunning = false
}
that.dynamicStartupStatus = that.dynamicStartupStatusMap.start.code
} else {
@@ -564,75 +191,87 @@ export default {
// 存在失败的节点
if (that.dynamicWsClient && failCount > 0) {
that.dynamicWsClient.close()
that.dynamicRunning = false
}
that.dynamicStartupStatus = that.dynamicStartupStatusMap.restart.code
}
} catch (e) {
// ignore
that.dynamicRunning = false
}
},
// /**
// * 通过Http的方式拉取流水线最新的状态
// * @param instanceId
// * @returns {Promise<void>}
// */
// async fetchLastDetail(instanceId) {
// const that = this
// const intervalTime = 2000
// setTimeout(() => {
// that.dynamicHook = setInterval(() => {
// queryLastPipelineDetail(instanceId).then((data) => {
// that.dynamicInstance = data
// // 判断流水线是否结束
// const successCount = CountArraysObjectByPropKey(data.nodes, 'status', 'success')
// if (that.dynamicTemplateList && that.dynamicTemplateList.length === successCount) {
// clearInterval(that.dynamicHook)
// that.dynamicHook = null
// that.dynamicStartupStatus = that.dynamicStartupStatusMap.start.code
// } else {
// that.dynamicStartupStatus = that.dynamicStartupStatusMap.restart.code
// }
// })
// }, intervalTime)
// that.dynamicStartButtonLoading = false
// }, 2000)
// },
/**
* 启动流水线
* @returns {Promise<void>}
*/
async startPipelineTest() {
async doStartPipeline() {
const that = this
const args = {
id: that.dynamicTemplate.id
}
try {
// if (that.dynamicHook) {
// clearInterval(that.dynamicHook)
// }
that.dynamicStartButtonLoading = true
// 这里的 dynamicStartupStatus状态,需要后期与上下文关联后,初始化的时候带入最近一个流水线实例
// let result
// if (that.dynamicStartupStatus === that.dynamicStartupStatusMap.start.code) {
// result = await restartPipeline()
// CsMessage.Success('流水线重新启动成功')
// } else {
// result = await startPipeline()
// CsMessage.Success('流水线启动成功')
// }
const result = await startPipeline(args)
const args = {
templateId: that.dynamicTemplate.id,
instanceName: that.testAppInfo.iterationName,
contextName: that.testAppInfo.appName,
env: that.testAppInfo.pipelineTemplateEnv
}
let result
const pipelineInstanceId = sessionStorage.getItem('pipelineInstanceId')
if (pipelineInstanceId) {
result = await restartPipeline({
...args,
instanceId: pipelineInstanceId
})
CsMessage.Success('流水线重启成功')
} else {
result = await startPipeline(args)
CsMessage.Success('流水线启动成功')
// await that.fetchLastDetail(result.instanceId)
}
sessionStorage.setItem('pipelineInstanceId', result.instanceId)
that.connectWebSocketServer(result.instanceId)
} catch (e) {
console.error('error', e)
that.dynamicStartButtonLoading = false
CsMessage.Error('流水线启动失败')
}
},
onPipelineRetrySuccess(data) {
sessionStorage.setItem('pipelineInstanceId', data.instanceId)
/**
* 停止流水线
* @returns {Promise<void>}
*/
async doStopPipeline() {
const that = this
const args = {
templateId: that.dynamicTemplate.id,
instanceName: that.testAppInfo.iterationName,
contextName: that.testAppInfo.appName,
env: that.testAppInfo.pipelineTemplateEnv
}
const pipelineInstanceId = sessionStorage.getItem('pipelineInstanceId')
if (pipelineInstanceId) {
await stopPipeline({
...args,
instanceId: pipelineInstanceId
})
CsMessage.Success('流水线停止成功')
}
},
onPipelineNodeClick(data) {
console.log('data', data)
this.currentNodeData = data
this.$refs.detailDrawer.show()
},
async onPipelineNodeRetryClick(data) {
console.log('data', data)
const result = await retryPipeline({
instanceId: data.instanceId,
code: data.code
})
sessionStorage.setItem('pipelineInstanceId', result.instanceId)
this.connectWebSocketServer(data.instanceId)
},
async onPipelineNodeOperationClick(data, buttonInfo) {
console.log('data', data, buttonInfo)
}
}
}
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.annotation;
import java.lang.annotation.*;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.annotation;
import org.springframework.core.annotation.AliasFor;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.annotation;
import org.springframework.core.annotation.AliasFor;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.annotation;
import org.springframework.core.annotation.AliasFor;
@@ -9,7 +24,7 @@ import java.lang.annotation.*;
/**
* Annotation for mapping HTTP {@code PATCH} requests onto specific handler
* methods.
* * 支持匿名访问 PatchMapping
* 支持匿名访问 PatchMapping
*
* @see AnonymousGetMapping
* @see AnonymousPostMapping
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.annotation;
import org.springframework.core.annotation.AliasFor;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.annotation;
import org.springframework.core.annotation.AliasFor;
@@ -9,7 +24,7 @@ import java.lang.annotation.*;
/**
* Annotation for mapping HTTP {@code PUT} requests onto specific handler
* methods.
* * 支持匿名访问 PutMapping
* 支持匿名访问 PutMapping
*
* @see AnonymousGetMapping
* @see AnonymousPostMapping
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.base;
import lombok.Getter;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.base;
import com.baomidou.mybatisplus.annotation.FieldFill;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.base;
import com.baomidou.mybatisplus.annotation.FieldFill;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.base;
import java.io.Serializable;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.base;
import io.swagger.annotations.ApiModelProperty;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.base;
import lombok.AllArgsConstructor;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.constant;
/**
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.constant;
import lombok.AllArgsConstructor;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.constant;
import lombok.AllArgsConstructor;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.constant;
/**
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.context;
import lombok.extern.slf4j.Slf4j;
@@ -1,8 +1,23 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.doc;
import cn.odboy.constant.SystemConst;
import cn.odboy.framework.properties.AppProperties;
import cn.odboy.util.AnonTagUtil;
import cn.odboy.util.CsAnonTagUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Value;
@@ -80,7 +95,7 @@ public class SwaggerConfig {
}
private SecurityContext getContextByPath() {
Set<String> urls = AnonTagUtil.getAllAnonymousUrl(applicationContext);
Set<String> urls = CsAnonTagUtil.getAllAnonymousUrl(applicationContext);
urls = urls.stream().filter(url -> !"/".equals(url)).collect(Collectors.toSet());
String regExp = "^(?!" + apiPath + String.join("|" + apiPath, urls) + ").*$";
return SecurityContext.builder()
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.exception;
import lombok.Getter;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.exception.handler;
import lombok.Data;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.exception.handler;
import cn.hutool.core.exceptions.ExceptionUtil;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.monitor.service;
import org.springframework.http.ResponseEntity;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.mybatisplus.config;
/**
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.mybatisplus.config;
import java.lang.annotation.ElementType;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.mybatisplus.config;
import cn.odboy.framework.exception.BadRequestException;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.mybatisplus.config;
import cn.hutool.core.util.StrUtil;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.mybatisplus.config;
import com.baomidou.mybatisplus.annotation.DbType;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.mybatisplus.config;
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.mybatisplus.core;
import cn.hutool.core.bean.BeanUtil;
@@ -18,7 +18,7 @@ package cn.odboy.framework.mybatisplus.core;
import cn.hutool.core.util.StrUtil;
import cn.odboy.base.CsBaseUserTimeTb;
import cn.odboy.framework.exception.BadRequestException;
import cn.odboy.util.FileUtil;
import cn.odboy.util.CsFileUtil;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.config.*;
@@ -193,7 +193,7 @@ public class CsMpCmdGenUtil {
}
private static Consumer<GlobalConfig.Builder> getGlobalConfigConsumer() {
String outputDir = FileUtil.getTmpDirPath() + "CodeGen";
String outputDir = CsFileUtil.getTmpDirPath() + "CodeGen";
return globalConfigBuilder -> globalConfigBuilder
.enableSwagger()
.outputDir(outputDir)
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.mybatisplus.core;
import cn.hutool.core.collection.CollectionUtil;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.properties;
import cn.odboy.framework.properties.model.*;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.properties.model;
import cn.odboy.base.CsObject;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.properties.model;
import cn.odboy.base.CsObject;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.properties.model;
import cn.odboy.base.CsObject;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.properties.model;
import cn.odboy.base.CsObject;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.properties.model;
import lombok.Getter;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.properties.model;
import cn.odboy.base.CsObject;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.properties.model;
import cn.odboy.base.CsObject;
@@ -1,9 +1,24 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.properties.model;
import cn.odboy.base.CsObject;
import cn.odboy.constant.CaptchaCodeEnum;
import cn.odboy.framework.exception.BadRequestException;
import cn.odboy.util.StringUtil;
import cn.odboy.util.CsStringUtil;
import com.wf.captcha.*;
import com.wf.captcha.base.Captcha;
import lombok.Getter;
@@ -84,7 +99,7 @@ public class UserLoginCaptchaSettingModel extends CsObject {
default:
throw new BadRequestException("验证码配置信息错误!正确配置查看 LoginCodeEnum ");
}
if (StringUtil.isNotBlank(fontName)) {
if (CsStringUtil.isNotBlank(fontName)) {
captcha.setFont(new Font(fontName, Font.PLAIN, fontSize));
}
return captcha;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.properties.model;
import cn.odboy.base.CsObject;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.quartz.config;
import lombok.extern.slf4j.Slf4j;
@@ -23,24 +38,23 @@ public class QuartzConfig {
@Component("quartzJobFactory")
public static class QuartzJobFactory extends AdaptableJobFactory {
private final AutowireCapableBeanFactory capableBeanFactory;
private final AutowireCapableBeanFactory autowireCapableBeanFactory;
@Autowired
public QuartzJobFactory(AutowireCapableBeanFactory capableBeanFactory) {
this.capableBeanFactory = capableBeanFactory;
public QuartzJobFactory(AutowireCapableBeanFactory autowireCapableBeanFactory) {
this.autowireCapableBeanFactory = autowireCapableBeanFactory;
}
@NonNull
@Override
protected Object createJobInstance(@NonNull TriggerFiredBundle bundle) throws Exception {
protected Object createJobInstance(@NonNull TriggerFiredBundle triggerFiredBundle) throws Exception {
try {
// 调用父类的方法, 把Job注入到spring中
Object jobInstance = super.createJobInstance(bundle);
capableBeanFactory.autowireBean(jobInstance);
log.debug("Job instance created and autowired: {}", jobInstance.getClass().getName());
// 调用父类的方法, 把Job注入Spring中
Object jobInstance = super.createJobInstance(triggerFiredBundle);
autowireCapableBeanFactory.autowireBean(jobInstance);
return jobInstance;
} catch (Exception e) {
log.error("Error creating job instance for bundle: {}", bundle, e);
log.error("Job注入Spring失败, {}", triggerFiredBundle, e);
throw e;
}
}
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.quartz.core;
import cn.odboy.framework.context.CsSpringBeanHolder;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.redis;
import com.alibaba.fastjson2.JSON;
@@ -5,7 +20,6 @@ import com.alibaba.fastjson2.JSONFactory;
import com.alibaba.fastjson2.JSONWriter;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.digest.MurmurHash3;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration;
import org.springframework.cache.Cache;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.redis;
import cn.hutool.core.util.StrUtil;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.redis;
import cn.hutool.core.util.StrUtil;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.server.config;
import cn.odboy.framework.properties.AppProperties;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.server.converters;
import org.springframework.core.convert.converter.Converter;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.server.converters;
import cn.hutool.core.util.StrUtil;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.server.core;
import cn.odboy.framework.server.converters.DateStringArraysToListDateConverter;
@@ -23,13 +38,19 @@ import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
/**
* 跨越、静态资源映射、Http消息转换
*
* @author odboy
* @date 2025-03-21
*/
@Configuration
@EnableWebMvc
@RequiredArgsConstructor
public class ConfigurerAdapter implements WebMvcConfigurer {
private final DateStringArraysToListDateConverter dateStringArraysToListDateConverter;
private final DateStringToDateConverter dateStringToDateConverter;
private final FileUploadPathHelper fileUploadPathHelper;
private final CsFileLocalUploadHelper fileUploadPathHelper;
@Bean
public CorsFilter corsFilter() {
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.server.core;
import cn.odboy.constant.SystemConst;
@@ -10,7 +25,7 @@ import org.springframework.stereotype.Component;
* @author odboy
*/
@Component
public class FileUploadPathHelper {
public class CsFileLocalUploadHelper {
/**
* 单位MB
*/
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.websocket.config;
import org.springframework.context.annotation.Bean;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.websocket.config;
import io.undertow.server.DefaultByteBufferPool;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.websocket.context;
import lombok.extern.slf4j.Slf4j;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.websocket.context;
import cn.odboy.base.CsObject;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.websocket.context;
import com.alibaba.fastjson2.JSON;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.websocket.model;
import cn.odboy.base.CsObject;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.framework.websocket.util;
import cn.odboy.framework.exception.BadRequestException;
@@ -16,7 +16,7 @@ import java.util.*;
* 匿名标记工具
*/
@UtilityClass
public class AnonTagUtil {
public class CsAnonTagUtil {
/**
* 获取匿名标记的URL
@@ -9,7 +9,7 @@ import java.math.RoundingMode;
* 计算类
*/
@UtilityClass
public final class BigDecimalUtil {
public final class CsBigDecimalUtil {
/**
* 将对象转换为 BigDecimal
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.util;
import cn.hutool.http.useragent.UserAgent;
@@ -14,7 +29,7 @@ import java.net.UnknownHostException;
*/
@Slf4j
@UtilityClass
public final class BrowserUtil {
public final class CsBrowserUtil {
private static final String UNKNOWN = "unknown";
/**
@@ -10,7 +10,7 @@ import java.util.List;
* 类 相关
*/
@UtilityClass
public final class ClassUtil {
public final class CsClassUtil {
@SuppressWarnings({"unchecked", "all"})
public static List<Field> getAllFields(Class clazz, List<Field> fields) {
if (clazz != null) {
@@ -8,7 +8,7 @@ import java.io.Closeable;
* 用于关闭各种连接, 缺啥补啥
*/
@UtilityClass
public final class CloseUtil {
public final class CsCloseUtil {
public static void close(Closeable closeable) {
if (null != closeable) {
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.util;
import cn.hutool.core.date.DatePattern;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.util;
import lombok.experimental.UtilityClass;
@@ -13,7 +28,7 @@ import java.nio.charset.StandardCharsets;
* DES加密
*/
@UtilityClass
public final class DesEncryptUtil {
public final class CsDesEncryptUtil {
private static final String STR_PARAM = "Passw0rd";
private static final IvParameterSpec IV = new IvParameterSpec(STR_PARAM.getBytes(StandardCharsets.UTF_8));
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.util;
import java.util.concurrent.atomic.AtomicLong;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.util;
import cn.hutool.core.io.IoUtil;
@@ -34,7 +49,7 @@ import static cn.odboy.constant.SystemConst.*;
*/
@Slf4j
@UtilityClass
public final class FileUtil extends cn.hutool.core.io.FileUtil {
public final class CsFileUtil extends cn.hutool.core.io.FileUtil {
/**
* 系统临时目录
@@ -127,8 +142,8 @@ public final class FileUtil extends cn.hutool.core.io.FileUtil {
} catch (Exception e) {
log.error(e.getMessage(), e);
} finally {
CloseUtil.close(os);
CloseUtil.close(ins);
CsCloseUtil.close(os);
CsCloseUtil.close(ins);
}
return file;
}
@@ -273,7 +288,7 @@ public final class FileUtil extends cn.hutool.core.io.FileUtil {
log.error(e.getMessage(), e);
return null;
} finally {
CloseUtil.close(in);
CsCloseUtil.close(in);
}
return b;
}
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.util;
import cn.odboy.framework.context.CsSpringBeanHolder;
@@ -13,7 +28,7 @@ import java.util.Enumeration;
* IP地址 相关
*/
@UtilityClass
public final class IpUtil {
public final class CsIPUtil {
/**
* 注入bean
*/
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.util;
import cn.odboy.base.CsResultVo;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.util;
import cn.hutool.core.lang.Dict;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.util;
import lombok.experimental.UtilityClass;
@@ -15,7 +30,7 @@ import java.security.spec.X509EncodedKeySpec;
* Rsa 工具类, 公钥私钥生成, 加解密
*/
@UtilityClass
public final class RsaEncryptUtil {
public final class CsRsaEncryptUtil {
private static final String SRC = "123456";
@@ -36,12 +51,12 @@ public final class RsaEncryptUtil {
*/
private static void test1(RsaKeyPair keyPair) throws Exception {
System.out.println("***************** 公钥加密私钥解密开始 *****************");
String text1 = encryptByPublicKey(keyPair.getPublicKey(), RsaEncryptUtil.SRC);
String text1 = encryptByPublicKey(keyPair.getPublicKey(), CsRsaEncryptUtil.SRC);
String text2 = decryptByPrivateKey(keyPair.getPrivateKey(), text1);
System.out.println("加密前:" + RsaEncryptUtil.SRC);
System.out.println("加密前:" + CsRsaEncryptUtil.SRC);
System.out.println("加密后:" + text1);
System.out.println("解密后:" + text2);
if (RsaEncryptUtil.SRC.equals(text2)) {
if (CsRsaEncryptUtil.SRC.equals(text2)) {
System.out.println("解密字符串和原始字符串一致, 解密成功");
} else {
System.out.println("解密字符串和原始字符串不一致,解密失败");
@@ -56,12 +71,12 @@ public final class RsaEncryptUtil {
*/
private static void test2(RsaKeyPair keyPair) throws Exception {
System.out.println("***************** 私钥加密公钥解密开始 *****************");
String text1 = encryptByPrivateKey(keyPair.getPrivateKey(), RsaEncryptUtil.SRC);
String text1 = encryptByPrivateKey(keyPair.getPrivateKey(), CsRsaEncryptUtil.SRC);
String text2 = decryptByPublicKey(keyPair.getPublicKey(), text1);
System.out.println("加密前:" + RsaEncryptUtil.SRC);
System.out.println("加密前:" + CsRsaEncryptUtil.SRC);
System.out.println("加密后:" + text1);
System.out.println("解密后:" + text2);
if (RsaEncryptUtil.SRC.equals(text2)) {
if (CsRsaEncryptUtil.SRC.equals(text2)) {
System.out.println("解密字符串和原始字符串一致,解密成功");
} else {
System.out.println("解密字符串和原始字符串不一致,解密失败");
@@ -11,7 +11,7 @@ import java.util.Date;
*/
@Slf4j
@UtilityClass
public final class StringUtil extends org.apache.commons.lang3.StringUtils {
public final class CsStringUtil extends org.apache.commons.lang3.StringUtils {
private static final char SEPARATOR = '_';
@@ -20,8 +20,10 @@ import lombok.experimental.UtilityClass;
import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import javax.validation.ValidatorFactory;
import javax.validation.groups.Default;
import java.util.Set;
import java.util.stream.Collectors;
/**
* Bean验证工具
@@ -31,16 +33,22 @@ import java.util.Set;
*/
@UtilityClass
public final class CsValidUtil {
private static final Validator VALIDATOR = Validation.buildDefaultValidatorFactory().getValidator();
private static final Validator VALIDATOR;
static {
try (ValidatorFactory factory = Validation.buildDefaultValidatorFactory()) {
VALIDATOR = factory.getValidator();
}
}
public static <T> void validate(T object) {
Set<ConstraintViolation<T>> violations = VALIDATOR.validate(object, Default.class);
if (!violations.isEmpty()) {
StringBuilder sb = new StringBuilder();
for (ConstraintViolation<T> violation : violations) {
sb.append(violation.getMessage()).append(", ");
}
throw new IllegalArgumentException(sb.toString());
throw new IllegalArgumentException(violations
.stream()
.map(ConstraintViolation::getMessage)
.collect(Collectors.joining(","))
);
}
}
}
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.devops.constant.pipeline;
/**
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.devops.constant.pipeline;
import lombok.AllArgsConstructor;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.devops.constant.pipeline;
import lombok.AllArgsConstructor;
@@ -1,8 +1,25 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.devops.controller;
import cn.odboy.devops.dal.dataobject.PipelineInstanceTb;
import cn.odboy.devops.dal.dataobject.PipelineTemplateTb;
import cn.odboy.devops.dal.model.DevOpsQueryLastPipelineDetailArgs;
import cn.odboy.devops.dal.model.QueryLastPipelineDetailArgs;
import cn.odboy.devops.dal.model.RestartPipelineArgs;
import cn.odboy.devops.dal.model.StartPipelineArgs;
import cn.odboy.devops.framework.pipeline.model.PipelineInstanceVo;
import cn.odboy.devops.service.core.PipelineInstanceService;
import cn.odboy.devops.service.core.PipelineTemplateService;
@@ -36,31 +53,39 @@ public class DevopsPipelineInstanceController {
@ApiOperation("启动流水线")
@PostMapping(value = "/start")
@PreAuthorize("@el.check()")
public ResponseEntity<?> startPipeline(@RequestBody PipelineTemplateTb args) {
// 输入参数
String appName = "cuteops";
String envCode = "daily";
public ResponseEntity<?> startPipeline(@Validated @RequestBody StartPipelineArgs args) {
// 获取模板
PipelineTemplateTb pipelineTemplateTb = pipelineTemplateService.getPipelineTemplateById(args.getId());
PipelineTemplateTb pipelineTemplateTb = pipelineTemplateService.getPipelineTemplateById(args.getTemplateId());
// 创建流水线实例
PipelineInstanceTb pipelineInstanceTb = new PipelineInstanceTb();
pipelineInstanceTb.setTemplateId(pipelineTemplateTb.getId());
pipelineInstanceTb.setInstanceName("流水线测试");
pipelineInstanceTb.setTemplateType(pipelineTemplateTb.getType());
pipelineInstanceTb.setContextName(appName);
pipelineInstanceTb.setEnv(envCode);
pipelineInstanceTb.setTemplateContent(pipelineTemplateTb.getTemplate());
pipelineInstanceTb.setInstanceName(args.getInstanceName());
pipelineInstanceTb.setContextName(args.getContextName());
pipelineInstanceTb.setEnv(args.getEnv());
return ResponseEntity.ok(pipelineInstanceService.startPipeline(pipelineInstanceTb));
}
/**
* TODO 待实现
* 已验证流程
*/
@ApiOperation("重启流水线")
@PostMapping(value = "/restart")
@PreAuthorize("@el.check()")
public ResponseEntity<?> restartPipeline(@RequestBody PipelineTemplateTb args) {
return ResponseEntity.ok("功能开发中");
public ResponseEntity<?> restartPipeline(@RequestBody RestartPipelineArgs args) {
return ResponseEntity.ok(pipelineInstanceService.restartPipeline(args));
}
/**
* 已验证流程
*/
@ApiOperation("停止流水线")
@PostMapping(value = "/stop")
@PreAuthorize("@el.check()")
public ResponseEntity<?> stopPipeline(@RequestBody RestartPipelineArgs args) {
pipelineInstanceService.stopPipeline(args);
return ResponseEntity.ok("流水线停止成功");
}
/**
@@ -76,14 +101,14 @@ public class DevopsPipelineInstanceController {
@ApiOperation("查询流水线明细")
@PostMapping(value = "/last")
@PreAuthorize("@el.check()")
public ResponseEntity<?> queryLastPipelineDetail(@Validated @RequestBody DevOpsQueryLastPipelineDetailArgs args) {
public ResponseEntity<?> queryLastPipelineDetail(@Validated @RequestBody QueryLastPipelineDetailArgs args) {
return ResponseEntity.ok(pipelineInstanceService.queryLastPipelineDetail(args.getInstanceId()));
}
@ApiOperation("查询流水线明细Ws")
@PostMapping(value = "/lastWs")
@PreAuthorize("@el.check()")
public ResponseEntity<?> queryLastPipelineDetailWs(@Validated @RequestBody DevOpsQueryLastPipelineDetailArgs args) {
public ResponseEntity<?> queryLastPipelineDetailWs(@Validated @RequestBody QueryLastPipelineDetailArgs args) {
pipelineInstanceService.queryLastPipelineDetailWs(args.getInstanceId());
return ResponseEntity.ok("开始推送流水线明细");
}
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.devops.controller;
import cn.odboy.base.CsArgs;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.devops.dal.dataobject;
import cn.odboy.base.CsObject;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.devops.dal.dataobject;
import cn.odboy.base.CsObject;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.devops.dal.dataobject;
import cn.odboy.base.CsObject;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.devops.dal.dataobject;
import cn.odboy.base.CsBaseUserTimeLogicTb;
@@ -1,14 +0,0 @@
package cn.odboy.devops.dal.model;
import cn.odboy.base.CsObject;
import lombok.Getter;
import lombok.Setter;
import javax.validation.constraints.NotBlank;
@Getter
@Setter
public class DevOpsQueryLastPipelineDetailArgs extends CsObject {
@NotBlank(message = "流水线实例Id必填")
private String instanceId;
}
@@ -0,0 +1,29 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.devops.dal.model;
import cn.odboy.base.CsObject;
import lombok.Getter;
import lombok.Setter;
import javax.validation.constraints.NotBlank;
@Getter
@Setter
public class QueryLastPipelineDetailArgs extends CsObject {
@NotBlank(message = "流水线实例id必填")
private String instanceId;
}
@@ -0,0 +1,34 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.devops.dal.model;
import lombok.Getter;
import lombok.Setter;
import javax.validation.constraints.NotBlank;
/**
* 重启流水线 参数
*
* @author odboy
* @date 2025-07-28
*/
@Getter
@Setter
public class RestartPipelineArgs extends StartPipelineArgs {
@NotBlank(message = "流水线实例id必填")
private String instanceId;
}
@@ -0,0 +1,37 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.devops.dal.model;
import cn.odboy.base.CsObject;
import lombok.Getter;
import lombok.Setter;
import javax.validation.constraints.NotBlank;
/**
* 流水线节点重试 参数
*
* @author odboy
* @date 2025-07-28
*/
@Getter
@Setter
public class RestartPipelineNodeArgs extends CsObject {
@NotBlank(message = "流水线实例id必填")
private String instanceId;
@NotBlank(message = "重试节点code必填")
private String code;
}
@@ -0,0 +1,42 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.devops.dal.model;
import cn.odboy.base.CsObject;
import lombok.Getter;
import lombok.Setter;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* 启动流水线 参数
*
* @author odboy
* @date 2025-07-28
*/
@Getter
@Setter
public class StartPipelineArgs extends CsObject {
@NotNull(message = "模板id必填")
private Long templateId;
@NotBlank(message = "实例名称必填")
private String instanceName;
@NotBlank(message = "上下文名称必填")
private String contextName;
@NotBlank(message = "环境编码必填")
private String env;
}
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.devops.dal.model;
import cn.odboy.base.CsObject;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.devops.dal.mysql;
import cn.odboy.devops.dal.dataobject.PipelineInstanceTb;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.devops.dal.mysql;
import cn.odboy.devops.dal.dataobject.PipelineTemplateTb;
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.devops.dal.redis;
import cn.odboy.devops.constant.pipeline.PipelineConst;
@@ -25,6 +40,12 @@ public class PipelineInstanceDAO {
return false;
}
public boolean isLock(PipelineInstanceTb pipelineInstanceTb) {
String redisKey = PipelineConst.INSTANCE_PREFIX + pipelineInstanceTb.getTemplateId() + pipelineInstanceTb.getContextName();
Object o = redisHelper.get(redisKey);
return o != null;
}
public void unLock(PipelineInstanceTb pipelineInstanceTb) {
String redisKey = PipelineConst.INSTANCE_PREFIX + pipelineInstanceTb.getTemplateId() + pipelineInstanceTb.getContextName();
Object o = redisHelper.get(redisKey);
@@ -1,3 +1,18 @@
/*
* Copyright 2021-2025 Odboy
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package cn.odboy.devops.framework.mongoplus;
import com.anwen.mongo.handlers.MetaObjectHandler;

Some files were not shown because too many files have changed in this diff Show More