refactor: 优化项目结构,移除运维管理,更新Sql文件
This commit is contained in:
parent
b9518dbec8
commit
2c23b68d08
@ -1,27 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/app',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/app',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/app',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
@ -1,17 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function testDbConnect(data) {
|
||||
return request({
|
||||
url: 'api/database/testConnect',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function testServerConnect(data) {
|
||||
return request({
|
||||
url: 'api/serverDeploy/testConnect',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/database',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/database',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/database',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function testDbConnection(data) {
|
||||
return request({
|
||||
url: 'api/database/testConnect',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, testDbConnection }
|
@ -1,77 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/deploy',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/deploy',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/deploy',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getApps() {
|
||||
return request({
|
||||
url: 'api/app',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function getServers() {
|
||||
return request({
|
||||
url: 'api/serverDeploy',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 启动服务
|
||||
* @param data 选中行
|
||||
*/
|
||||
export function startServer(data) {
|
||||
return request({
|
||||
url: 'api/deploy/startServer',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 停止服务
|
||||
* @param data 选中行
|
||||
*/
|
||||
export function stopServer(data) {
|
||||
return request({
|
||||
url: 'api/deploy/stopServer',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 停止服务
|
||||
* @param data 选中行
|
||||
*/
|
||||
export function serverStatus(data) {
|
||||
return request({
|
||||
url: 'api/deploy/serverStatus',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del, stopServer, serverStatus, startServer, getServers, getApps }
|
@ -1,21 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/deployHistory',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 版本回退
|
||||
* @param data 选中行
|
||||
*/
|
||||
export function reducte(data) {
|
||||
return request({
|
||||
url: 'api/deploy/serverReduction',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/serverDeploy',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/serverDeploy',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/serverDeploy',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
@ -149,9 +149,9 @@
|
||||
<el-input v-model="form.moduleName" style="width: 40%" />
|
||||
<span style="color: #C0C0C0;margin-left: 10px;">模块的名称,请选择项目中已存在的模块</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="至于包下" prop="pack">
|
||||
<el-form-item label="项目包名" prop="pack">
|
||||
<el-input v-model="form.pack" style="width: 40%" />
|
||||
<span style="color: #C0C0C0;margin-left: 10px;">项目包的名称,生成的代码放到哪个包里面</span>
|
||||
<span style="color: #C0C0C0;margin-left: 10px;">项目包的名称,如:me.zhengjie</span>
|
||||
</el-form-item>
|
||||
<el-form-item label="接口名称" prop="apiAlias">
|
||||
<el-input v-model="form.apiAlias" style="width: 40%" />
|
||||
|
@ -1,144 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-input v-model="query.name" clearable placeholder="输入名称搜索" style="width: 200px" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<date-range-picker v-model="query.createTime" class="date-item" />
|
||||
<rrOperation />
|
||||
</div>
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="left"
|
||||
v-permission="['admin','app:add']"
|
||||
:disabled="!currentRow"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="copy"
|
||||
>复制</el-button>
|
||||
</crudOperation>
|
||||
</div>
|
||||
<!--表单组件-->
|
||||
<el-dialog append-to-body :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="800px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="100px">
|
||||
<el-form-item label="应用名称" prop="name">
|
||||
<el-input v-model="form.name" style="width: 670px" placeholder="部署后的文件或者目录名称,用于备份" />
|
||||
</el-form-item>
|
||||
<el-form-item label="应用端口" prop="port">
|
||||
<el-input-number v-model.number="form.port" placeholder="例如:8080" />
|
||||
</el-form-item>
|
||||
<el-form-item label="上传目录" prop="uploadPath">
|
||||
<el-input v-model="form.uploadPath" style="width: 670px" placeholder="例如: /opt/upload" />
|
||||
</el-form-item>
|
||||
<el-form-item label="部署目录" prop="deployPath">
|
||||
<el-input v-model="form.deployPath" style="width: 670px" placeholder="例如: /opt/app" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备份目录" prop="backupPath">
|
||||
<el-input v-model="form.backupPath" style="width: 670px" placeholder="例如: /opt/backup" />
|
||||
</el-form-item>
|
||||
<el-form-item label="部署脚本" prop="deployScript">
|
||||
<el-input v-model="form.deployScript" :rows="3" type="textarea" autosize style="width: 670px" placeholder="" />
|
||||
</el-form-item>
|
||||
<el-form-item label="启动脚本" prop="startScript">
|
||||
<el-input v-model="form.startScript" :rows="3" type="textarea" autosize style="width: 670px" placeholder="" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" highlight-current-row style="width: 100%" @selection-change="crud.selectionChangeHandler" @current-change="handleCurrentChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="name" label="应用名称" />
|
||||
<el-table-column prop="port" label="端口号" />
|
||||
<el-table-column prop="uploadPath" label="上传目录" />
|
||||
<el-table-column prop="deployPath" label="部署目录" />
|
||||
<el-table-column prop="backupPath" label="备份目录" />
|
||||
<el-table-column prop="createTime" label="创建日期" />
|
||||
<el-table-column v-if="checkPer(['admin','app:edit','app:del'])" label="操作" width="150px" align="center">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudApp from '@/api/mnt/app'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import DateRangePicker from '@/components/DateRangePicker'
|
||||
|
||||
const defaultForm = { id: null, name: null, port: 8080, uploadPath: '/opt/upload', deployPath: '/opt/app', backupPath: '/opt/backup', startScript: null, deployScript: null }
|
||||
export default {
|
||||
name: 'App',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, DateRangePicker },
|
||||
cruds() {
|
||||
return CRUD({ title: '应用', url: 'api/app', crudMethod: { ...crudApp }})
|
||||
},
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
data() {
|
||||
return {
|
||||
currentRow: null,
|
||||
permission: {
|
||||
add: ['admin', 'app:add'],
|
||||
edit: ['admin', 'app:edit'],
|
||||
del: ['admin', 'app:del']
|
||||
},
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: '请输入应用名称', trigger: 'blur' }
|
||||
],
|
||||
port: [
|
||||
{ required: true, message: '请输入应用端口', trigger: 'blur', type: 'number' }
|
||||
],
|
||||
uploadPath: [
|
||||
{ required: true, message: '请输入上传目录', trigger: 'blur' }
|
||||
],
|
||||
deployPath: [
|
||||
{ required: true, message: '请输入部署目录', trigger: 'blur' }
|
||||
],
|
||||
backupPath: [
|
||||
{ required: true, message: '请输入备份目录', trigger: 'blur' }
|
||||
],
|
||||
startScript: [
|
||||
{ required: true, message: '请输入启动脚本', trigger: 'blur' }
|
||||
],
|
||||
deployScript: [
|
||||
{ required: true, message: '请输入部署脚本', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
copy() {
|
||||
for (const key in this.currentRow) {
|
||||
this.form[key] = this.currentRow[key]
|
||||
}
|
||||
this.form.id = null
|
||||
this.form.createTime = null
|
||||
this.crud.toAdd()
|
||||
},
|
||||
handleCurrentChange(row) {
|
||||
this.currentRow = JSON.parse(JSON.stringify(row))
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
@ -1,86 +0,0 @@
|
||||
<template>
|
||||
<el-dialog append-to-body :close-on-click-modal="false" :visible.sync="dialog" title="执行脚本" width="400px">
|
||||
<el-form ref="form" :rules="rules" size="small">
|
||||
<el-upload
|
||||
:action="databaseUploadApi"
|
||||
:data="databaseInfo"
|
||||
:headers="headers"
|
||||
:on-success="handleSuccess"
|
||||
:on-error="handleError"
|
||||
class="upload-demo"
|
||||
drag
|
||||
>
|
||||
<i class="el-icon-upload" />
|
||||
<div class="el-upload__text">
|
||||
将文件拖到此处,或
|
||||
<em>点击上传</em>
|
||||
</div>
|
||||
<div slot="tip" class="el-upload__tip">上传后,系统会自动执行SQL脚本</div>
|
||||
</el-upload>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="cancel">关闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
import { getToken } from '@/utils/auth'
|
||||
export default {
|
||||
props: {
|
||||
databaseInfo: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
dialog: false,
|
||||
headers: {
|
||||
Authorization: getToken()
|
||||
},
|
||||
rules: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['databaseUploadApi'])
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
cancel() {
|
||||
this.dialog = false
|
||||
},
|
||||
handleSuccess(response, file, fileList) {
|
||||
if (response === 'success') {
|
||||
this.$notify({
|
||||
title: '执行成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
} else {
|
||||
this.$notify({
|
||||
title: response,
|
||||
type: 'error',
|
||||
duration: 0
|
||||
})
|
||||
}
|
||||
},
|
||||
handleError(e, file, fileList) {
|
||||
const msg = JSON.parse(e.message)
|
||||
this.$notify({
|
||||
title: msg.message,
|
||||
type: 'error',
|
||||
duration: 0
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
@ -1,148 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-input v-model="query.blurry" clearable placeholder="模糊搜索" style="width: 200px" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<date-range-picker v-model="query.createTime" class="date-item" />
|
||||
<rrOperation />
|
||||
</div>
|
||||
<crudOperation :permission="permission">
|
||||
<el-button
|
||||
slot="right"
|
||||
v-permission="['admin','database:add']"
|
||||
:disabled="!selectIndex"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="warning"
|
||||
icon="el-icon-upload"
|
||||
@click="execute"
|
||||
>执行脚本
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
</div>
|
||||
<!--表单组件-->
|
||||
<eForm ref="execute" :database-info="currentRow" />
|
||||
<el-dialog append-to-body :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="530px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="100px">
|
||||
<el-form-item label="连接名称" prop="name">
|
||||
<el-input v-model="form.name" style="width: 370px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="JDBC地址" prop="jdbcUrl">
|
||||
<el-input v-model="form.jdbcUrl" style="width: 300px" />
|
||||
<el-button :loading="loading" type="success" @click="testConnectDatabase">测试</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item label="用户" prop="userName">
|
||||
<el-input v-model="form.userName" style="width: 370px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="密码" prop="pwd">
|
||||
<el-input v-model="form.pwd" type="password" style="width: 370px" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" highlight-current-row stripe style="width: 100%" @selection-change="handleCurrentChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="name" width="130px" label="数据库名称" />
|
||||
<el-table-column prop="jdbcUrl" label="连接地址" />
|
||||
<el-table-column prop="userName" width="200px" label="用户名" />
|
||||
<el-table-column prop="createTime" width="200px" label="创建日期" />
|
||||
<el-table-column v-if="checkPer(['admin','database:edit','database:del'])" label="操作" width="150px" align="center">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudDatabase from '@/api/mnt/database'
|
||||
import { testDbConnect } from '@/api/mnt/connect'
|
||||
import eForm from './execute'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import DateRangePicker from '@/components/DateRangePicker'
|
||||
|
||||
const defaultForm = { id: null, name: null, jdbcUrl: 'jdbc:mysql://', userName: null, pwd: null }
|
||||
export default {
|
||||
name: 'DataBase',
|
||||
components: { eForm, pagination, crudOperation, rrOperation, udOperation, DateRangePicker },
|
||||
cruds() {
|
||||
return CRUD({ title: '数据库', url: 'api/database', crudMethod: { ...crudDatabase }})
|
||||
},
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
data() {
|
||||
return {
|
||||
currentRow: {},
|
||||
selectIndex: '',
|
||||
databaseInfo: '',
|
||||
loading: false,
|
||||
permission: {
|
||||
add: ['admin', 'database:add'],
|
||||
edit: ['admin', 'database:edit'],
|
||||
del: ['admin', 'database:del']
|
||||
},
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: '请输入数据库名称', trigger: 'blur' }
|
||||
],
|
||||
jdbcUrl: [
|
||||
{ required: true, message: '请输入数据库连接地址', trigger: 'blur' }
|
||||
],
|
||||
userName: [
|
||||
{ required: true, message: '请输入用户名', trigger: 'blur' }
|
||||
],
|
||||
pwd: [
|
||||
{ required: true, message: '请输入数据库密码', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
testConnectDatabase() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true
|
||||
testDbConnect(this.form).then((res) => {
|
||||
this.loading = false
|
||||
this.crud.notify(res ? '连接成功' : '连接失败', res ? 'success' : 'error')
|
||||
}).catch(() => {
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
execute() {
|
||||
this.$refs.execute.dialog = true
|
||||
},
|
||||
handleCurrentChange(selection) {
|
||||
this.crud.selections = selection
|
||||
if (selection.length === 1) {
|
||||
const row = selection[0]
|
||||
this.selectIndex = row.id
|
||||
this.currentRow = row
|
||||
} else {
|
||||
this.currentRow = {}
|
||||
this.selectIndex = ''
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
@ -1,190 +0,0 @@
|
||||
<template>
|
||||
<el-dialog append-to-body :close-on-click-modal="false" :visible.sync="dialog" title="应用部署" width="400px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small">
|
||||
<el-upload
|
||||
:action="deployUploadApi"
|
||||
:data="deployInfo"
|
||||
:headers="headers"
|
||||
:on-success="handleSuccess"
|
||||
:on-error="handleError"
|
||||
class="upload-demo"
|
||||
drag
|
||||
>
|
||||
<i class="el-icon-upload" />
|
||||
<div class="el-upload__text">
|
||||
将文件拖到此处,或
|
||||
<em>点击上传</em>
|
||||
</div>
|
||||
<div slot="tip" class="el-upload__tip">多个应用上传文件名称为all.zip,数据库更新脚本扩展名为.sql,上传成功后系统自动部署系统。</div>
|
||||
</el-upload>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="cancel">关闭</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { add, edit, getApps, getServers } from '@/api/mnt/deploy'
|
||||
import { mapGetters } from 'vuex'
|
||||
import { getToken } from '@/utils/auth'
|
||||
|
||||
export default {
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
dialog: false,
|
||||
apps: [],
|
||||
servers: [],
|
||||
headers: {
|
||||
Authorization: getToken()
|
||||
},
|
||||
deployInfo: {},
|
||||
form: {
|
||||
id: '',
|
||||
appId: '',
|
||||
ip: '',
|
||||
selectIp: []
|
||||
},
|
||||
rules: {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['deployUploadApi'])
|
||||
},
|
||||
created() {
|
||||
this.initWebSocket()
|
||||
},
|
||||
mounted() {
|
||||
this.initSelect()
|
||||
},
|
||||
methods: {
|
||||
cancel() {
|
||||
this.resetForm()
|
||||
},
|
||||
doSubmit() {
|
||||
this.loading = true
|
||||
if (this.isAdd) {
|
||||
this.doAdd()
|
||||
} else {
|
||||
this.doEdit()
|
||||
}
|
||||
},
|
||||
joinIp() {
|
||||
this.form.ip = ''
|
||||
this.form.selectIp.forEach(ip => {
|
||||
if (this.form.ip !== '') {
|
||||
this.form.ip += ','
|
||||
}
|
||||
this.form.ip += ip
|
||||
})
|
||||
},
|
||||
doAdd() {
|
||||
this.joinIp()
|
||||
add(this.form)
|
||||
.then(res => {
|
||||
this.resetForm()
|
||||
this.$notify({
|
||||
title: '添加成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
this.loading = false
|
||||
this.$parent.init()
|
||||
})
|
||||
.catch(err => {
|
||||
this.loading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
doEdit() {
|
||||
this.joinIp()
|
||||
edit(this.form)
|
||||
.then(res => {
|
||||
this.resetForm()
|
||||
this.$notify({
|
||||
title: '修改成功',
|
||||
type: 'success',
|
||||
duration: 2500
|
||||
})
|
||||
this.loading = false
|
||||
this.$parent.init()
|
||||
})
|
||||
.catch(err => {
|
||||
this.loading = false
|
||||
console.log(err.response.data.message)
|
||||
})
|
||||
},
|
||||
resetForm() {
|
||||
this.dialog = false
|
||||
this.$refs['form'].resetFields()
|
||||
this.form = {
|
||||
id: '',
|
||||
appId: '',
|
||||
ip: '',
|
||||
selectIp: []
|
||||
}
|
||||
},
|
||||
initSelect() {
|
||||
getApps().then(res => {
|
||||
this.apps = res.content
|
||||
})
|
||||
getServers().then(res => {
|
||||
this.servers = res.content
|
||||
})
|
||||
},
|
||||
handleSuccess(response, file, fileList) {
|
||||
this.cancel()
|
||||
},
|
||||
// 监听上传失败
|
||||
handleError(e, file, fileList) {
|
||||
const msg = JSON.parse(e.message)
|
||||
this.$notify({
|
||||
title: msg.message,
|
||||
type: 'error',
|
||||
duration: 2500
|
||||
})
|
||||
},
|
||||
initWebSocket() {
|
||||
const wsUri = (process.env.VUE_APP_WS_API === '/' ? '/' : (process.env.VUE_APP_WS_API + '/')) + 'webSocket/deploy'
|
||||
this.websock = new WebSocket(wsUri)
|
||||
this.websock.onerror = this.webSocketOnError
|
||||
this.websock.onmessage = this.webSocketOnMessage
|
||||
},
|
||||
webSocketOnError(e) {
|
||||
this.$notify({
|
||||
title: 'WebSocket连接发生错误',
|
||||
type: 'error',
|
||||
duration: 0
|
||||
})
|
||||
},
|
||||
webSocketOnMessage(e) {
|
||||
const data = JSON.parse(e.data)
|
||||
if (data.msgType === 'INFO') {
|
||||
this.$notify({
|
||||
title: '',
|
||||
message: data.msg,
|
||||
type: 'success',
|
||||
dangerouslyUseHTMLString: true,
|
||||
duration: 5500
|
||||
})
|
||||
} else if (data.msgType === 'ERROR') {
|
||||
this.$notify({
|
||||
title: '',
|
||||
message: data.msg,
|
||||
dangerouslyUseHTMLString: true,
|
||||
type: 'error',
|
||||
duration: 0
|
||||
})
|
||||
}
|
||||
},
|
||||
webSocketSend(agentData) {
|
||||
this.websock.send(agentData)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
@ -1,229 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-input v-model="query.appName" clearable placeholder="输入应用名称查询" style="width: 200px" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<date-range-picker v-model="query.createTime" class="date-item" />
|
||||
<rrOperation />
|
||||
</div>
|
||||
<crudOperation :permission="permission">
|
||||
<template slot="right">
|
||||
<el-button
|
||||
v-permission="['admin','deploy:add']"
|
||||
:disabled="!selectIndex"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-upload"
|
||||
@click="sysRestore"
|
||||
>系统还原
|
||||
</el-button>
|
||||
<el-button
|
||||
v-permission="['admin','deploy:add']"
|
||||
:disabled="!selectIndex"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-upload"
|
||||
@click="serverStatus"
|
||||
>状态查询
|
||||
</el-button>
|
||||
<el-button
|
||||
v-permission="['admin','deploy:add']"
|
||||
:disabled="!selectIndex"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="success"
|
||||
icon="el-icon-upload"
|
||||
@click="startServer"
|
||||
>启动
|
||||
</el-button>
|
||||
<el-button
|
||||
v-permission="['admin','deploy:add']"
|
||||
:disabled="!selectIndex"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-upload"
|
||||
@click="stopServer"
|
||||
>停止
|
||||
</el-button>
|
||||
<el-button
|
||||
v-permission="['admin','deploy:add']"
|
||||
:disabled="!selectIndex"
|
||||
class="filter-item"
|
||||
size="mini"
|
||||
type="warning"
|
||||
icon="el-icon-upload"
|
||||
@click="deploy"
|
||||
>一键部署
|
||||
</el-button>
|
||||
</template>
|
||||
</crudOperation>
|
||||
</div>
|
||||
<!--表单组件-->
|
||||
<el-dialog append-to-body :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="80px">
|
||||
<el-form-item label="应用" prop="app.id">
|
||||
<el-select v-model.number="form.app.id" placeholder="请选择" style="width: 370px">
|
||||
<el-option v-for="item in apps" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="服务器" prop="deploys">
|
||||
<el-select v-model="form.deploys" multiple placeholder="请选择" style="width: 370px">
|
||||
<el-option v-for="item in servers" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--统还原组件-->
|
||||
<fForm ref="sysRestore" :key="times" :app-name="appName" />
|
||||
<dForm ref="deploy" />
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" highlight-current-row stripe style="width: 100%" @selection-change="handleCurrentChange">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="app.name" label="应用名称" />
|
||||
<el-table-column prop="servers" label="服务器列表" />
|
||||
<el-table-column prop="createTime" label="部署日期" />
|
||||
<el-table-column v-if="checkPer(['admin','deploy:edit','deploy:del'])" label="操作" width="150px" align="center">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudDeploy from '@/api/mnt/deploy'
|
||||
import dForm from './deploy'
|
||||
import fForm from './sysRestore'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import DateRangePicker from '@/components/DateRangePicker'
|
||||
|
||||
const defaultForm = { id: null, app: { id: null }, deploys: [] }
|
||||
export default {
|
||||
name: 'Deploy',
|
||||
components: { dForm, fForm, pagination, crudOperation, rrOperation, udOperation, DateRangePicker },
|
||||
cruds() {
|
||||
return CRUD({ title: '部署', url: 'api/deploy', crudMethod: { ...crudDeploy }})
|
||||
},
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
data() {
|
||||
return {
|
||||
currentRow: {}, selectIndex: '', appName: '', urlHistory: '',
|
||||
times: 0, appId: '', deployId: '', apps: [], servers: [],
|
||||
permission: {
|
||||
add: ['admin', 'deploy:add'],
|
||||
edit: ['admin', 'deploy:edit'],
|
||||
del: ['admin', 'deploy:del']
|
||||
},
|
||||
rules: {
|
||||
'app.id': [
|
||||
{ required: true, message: '应用不能为空', trigger: 'blur', type: 'number' }
|
||||
],
|
||||
deploys: [
|
||||
{ required: true, message: '服务器不能为空', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
this.selectIndex = ''
|
||||
return true
|
||||
},
|
||||
// 新增编辑前做的操作
|
||||
[CRUD.HOOK.beforeToCU](crud, form) {
|
||||
this.initSelect()
|
||||
const deploys = []
|
||||
form.deploys.forEach(function(deploy, index) {
|
||||
deploys.push(deploy.id)
|
||||
})
|
||||
this.form.deploys = deploys
|
||||
},
|
||||
// 提交前
|
||||
[CRUD.HOOK.beforeSubmit]() {
|
||||
const deploys = []
|
||||
this.form.deploys.forEach(function(data, index) {
|
||||
const deploy = { id: data }
|
||||
deploys.push(deploy)
|
||||
})
|
||||
this.form.deploys = deploys
|
||||
return true
|
||||
},
|
||||
deploy() {
|
||||
this.$refs.deploy.dialog = true
|
||||
this.$refs.deploy.deployInfo = this.currentRow
|
||||
},
|
||||
sysRestore() {
|
||||
this.$refs.sysRestore.dialog = true
|
||||
},
|
||||
handleCurrentChange(selection) {
|
||||
this.crud.selections = selection
|
||||
if (selection.length === 1) {
|
||||
const row = selection[0]
|
||||
this.selectIndex = row.id
|
||||
this.currentRow = row
|
||||
this.appName = row.app.name
|
||||
this.times = this.times + 1
|
||||
this.appId = row.appId
|
||||
this.deployId = row.id
|
||||
} else {
|
||||
this.currentRow = {}
|
||||
this.selectIndex = ''
|
||||
}
|
||||
},
|
||||
startServer() {
|
||||
crudDeploy.startServer(JSON.stringify(this.currentRow))
|
||||
.then(res => {
|
||||
})
|
||||
.catch(err => {
|
||||
console.log('error:' + err.response.data.message)
|
||||
})
|
||||
},
|
||||
stopServer() {
|
||||
crudDeploy.stopServer(JSON.stringify(this.currentRow))
|
||||
.then(res => {
|
||||
})
|
||||
.catch(err => {
|
||||
console.log('error:' + err.response.data.message)
|
||||
})
|
||||
},
|
||||
serverStatus() {
|
||||
crudDeploy.serverStatus(JSON.stringify(this.currentRow))
|
||||
.then(res => {
|
||||
})
|
||||
.catch(err => {
|
||||
console.log('error:' + err.response.data.message)
|
||||
})
|
||||
},
|
||||
initSelect() {
|
||||
crudDeploy.getApps().then(res => {
|
||||
this.apps = res.content
|
||||
})
|
||||
crudDeploy.getServers().then(res => {
|
||||
this.servers = res.content
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
@ -1,107 +0,0 @@
|
||||
<template>
|
||||
<el-dialog append-to-body :close-on-click-modal="false" :visible.sync="dialog" title="系统还原" width="800px">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<date-range-picker v-model="query.createTime" class="date-item" />
|
||||
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
|
||||
</div>
|
||||
<el-form size="small" label-width="80px">
|
||||
<!--表格渲染-->
|
||||
<el-table v-loading="loading" :data="data" style="width: 100%" @row-click="showRow">
|
||||
<el-table-column width="30px">
|
||||
<template slot-scope="scope">
|
||||
<el-radio v-model="radio" :label="scope.$index" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="appName" label="应用名称" />
|
||||
<el-table-column prop="ip" label="部署IP" />
|
||||
<el-table-column prop="deployDate" label="部署时间" />
|
||||
<el-table-column prop="deployUser" label="部署人员" />
|
||||
</el-table>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="cancel">取消</el-button>
|
||||
<el-button v-permission="['admin','deploy:add']" :loading="submitLoading" type="primary" @click="doSubmit">确认</el-button>
|
||||
</div>
|
||||
<!--分页组件-->
|
||||
<el-pagination
|
||||
:total="total"
|
||||
:current-page="page"
|
||||
style="margin-top: 8px"
|
||||
layout="total, prev, pager, next, sizes"
|
||||
@size-change="sizeChange"
|
||||
@current-change="pageChange"
|
||||
/>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crud from '@/mixins/crud'
|
||||
import { reducte } from '@/api/mnt/deployHistory'
|
||||
import DateRangePicker from '@/components/DateRangePicker'
|
||||
export default {
|
||||
components: { DateRangePicker },
|
||||
mixins: [crud],
|
||||
props: {
|
||||
appName: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
submitLoading: false,
|
||||
dialog: false,
|
||||
history: [],
|
||||
radio: '',
|
||||
appNames: '',
|
||||
selectIndex: ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$nextTick(() => {
|
||||
this.init()
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
beforeInit() {
|
||||
this.url = 'api/deployHistory'
|
||||
this.deployId = this.$parent.deployId
|
||||
if (this.deployId === '') {
|
||||
return false
|
||||
}
|
||||
this.params['deployId'] = this.deployId
|
||||
return true
|
||||
},
|
||||
showRow(row) {
|
||||
this.radio = this.data.indexOf(row)
|
||||
this.selectIndex = row.id
|
||||
},
|
||||
cancel() {
|
||||
this.dialog = false
|
||||
this.submitLoading = false
|
||||
},
|
||||
doSubmit() {
|
||||
if (this.selectIndex === '') {
|
||||
this.$message.error('请选择要还原的备份')
|
||||
} else {
|
||||
this.submitLoading = true
|
||||
reducte(JSON.stringify(this.data[this.radio]))
|
||||
.then(res => {
|
||||
this.dialog = false
|
||||
this.submitLoading = false
|
||||
this.appNames = ''
|
||||
this.$parent.crud.toQuery()
|
||||
})
|
||||
.catch(err => {
|
||||
this.submitLoading = false
|
||||
console.log('error:' + err.response.data.message)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
@ -1,93 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-input v-model="query.blurry" clearable placeholder="输入搜索内容" style="width: 200px" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<date-range-picker v-model="query.deployDate" class="date-item" />
|
||||
<rrOperation />
|
||||
</div>
|
||||
<crudOperation :permission="permission" />
|
||||
</div>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" style="width: 100%" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="appName" label="应用名称" />
|
||||
<el-table-column prop="ip" label="部署IP" />
|
||||
<el-table-column prop="deployUser" label="部署人员" />
|
||||
<el-table-column prop="deployDate" label="部署时间" />
|
||||
<el-table-column v-if="checkPer(['admin','deployHistory:del'])" label="操作" width="100px" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-popover
|
||||
:ref="scope.row.id"
|
||||
v-permission="['admin','deployHistory:del']"
|
||||
placement="top"
|
||||
width="180"
|
||||
>
|
||||
<p>确定删除本条数据吗?</p>
|
||||
<div style="text-align: right; margin: 0">
|
||||
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
|
||||
<el-button :loading="delLoading" type="primary" size="mini" @click="delMethod(scope.row.id)">确定</el-button>
|
||||
</div>
|
||||
<el-button slot="reference" type="danger" icon="el-icon-delete" size="mini" />
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { del } from '@/api/mnt/deployHistory'
|
||||
import CRUD, { presenter, header } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import DateRangePicker from '@/components/DateRangePicker'
|
||||
|
||||
export default {
|
||||
name: 'DeployHistory',
|
||||
components: { pagination, crudOperation, rrOperation, DateRangePicker },
|
||||
cruds() {
|
||||
return CRUD({ title: '部署历史', url: 'api/deployHistory', crudMethod: { del }})
|
||||
},
|
||||
mixins: [presenter(), header()],
|
||||
data() {
|
||||
return {
|
||||
delLoading: false,
|
||||
permission: {
|
||||
del: ['admin', 'deployHistory:del']
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.crud.optShow = {
|
||||
add: false,
|
||||
edit: false,
|
||||
del: true,
|
||||
download: true
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
delMethod(id) {
|
||||
this.delLoading = true
|
||||
del([id]).then(() => {
|
||||
this.delLoading = false
|
||||
this.$refs[id].doClose()
|
||||
this.crud.dleChangePage(1)
|
||||
this.crud.delSuccessNotify()
|
||||
this.crud.toQuery()
|
||||
}).catch(() => {
|
||||
this.delLoading = false
|
||||
this.$refs[id].doClose()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
@ -1,136 +0,0 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<div v-if="crud.props.searchToggle">
|
||||
<!-- 搜索 -->
|
||||
<el-input v-model="query.blurry" clearable placeholder="输入名称或IP搜索" style="width: 200px" class="filter-item" @keyup.enter.native="crud.toQuery" />
|
||||
<date-range-picker v-model="query.createTime" class="date-item" />
|
||||
<rrOperation />
|
||||
</div>
|
||||
<crudOperation :permission="permission" />
|
||||
</div>
|
||||
<!--表单组件-->
|
||||
<el-dialog append-to-body :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="470px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="55px">
|
||||
<el-form-item label="名称" prop="name">
|
||||
<el-input v-model="form.name" style="width: 370px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="IP" prop="ip">
|
||||
<el-input v-model="form.ip" style="width: 370px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="端口" prop="port">
|
||||
<el-input-number v-model.number="form.port" controls-position="right" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="账号" prop="account">
|
||||
<el-input v-model="form.account" style="width: 370px" />
|
||||
</el-form-item>
|
||||
<el-form-item label="密码" prop="password">
|
||||
<el-input v-model="form.password" type="password" style="width: 200px" />
|
||||
<el-button :loading="loading" type="success" style="align: right;" @click="testConnectServer">测试连接</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||
<el-button :loading="crud.status.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" style="width: 100%" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="name" label="名称" />
|
||||
<el-table-column prop="ip" label="IP" />
|
||||
<el-table-column prop="port" label="端口" />
|
||||
<el-table-column prop="account" label="账号" />
|
||||
<el-table-column prop="createTime" label="创建日期" />
|
||||
<el-table-column v-if="checkPer(['admin','serverDeploy:edit','serverDeploy:del'])" label="操作" width="150px" align="center">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import crudServer from '@/api/mnt/serverDeploy'
|
||||
import { testServerConnect } from '@/api/mnt/connect'
|
||||
import { validateIP } from '@/utils/validate'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import DateRangePicker from '@/components/DateRangePicker'
|
||||
|
||||
const defaultForm = { id: null, name: null, ip: null, port: 22, account: 'root', password: null }
|
||||
export default {
|
||||
name: 'Server',
|
||||
components: { pagination, crudOperation, rrOperation, udOperation, DateRangePicker },
|
||||
cruds() {
|
||||
return CRUD({ title: '服务器', url: 'api/serverDeploy', crudMethod: { ...crudServer }})
|
||||
},
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
data() {
|
||||
return {
|
||||
accountList: [],
|
||||
accountMap: {},
|
||||
loading: false,
|
||||
permission: {
|
||||
add: ['admin', 'serverDeploy:add'],
|
||||
edit: ['admin', 'serverDeploy:edit'],
|
||||
del: ['admin', 'serverDeploy:del']
|
||||
},
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: '请输入名称', trigger: 'blur' }
|
||||
],
|
||||
ip: [
|
||||
{ required: true, message: '请输入IP', trigger: 'blur' },
|
||||
{ validator: validateIP, trigger: 'change' }
|
||||
],
|
||||
port: [
|
||||
{ required: true, message: '请输入端口', trigger: 'blur', type: 'number' }
|
||||
],
|
||||
account: [
|
||||
{ required: true, message: '请输入账号', trigger: 'blur' }
|
||||
],
|
||||
password: [
|
||||
{ required: true, message: '请输入密码', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
testConnectServer() {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true
|
||||
testServerConnect(this.form).then((res) => {
|
||||
this.loading = false
|
||||
this.$notify({
|
||||
title: res ? '连接成功' : '连接失败',
|
||||
type: res ? 'success' : 'error',
|
||||
duration: 2500
|
||||
})
|
||||
}).catch(() => {
|
||||
this.loading = false
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style rel="stylesheet/scss" lang="scss" scoped>
|
||||
::v-deep .el-input-number .el-input__inner {
|
||||
text-align: left;
|
||||
}
|
||||
</style>
|
@ -1,7 +1,7 @@
|
||||
<h1 style="text-align: center">ELADMIN 后台管理系统</h1>
|
||||
|
||||
#### 项目简介
|
||||
一个基于 Spring Boot 2.6.4 、 Mybatis-Plus、 JWT、Spring Security、Redis、Vue的前后端分离的后台管理系统
|
||||
一个基于 Spring Boot 2.6.6 、 Mybatis-Plus、 JWT、Spring Security、Redis、Vue的前后端分离的后台管理系统
|
||||
|
||||
**开发文档:** [https://eladmin.vip](https://eladmin.vip)
|
||||
|
||||
@ -33,7 +33,6 @@
|
||||
- 对一些常用地前端组件封装:表格数据请求、数据字典等
|
||||
- 前后端统一异常拦截处理,统一输出异常,避免繁琐的判断
|
||||
- 支持在线用户管理与服务器性能监控,支持限制单用户登录
|
||||
- 支持运维管理,可方便地对远程服务器的应用进行部署与管理
|
||||
|
||||
#### 系统功能
|
||||
- 用户管理:提供用户的相关配置,新增用户后,默认密码为123456
|
||||
@ -50,7 +49,6 @@
|
||||
- 七牛云存储:可同步七牛云存储的数据到系统,无需登录七牛云直接操作云数据
|
||||
- 支付宝支付:整合了支付宝支付并且提供了测试账号,可自行测试
|
||||
- 服务监控:监控服务器的负载情况
|
||||
- 运维管理:一键部署你的应用
|
||||
|
||||
#### 项目结构
|
||||
项目采用按功能分模块的开发方式,结构如下
|
||||
@ -72,15 +70,30 @@
|
||||
- annotation 为系统自定义注解
|
||||
- aspect 自定义注解的切面
|
||||
- base 提供了 Entity 基类
|
||||
- config 自定义权限实现、redis配置、swagger配置、Rsa配置等
|
||||
- config 项目通用配置
|
||||
- Mybatis-Plus 配置
|
||||
- Web配置跨域与静态资源映射、Swagger配置,文件上传临时路径配置
|
||||
- Redis配置,Redission配置, 异步线程池配置
|
||||
- 权限拦截配置:AuthorityConfig、Druid 删除广告配置
|
||||
- exception 项目统一异常的处理
|
||||
- utils 系统通用工具类
|
||||
- utils 系统通用工具类,列举一些常用的工具类
|
||||
- BigDecimaUtils 金额计算工具类
|
||||
- RequestHolder 请求工具类
|
||||
- SecurityUtils 安全工具类
|
||||
- StringUtils 字符串工具类
|
||||
- SpringBeanHolder Spring Bean工具类
|
||||
- RedisUtils Redis工具类
|
||||
- EncryptUtils 加密工具类
|
||||
- FileUtil 文件工具类
|
||||
- eladmin-system 系统核心模块(系统启动入口)
|
||||
- config 配置跨域与静态资源,与数据权限
|
||||
- thread 线程池相关
|
||||
- modules 系统相关模块(登录授权、系统监控、定时任务、运维管理等)
|
||||
- sysrunner 程序启动后处理数据
|
||||
- modules 系统相关模块(登录授权、系统监控、定时任务、系统模块)
|
||||
- eladmin-logging 系统日志模块
|
||||
- eladmin-tools 系统第三方工具模块
|
||||
- email 邮件工具
|
||||
- qiniu 七牛云存储工具
|
||||
- alipay 支付宝支付工具
|
||||
- local-storage 本地存储工具
|
||||
- eladmin-generator 系统代码生成模块
|
||||
```
|
||||
|
||||
@ -90,8 +103,6 @@
|
||||
|
||||
- 感谢 [Moxun](https://github.com/moxun1639) 大佬提供的前端 Curd 通用组件
|
||||
|
||||
- 感谢 [zhy6599](https://gitee.com/zhy6599) 大佬提供的后端运维管理相关功能
|
||||
|
||||
- 感谢 [j.yao.SUSE](https://github.com/everhopingandwaiting) 大佬提供的匿名接口与Redis限流等功能
|
||||
|
||||
#### 项目捐赠
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019-2023 Zheng Jie
|
||||
* Copyright 2019-2025 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019-2023 Zheng Jie
|
||||
* Copyright 2019-2025 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,33 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* 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 me.zhengjie.config.webConfig;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
|
||||
|
||||
/**
|
||||
* @author ZhangHouYing
|
||||
* @date 2019-08-24 15:44
|
||||
*/
|
||||
@Configuration
|
||||
public class WebSocketConfig {
|
||||
|
||||
@Bean
|
||||
public ServerEndpointExporter serverEndpointExporter() {
|
||||
return new ServerEndpointExporter();
|
||||
}
|
||||
}
|
@ -32,7 +32,7 @@ import java.io.Serializable;
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@TableName("code_column_config")
|
||||
@TableName("code_column")
|
||||
public class ColumnInfo implements Serializable {
|
||||
|
||||
@ApiModelProperty(value = "ID", hidden = true)
|
||||
|
@ -34,7 +34,7 @@ import java.io.Serializable;
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@TableName("code_gen_config")
|
||||
@TableName("code_config")
|
||||
public class GenConfig implements Serializable {
|
||||
|
||||
public GenConfig(String tableName) {
|
||||
|
@ -32,7 +32,7 @@
|
||||
<select id="findByTableNameOrderByIdAsc" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from code_column_config
|
||||
from code_column
|
||||
where table_name = #{tableName}
|
||||
order by column_id
|
||||
</select>
|
||||
|
@ -21,7 +21,7 @@
|
||||
<select id="findByTableName" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM code_gen_config
|
||||
FROM code_config
|
||||
WHERE table_name = #{tableName}
|
||||
</select>
|
||||
</mapper>
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019-2023 Zheng Jie
|
||||
* Copyright 2019-2025 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019-2023 Zheng Jie
|
||||
* Copyright 2019-2025 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019-2023 Zheng Jie
|
||||
* Copyright 2019-2025 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019-2023 Zheng Jie
|
||||
* Copyright 2019-2025 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019-2023 Zheng Jie
|
||||
* Copyright 2019-2025 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019-2023 Zheng Jie
|
||||
* Copyright 2019-2025 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019-2023 Zheng Jie
|
||||
* Copyright 2019-2025 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -62,18 +62,6 @@
|
||||
<version>${jjwt.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- linux的管理 -->
|
||||
<dependency>
|
||||
<groupId>ch.ethz.ganymed</groupId>
|
||||
<artifactId>ganymed-ssh2</artifactId>
|
||||
<version>build210</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jcraft</groupId>
|
||||
<artifactId>jsch</artifactId>
|
||||
<version>0.1.55</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 获取系统信息 -->
|
||||
<dependency>
|
||||
<groupId>com.github.oshi</groupId>
|
||||
|
@ -1,67 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* 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 me.zhengjie.modules.mnt.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import me.zhengjie.base.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author zhanghouying
|
||||
* @date 2019-08-24
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("mnt_app")
|
||||
public class App extends BaseEntity implements Serializable {
|
||||
|
||||
|
||||
@TableId(value = "app_id", type = IdType.AUTO)
|
||||
@ApiModelProperty(value = "ID", hidden = true)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "端口")
|
||||
private int port;
|
||||
|
||||
@ApiModelProperty(value = "上传路径")
|
||||
private String uploadPath;
|
||||
|
||||
@ApiModelProperty(value = "部署路径")
|
||||
private String deployPath;
|
||||
|
||||
@ApiModelProperty(value = "备份路径")
|
||||
private String backupPath;
|
||||
|
||||
@ApiModelProperty(value = "启动脚本")
|
||||
private String startScript;
|
||||
|
||||
@ApiModelProperty(value = "部署脚本")
|
||||
private String deployScript;
|
||||
|
||||
public void copy(App source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* 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 me.zhengjie.modules.mnt.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import me.zhengjie.base.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author zhanghouying
|
||||
* @date 2019-08-24
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("mnt_database")
|
||||
public class Database extends BaseEntity implements Serializable {
|
||||
|
||||
@TableId(value = "db_id", type = IdType.AUTO)
|
||||
@ApiModelProperty(value = "ID", hidden = true)
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "数据库名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "数据库连接地址")
|
||||
private String jdbcUrl;
|
||||
|
||||
@ApiModelProperty(value = "数据库密码")
|
||||
private String pwd;
|
||||
|
||||
@ApiModelProperty(value = "用户名")
|
||||
private String userName;
|
||||
|
||||
public void copy(Database source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
}
|
@ -1,68 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* 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 me.zhengjie.modules.mnt.domain;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import me.zhengjie.base.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author zhanghouying
|
||||
* @date 2019-08-24
|
||||
*/
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("mnt_deploy")
|
||||
public class Deploy extends BaseEntity implements Serializable {
|
||||
|
||||
@TableId(value = "deploy_id", type = IdType.AUTO)
|
||||
@ApiModelProperty(value = "ID", hidden = true)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "应用编号")
|
||||
private Long appId;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(name = "服务器", hidden = true)
|
||||
private Set<Server> deploys;
|
||||
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "应用")
|
||||
private App app;
|
||||
|
||||
public void copy(Deploy source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
|
||||
public String getServers() {
|
||||
if(CollectionUtil.isNotEmpty(deploys)){
|
||||
return deploys.stream().map(Server::getName).collect(Collectors.joining(","));
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
@ -1,60 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* 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 me.zhengjie.modules.mnt.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import java.io.Serializable;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
/**
|
||||
* @author zhanghouying
|
||||
* @date 2019-08-24
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("mnt_deploy_history")
|
||||
public class DeployHistory implements Serializable {
|
||||
|
||||
@TableId(value = "history_id", type = IdType.AUTO)
|
||||
@ApiModelProperty(value = "ID", hidden = true)
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "应用名称")
|
||||
private String appName;
|
||||
|
||||
@ApiModelProperty(value = "IP")
|
||||
private String ip;
|
||||
|
||||
@ApiModelProperty(value = "部署时间")
|
||||
private Timestamp deployDate;
|
||||
|
||||
@ApiModelProperty(value = "部署者")
|
||||
private String deployUser;
|
||||
|
||||
@ApiModelProperty(value = "部署ID")
|
||||
private Long deployId;
|
||||
|
||||
public void copy(DeployHistory source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
}
|
@ -1,79 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* 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 me.zhengjie.modules.mnt.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import me.zhengjie.base.BaseEntity;
|
||||
import java.io.Serializable;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author zhanghouying
|
||||
* @date 2019-08-24
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@TableName("mnt_server")
|
||||
public class Server extends BaseEntity implements Serializable {
|
||||
|
||||
@TableId(value = "server_id", type = IdType.AUTO)
|
||||
@ApiModelProperty(value = "ID", hidden = true)
|
||||
private Long id;
|
||||
|
||||
@ApiModelProperty(value = "服务器名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "IP")
|
||||
private String ip;
|
||||
|
||||
@ApiModelProperty(value = "端口")
|
||||
private Integer port;
|
||||
|
||||
@ApiModelProperty(value = "账号")
|
||||
private String account;
|
||||
|
||||
@ApiModelProperty(value = "密码")
|
||||
private String password;
|
||||
|
||||
public void copy(Server source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
Server that = (Server) o;
|
||||
return Objects.equals(id, that.id) &&
|
||||
Objects.equals(name, that.name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(id, name);
|
||||
}
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* 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 me.zhengjie.modules.mnt.domain.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhanghouying
|
||||
* @date 2019-08-24
|
||||
*/
|
||||
@Data
|
||||
public class AppQueryCriteria{
|
||||
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private List<Timestamp> createTime;
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* 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 me.zhengjie.modules.mnt.domain.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhanghouying
|
||||
* @date 2019-08-24
|
||||
*/
|
||||
@Data
|
||||
public class DatabaseQueryCriteria{
|
||||
|
||||
@ApiModelProperty(value = "名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "数据源")
|
||||
private String jdbcUrl;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private List<Timestamp> createTime;
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* 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 me.zhengjie.modules.mnt.domain.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhanghouying
|
||||
* @date 2019-08-24
|
||||
*/
|
||||
@Data
|
||||
public class DeployHistoryQueryCriteria{
|
||||
|
||||
@ApiModelProperty(value = "模糊查询")
|
||||
private String blurry;
|
||||
|
||||
@ApiModelProperty(value = "部署ID")
|
||||
private Long deployId;
|
||||
|
||||
@ApiModelProperty(value = "部署时间")
|
||||
private List<Timestamp> deployDate;
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* 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 me.zhengjie.modules.mnt.domain.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhanghouying
|
||||
* @date 2019-08-24
|
||||
*/
|
||||
@Data
|
||||
public class DeployQueryCriteria{
|
||||
|
||||
@ApiModelProperty(value = "应用名称")
|
||||
private String appName;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private List<Timestamp> createTime;
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* 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 me.zhengjie.modules.mnt.domain.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author zhanghouying
|
||||
* @date 2019-08-24
|
||||
*/
|
||||
@Data
|
||||
public class ServerQueryCriteria {
|
||||
|
||||
@ApiModelProperty(value = "模糊查询")
|
||||
private String blurry;
|
||||
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private List<Timestamp> createTime;
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2023 Zheng Jie
|
||||
*
|
||||
* 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 me.zhengjie.modules.mnt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import me.zhengjie.modules.mnt.domain.App;
|
||||
import me.zhengjie.modules.mnt.domain.dto.AppQueryCriteria;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Zheng Jie
|
||||
* @description
|
||||
* @date 2023-06-12
|
||||
**/
|
||||
@Mapper
|
||||
public interface AppMapper extends BaseMapper<App> {
|
||||
|
||||
IPage<App> queryAll(@Param("criteria") AppQueryCriteria criteria, Page<Object> page);
|
||||
|
||||
List<App> queryAll(@Param("criteria") AppQueryCriteria criteria);
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2023 Zheng Jie
|
||||
*
|
||||
* 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 me.zhengjie.modules.mnt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import me.zhengjie.modules.mnt.domain.Database;
|
||||
import me.zhengjie.modules.mnt.domain.dto.DatabaseQueryCriteria;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Zheng Jie
|
||||
* @description
|
||||
* @date 2023-06-12
|
||||
**/
|
||||
@Mapper
|
||||
public interface DatabaseMapper extends BaseMapper<Database> {
|
||||
|
||||
IPage<Database> findAll(@Param("criteria") DatabaseQueryCriteria criteria, Page<Object> page);
|
||||
|
||||
List<Database> findAll(@Param("criteria") DatabaseQueryCriteria criteria);
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2023 Zheng Jie
|
||||
*
|
||||
* 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 me.zhengjie.modules.mnt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import me.zhengjie.modules.mnt.domain.DeployHistory;
|
||||
import me.zhengjie.modules.mnt.domain.dto.DeployHistoryQueryCriteria;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Zheng Jie
|
||||
* @description
|
||||
* @date 2023-06-12
|
||||
**/
|
||||
@Mapper
|
||||
public interface DeployHistoryMapper extends BaseMapper<DeployHistory> {
|
||||
|
||||
IPage<DeployHistory> findAll(@Param("criteria") DeployHistoryQueryCriteria criteria, Page<Object> page);
|
||||
|
||||
List<DeployHistory> findAll(@Param("criteria") DeployHistoryQueryCriteria criteria);
|
||||
}
|
@ -1,44 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2023 Zheng Jie
|
||||
*
|
||||
* 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 me.zhengjie.modules.mnt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import me.zhengjie.modules.mnt.domain.Deploy;
|
||||
import me.zhengjie.modules.mnt.domain.dto.DeployQueryCriteria;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author Zheng Jie
|
||||
* @description
|
||||
* @date 2023-06-12
|
||||
**/
|
||||
@Mapper
|
||||
public interface DeployMapper extends BaseMapper<Deploy> {
|
||||
|
||||
List<Deploy> findAll(@Param("criteria") DeployQueryCriteria criteria);
|
||||
|
||||
IPage<Deploy> findAll(@Param("criteria") DeployQueryCriteria criteria, Page<Object> page);
|
||||
|
||||
Set<Long> getIdByAppIds(@Param("appIds") Set<Long> appIds);
|
||||
|
||||
Deploy getDeployById(@Param("deployId") Long deployId);
|
||||
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2023 Zheng Jie
|
||||
*
|
||||
* 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 me.zhengjie.modules.mnt.mapper;
|
||||
|
||||
import me.zhengjie.modules.mnt.domain.Server;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author Zheng Jie
|
||||
* @description
|
||||
* @date 2023-06-12
|
||||
**/
|
||||
@Mapper
|
||||
public interface DeployServerMapper {
|
||||
|
||||
void insertData(@Param("deployId") Long deployId, @Param("servers") Set<Server> servers);
|
||||
|
||||
void deleteByDeployId(@Param("deployId") Long deployId);
|
||||
|
||||
void deleteByDeployIds(@Param("deployIds") Set<Long> deployIds);
|
||||
|
||||
void deleteByServerIds(@Param("serverIds") Set<Long> serverIds);
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2023 Zheng Jie
|
||||
*
|
||||
* 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 me.zhengjie.modules.mnt.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import me.zhengjie.modules.mnt.domain.Server;
|
||||
import me.zhengjie.modules.mnt.domain.dto.ServerQueryCriteria;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Zheng Jie
|
||||
* @description
|
||||
* @date 2023-06-12
|
||||
**/
|
||||
@Mapper
|
||||
public interface ServerMapper extends BaseMapper<Server> {
|
||||
Server findByIp(@Param("ip") String ip);
|
||||
|
||||
IPage<Server> findAll(@Param("criteria") ServerQueryCriteria criteria, Page<Object> page);
|
||||
|
||||
List<Server> findAll(@Param("criteria") ServerQueryCriteria criteria);
|
||||
}
|
@ -1,88 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* 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 me.zhengjie.modules.mnt.rest;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import me.zhengjie.annotation.Log;
|
||||
import me.zhengjie.modules.mnt.domain.App;
|
||||
import me.zhengjie.modules.mnt.service.AppService;
|
||||
import me.zhengjie.modules.mnt.domain.dto.AppQueryCriteria;
|
||||
import me.zhengjie.utils.PageResult;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author zhanghouying
|
||||
* @date 2019-08-24
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "运维:应用管理")
|
||||
@RequestMapping("/api/app")
|
||||
public class AppController {
|
||||
|
||||
private final AppService appService;
|
||||
|
||||
@ApiOperation("导出应用数据")
|
||||
@GetMapping(value = "/download")
|
||||
@PreAuthorize("@el.check('app:list')")
|
||||
public void exportApp(HttpServletResponse response, AppQueryCriteria criteria) throws IOException {
|
||||
appService.download(appService.queryAll(criteria), response);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询应用")
|
||||
@GetMapping
|
||||
@PreAuthorize("@el.check('app:list')")
|
||||
public ResponseEntity<PageResult<App>> queryApp(AppQueryCriteria criteria, Page<Object> page){
|
||||
return new ResponseEntity<>(appService.queryAll(criteria, page),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("新增应用")
|
||||
@ApiOperation(value = "新增应用")
|
||||
@PostMapping
|
||||
@PreAuthorize("@el.check('app:add')")
|
||||
public ResponseEntity<Object> createApp(@Validated @RequestBody App resources){
|
||||
appService.create(resources);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@Log("修改应用")
|
||||
@ApiOperation(value = "修改应用")
|
||||
@PutMapping
|
||||
@PreAuthorize("@el.check('app:edit')")
|
||||
public ResponseEntity<Object> updateApp(@Validated @RequestBody App resources){
|
||||
appService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除应用")
|
||||
@ApiOperation(value = "删除应用")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@el.check('app:del')")
|
||||
public ResponseEntity<Object> deleteApp(@RequestBody Set<Long> ids){
|
||||
appService.delete(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
@ -1,123 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* 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 me.zhengjie.modules.mnt.rest;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import me.zhengjie.annotation.Log;
|
||||
import me.zhengjie.exception.BadRequestException;
|
||||
import me.zhengjie.modules.mnt.domain.Database;
|
||||
import me.zhengjie.modules.mnt.service.DatabaseService;
|
||||
import me.zhengjie.modules.mnt.domain.dto.DatabaseQueryCriteria;
|
||||
import me.zhengjie.modules.mnt.util.SqlUtils;
|
||||
import me.zhengjie.utils.FileUtil;
|
||||
import me.zhengjie.utils.PageResult;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author zhanghouying
|
||||
* @date 2019-08-24
|
||||
*/
|
||||
@Api(tags = "运维:数据库管理")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/database")
|
||||
public class DatabaseController {
|
||||
|
||||
private final String fileSavePath = FileUtil.getTmpDirPath()+"/";
|
||||
private final DatabaseService databaseService;
|
||||
|
||||
@ApiOperation("导出数据库数据")
|
||||
@GetMapping(value = "/download")
|
||||
@PreAuthorize("@el.check('database:list')")
|
||||
public void exportDatabase(HttpServletResponse response, DatabaseQueryCriteria criteria) throws IOException {
|
||||
databaseService.download(databaseService.queryAll(criteria), response);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询数据库")
|
||||
@GetMapping
|
||||
@PreAuthorize("@el.check('database:list')")
|
||||
public ResponseEntity<PageResult<Database>> queryDatabase(DatabaseQueryCriteria criteria, Page<Object> page){
|
||||
return new ResponseEntity<>(databaseService.queryAll(criteria, page),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("新增数据库")
|
||||
@ApiOperation(value = "新增数据库")
|
||||
@PostMapping
|
||||
@PreAuthorize("@el.check('database:add')")
|
||||
public ResponseEntity<Object> createDatabase(@Validated @RequestBody Database resources){
|
||||
databaseService.create(resources);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@Log("修改数据库")
|
||||
@ApiOperation(value = "修改数据库")
|
||||
@PutMapping
|
||||
@PreAuthorize("@el.check('database:edit')")
|
||||
public ResponseEntity<Object> updateDatabase(@Validated @RequestBody Database resources){
|
||||
databaseService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除数据库")
|
||||
@ApiOperation(value = "删除数据库")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@el.check('database:del')")
|
||||
public ResponseEntity<Object> deleteDatabase(@RequestBody Set<String> ids){
|
||||
databaseService.delete(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("测试数据库链接")
|
||||
@ApiOperation(value = "测试数据库链接")
|
||||
@PostMapping("/testConnect")
|
||||
@PreAuthorize("@el.check('database:testConnect')")
|
||||
public ResponseEntity<Object> testConnect(@Validated @RequestBody Database resources){
|
||||
return new ResponseEntity<>(databaseService.testConnection(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@Log("执行SQL脚本")
|
||||
@ApiOperation(value = "执行SQL脚本")
|
||||
@PostMapping(value = "/upload")
|
||||
@PreAuthorize("@el.check('database:add')")
|
||||
public ResponseEntity<Object> uploadDatabase(@RequestBody MultipartFile file, HttpServletRequest request)throws Exception{
|
||||
String id = request.getParameter("id");
|
||||
Database database = databaseService.getById(id);
|
||||
String fileName;
|
||||
if(database != null){
|
||||
fileName = file.getOriginalFilename();
|
||||
File executeFile = new File(fileSavePath+fileName);
|
||||
FileUtil.del(executeFile);
|
||||
file.transferTo(executeFile);
|
||||
String result = SqlUtils.executeFile(database.getJdbcUrl(), database.getUserName(), database.getPwd(), executeFile);
|
||||
return new ResponseEntity<>(result,HttpStatus.OK);
|
||||
}else{
|
||||
throw new BadRequestException("Database not exist");
|
||||
}
|
||||
}
|
||||
}
|
@ -1,157 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* 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 me.zhengjie.modules.mnt.rest;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import me.zhengjie.annotation.Log;
|
||||
import me.zhengjie.modules.mnt.domain.Deploy;
|
||||
import me.zhengjie.modules.mnt.domain.DeployHistory;
|
||||
import me.zhengjie.modules.mnt.service.DeployService;
|
||||
import me.zhengjie.modules.mnt.domain.dto.DeployQueryCriteria;
|
||||
import me.zhengjie.utils.FileUtil;
|
||||
import me.zhengjie.utils.PageResult;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author zhanghouying
|
||||
* @date 2019-08-24
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "运维:部署管理")
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/deploy")
|
||||
public class DeployController {
|
||||
|
||||
private final String fileSavePath = FileUtil.getTmpDirPath()+"/";
|
||||
private final DeployService deployService;
|
||||
|
||||
@ApiOperation("导出部署数据")
|
||||
@GetMapping(value = "/download")
|
||||
@PreAuthorize("@el.check('database:list')")
|
||||
public void exportDeployData(HttpServletResponse response, DeployQueryCriteria criteria) throws IOException {
|
||||
deployService.download(deployService.queryAll(criteria), response);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询部署")
|
||||
@GetMapping
|
||||
@PreAuthorize("@el.check('deploy:list')")
|
||||
public ResponseEntity<PageResult<Deploy>> queryDeployData(DeployQueryCriteria criteria, Page<Object> page){
|
||||
return new ResponseEntity<>(deployService.queryAll(criteria, page),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("新增部署")
|
||||
@ApiOperation(value = "新增部署")
|
||||
@PostMapping
|
||||
@PreAuthorize("@el.check('deploy:add')")
|
||||
public ResponseEntity<Object> createDeploy(@Validated @RequestBody Deploy resources){
|
||||
deployService.create(resources);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@Log("修改部署")
|
||||
@ApiOperation(value = "修改部署")
|
||||
@PutMapping
|
||||
@PreAuthorize("@el.check('deploy:edit')")
|
||||
public ResponseEntity<Object> updateDeploy(@Validated @RequestBody Deploy resources){
|
||||
deployService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除部署")
|
||||
@ApiOperation(value = "删除部署")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@el.check('deploy:del')")
|
||||
public ResponseEntity<Object> deleteDeploy(@RequestBody Set<Long> ids){
|
||||
deployService.delete(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("上传文件部署")
|
||||
@ApiOperation(value = "上传文件部署")
|
||||
@PostMapping(value = "/upload")
|
||||
@PreAuthorize("@el.check('deploy:edit')")
|
||||
public ResponseEntity<Object> uploadDeploy(@RequestBody MultipartFile file, HttpServletRequest request)throws Exception{
|
||||
Long id = Long.valueOf(request.getParameter("id"));
|
||||
String fileName = "";
|
||||
if(file != null){
|
||||
fileName = file.getOriginalFilename();
|
||||
File deployFile = new File(fileSavePath+fileName);
|
||||
FileUtil.del(deployFile);
|
||||
file.transferTo(deployFile);
|
||||
//文件下一步要根据文件名字来
|
||||
deployService.deploy(fileSavePath+fileName ,id);
|
||||
}else{
|
||||
System.out.println("没有找到相对应的文件");
|
||||
}
|
||||
System.out.println("文件上传的原名称为:"+ Objects.requireNonNull(file).getOriginalFilename());
|
||||
Map<String,Object> map = new HashMap<>(2);
|
||||
map.put("errno",0);
|
||||
map.put("id",fileName);
|
||||
return new ResponseEntity<>(map,HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("系统还原")
|
||||
@ApiOperation(value = "系统还原")
|
||||
@PostMapping(value = "/serverReduction")
|
||||
@PreAuthorize("@el.check('deploy:edit')")
|
||||
public ResponseEntity<String> serverReduction(@Validated @RequestBody DeployHistory resources){
|
||||
String result = deployService.serverReduction(resources);
|
||||
return new ResponseEntity<>(result,HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("服务运行状态")
|
||||
@ApiOperation(value = "服务运行状态")
|
||||
@PostMapping(value = "/serverStatus")
|
||||
@PreAuthorize("@el.check('deploy:edit')")
|
||||
public ResponseEntity<String> serverStatus(@Validated @RequestBody Deploy resources){
|
||||
String result = deployService.serverStatus(resources);
|
||||
return new ResponseEntity<>(result,HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("启动服务")
|
||||
@ApiOperation(value = "启动服务")
|
||||
@PostMapping(value = "/startServer")
|
||||
@PreAuthorize("@el.check('deploy:edit')")
|
||||
public ResponseEntity<String> startServer(@Validated @RequestBody Deploy resources){
|
||||
String result = deployService.startServer(resources);
|
||||
return new ResponseEntity<>(result,HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("停止服务")
|
||||
@ApiOperation(value = "停止服务")
|
||||
@PostMapping(value = "/stopServer")
|
||||
@PreAuthorize("@el.check('deploy:edit')")
|
||||
public ResponseEntity<String> stopServer(@Validated @RequestBody Deploy resources){
|
||||
String result = deployService.stopServer(resources);
|
||||
return new ResponseEntity<>(result,HttpStatus.OK);
|
||||
}
|
||||
}
|
@ -1,69 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* 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 me.zhengjie.modules.mnt.rest;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import me.zhengjie.annotation.Log;
|
||||
import me.zhengjie.modules.mnt.domain.DeployHistory;
|
||||
import me.zhengjie.modules.mnt.service.DeployHistoryService;
|
||||
import me.zhengjie.modules.mnt.domain.dto.DeployHistoryQueryCriteria;
|
||||
import me.zhengjie.utils.PageResult;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author zhanghouying
|
||||
* @date 2019-08-24
|
||||
*/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "运维:部署历史管理")
|
||||
@RequestMapping("/api/deployHistory")
|
||||
public class DeployHistoryController {
|
||||
|
||||
private final DeployHistoryService deployhistoryService;
|
||||
|
||||
@ApiOperation("导出部署历史数据")
|
||||
@GetMapping(value = "/download")
|
||||
@PreAuthorize("@el.check('deployHistory:list')")
|
||||
public void exportDeployHistory(HttpServletResponse response, DeployHistoryQueryCriteria criteria) throws IOException {
|
||||
deployhistoryService.download(deployhistoryService.queryAll(criteria), response);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询部署历史")
|
||||
@GetMapping
|
||||
@PreAuthorize("@el.check('deployHistory:list')")
|
||||
public ResponseEntity<PageResult<DeployHistory>> queryDeployHistory(DeployHistoryQueryCriteria criteria, Page<Object> page){
|
||||
return new ResponseEntity<>(deployhistoryService.queryAll(criteria, page),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("删除DeployHistory")
|
||||
@ApiOperation(value = "删除部署历史")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@el.check('deployHistory:del')")
|
||||
public ResponseEntity<Object> deleteDeployHistory(@RequestBody Set<String> ids){
|
||||
deployhistoryService.delete(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
@ -1,96 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* 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 me.zhengjie.modules.mnt.rest;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import me.zhengjie.annotation.Log;
|
||||
import me.zhengjie.modules.mnt.domain.Server;
|
||||
import me.zhengjie.modules.mnt.service.ServerService;
|
||||
import me.zhengjie.modules.mnt.domain.dto.ServerQueryCriteria;
|
||||
import me.zhengjie.utils.PageResult;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author zhanghouying
|
||||
* @date 2019-08-24
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "运维:服务器管理")
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/serverDeploy")
|
||||
public class ServerController {
|
||||
|
||||
private final ServerService serverService;
|
||||
|
||||
@ApiOperation("导出服务器数据")
|
||||
@GetMapping(value = "/download")
|
||||
@PreAuthorize("@el.check('serverDeploy:list')")
|
||||
public void exportServerDeploy(HttpServletResponse response, ServerQueryCriteria criteria) throws IOException {
|
||||
serverService.download(serverService.queryAll(criteria), response);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "查询服务器")
|
||||
@GetMapping
|
||||
@PreAuthorize("@el.check('serverDeploy:list')")
|
||||
public ResponseEntity<PageResult<Server>> queryServerDeploy(ServerQueryCriteria criteria, Page<Object> page){
|
||||
return new ResponseEntity<>(serverService.queryAll(criteria, page),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("新增服务器")
|
||||
@ApiOperation(value = "新增服务器")
|
||||
@PostMapping
|
||||
@PreAuthorize("@el.check('serverDeploy:add')")
|
||||
public ResponseEntity<Object> createServerDeploy(@Validated @RequestBody Server resources){
|
||||
serverService.create(resources);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@Log("修改服务器")
|
||||
@ApiOperation(value = "修改服务器")
|
||||
@PutMapping
|
||||
@PreAuthorize("@el.check('serverDeploy:edit')")
|
||||
public ResponseEntity<Object> updateServerDeploy(@Validated @RequestBody Server resources){
|
||||
serverService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除服务器")
|
||||
@ApiOperation(value = "删除Server")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@el.check('serverDeploy:del')")
|
||||
public ResponseEntity<Object> deleteServerDeploy(@RequestBody Set<Long> ids){
|
||||
serverService.delete(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("测试连接服务器")
|
||||
@ApiOperation(value = "测试连接服务器")
|
||||
@PostMapping("/testConnect")
|
||||
@PreAuthorize("@el.check('serverDeploy:add')")
|
||||
public ResponseEntity<Object> testConnectServerDeploy(@Validated @RequestBody Server resources){
|
||||
return new ResponseEntity<>(serverService.testConnect(resources),HttpStatus.CREATED);
|
||||
}
|
||||
}
|
@ -1,76 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* 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 me.zhengjie.modules.mnt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import me.zhengjie.modules.mnt.domain.App;
|
||||
import me.zhengjie.modules.mnt.domain.dto.AppQueryCriteria;
|
||||
import me.zhengjie.utils.PageResult;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author zhanghouying
|
||||
* @date 2019-08-24
|
||||
*/
|
||||
public interface AppService extends IService<App> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param criteria 条件
|
||||
* @param page 分页参数
|
||||
* @return /
|
||||
*/
|
||||
PageResult<App> queryAll(AppQueryCriteria criteria, Page<Object> page);
|
||||
|
||||
/**
|
||||
* 查询全部数据
|
||||
*
|
||||
* @param criteria 条件
|
||||
* @return /
|
||||
*/
|
||||
List<App> queryAll(AppQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param resources /
|
||||
*/
|
||||
void create(App resources);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param resources /
|
||||
*/
|
||||
void update(App resources);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param ids /
|
||||
*/
|
||||
void delete(Set<Long> ids);
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
* @param apps /
|
||||
* @param response /
|
||||
* @throws IOException /
|
||||
*/
|
||||
void download(List<App> apps, HttpServletResponse response) throws IOException;
|
||||
}
|
@ -1,83 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* 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 me.zhengjie.modules.mnt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import me.zhengjie.modules.mnt.domain.Database;
|
||||
import me.zhengjie.modules.mnt.domain.dto.DatabaseQueryCriteria;
|
||||
import me.zhengjie.utils.PageResult;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author ZhangHouYing
|
||||
* @date 2019-08-24
|
||||
*/
|
||||
public interface DatabaseService extends IService<Database> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param criteria 条件
|
||||
* @param page 分页参数
|
||||
* @return /
|
||||
*/
|
||||
PageResult<Database> queryAll(DatabaseQueryCriteria criteria, Page<Object> page);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
* @param criteria 条件
|
||||
* @return /
|
||||
*/
|
||||
List<Database> queryAll(DatabaseQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param resources /
|
||||
*/
|
||||
void create(Database resources);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param resources /
|
||||
*/
|
||||
void update(Database resources);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param ids /
|
||||
*/
|
||||
void delete(Set<String> ids);
|
||||
|
||||
/**
|
||||
* 测试连接数据库
|
||||
* @param resources /
|
||||
* @return /
|
||||
*/
|
||||
boolean testConnection(Database resources);
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
* @param queryAll /
|
||||
* @param response /
|
||||
* @throws IOException e
|
||||
*/
|
||||
void download(List<Database> queryAll, HttpServletResponse response) throws IOException;
|
||||
}
|
@ -1,70 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* 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 me.zhengjie.modules.mnt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import me.zhengjie.modules.mnt.domain.DeployHistory;
|
||||
import me.zhengjie.modules.mnt.domain.dto.DeployHistoryQueryCriteria;
|
||||
import me.zhengjie.utils.PageResult;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author zhanghouying
|
||||
*/
|
||||
public interface DeployHistoryService extends IService<DeployHistory> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param criteria 条件
|
||||
* @param page 分页参数
|
||||
* @return /
|
||||
*/
|
||||
PageResult<DeployHistory> queryAll(DeployHistoryQueryCriteria criteria, Page<Object> page);
|
||||
|
||||
/**
|
||||
* 查询全部
|
||||
*
|
||||
* @param criteria 条件
|
||||
* @return /
|
||||
*/
|
||||
List<DeployHistory> queryAll(DeployHistoryQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param resources /
|
||||
*/
|
||||
void create(DeployHistory resources);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param ids /
|
||||
*/
|
||||
void delete(Set<String> ids);
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
* @param queryAll /
|
||||
* @param response /
|
||||
* @throws IOException /
|
||||
*/
|
||||
void download(List<DeployHistory> queryAll, HttpServletResponse response) throws IOException;
|
||||
}
|
@ -1,111 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* 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 me.zhengjie.modules.mnt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import me.zhengjie.modules.mnt.domain.Deploy;
|
||||
import me.zhengjie.modules.mnt.domain.DeployHistory;
|
||||
import me.zhengjie.modules.mnt.domain.dto.DeployQueryCriteria;
|
||||
import me.zhengjie.utils.PageResult;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author zhanghouying
|
||||
* @date 2019-08-24
|
||||
*/
|
||||
public interface DeployService extends IService<Deploy> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param criteria 条件
|
||||
* @param page 分页参数
|
||||
* @return /
|
||||
*/
|
||||
PageResult<Deploy> queryAll(DeployQueryCriteria criteria, Page<Object> page);
|
||||
|
||||
/**
|
||||
* 查询全部数据
|
||||
* @param criteria 条件
|
||||
* @return /
|
||||
*/
|
||||
List<Deploy> queryAll(DeployQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param resources /
|
||||
*/
|
||||
void create(Deploy resources);
|
||||
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param resources /
|
||||
*/
|
||||
void update(Deploy resources);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param ids /
|
||||
*/
|
||||
void delete(Set<Long> ids);
|
||||
|
||||
/**
|
||||
* 部署文件到服务器
|
||||
* @param fileSavePath 文件路径
|
||||
* @param appId 应用ID
|
||||
*/
|
||||
void deploy(String fileSavePath, Long appId);
|
||||
|
||||
/**
|
||||
* 查询部署状态
|
||||
* @param resources /
|
||||
* @return /
|
||||
*/
|
||||
String serverStatus(Deploy resources);
|
||||
/**
|
||||
* 启动服务
|
||||
* @param resources /
|
||||
* @return /
|
||||
*/
|
||||
String startServer(Deploy resources);
|
||||
/**
|
||||
* 停止服务
|
||||
* @param resources /
|
||||
* @return /
|
||||
*/
|
||||
String stopServer(Deploy resources);
|
||||
|
||||
/**
|
||||
* 停止服务
|
||||
* @param resources /
|
||||
* @return /
|
||||
*/
|
||||
String serverReduction(DeployHistory resources);
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
* @param queryAll /
|
||||
* @param response /
|
||||
* @throws IOException /
|
||||
*/
|
||||
void download(List<Deploy> queryAll, HttpServletResponse response) throws IOException;
|
||||
}
|
@ -1,91 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* 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 me.zhengjie.modules.mnt.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import me.zhengjie.modules.mnt.domain.Server;
|
||||
import me.zhengjie.modules.mnt.domain.dto.ServerQueryCriteria;
|
||||
import me.zhengjie.utils.PageResult;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author zhanghouying
|
||||
* @date 2019-08-24
|
||||
*/
|
||||
public interface ServerService extends IService<Server> {
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
* @param criteria 条件
|
||||
* @param page 分页参数
|
||||
* @return /
|
||||
*/
|
||||
PageResult<Server> queryAll(ServerQueryCriteria criteria, Page<Object> page);
|
||||
|
||||
/**
|
||||
* 查询全部数据
|
||||
* @param criteria 条件
|
||||
* @return /
|
||||
*/
|
||||
List<Server> queryAll(ServerQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param resources /
|
||||
*/
|
||||
void create(Server resources);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param resources /
|
||||
*/
|
||||
void update(Server resources);
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param ids /
|
||||
*/
|
||||
void delete(Set<Long> ids);
|
||||
|
||||
/**
|
||||
* 根据IP查询
|
||||
*
|
||||
* @param ip /
|
||||
* @return /
|
||||
*/
|
||||
Server findByIp(String ip);
|
||||
|
||||
/**
|
||||
* 测试登录服务器
|
||||
* @param resources /
|
||||
* @return /
|
||||
*/
|
||||
Boolean testConnect(Server resources);
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
* @param queryAll /
|
||||
* @param response /
|
||||
* @throws IOException /
|
||||
*/
|
||||
void download(List<Server> queryAll, HttpServletResponse response) throws IOException;
|
||||
}
|
@ -1,119 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* 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 me.zhengjie.modules.mnt.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import me.zhengjie.exception.BadRequestException;
|
||||
import me.zhengjie.modules.mnt.domain.App;
|
||||
import me.zhengjie.modules.mnt.mapper.AppMapper;
|
||||
import me.zhengjie.modules.mnt.mapper.DeployMapper;
|
||||
import me.zhengjie.modules.mnt.mapper.DeployServerMapper;
|
||||
import me.zhengjie.modules.mnt.service.AppService;
|
||||
import me.zhengjie.modules.mnt.domain.dto.AppQueryCriteria;
|
||||
import me.zhengjie.utils.FileUtil;
|
||||
import me.zhengjie.utils.PageResult;
|
||||
import me.zhengjie.utils.PageUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author zhanghouying
|
||||
* @date 2019-08-24
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class AppServiceImpl extends ServiceImpl<AppMapper, App> implements AppService {
|
||||
|
||||
private final AppMapper appMapper;
|
||||
private final DeployMapper deployMapper;
|
||||
private final DeployServerMapper deployServerMapper;
|
||||
|
||||
@Override
|
||||
public PageResult<App> queryAll(AppQueryCriteria criteria, Page<Object> page){
|
||||
return PageUtil.toPage(appMapper.queryAll(criteria, page));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<App> queryAll(AppQueryCriteria criteria){
|
||||
return appMapper.queryAll(criteria);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(App resources) {
|
||||
verification(resources);
|
||||
save(resources);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(App resources) {
|
||||
verification(resources);
|
||||
App app = getById(resources.getId());
|
||||
app.copy(resources);
|
||||
saveOrUpdate(app);
|
||||
}
|
||||
|
||||
private void verification(App resources){
|
||||
String opt = "/opt";
|
||||
String home = "/home";
|
||||
if (!(resources.getUploadPath().startsWith(opt) || resources.getUploadPath().startsWith(home))) {
|
||||
throw new BadRequestException("文件只能上传在opt目录或者home目录 ");
|
||||
}
|
||||
if (!(resources.getDeployPath().startsWith(opt) || resources.getDeployPath().startsWith(home))) {
|
||||
throw new BadRequestException("文件只能部署在opt目录或者home目录 ");
|
||||
}
|
||||
if (!(resources.getBackupPath().startsWith(opt) || resources.getBackupPath().startsWith(home))) {
|
||||
throw new BadRequestException("文件只能备份在opt目录或者home目录 ");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delete(Set<Long> ids) {
|
||||
// 删除应用
|
||||
removeBatchByIds(ids);
|
||||
// 删除部署
|
||||
Set<Long> deployIds = deployMapper.getIdByAppIds(ids);
|
||||
if(deployIds != null && deployIds.size() > 0){
|
||||
deployServerMapper.deleteByDeployIds(deployIds);
|
||||
deployMapper.deleteBatchIds(deployIds);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(List<App> apps, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (App app : apps) {
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
map.put("应用名称", app.getName());
|
||||
map.put("端口", app.getPort());
|
||||
map.put("上传目录", app.getUploadPath());
|
||||
map.put("部署目录", app.getDeployPath());
|
||||
map.put("备份目录", app.getBackupPath());
|
||||
map.put("启动脚本", app.getStartScript());
|
||||
map.put("部署脚本", app.getDeployScript());
|
||||
map.put("创建日期", app.getCreateTime());
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
}
|
@ -1,102 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* 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 me.zhengjie.modules.mnt.service.impl;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.zhengjie.modules.mnt.domain.Database;
|
||||
import me.zhengjie.modules.mnt.mapper.DatabaseMapper;
|
||||
import me.zhengjie.modules.mnt.service.DatabaseService;
|
||||
import me.zhengjie.modules.mnt.domain.dto.DatabaseQueryCriteria;
|
||||
import me.zhengjie.modules.mnt.util.SqlUtils;
|
||||
import me.zhengjie.utils.FileUtil;
|
||||
import me.zhengjie.utils.PageResult;
|
||||
import me.zhengjie.utils.PageUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author zhanghouying
|
||||
* @date 2019-08-24
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class DatabaseServiceImpl extends ServiceImpl<DatabaseMapper, Database> implements DatabaseService {
|
||||
|
||||
private final DatabaseMapper databaseMapper;
|
||||
|
||||
@Override
|
||||
public PageResult<Database> queryAll(DatabaseQueryCriteria criteria, Page<Object> page){
|
||||
return PageUtil.toPage(databaseMapper.findAll(criteria, page));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Database> queryAll(DatabaseQueryCriteria criteria){
|
||||
return databaseMapper.findAll(criteria);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(Database resources) {
|
||||
resources.setId(IdUtil.simpleUUID());
|
||||
save(resources);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(Database resources) {
|
||||
Database database = getById(resources.getId());
|
||||
database.copy(resources);
|
||||
saveOrUpdate(database);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delete(Set<String> ids) {
|
||||
removeBatchByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean testConnection(Database resources) {
|
||||
try {
|
||||
return SqlUtils.testConnection(resources.getJdbcUrl(), resources.getUserName(), resources.getPwd());
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(List<Database> databases, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (Database database : databases) {
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
map.put("数据库名称", database.getName());
|
||||
map.put("数据库连接地址", database.getJdbcUrl());
|
||||
map.put("用户名", database.getUserName());
|
||||
map.put("创建日期", database.getCreateTime());
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
}
|
@ -1,84 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* 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 me.zhengjie.modules.mnt.service.impl;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import me.zhengjie.modules.mnt.domain.DeployHistory;
|
||||
import me.zhengjie.modules.mnt.mapper.DeployHistoryMapper;
|
||||
import me.zhengjie.modules.mnt.service.DeployHistoryService;
|
||||
import me.zhengjie.modules.mnt.domain.dto.DeployHistoryQueryCriteria;
|
||||
import me.zhengjie.utils.DateUtil;
|
||||
import me.zhengjie.utils.FileUtil;
|
||||
import me.zhengjie.utils.PageResult;
|
||||
import me.zhengjie.utils.PageUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author zhanghouying
|
||||
* @date 2019-08-24
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class DeployHistoryServiceImpl extends ServiceImpl<DeployHistoryMapper, DeployHistory> implements DeployHistoryService {
|
||||
|
||||
private final DeployHistoryMapper deployhistoryMapper;
|
||||
|
||||
@Override
|
||||
public PageResult<DeployHistory> queryAll(DeployHistoryQueryCriteria criteria, Page<Object> page){
|
||||
return PageUtil.toPage(deployhistoryMapper.findAll(criteria, page));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DeployHistory> queryAll(DeployHistoryQueryCriteria criteria){
|
||||
return deployhistoryMapper.findAll(criteria);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(DeployHistory resources) {
|
||||
resources.setId(IdUtil.simpleUUID());
|
||||
resources.setDeployDate(DateUtil.getTimeStamp());
|
||||
save(resources);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delete(Set<String> ids) {
|
||||
removeBatchByIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(List<DeployHistory> deployHistories, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (DeployHistory deployHistory : deployHistories) {
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
map.put("部署编号", deployHistory.getDeployId());
|
||||
map.put("应用名称", deployHistory.getAppName());
|
||||
map.put("部署IP", deployHistory.getIp());
|
||||
map.put("部署时间", deployHistory.getDeployDate());
|
||||
map.put("部署人员", deployHistory.getDeployUser());
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
}
|
@ -1,424 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* 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 me.zhengjie.modules.mnt.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.zhengjie.exception.BadRequestException;
|
||||
import me.zhengjie.modules.mnt.domain.App;
|
||||
import me.zhengjie.modules.mnt.domain.Deploy;
|
||||
import me.zhengjie.modules.mnt.domain.DeployHistory;
|
||||
import me.zhengjie.modules.mnt.domain.Server;
|
||||
import me.zhengjie.modules.mnt.mapper.DeployMapper;
|
||||
import me.zhengjie.modules.mnt.mapper.DeployServerMapper;
|
||||
import me.zhengjie.modules.mnt.service.DeployHistoryService;
|
||||
import me.zhengjie.modules.mnt.service.DeployService;
|
||||
import me.zhengjie.modules.mnt.service.ServerService;
|
||||
import me.zhengjie.modules.mnt.domain.dto.DeployQueryCriteria;
|
||||
import me.zhengjie.modules.mnt.util.ExecuteShellUtil;
|
||||
import me.zhengjie.modules.mnt.util.ScpClientUtil;
|
||||
import me.zhengjie.modules.mnt.websocket.MsgType;
|
||||
import me.zhengjie.modules.mnt.websocket.SocketMsg;
|
||||
import me.zhengjie.modules.mnt.websocket.WebSocketServer;
|
||||
import me.zhengjie.utils.*;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author zhanghouying
|
||||
* @date 2019-08-24
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class DeployServiceImpl extends ServiceImpl<DeployMapper, Deploy> implements DeployService {
|
||||
|
||||
private final String FILE_SEPARATOR = "/";
|
||||
private final DeployMapper deployMapper;
|
||||
private final DeployServerMapper deployServerMapper;
|
||||
private final ServerService serverService;
|
||||
private final DeployHistoryService deployHistoryService;
|
||||
/**
|
||||
* 循环次数
|
||||
*/
|
||||
private final Integer count = 30;
|
||||
|
||||
@Override
|
||||
public PageResult<Deploy> queryAll(DeployQueryCriteria criteria, Page<Object> page) {
|
||||
IPage<Deploy> deploys = deployMapper.findAll(criteria, page);
|
||||
return PageUtil.toPage(deploys);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Deploy> queryAll(DeployQueryCriteria criteria) {
|
||||
return deployMapper.findAll(criteria);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(Deploy resources) {
|
||||
resources.setAppId(resources.getApp().getId());
|
||||
save(resources);
|
||||
// 保存关联关系
|
||||
deployServerMapper.insertData(resources.getId(), resources.getDeploys());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(Deploy resources) {
|
||||
Deploy deploy = getById(resources.getId());
|
||||
deploy.copy(resources);
|
||||
saveOrUpdate(deploy);
|
||||
// 更新关联关系
|
||||
deployServerMapper.deleteByDeployId(resources.getId());
|
||||
deployServerMapper.insertData(resources.getId(), resources.getDeploys());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delete(Set<Long> ids) {
|
||||
removeBatchByIds(ids);
|
||||
// 删除关联
|
||||
deployServerMapper.deleteByDeployIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deploy(String fileSavePath, Long id) {
|
||||
deployApp(fileSavePath, id);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param fileSavePath 本机路径
|
||||
* @param id ID
|
||||
*/
|
||||
private void deployApp(String fileSavePath, Long id) {
|
||||
Deploy deploy = deployMapper.getDeployById(id);
|
||||
if (deploy == null) {
|
||||
sendMsg("部署信息不存在", MsgType.ERROR);
|
||||
throw new BadRequestException("部署信息不存在");
|
||||
}
|
||||
App app = deploy.getApp();
|
||||
if (app == null) {
|
||||
sendMsg("包对应应用信息不存在", MsgType.ERROR);
|
||||
throw new BadRequestException("包对应应用信息不存在");
|
||||
}
|
||||
int port = app.getPort();
|
||||
//这个是服务器部署路径
|
||||
String uploadPath = app.getUploadPath();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String msg;
|
||||
Set<Server> deploys = deploy.getDeploys();
|
||||
for (Server server : deploys) {
|
||||
String ip = server.getIp();
|
||||
ExecuteShellUtil executeShellUtil = getExecuteShellUtil(ip);
|
||||
//判断是否第一次部署
|
||||
boolean flag = checkFile(executeShellUtil, app);
|
||||
//第一步要确认服务器上有这个目录
|
||||
executeShellUtil.execute("mkdir -p " + app.getUploadPath());
|
||||
executeShellUtil.execute("mkdir -p " + app.getBackupPath());
|
||||
executeShellUtil.execute("mkdir -p " + app.getDeployPath());
|
||||
//上传文件
|
||||
msg = String.format("登陆到服务器:%s", ip);
|
||||
ScpClientUtil scpClientUtil = getScpClientUtil(ip);
|
||||
log.info(msg);
|
||||
sendMsg(msg, MsgType.INFO);
|
||||
msg = String.format("上传文件到服务器:%s<br>目录:%s下,请稍等...", ip, uploadPath);
|
||||
sendMsg(msg, MsgType.INFO);
|
||||
scpClientUtil.putFile(fileSavePath, uploadPath);
|
||||
if (flag) {
|
||||
sendMsg("停止原来应用", MsgType.INFO);
|
||||
//停止应用
|
||||
stopApp(port, executeShellUtil);
|
||||
sendMsg("备份原来应用", MsgType.INFO);
|
||||
//备份应用
|
||||
backupApp(executeShellUtil, ip, app.getDeployPath()+FILE_SEPARATOR, app.getName(), app.getBackupPath()+FILE_SEPARATOR, id);
|
||||
}
|
||||
sendMsg("部署应用", MsgType.INFO);
|
||||
//部署文件,并启动应用
|
||||
String deployScript = app.getDeployScript();
|
||||
executeShellUtil.execute(deployScript);
|
||||
sleep(3);
|
||||
sendMsg("应用部署中,请耐心等待部署结果,或者稍后手动查看部署状态", MsgType.INFO);
|
||||
int i = 0;
|
||||
boolean result = false;
|
||||
// 由于启动应用需要时间,所以需要循环获取状态,如果超过30次,则认为是启动失败
|
||||
while (i++ < count){
|
||||
result = checkIsRunningStatus(port, executeShellUtil);
|
||||
if(result){
|
||||
break;
|
||||
}
|
||||
// 休眠6秒
|
||||
sleep(6);
|
||||
}
|
||||
sb.append("服务器:").append(server.getName()).append("<br>应用:").append(app.getName());
|
||||
sendResultMsg(result, sb);
|
||||
executeShellUtil.close();
|
||||
}
|
||||
}
|
||||
|
||||
private void sleep(int second) {
|
||||
try {
|
||||
Thread.sleep(second * 1000L);
|
||||
} catch (InterruptedException e) {
|
||||
log.error(e.getMessage(),e);
|
||||
}
|
||||
}
|
||||
|
||||
private void backupApp(ExecuteShellUtil executeShellUtil, String ip, String fileSavePath, String appName, String backupPath, Long id) {
|
||||
String deployDate = DateUtil.format(new Date(), DatePattern.PURE_DATETIME_PATTERN);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
backupPath += appName + FILE_SEPARATOR + deployDate + "\n";
|
||||
sb.append("mkdir -p ").append(backupPath);
|
||||
sb.append("mv -f ").append(fileSavePath);
|
||||
sb.append(appName).append(" ").append(backupPath);
|
||||
log.info("备份应用脚本:" + sb.toString());
|
||||
executeShellUtil.execute(sb.toString());
|
||||
//还原信息入库
|
||||
DeployHistory deployHistory = new DeployHistory();
|
||||
deployHistory.setAppName(appName);
|
||||
deployHistory.setDeployUser(SecurityUtils.getCurrentUsername());
|
||||
deployHistory.setIp(ip);
|
||||
deployHistory.setDeployId(id);
|
||||
deployHistoryService.create(deployHistory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 停App
|
||||
*
|
||||
* @param port 端口
|
||||
* @param executeShellUtil /
|
||||
*/
|
||||
private void stopApp(int port, ExecuteShellUtil executeShellUtil) {
|
||||
//发送停止命令
|
||||
executeShellUtil.execute(String.format("lsof -i :%d|grep -v \"PID\"|awk '{print \"kill -9\",$2}'|sh", port));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 指定端口程序是否在运行
|
||||
*
|
||||
* @param port 端口
|
||||
* @param executeShellUtil /
|
||||
* @return true 正在运行 false 已经停止
|
||||
*/
|
||||
private boolean checkIsRunningStatus(int port, ExecuteShellUtil executeShellUtil) {
|
||||
String result = executeShellUtil.executeForResult(String.format("fuser -n tcp %d", port));
|
||||
return result.indexOf("/tcp:")>0;
|
||||
}
|
||||
|
||||
private void sendMsg(String msg, MsgType msgType) {
|
||||
try {
|
||||
WebSocketServer.sendInfo(new SocketMsg(msg, msgType), "deploy");
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage(),e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String serverStatus(Deploy resources) {
|
||||
Set<Server> servers = resources.getDeploys();
|
||||
App app = resources.getApp();
|
||||
for (Server server : servers) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
ExecuteShellUtil executeShellUtil = getExecuteShellUtil(server.getIp());
|
||||
sb.append("服务器:").append(server.getName()).append("<br>应用:").append(app.getName());
|
||||
boolean result = checkIsRunningStatus(app.getPort(), executeShellUtil);
|
||||
if (result) {
|
||||
sb.append("<br>正在运行");
|
||||
sendMsg(sb.toString(), MsgType.INFO);
|
||||
} else {
|
||||
sb.append("<br>已停止!");
|
||||
sendMsg(sb.toString(), MsgType.ERROR);
|
||||
}
|
||||
log.info(sb.toString());
|
||||
executeShellUtil.close();
|
||||
}
|
||||
return "执行完毕";
|
||||
}
|
||||
|
||||
private boolean checkFile(ExecuteShellUtil executeShellUtil, App app) {
|
||||
String result = executeShellUtil.executeForResult("find " + app.getDeployPath() + " -name " + app.getName());
|
||||
return result.indexOf(app.getName())>0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 启动服务
|
||||
* @param resources /
|
||||
* @return /
|
||||
*/
|
||||
@Override
|
||||
public String startServer(Deploy resources) {
|
||||
Set<Server> deploys = resources.getDeploys();
|
||||
App app = resources.getApp();
|
||||
for (Server deploy : deploys) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
ExecuteShellUtil executeShellUtil = getExecuteShellUtil(deploy.getIp());
|
||||
//为了防止重复启动,这里先停止应用
|
||||
stopApp(app.getPort(), executeShellUtil);
|
||||
sb.append("服务器:").append(deploy.getName()).append("<br>应用:").append(app.getName());
|
||||
sendMsg("下发启动命令", MsgType.INFO);
|
||||
executeShellUtil.execute(app.getStartScript());
|
||||
sleep(3);
|
||||
sendMsg("应用启动中,请耐心等待启动结果,或者稍后手动查看运行状态", MsgType.INFO);
|
||||
int i = 0;
|
||||
boolean result = false;
|
||||
// 由于启动应用需要时间,所以需要循环获取状态,如果超过30次,则认为是启动失败
|
||||
while (i++ < count){
|
||||
result = checkIsRunningStatus(app.getPort(), executeShellUtil);
|
||||
if(result){
|
||||
break;
|
||||
}
|
||||
// 休眠6秒
|
||||
sleep(6);
|
||||
}
|
||||
sendResultMsg(result, sb);
|
||||
log.info(sb.toString());
|
||||
executeShellUtil.close();
|
||||
}
|
||||
return "执行完毕";
|
||||
}
|
||||
|
||||
/**
|
||||
* 停止服务
|
||||
* @param resources /
|
||||
* @return /
|
||||
*/
|
||||
@Override
|
||||
public String stopServer(Deploy resources) {
|
||||
Set<Server> deploys = resources.getDeploys();
|
||||
App app = resources.getApp();
|
||||
for (Server deploy : deploys) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
ExecuteShellUtil executeShellUtil = getExecuteShellUtil(deploy.getIp());
|
||||
sb.append("服务器:").append(deploy.getName()).append("<br>应用:").append(app.getName());
|
||||
sendMsg("下发停止命令", MsgType.INFO);
|
||||
//停止应用
|
||||
stopApp(app.getPort(), executeShellUtil);
|
||||
sleep(1);
|
||||
boolean result = checkIsRunningStatus(app.getPort(), executeShellUtil);
|
||||
if (result) {
|
||||
sb.append("<br>关闭失败!");
|
||||
sendMsg(sb.toString(), MsgType.ERROR);
|
||||
} else {
|
||||
sb.append("<br>关闭成功!");
|
||||
sendMsg(sb.toString(), MsgType.INFO);
|
||||
}
|
||||
log.info(sb.toString());
|
||||
executeShellUtil.close();
|
||||
}
|
||||
return "执行完毕";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String serverReduction(DeployHistory resources) {
|
||||
Long deployId = resources.getDeployId();
|
||||
Deploy deployInfo = getById(deployId);
|
||||
String deployDate = DateUtil.format(resources.getDeployDate(), DatePattern.PURE_DATETIME_PATTERN);
|
||||
App app = deployInfo.getApp();
|
||||
if (app == null) {
|
||||
sendMsg("应用信息不存在:" + resources.getAppName(), MsgType.ERROR);
|
||||
throw new BadRequestException("应用信息不存在:" + resources.getAppName());
|
||||
}
|
||||
String backupPath = app.getBackupPath()+FILE_SEPARATOR;
|
||||
backupPath += resources.getAppName() + FILE_SEPARATOR + deployDate;
|
||||
//这个是服务器部署路径
|
||||
String deployPath = app.getDeployPath();
|
||||
String ip = resources.getIp();
|
||||
ExecuteShellUtil executeShellUtil = getExecuteShellUtil(ip);
|
||||
String msg;
|
||||
|
||||
msg = String.format("登陆到服务器:%s", ip);
|
||||
log.info(msg);
|
||||
sendMsg(msg, MsgType.INFO);
|
||||
sendMsg("停止原来应用", MsgType.INFO);
|
||||
//停止应用
|
||||
stopApp(app.getPort(), executeShellUtil);
|
||||
//删除原来应用
|
||||
sendMsg("删除应用", MsgType.INFO);
|
||||
executeShellUtil.execute("rm -rf " + deployPath + FILE_SEPARATOR + resources.getAppName());
|
||||
//还原应用
|
||||
sendMsg("还原应用", MsgType.INFO);
|
||||
executeShellUtil.execute("cp -r " + backupPath + "/. " + deployPath);
|
||||
sendMsg("启动应用", MsgType.INFO);
|
||||
executeShellUtil.execute(app.getStartScript());
|
||||
sendMsg("应用启动中,请耐心等待启动结果,或者稍后手动查看启动状态", MsgType.INFO);
|
||||
int i = 0;
|
||||
boolean result = false;
|
||||
// 由于启动应用需要时间,所以需要循环获取状态,如果超过30次,则认为是启动失败
|
||||
while (i++ < count){
|
||||
result = checkIsRunningStatus(app.getPort(), executeShellUtil);
|
||||
if(result){
|
||||
break;
|
||||
}
|
||||
// 休眠6秒
|
||||
sleep(6);
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("服务器:").append(ip).append("<br>应用:").append(resources.getAppName());
|
||||
sendResultMsg(result, sb);
|
||||
executeShellUtil.close();
|
||||
return "";
|
||||
}
|
||||
|
||||
private ExecuteShellUtil getExecuteShellUtil(String ip) {
|
||||
Server server = serverService.findByIp(ip);
|
||||
if (server == null) {
|
||||
sendMsg("IP对应服务器信息不存在:" + ip, MsgType.ERROR);
|
||||
throw new BadRequestException("IP对应服务器信息不存在:" + ip);
|
||||
}
|
||||
return new ExecuteShellUtil(ip, server.getAccount(), server.getPassword(), server.getPort());
|
||||
}
|
||||
|
||||
private ScpClientUtil getScpClientUtil(String ip) {
|
||||
Server server = serverService.findByIp(ip);
|
||||
if (server == null) {
|
||||
sendMsg("IP对应服务器信息不存在:" + ip, MsgType.ERROR);
|
||||
throw new BadRequestException("IP对应服务器信息不存在:" + ip);
|
||||
}
|
||||
return ScpClientUtil.getInstance(ip, server.getPort(), server.getAccount(), server.getPassword());
|
||||
}
|
||||
|
||||
private void sendResultMsg(boolean result, StringBuilder sb) {
|
||||
if (result) {
|
||||
sb.append("<br>启动成功!");
|
||||
sendMsg(sb.toString(), MsgType.INFO);
|
||||
} else {
|
||||
sb.append("<br>启动失败!");
|
||||
sendMsg(sb.toString(), MsgType.ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(List<Deploy> deploys, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (Deploy deploy : deploys) {
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
map.put("应用名称", deploy.getApp().getName());
|
||||
map.put("服务器", deploy.getServers());
|
||||
map.put("部署日期", deploy.getCreateTime());
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
}
|
@ -1,113 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* 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 me.zhengjie.modules.mnt.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import me.zhengjie.modules.mnt.domain.Server;
|
||||
import me.zhengjie.modules.mnt.mapper.DeployServerMapper;
|
||||
import me.zhengjie.modules.mnt.mapper.ServerMapper;
|
||||
import me.zhengjie.modules.mnt.service.ServerService;
|
||||
import me.zhengjie.modules.mnt.domain.dto.ServerQueryCriteria;
|
||||
import me.zhengjie.modules.mnt.util.ExecuteShellUtil;
|
||||
import me.zhengjie.utils.FileUtil;
|
||||
import me.zhengjie.utils.PageResult;
|
||||
import me.zhengjie.utils.PageUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author zhanghouying
|
||||
* @date 2019-08-24
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class ServerServiceImpl extends ServiceImpl<ServerMapper, Server> implements ServerService {
|
||||
|
||||
private final ServerMapper serverMapper;
|
||||
private final DeployServerMapper deployServerMapper;
|
||||
|
||||
@Override
|
||||
public PageResult<Server> queryAll(ServerQueryCriteria criteria, Page<Object> page){
|
||||
return PageUtil.toPage(serverMapper.findAll(criteria, page));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Server> queryAll(ServerQueryCriteria criteria){
|
||||
return serverMapper.findAll(criteria);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Server findByIp(String ip) {
|
||||
return serverMapper.findByIp(ip);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean testConnect(Server resources) {
|
||||
ExecuteShellUtil executeShellUtil = null;
|
||||
try {
|
||||
executeShellUtil = new ExecuteShellUtil(resources.getIp(), resources.getAccount(), resources.getPassword(),resources.getPort());
|
||||
return executeShellUtil.execute("ls")==0;
|
||||
} catch (Exception e) {
|
||||
return false;
|
||||
}finally {
|
||||
if (executeShellUtil != null) {
|
||||
executeShellUtil.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(Server resources) {
|
||||
save(resources);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(Server resources) {
|
||||
Server server = getById(resources.getId());
|
||||
server.copy(resources);
|
||||
saveOrUpdate(server);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void delete(Set<Long> ids) {
|
||||
removeBatchByIds(ids);
|
||||
// 删除与之关联的服务
|
||||
deployServerMapper.deleteByServerIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(List<Server> servers, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (Server deploy : servers) {
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
map.put("服务器名称", deploy.getName());
|
||||
map.put("服务器IP", deploy.getIp());
|
||||
map.put("端口", deploy.getPort());
|
||||
map.put("账号", deploy.getAccount());
|
||||
map.put("创建日期", deploy.getCreateTime());
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
}
|
@ -1,140 +0,0 @@
|
||||
/*
|
||||
* <<
|
||||
* Davinci
|
||||
* ==
|
||||
* Copyright (C) 2016 - 2019 EDP
|
||||
* ==
|
||||
* 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 me.zhengjie.modules.mnt.util;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* @author /
|
||||
*/
|
||||
@Slf4j
|
||||
@SuppressWarnings({"unchecked","all"})
|
||||
public enum DataTypeEnum {
|
||||
|
||||
/** mysql */
|
||||
MYSQL("mysql", "mysql", "com.mysql.jdbc.Driver", "`", "`", "'", "'"),
|
||||
|
||||
/** oracle */
|
||||
ORACLE("oracle", "oracle", "oracle.jdbc.driver.OracleDriver", "\"", "\"", "\"", "\""),
|
||||
|
||||
/** sql server */
|
||||
SQLSERVER("sqlserver", "sqlserver", "com.microsoft.sqlserver.jdbc.SQLServerDriver", "\"", "\"", "\"", "\""),
|
||||
|
||||
/** h2 */
|
||||
H2("h2", "h2", "org.h2.Driver", "`", "`", "\"", "\""),
|
||||
|
||||
/** phoenix */
|
||||
PHOENIX("phoenix", "hbase phoenix", "org.apache.phoenix.jdbc.PhoenixDriver", "", "", "\"", "\""),
|
||||
|
||||
/** mongo */
|
||||
MONGODB("mongo", "mongodb", "mongodb.jdbc.MongoDriver", "`", "`", "\"", "\""),
|
||||
|
||||
/** sql4es */
|
||||
ELASTICSEARCH("sql4es", "elasticsearch", "nl.anchormen.sql4es.jdbc.ESDriver", "", "", "'", "'"),
|
||||
|
||||
/** presto */
|
||||
PRESTO("presto", "presto", "com.facebook.presto.jdbc.PrestoDriver", "", "", "\"", "\""),
|
||||
|
||||
/** moonbox */
|
||||
MOONBOX("moonbox", "moonbox", "moonbox.jdbc.MbDriver", "`", "`", "`", "`"),
|
||||
|
||||
/** cassandra */
|
||||
CASSANDRA("cassandra", "cassandra", "com.github.adejanovski.cassandra.jdbc.CassandraDriver", "", "", "'", "'"),
|
||||
|
||||
/** click house */
|
||||
CLICKHOUSE("clickhouse", "clickhouse", "ru.yandex.clickhouse.ClickHouseDriver", "", "", "\"", "\""),
|
||||
|
||||
/** kylin */
|
||||
KYLIN("kylin", "kylin", "org.apache.kylin.jdbc.Driver", "\"", "\"", "\"", "\""),
|
||||
|
||||
/** vertica */
|
||||
VERTICA("vertica", "vertica", "com.vertica.jdbc.Driver", "", "", "'", "'"),
|
||||
|
||||
/** sap */
|
||||
HANA("sap", "sap hana", "com.sap.db.jdbc.Driver", "", "", "'", "'"),
|
||||
|
||||
/** impala */
|
||||
IMPALA("impala", "impala", "com.cloudera.impala.jdbc41.Driver", "", "", "'", "'");
|
||||
|
||||
private String feature;
|
||||
private String desc;
|
||||
private String driver;
|
||||
private String keywordPrefix;
|
||||
private String keywordSuffix;
|
||||
private String aliasPrefix;
|
||||
private String aliasSuffix;
|
||||
|
||||
private static final String JDBC_URL_PREFIX = "jdbc:";
|
||||
|
||||
DataTypeEnum(String feature, String desc, String driver, String keywordPrefix, String keywordSuffix, String aliasPrefix, String aliasSuffix) {
|
||||
this.feature = feature;
|
||||
this.desc = desc;
|
||||
this.driver = driver;
|
||||
this.keywordPrefix = keywordPrefix;
|
||||
this.keywordSuffix = keywordSuffix;
|
||||
this.aliasPrefix = aliasPrefix;
|
||||
this.aliasSuffix = aliasSuffix;
|
||||
}
|
||||
|
||||
public static DataTypeEnum urlOf(String jdbcUrl) {
|
||||
String url = jdbcUrl.toLowerCase().trim();
|
||||
for (DataTypeEnum dataTypeEnum : values()) {
|
||||
if (url.startsWith(JDBC_URL_PREFIX + dataTypeEnum.feature)) {
|
||||
try {
|
||||
Class<?> aClass = Class.forName(dataTypeEnum.getDriver());
|
||||
if (null == aClass) {
|
||||
throw new RuntimeException("Unable to get driver instance for jdbcUrl: " + jdbcUrl);
|
||||
}
|
||||
} catch (ClassNotFoundException e) {
|
||||
throw new RuntimeException("Unable to get driver instance: " + jdbcUrl);
|
||||
}
|
||||
return dataTypeEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getFeature() {
|
||||
return feature;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public String getDriver() {
|
||||
return driver;
|
||||
}
|
||||
|
||||
public String getKeywordPrefix() {
|
||||
return keywordPrefix;
|
||||
}
|
||||
|
||||
public String getKeywordSuffix() {
|
||||
return keywordSuffix;
|
||||
}
|
||||
|
||||
public String getAliasPrefix() {
|
||||
return aliasPrefix;
|
||||
}
|
||||
|
||||
public String getAliasSuffix() {
|
||||
return aliasSuffix;
|
||||
}
|
||||
}
|
@ -1,101 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* 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 me.zhengjie.modules.mnt.util;
|
||||
|
||||
import cn.hutool.core.io.IoUtil;
|
||||
import com.jcraft.jsch.ChannelShell;
|
||||
import com.jcraft.jsch.JSch;
|
||||
import com.jcraft.jsch.Session;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.Vector;
|
||||
|
||||
/**
|
||||
* 执行shell命令
|
||||
*
|
||||
* @author: ZhangHouYing
|
||||
* @date: 2019/8/10
|
||||
*/
|
||||
@Slf4j
|
||||
public class ExecuteShellUtil {
|
||||
|
||||
private Vector<String> stdout;
|
||||
|
||||
Session session;
|
||||
|
||||
public ExecuteShellUtil(final String ipAddress, final String username, final String password,int port) {
|
||||
try {
|
||||
JSch jsch = new JSch();
|
||||
session = jsch.getSession(username, ipAddress, port);
|
||||
session.setPassword(password);
|
||||
session.setConfig("StrictHostKeyChecking", "no");
|
||||
session.connect(3000);
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public int execute(final String command) {
|
||||
int returnCode = 0;
|
||||
ChannelShell channel = null;
|
||||
PrintWriter printWriter = null;
|
||||
BufferedReader input = null;
|
||||
stdout = new Vector<String>();
|
||||
try {
|
||||
channel = (ChannelShell) session.openChannel("shell");
|
||||
channel.connect();
|
||||
input = new BufferedReader(new InputStreamReader(channel.getInputStream()));
|
||||
printWriter = new PrintWriter(channel.getOutputStream());
|
||||
printWriter.println(command);
|
||||
printWriter.println("exit");
|
||||
printWriter.flush();
|
||||
log.info("The remote command is: ");
|
||||
String line;
|
||||
while ((line = input.readLine()) != null) {
|
||||
stdout.add(line);
|
||||
System.out.println(line);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
return -1;
|
||||
}finally {
|
||||
IoUtil.close(printWriter);
|
||||
IoUtil.close(input);
|
||||
if (channel != null) {
|
||||
channel.disconnect();
|
||||
}
|
||||
}
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
public void close(){
|
||||
if (session != null) {
|
||||
session.disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
public String executeForResult(String command) {
|
||||
execute(command);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (String str : stdout) {
|
||||
sb.append(str);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
}
|
@ -1,105 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* 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 me.zhengjie.modules.mnt.util;
|
||||
|
||||
import ch.ethz.ssh2.Connection;
|
||||
import ch.ethz.ssh2.SCPClient;
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* 远程执行linux命令
|
||||
* @author: ZhangHouYing
|
||||
* @date: 2019-08-10 10:06
|
||||
*/
|
||||
public class ScpClientUtil {
|
||||
|
||||
static private Map<String,ScpClientUtil> instance = Maps.newHashMap();
|
||||
|
||||
static synchronized public ScpClientUtil getInstance(String ip, int port, String username, String password) {
|
||||
if (instance.get(ip) == null) {
|
||||
instance.put(ip, new ScpClientUtil(ip, port, username, password));
|
||||
}
|
||||
return instance.get(ip);
|
||||
}
|
||||
|
||||
public ScpClientUtil(String ip, int port, String username, String password) {
|
||||
this.ip = ip;
|
||||
this.port = port;
|
||||
this.username = username;
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public void getFile(String remoteFile, String localTargetDirectory) {
|
||||
Connection conn = new Connection(ip, port);
|
||||
try {
|
||||
conn.connect();
|
||||
boolean isAuthenticated = conn.authenticateWithPassword(username, password);
|
||||
if (!isAuthenticated) {
|
||||
System.err.println("authentication failed");
|
||||
}
|
||||
SCPClient client = new SCPClient(conn);
|
||||
client.get(remoteFile, localTargetDirectory);
|
||||
} catch (IOException ex) {
|
||||
Logger.getLogger(SCPClient.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}finally{
|
||||
conn.close();
|
||||
}
|
||||
}
|
||||
|
||||
public void putFile(String localFile, String remoteTargetDirectory) {
|
||||
putFile(localFile, null, remoteTargetDirectory);
|
||||
}
|
||||
|
||||
public void putFile(String localFile, String remoteFileName, String remoteTargetDirectory) {
|
||||
putFile(localFile, remoteFileName, remoteTargetDirectory,null);
|
||||
}
|
||||
|
||||
public void putFile(String localFile, String remoteFileName, String remoteTargetDirectory, String mode) {
|
||||
Connection conn = new Connection(ip, port);
|
||||
try {
|
||||
conn.connect();
|
||||
boolean isAuthenticated = conn.authenticateWithPassword(username, password);
|
||||
if (!isAuthenticated) {
|
||||
System.err.println("authentication failed");
|
||||
}
|
||||
SCPClient client = new SCPClient(conn);
|
||||
if ((mode == null) || (mode.length() == 0)) {
|
||||
mode = "0600";
|
||||
}
|
||||
if (remoteFileName == null) {
|
||||
client.put(localFile, remoteTargetDirectory);
|
||||
} else {
|
||||
client.put(localFile, remoteFileName, remoteTargetDirectory, mode);
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
Logger.getLogger(ScpClientUtil.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}finally{
|
||||
conn.close();
|
||||
}
|
||||
}
|
||||
|
||||
private String ip;
|
||||
private int port;
|
||||
private String username;
|
||||
private String password;
|
||||
|
||||
|
||||
}
|
@ -1,201 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* 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 me.zhengjie.modules.mnt.util;
|
||||
|
||||
import com.alibaba.druid.pool.DruidDataSource;
|
||||
import com.alibaba.druid.util.StringUtils;
|
||||
import com.google.common.collect.Lists;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import me.zhengjie.utils.CloseUtil;
|
||||
import javax.sql.DataSource;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.sql.*;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author /
|
||||
*/
|
||||
@Slf4j
|
||||
public class SqlUtils {
|
||||
|
||||
/**
|
||||
* 获取数据源
|
||||
*
|
||||
* @param jdbcUrl /
|
||||
* @param userName /
|
||||
* @param password /
|
||||
* @return DataSource
|
||||
*/
|
||||
private static DataSource getDataSource(String jdbcUrl, String userName, String password) {
|
||||
DruidDataSource druidDataSource = new DruidDataSource();
|
||||
String className;
|
||||
try {
|
||||
className = DriverManager.getDriver(jdbcUrl.trim()).getClass().getName();
|
||||
} catch (SQLException e) {
|
||||
throw new RuntimeException("Get class name error: =" + jdbcUrl);
|
||||
}
|
||||
if (StringUtils.isEmpty(className)) {
|
||||
DataTypeEnum dataTypeEnum = DataTypeEnum.urlOf(jdbcUrl);
|
||||
if (null == dataTypeEnum) {
|
||||
throw new RuntimeException("Not supported data type: jdbcUrl=" + jdbcUrl);
|
||||
}
|
||||
druidDataSource.setDriverClassName(dataTypeEnum.getDriver());
|
||||
} else {
|
||||
druidDataSource.setDriverClassName(className);
|
||||
}
|
||||
|
||||
|
||||
druidDataSource.setUrl(jdbcUrl);
|
||||
druidDataSource.setUsername(userName);
|
||||
druidDataSource.setPassword(password);
|
||||
// 配置获取连接等待超时的时间
|
||||
druidDataSource.setMaxWait(3000);
|
||||
// 配置初始化大小、最小、最大
|
||||
druidDataSource.setInitialSize(1);
|
||||
druidDataSource.setMinIdle(1);
|
||||
druidDataSource.setMaxActive(1);
|
||||
|
||||
// 如果链接出现异常则直接判定为失败而不是一直重试
|
||||
druidDataSource.setBreakAfterAcquireFailure(true);
|
||||
try {
|
||||
druidDataSource.init();
|
||||
} catch (SQLException e) {
|
||||
log.error("Exception during pool initialization", e);
|
||||
throw new RuntimeException(e.getMessage());
|
||||
}
|
||||
|
||||
return druidDataSource;
|
||||
}
|
||||
|
||||
private static Connection getConnection(String jdbcUrl, String userName, String password) {
|
||||
DataSource dataSource = getDataSource(jdbcUrl, userName, password);
|
||||
Connection connection = null;
|
||||
try {
|
||||
connection = dataSource.getConnection();
|
||||
} catch (Exception ignored) {}
|
||||
try {
|
||||
int timeOut = 5;
|
||||
if (null == connection || connection.isClosed() || !connection.isValid(timeOut)) {
|
||||
log.info("connection is closed or invalid, retry get connection!");
|
||||
connection = dataSource.getConnection();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("create connection error, jdbcUrl: {}", jdbcUrl);
|
||||
throw new RuntimeException("create connection error, jdbcUrl: " + jdbcUrl);
|
||||
} finally {
|
||||
CloseUtil.close(connection);
|
||||
}
|
||||
return connection;
|
||||
}
|
||||
|
||||
private static void releaseConnection(Connection connection) {
|
||||
if (null != connection) {
|
||||
try {
|
||||
connection.close();
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
log.error("connection close error:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean testConnection(String jdbcUrl, String userName, String password) {
|
||||
Connection connection = null;
|
||||
try {
|
||||
connection = getConnection(jdbcUrl, userName, password);
|
||||
if (null != connection) {
|
||||
return true;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.info("Get connection failed:" + e.getMessage());
|
||||
} finally {
|
||||
releaseConnection(connection);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static String executeFile(String jdbcUrl, String userName, String password, File sqlFile) {
|
||||
Connection connection = getConnection(jdbcUrl, userName, password);
|
||||
try {
|
||||
batchExecute(connection, readSqlList(sqlFile));
|
||||
} catch (Exception e) {
|
||||
log.error("sql脚本执行发生异常:{}",e.getMessage());
|
||||
return e.getMessage();
|
||||
}finally {
|
||||
releaseConnection(connection);
|
||||
}
|
||||
return "success";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量执行sql
|
||||
* @param connection /
|
||||
* @param sqlList /
|
||||
*/
|
||||
public static void batchExecute(Connection connection, List<String> sqlList) {
|
||||
Statement st = null;
|
||||
try {
|
||||
st = connection.createStatement();
|
||||
for (String sql : sqlList) {
|
||||
if (sql.endsWith(";")) {
|
||||
sql = sql.substring(0, sql.length() - 1);
|
||||
}
|
||||
st.addBatch(sql);
|
||||
}
|
||||
st.executeBatch();
|
||||
} catch (SQLException throwables) {
|
||||
throwables.printStackTrace();
|
||||
} finally {
|
||||
CloseUtil.close(st);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将文件中的sql语句以;为单位读取到列表中
|
||||
* @param sqlFile /
|
||||
* @return /
|
||||
* @throws Exception e
|
||||
*/
|
||||
private static List<String> readSqlList(File sqlFile) throws Exception {
|
||||
List<String> sqlList = Lists.newArrayList();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
try (BufferedReader reader = new BufferedReader(new InputStreamReader(
|
||||
new FileInputStream(sqlFile), StandardCharsets.UTF_8))) {
|
||||
String tmp;
|
||||
while ((tmp = reader.readLine()) != null) {
|
||||
log.info("line:{}", tmp);
|
||||
if (tmp.endsWith(";")) {
|
||||
sb.append(tmp);
|
||||
sqlList.add(sb.toString());
|
||||
sb.delete(0, sb.length());
|
||||
} else {
|
||||
sb.append(tmp);
|
||||
}
|
||||
}
|
||||
if (!"".endsWith(sb.toString().trim())) {
|
||||
sqlList.add(sb.toString());
|
||||
}
|
||||
}
|
||||
|
||||
return sqlList;
|
||||
}
|
||||
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* 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 me.zhengjie.modules.mnt.websocket;
|
||||
|
||||
/**
|
||||
* @author ZhangHouYing
|
||||
* @date 2019-08-10 9:56
|
||||
*/
|
||||
public enum MsgType {
|
||||
/** 连接 */
|
||||
CONNECT,
|
||||
/** 关闭 */
|
||||
CLOSE,
|
||||
/** 信息 */
|
||||
INFO,
|
||||
/** 错误 */
|
||||
ERROR
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* 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 me.zhengjie.modules.mnt.websocket;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author ZhangHouYing
|
||||
* @date 2019-08-10 9:55
|
||||
*/
|
||||
@Data
|
||||
public class SocketMsg {
|
||||
private String msg;
|
||||
private MsgType msgType;
|
||||
|
||||
public SocketMsg(String msg, MsgType msgType) {
|
||||
this.msg = msg;
|
||||
this.msgType = msgType;
|
||||
}
|
||||
}
|
@ -1,134 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* 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 me.zhengjie.modules.mnt.websocket;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
import javax.websocket.*;
|
||||
import javax.websocket.server.PathParam;
|
||||
import javax.websocket.server.ServerEndpoint;
|
||||
import java.io.IOException;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
/**
|
||||
* @author ZhangHouYing
|
||||
* @date 2019-08-10 15:46
|
||||
*/
|
||||
@ServerEndpoint("/webSocket/{sid}")
|
||||
@Slf4j
|
||||
@Component
|
||||
public class WebSocketServer {
|
||||
|
||||
/**
|
||||
* concurrent包的线程安全Set,用来存放每个客户端对应的MyWebSocket对象。
|
||||
*/
|
||||
private static final CopyOnWriteArraySet<WebSocketServer> webSocketSet = new CopyOnWriteArraySet<WebSocketServer>();
|
||||
|
||||
/**
|
||||
* 与某个客户端的连接会话,需要通过它来给客户端发送数据
|
||||
*/
|
||||
private Session session;
|
||||
|
||||
/**
|
||||
* 接收sid
|
||||
*/
|
||||
private String sid="";
|
||||
/**
|
||||
* 连接建立成功调用的方法
|
||||
* */
|
||||
@OnOpen
|
||||
public void onOpen(Session session,@PathParam("sid") String sid) {
|
||||
this.session = session;
|
||||
//如果存在就先删除一个,防止重复推送消息
|
||||
webSocketSet.removeIf(webSocket -> webSocket.sid.equals(sid));
|
||||
webSocketSet.add(this);
|
||||
this.sid=sid;
|
||||
}
|
||||
|
||||
/**
|
||||
* 连接关闭调用的方法
|
||||
*/
|
||||
@OnClose
|
||||
public void onClose() {
|
||||
webSocketSet.remove(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* 收到客户端消息后调用的方法
|
||||
* @param message 客户端发送过来的消息*/
|
||||
@OnMessage
|
||||
public void onMessage(String message, Session session) {
|
||||
log.info("收到来"+sid+"的信息:"+message);
|
||||
//群发消息
|
||||
for (WebSocketServer item : webSocketSet) {
|
||||
try {
|
||||
item.sendMessage(message);
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage(),e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@OnError
|
||||
public void onError(Session session, Throwable error) {
|
||||
log.error("发生错误");
|
||||
error.printStackTrace();
|
||||
}
|
||||
/**
|
||||
* 实现服务器主动推送
|
||||
*/
|
||||
private void sendMessage(String message) throws IOException {
|
||||
this.session.getBasicRemote().sendText(message);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 群发自定义消息
|
||||
* */
|
||||
public static void sendInfo(SocketMsg socketMsg,@PathParam("sid") String sid) throws IOException {
|
||||
String message = JSON.toJSONString(socketMsg);
|
||||
log.info("推送消息到"+sid+",推送内容:"+message);
|
||||
for (WebSocketServer item : webSocketSet) {
|
||||
try {
|
||||
//这里可以设定只推送给这个sid的,为null则全部推送
|
||||
if(sid==null) {
|
||||
item.sendMessage(message);
|
||||
}else if(item.sid.equals(sid)){
|
||||
item.sendMessage(message);
|
||||
}
|
||||
} catch (IOException ignored) { }
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
WebSocketServer that = (WebSocketServer) o;
|
||||
return Objects.equals(session, that.session) &&
|
||||
Objects.equals(sid, that.sid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(session, sid);
|
||||
}
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019-2023 Zheng Jie
|
||||
* Copyright 2019-2025 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019-2023 Zheng Jie
|
||||
* Copyright 2019-2025 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -4,7 +4,7 @@ spring:
|
||||
druid:
|
||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.p6spy.engine.spy.P6SpyDriver
|
||||
url: jdbc:p6spy:mysql://localhost:3306/eladmin?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
|
||||
url: jdbc:p6spy:mysql://localhost:3306/eladmin-mp?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
|
||||
username: root
|
||||
password: 123456
|
||||
# 初始连接数,建议设置为与最小空闲连接数相同
|
||||
|
@ -18,6 +18,5 @@
|
||||
</root>
|
||||
|
||||
<!--部分日志调整为ERROR-->
|
||||
<logger name="io.undertow.websockets.jsr" level="ERROR"/>
|
||||
<logger name="io.netty.resolver.dns.DnsServerAddressStreamProviders" level="ERROR"/>
|
||||
</configuration>
|
@ -1,37 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="me.zhengjie.modules.mnt.mapper.AppMapper">
|
||||
<resultMap id="BaseResultMap" type="me.zhengjie.modules.mnt.domain.App">
|
||||
<id column="app_id" property="id"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="port" property="port"/>
|
||||
<result column="upload_path" property="uploadPath"/>
|
||||
<result column="deploy_path" property="deployPath"/>
|
||||
<result column="backup_path" property="backupPath"/>
|
||||
<result column="start_script" property="startScript"/>
|
||||
<result column="deploy_script" property="deployScript"/>
|
||||
<result column="create_by" property="createBy"/>
|
||||
<result column="update_by" property="updateBy"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
app_id,name,port,upload_path,deploy_path,backup_path,start_script,deploy_script,create_by,update_by,create_time,update_time
|
||||
</sql>
|
||||
|
||||
<select id="queryAll" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from mnt_app
|
||||
<where>
|
||||
<if test="criteria.name != null and criteria.name != ''">
|
||||
and name like concat('%',#{criteria.name},'%')
|
||||
</if>
|
||||
<if test="criteria.createTime != null and criteria.createTime.size() > 0">
|
||||
and create_time between #{criteria.createTime[0]} and #{criteria.createTime[1]}
|
||||
</if>
|
||||
</where>
|
||||
order by app_id desc
|
||||
</select>
|
||||
</mapper>
|
@ -1,36 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="me.zhengjie.modules.mnt.mapper.DatabaseMapper">
|
||||
<resultMap id="BaseResultMap" type="me.zhengjie.modules.mnt.domain.Database">
|
||||
<id column="db_id" property="id"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="jdbc_url" property="jdbcUrl"/>
|
||||
<result column="pwd" property="pwd"/>
|
||||
<result column="user_name" property="userName"/>
|
||||
<result column="create_by" property="createBy"/>
|
||||
<result column="update_by" property="updateBy"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
db_id, name, jdbc_url, pwd, user_name, create_by, update_by, create_time, update_time
|
||||
</sql>
|
||||
|
||||
<select id="findAll" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM mnt_database
|
||||
<where>
|
||||
<if test="criteria.name != null and criteria.name != ''">
|
||||
AND name LIKE CONCAT('%',#{criteria.name},'%')
|
||||
</if>
|
||||
<if test="criteria.jdbcUrl != null and criteria.jdbcUrl != ''">
|
||||
AND jdbc_url = #{criteria.jdbcUrl}
|
||||
</if>
|
||||
<if test="criteria.createTime != null and criteria.createTime.size() != 0">
|
||||
AND create_time BETWEEN #{criteria.createTime[0]} AND #{criteria.createTime[1]}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
@ -1,39 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="me.zhengjie.modules.mnt.mapper.DeployHistoryMapper">
|
||||
<resultMap id="BaseResultMap" type="me.zhengjie.modules.mnt.domain.DeployHistory">
|
||||
<id column="history_id" property="id"/>
|
||||
<result column="app_name" property="appName"/>
|
||||
<result column="ip" property="ip"/>
|
||||
<result column="deploy_date" property="deployDate"/>
|
||||
<result column="deploy_user" property="deployUser"/>
|
||||
<result column="deploy_id" property="deployId"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
history_id, app_name, ip, deploy_date, deploy_user, deploy_id
|
||||
</sql>
|
||||
|
||||
<select id="findAll" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM mnt_deploy_history
|
||||
<where>
|
||||
<if test="criteria.blurry != null and criteria.blurry != ''">
|
||||
AND (
|
||||
app_name LIKE CONCAT('%',#{criteria.blurry},'%')
|
||||
or ip LIKE CONCAT('%',#{criteria.blurry},'%')
|
||||
or deploy_user LIKE CONCAT('%',#{criteria.blurry},'%')
|
||||
)
|
||||
</if>
|
||||
<if test="criteria.deployId != null">
|
||||
AND deploy_id = #{criteria.deployId}
|
||||
</if>
|
||||
<if test="criteria.deployDate != null and criteria.deployDate.size() != 0">
|
||||
AND deploy_date BETWEEN #{criteria.deployDate[0]} AND #{criteria.deployDate[1]}
|
||||
</if>
|
||||
</where>
|
||||
order by deploy_date desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -1,77 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis_deploy.org//DTD Mapper 3.0//EN" "http://mybatis_deploy.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="me.zhengjie.modules.mnt.mapper.DeployMapper">
|
||||
<resultMap id="BaseResultMap" type="me.zhengjie.modules.mnt.domain.Deploy">
|
||||
<id column="d_deploy_id" property="id"/>
|
||||
<result column="d_app_id" property="appId"/>
|
||||
<result column="d_create_by" property="createBy"/>
|
||||
<result column="d_update_by" property="updateBy"/>
|
||||
<result column="d_create_time" property="createTime"/>
|
||||
<result column="d_update_time" property="updateTime"/>
|
||||
<association property="app" javaType="me.zhengjie.modules.mnt.domain.App">
|
||||
<id column="a_app_id" property="id"/>
|
||||
<result column="a_name" property="name"/>
|
||||
<result column="a_port" property="port"/>
|
||||
<result column="a_upload_path" property="uploadPath"/>
|
||||
<result column="a_deploy_path" property="deployPath"/>
|
||||
<result column="a_backup_path" property="backupPath"/>
|
||||
<result column="a_start_script" property="startScript"/>
|
||||
<result column="a_deploy_script" property="deployScript"/>
|
||||
</association>
|
||||
<collection property="deploys" ofType="me.zhengjie.modules.mnt.domain.Server">
|
||||
<id column="s_server_id" property="id"/>
|
||||
<result column="s_name" property="name"/>
|
||||
<result column="s_ip" property="ip"/>
|
||||
<result column="s_port" property="port"/>
|
||||
<result column="s_account" property="account"/>
|
||||
<result column="s_password" property="password"/>
|
||||
</collection>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
deploy.deploy_id as d_deploy_id, deploy.app_id as d_app_id,deploy.create_by as d_create_by,deploy.update_by as d_update_by,deploy.create_time as d_create_time,deploy.update_time as d_update_time,
|
||||
app.app_id as a_app_id,app.name as a_name,app.port as a_port,app.upload_path as a_upload_path,app.deploy_path as a_deploy_path,app.backup_path as a_backup_path,app.start_script as a_start_script,app.deploy_script as a_deploy_script
|
||||
</sql>
|
||||
|
||||
<sql id="Server_Column_List">
|
||||
server.server_id as s_server_id,server.name as s_name,server.ip as s_ip,server.port as s_port,server.account as s_account,server.password as s_password
|
||||
</sql>
|
||||
|
||||
<select id="findAll" resultMap="BaseResultMap">
|
||||
select <include refid="Base_Column_List"/>,
|
||||
<include refid="Server_Column_List"/>
|
||||
from mnt_deploy deploy
|
||||
left join mnt_app app on deploy.app_id = app.app_id
|
||||
left join mnt_deploy_server mds on deploy.deploy_id = mds.deploy_id
|
||||
left join mnt_server server on server.server_id = mds.server_id
|
||||
<where>
|
||||
<if test="criteria.appName != null and criteria.appName != ''">
|
||||
and app.name like concat('%',#{criteria.appName},'%')
|
||||
</if>
|
||||
<if test="criteria.createTime != null and criteria.createTime.size() != 0">
|
||||
and deploy.create_time between #{criteria.createTime[0]} and #{criteria.createTime[1]}
|
||||
</if>
|
||||
</where>
|
||||
order by deploy.deploy_id desc
|
||||
</select>
|
||||
|
||||
<select id="getIdByAppIds" resultType="java.lang.Long">
|
||||
select deploy.deploy_id
|
||||
from mnt_deploy deploy
|
||||
where deploy.app_id in
|
||||
<foreach collection="appIds" item="appId" open="(" separator="," close=")">
|
||||
#{appId}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="getDeployById" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>,
|
||||
<include refid="Server_Column_List"/>
|
||||
from mnt_deploy deploy
|
||||
left join mnt_app app on deploy.app_id = app.app_id
|
||||
left join mnt_deploy_server mds on deploy.deploy_id = mds.deploy_id
|
||||
left join mnt_server server on server.server_id = mds.server_id
|
||||
where deploy.deploy_id = #{deployId}
|
||||
</select>
|
||||
</mapper>
|
@ -1,33 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="me.zhengjie.modules.mnt.mapper.DeployServerMapper">
|
||||
|
||||
<insert id="insertData">
|
||||
insert into mnt_deploy_server (deploy_id, server_id)
|
||||
values
|
||||
<foreach collection="servers" item="item" open="(" separator="),(" close=")">
|
||||
#{deployId}, #{item.id}
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<delete id="deleteByDeployId">
|
||||
delete from mnt_deploy_server
|
||||
where deploy_id = #{deployId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByDeployIds">
|
||||
delete from mnt_deploy_server
|
||||
where deploy_id in
|
||||
<foreach collection="deployIds" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByServerIds">
|
||||
delete from mnt_deploy_server
|
||||
where server_id in
|
||||
<foreach collection="serverIds" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -1,47 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatiorg//DTD Mapper 3.0//EN" "http://mybatiorg/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="me.zhengjie.modules.mnt.mapper.ServerMapper">
|
||||
<resultMap id="BaseResultMap" type="me.zhengjie.modules.mnt.domain.Server">
|
||||
<id column="server_id" property="id"/>
|
||||
<result column="name" property="name"/>
|
||||
<result column="ip" property="ip"/>
|
||||
<result column="port" property="port"/>
|
||||
<result column="account" property="account"/>
|
||||
<result column="password" property="password"/>
|
||||
<result column="create_by" property="createBy"/>
|
||||
<result column="update_by" property="updateBy"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
server_id, name, ip, port, account, password, create_by, update_by, create_time, update_time
|
||||
</sql>
|
||||
|
||||
<select id="findByIp" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM mnt_server
|
||||
<where>
|
||||
ip = #{ip}
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="findAll" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
<include refid="Base_Column_List"/>
|
||||
FROM mnt_server
|
||||
<where>
|
||||
<if test="criteria.blurry != null and criteria.blurry != ''">
|
||||
AND (
|
||||
name LIKE CONCAT('%',#{criteria.blurry},'%')
|
||||
or ip LIKE CONCAT('%',#{criteria.blurry},'%')
|
||||
)
|
||||
</if>
|
||||
<if test="criteria.createTime != null and criteria.createTime.size() != 0">
|
||||
AND create_time BETWEEN #{criteria.createTime[0]} AND #{criteria.createTime[1]}
|
||||
</if>
|
||||
</where>
|
||||
order by server_id desc
|
||||
</select>
|
||||
</mapper>
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019-2023 Zheng Jie
|
||||
* Copyright 2019-2025 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019-2023 Zheng Jie
|
||||
* Copyright 2019-2025 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019-2023 Zheng Jie
|
||||
* Copyright 2019-2025 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019-2023 Zheng Jie
|
||||
* Copyright 2019-2025 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2019-2023 Zheng Jie
|
||||
* Copyright 2019-2025 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -55,6 +55,13 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-undertow</artifactId>
|
||||
<exclusions>
|
||||
<!-- 排除 undertow-websockets-jsr 依赖,如果需要用到websockets,就移除这个 -->
|
||||
<exclusion>
|
||||
<groupId>io.undertow</groupId>
|
||||
<artifactId>undertow-websockets-jsr</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
|
||||
<!--Spring boot 测试-->
|
||||
|
717
sql/eladmin.sql
717
sql/eladmin.sql
@ -1,49 +1,55 @@
|
||||
/*
|
||||
Navicat Premium Data Transfer
|
||||
Navicat Premium Dump SQL
|
||||
|
||||
Source Server : localhost
|
||||
Source Server Type : MySQL
|
||||
Source Server Version : 100505
|
||||
Source Server Version : 110206 (11.2.6-MariaDB)
|
||||
Source Host : localhost:3306
|
||||
Source Schema : eladmin
|
||||
Source Schema : eladmin-mp
|
||||
|
||||
Target Server Type : MySQL
|
||||
Target Server Version : 100505
|
||||
Target Server Version : 110206 (11.2.6-MariaDB)
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 05/09/2020 10:49:19
|
||||
Date: 14/01/2025 11:38:07
|
||||
*/
|
||||
|
||||
SET NAMES utf8mb4;
|
||||
SET FOREIGN_KEY_CHECKS = 0;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for code_column_config
|
||||
-- Table structure for code_column
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `code_column_config`;
|
||||
CREATE TABLE `code_column_config` (
|
||||
DROP TABLE IF EXISTS `code_column`;
|
||||
CREATE TABLE `code_column` (
|
||||
`column_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
|
||||
`table_name` varchar(180) DEFAULT NULL,
|
||||
`column_name` varchar(255) DEFAULT NULL,
|
||||
`column_type` varchar(255) DEFAULT NULL,
|
||||
`dict_name` varchar(255) DEFAULT NULL,
|
||||
`extra` varchar(255) DEFAULT NULL,
|
||||
`form_show` bit(1) DEFAULT NULL,
|
||||
`form_type` varchar(255) DEFAULT NULL,
|
||||
`key_type` varchar(255) DEFAULT NULL,
|
||||
`list_show` bit(1) DEFAULT NULL,
|
||||
`not_null` bit(1) DEFAULT NULL,
|
||||
`query_type` varchar(255) DEFAULT NULL,
|
||||
`remark` varchar(255) DEFAULT NULL,
|
||||
`table_name` varchar(180) DEFAULT NULL COMMENT '表名',
|
||||
`column_name` varchar(255) DEFAULT NULL COMMENT '数据库字段名称',
|
||||
`column_type` varchar(255) DEFAULT NULL COMMENT '数据库字段类型',
|
||||
`dict_name` varchar(255) DEFAULT NULL COMMENT '字典名称',
|
||||
`extra` varchar(255) DEFAULT NULL COMMENT '字段额外的参数',
|
||||
`form_show` bit(1) DEFAULT NULL COMMENT '是否表单显示',
|
||||
`form_type` varchar(255) DEFAULT NULL COMMENT '表单类型',
|
||||
`key_type` varchar(255) DEFAULT NULL COMMENT '数据库字段键类型',
|
||||
`list_show` bit(1) DEFAULT NULL COMMENT '是否在列表显示',
|
||||
`not_null` bit(1) DEFAULT NULL COMMENT '是否为空',
|
||||
`query_type` varchar(255) DEFAULT NULL COMMENT '查询类型',
|
||||
`remark` varchar(255) DEFAULT NULL COMMENT '描述',
|
||||
PRIMARY KEY (`column_id`) USING BTREE,
|
||||
KEY `idx_table_name` (`table_name`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=191 ROW_FORMAT=COMPACT COMMENT='代码生成字段信息存储';
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=223 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='代码生成字段信息存储';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for code_gen_config
|
||||
-- Records of code_column
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `code_gen_config`;
|
||||
CREATE TABLE `code_gen_config` (
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for code_config
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `code_config`;
|
||||
CREATE TABLE `code_config` (
|
||||
`config_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
|
||||
`table_name` varchar(255) DEFAULT NULL COMMENT '表名',
|
||||
`author` varchar(255) DEFAULT NULL COMMENT '作者',
|
||||
@ -56,134 +62,15 @@ CREATE TABLE `code_gen_config` (
|
||||
`api_alias` varchar(255) DEFAULT NULL COMMENT '接口名称',
|
||||
PRIMARY KEY (`config_id`) USING BTREE,
|
||||
KEY `idx_table_name` (`table_name`(100))
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=7 ROW_FORMAT=COMPACT COMMENT='代码生成器配置';
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='代码生成器配置';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for mnt_app
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `mnt_app`;
|
||||
CREATE TABLE `mnt_app` (
|
||||
`app_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
|
||||
`name` varchar(255) DEFAULT NULL COMMENT '应用名称',
|
||||
`upload_path` varchar(255) DEFAULT NULL COMMENT '上传目录',
|
||||
`deploy_path` varchar(255) DEFAULT NULL COMMENT '部署路径',
|
||||
`backup_path` varchar(255) DEFAULT NULL COMMENT '备份路径',
|
||||
`port` int(255) DEFAULT NULL COMMENT '应用端口',
|
||||
`start_script` varchar(4000) DEFAULT NULL COMMENT '启动脚本',
|
||||
`deploy_script` varchar(4000) DEFAULT NULL COMMENT '部署脚本',
|
||||
`create_by` varchar(255) DEFAULT NULL COMMENT '创建者',
|
||||
`update_by` varchar(255) DEFAULT NULL COMMENT '更新者',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建日期',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
PRIMARY KEY (`app_id`) USING BTREE
|
||||
) ENGINE=InnoDB ROW_FORMAT=COMPACT COMMENT='应用管理';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of mnt_app
|
||||
-- Records of code_config
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `code_config` (`config_id`, `table_name`, `author`, `cover`, `module_name`, `pack`, `path`, `api_path`, `prefix`, `api_alias`) VALUES (7, 'sys_role', 'test', b'0', 'test', 'test', 'test', 'test/', NULL, 'test');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for mnt_database
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `mnt_database`;
|
||||
CREATE TABLE `mnt_database` (
|
||||
`db_id` varchar(50) NOT NULL COMMENT 'ID',
|
||||
`name` varchar(255) NOT NULL COMMENT '名称',
|
||||
`jdbc_url` varchar(255) NOT NULL COMMENT 'jdbc连接',
|
||||
`user_name` varchar(255) NOT NULL COMMENT '账号',
|
||||
`pwd` varchar(255) NOT NULL COMMENT '密码',
|
||||
`create_by` varchar(255) DEFAULT NULL COMMENT '创建者',
|
||||
`update_by` varchar(255) DEFAULT NULL COMMENT '更新者',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
PRIMARY KEY (`db_id`) USING BTREE
|
||||
) ENGINE=InnoDB ROW_FORMAT=COMPACT COMMENT='数据库管理';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of mnt_database
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for mnt_deploy
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `mnt_deploy`;
|
||||
CREATE TABLE `mnt_deploy` (
|
||||
`deploy_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
|
||||
`app_id` bigint(20) DEFAULT NULL COMMENT '应用编号',
|
||||
`create_by` varchar(255) DEFAULT NULL COMMENT '创建者',
|
||||
`update_by` varchar(255) DEFAULT NULL COMMENT '更新者',
|
||||
`create_time` datetime DEFAULT NULL,
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
PRIMARY KEY (`deploy_id`) USING BTREE,
|
||||
KEY `FK6sy157pseoxx4fmcqr1vnvvhy` (`app_id`) USING BTREE
|
||||
) ENGINE=InnoDB ROW_FORMAT=COMPACT COMMENT='部署管理';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of mnt_deploy
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for mnt_deploy_history
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `mnt_deploy_history`;
|
||||
CREATE TABLE `mnt_deploy_history` (
|
||||
`history_id` varchar(50) NOT NULL COMMENT 'ID',
|
||||
`app_name` varchar(255) NOT NULL COMMENT '应用名称',
|
||||
`deploy_date` datetime NOT NULL COMMENT '部署日期',
|
||||
`deploy_user` varchar(50) NOT NULL COMMENT '部署用户',
|
||||
`ip` varchar(20) NOT NULL COMMENT '服务器IP',
|
||||
`deploy_id` bigint(20) DEFAULT NULL COMMENT '部署编号',
|
||||
PRIMARY KEY (`history_id`) USING BTREE
|
||||
) ENGINE=InnoDB ROW_FORMAT=COMPACT COMMENT='部署历史管理';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of mnt_deploy_history
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for mnt_deploy_server
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `mnt_deploy_server`;
|
||||
CREATE TABLE `mnt_deploy_server` (
|
||||
`deploy_id` bigint(20) NOT NULL COMMENT '部署ID',
|
||||
`server_id` bigint(20) NOT NULL COMMENT '服务ID',
|
||||
PRIMARY KEY (`deploy_id`,`server_id`) USING BTREE,
|
||||
KEY `FKeaaha7jew9a02b3bk9ghols53` (`server_id`) USING BTREE
|
||||
) ENGINE=InnoDB ROW_FORMAT=COMPACT COMMENT='应用与服务器关联';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of mnt_deploy_server
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for mnt_server
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `mnt_server`;
|
||||
CREATE TABLE `mnt_server` (
|
||||
`server_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
|
||||
`account` varchar(50) DEFAULT NULL COMMENT '账号',
|
||||
`ip` varchar(20) DEFAULT NULL COMMENT 'IP地址',
|
||||
`name` varchar(100) DEFAULT NULL COMMENT '名称',
|
||||
`password` varchar(100) DEFAULT NULL COMMENT '密码',
|
||||
`port` int(11) DEFAULT NULL COMMENT '端口',
|
||||
`create_by` varchar(255) DEFAULT NULL COMMENT '创建者',
|
||||
`update_by` varchar(255) DEFAULT NULL COMMENT '更新者',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
PRIMARY KEY (`server_id`) USING BTREE,
|
||||
KEY `idx_ip` (`ip`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=2 ROW_FORMAT=COMPACT COMMENT='服务器管理';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for sys_dept
|
||||
-- ----------------------------
|
||||
@ -200,21 +87,21 @@ CREATE TABLE `sys_dept` (
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建日期',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
PRIMARY KEY (`dept_id`) USING BTREE,
|
||||
KEY `inx_pid` (`pid`),
|
||||
KEY `inx_enabled` (`enabled`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=18 ROW_FORMAT=COMPACT COMMENT='部门';
|
||||
KEY `idx_pid` (`pid`),
|
||||
KEY `idx_enabled` (`enabled`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='部门';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of sys_dept
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `sys_dept` VALUES (2, 7, 1, '研发部', 3, b'1', 'admin', 'admin', '2019-03-25 09:15:32', '2020-08-02 14:48:47');
|
||||
INSERT INTO `sys_dept` VALUES (5, 7, 0, '运维部', 4, b'1', 'admin', 'admin', '2019-03-25 09:20:44', '2020-05-17 14:27:27');
|
||||
INSERT INTO `sys_dept` VALUES (6, 8, 0, '测试部', 6, b'1', 'admin', 'admin', '2019-03-25 09:52:18', '2020-06-08 11:59:21');
|
||||
INSERT INTO `sys_dept` VALUES (7, NULL, 2, '华南分部', 0, b'1', 'admin', 'admin', '2019-03-25 11:04:50', '2020-06-08 12:08:56');
|
||||
INSERT INTO `sys_dept` VALUES (8, NULL, 2, '华北分部', 1, b'1', 'admin', 'admin', '2019-03-25 11:04:53', '2020-05-14 12:54:00');
|
||||
INSERT INTO `sys_dept` VALUES (15, 8, 0, 'UI部门', 7, b'1', 'admin', 'admin', '2020-05-13 22:56:53', '2020-05-14 12:54:13');
|
||||
INSERT INTO `sys_dept` VALUES (17, 2, 0, '研发一组', 999, b'1', 'admin', 'admin', '2020-08-02 14:49:07', '2020-08-02 14:49:07');
|
||||
INSERT INTO `sys_dept` (`dept_id`, `pid`, `sub_count`, `name`, `dept_sort`, `enabled`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (2, 7, 1, '研发部', 3, b'1', 'admin', 'admin', '2019-03-25 09:15:32', '2020-08-02 14:48:47');
|
||||
INSERT INTO `sys_dept` (`dept_id`, `pid`, `sub_count`, `name`, `dept_sort`, `enabled`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (5, 7, 0, '运维部', 4, b'1', 'admin', 'admin', '2019-03-25 09:20:44', '2020-05-17 14:27:27');
|
||||
INSERT INTO `sys_dept` (`dept_id`, `pid`, `sub_count`, `name`, `dept_sort`, `enabled`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (6, 8, 0, '测试部', 6, b'1', 'admin', 'admin', '2019-03-25 09:52:18', '2020-06-08 11:59:21');
|
||||
INSERT INTO `sys_dept` (`dept_id`, `pid`, `sub_count`, `name`, `dept_sort`, `enabled`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (7, NULL, 2, '华南分部', 0, b'1', 'admin', 'admin', '2019-03-25 11:04:50', '2020-06-08 12:08:56');
|
||||
INSERT INTO `sys_dept` (`dept_id`, `pid`, `sub_count`, `name`, `dept_sort`, `enabled`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (8, NULL, 2, '华北分部', 1, b'1', 'admin', 'admin', '2019-03-25 11:04:53', '2020-05-14 12:54:00');
|
||||
INSERT INTO `sys_dept` (`dept_id`, `pid`, `sub_count`, `name`, `dept_sort`, `enabled`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (15, 8, 0, 'UI部门', 7, b'1', 'admin', 'admin', '2020-05-13 22:56:53', '2020-05-14 12:54:13');
|
||||
INSERT INTO `sys_dept` (`dept_id`, `pid`, `sub_count`, `name`, `dept_sort`, `enabled`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (17, 2, 0, '研发一组', 999, b'1', 'admin', 'admin', '2020-08-02 14:49:07', '2020-08-02 14:49:07');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
@ -230,15 +117,15 @@ CREATE TABLE `sys_dict` (
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建日期',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
PRIMARY KEY (`dict_id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=6 ROW_FORMAT=COMPACT COMMENT='数据字典';
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='数据字典';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of sys_dict
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `sys_dict` VALUES (1, 'user_status', '用户状态', NULL, NULL, '2019-10-27 20:31:36', NULL);
|
||||
INSERT INTO `sys_dict` VALUES (4, 'dept_status', '部门状态', NULL, NULL, '2019-10-27 20:31:36', NULL);
|
||||
INSERT INTO `sys_dict` VALUES (5, 'job_status', '岗位状态', NULL, NULL, '2019-10-27 20:31:36', NULL);
|
||||
INSERT INTO `sys_dict` (`dict_id`, `name`, `description`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (1, 'user_status', '用户状态', NULL, NULL, '2019-10-27 20:31:36', NULL);
|
||||
INSERT INTO `sys_dict` (`dict_id`, `name`, `description`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (4, 'dept_status', '部门状态', NULL, NULL, '2019-10-27 20:31:36', NULL);
|
||||
INSERT INTO `sys_dict` (`dict_id`, `name`, `description`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (5, 'job_status', '岗位状态', NULL, NULL, '2019-10-27 20:31:36', NULL);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
@ -256,19 +143,19 @@ CREATE TABLE `sys_dict_detail` (
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建日期',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
PRIMARY KEY (`detail_id`) USING BTREE,
|
||||
KEY `FK5tpkputc6d9nboxojdbgnpmyb` (`dict_id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=7 ROW_FORMAT=COMPACT COMMENT='数据字典详情';
|
||||
KEY `idx_dict_id` (`dict_id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='数据字典详情';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of sys_dict_detail
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `sys_dict_detail` VALUES (1, 1, '激活', 'true', 1, NULL, NULL, '2019-10-27 20:31:36', NULL);
|
||||
INSERT INTO `sys_dict_detail` VALUES (2, 1, '禁用', 'false', 2, NULL, NULL, NULL, NULL);
|
||||
INSERT INTO `sys_dict_detail` VALUES (3, 4, '启用', 'true', 1, NULL, NULL, NULL, NULL);
|
||||
INSERT INTO `sys_dict_detail` VALUES (4, 4, '停用', 'false', 2, NULL, NULL, '2019-10-27 20:31:36', NULL);
|
||||
INSERT INTO `sys_dict_detail` VALUES (5, 5, '启用', 'true', 1, NULL, NULL, NULL, NULL);
|
||||
INSERT INTO `sys_dict_detail` VALUES (6, 5, '停用', 'false', 2, NULL, NULL, '2019-10-27 20:31:36', NULL);
|
||||
INSERT INTO `sys_dict_detail` (`detail_id`, `dict_id`, `label`, `value`, `dict_sort`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (1, 1, '激活', 'true', 1, NULL, NULL, '2019-10-27 20:31:36', NULL);
|
||||
INSERT INTO `sys_dict_detail` (`detail_id`, `dict_id`, `label`, `value`, `dict_sort`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (2, 1, '禁用', 'false', 2, NULL, NULL, NULL, NULL);
|
||||
INSERT INTO `sys_dict_detail` (`detail_id`, `dict_id`, `label`, `value`, `dict_sort`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (3, 4, '启用', 'true', 1, NULL, NULL, NULL, NULL);
|
||||
INSERT INTO `sys_dict_detail` (`detail_id`, `dict_id`, `label`, `value`, `dict_sort`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (4, 4, '停用', 'false', 2, NULL, NULL, '2019-10-27 20:31:36', NULL);
|
||||
INSERT INTO `sys_dict_detail` (`detail_id`, `dict_id`, `label`, `value`, `dict_sort`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (5, 5, '启用', 'true', 1, NULL, NULL, NULL, NULL);
|
||||
INSERT INTO `sys_dict_detail` (`detail_id`, `dict_id`, `label`, `value`, `dict_sort`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (6, 5, '停用', 'false', 2, NULL, NULL, '2019-10-27 20:31:36', NULL);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
@ -286,17 +173,17 @@ CREATE TABLE `sys_job` (
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
PRIMARY KEY (`job_id`) USING BTREE,
|
||||
UNIQUE KEY `uniq_name` (`name`),
|
||||
KEY `inx_enabled` (`enabled`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=13 ROW_FORMAT=COMPACT COMMENT='岗位';
|
||||
KEY `idx_enabled` (`enabled`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='岗位';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of sys_job
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `sys_job` VALUES (8, '人事专员', b'1', 3, NULL, NULL, '2019-03-29 14:52:28', NULL);
|
||||
INSERT INTO `sys_job` VALUES (10, '产品经理', b'1', 4, NULL, NULL, '2019-03-29 14:55:51', NULL);
|
||||
INSERT INTO `sys_job` VALUES (11, '全栈开发', b'1', 2, NULL, 'admin', '2019-03-31 13:39:30', '2020-05-05 11:33:43');
|
||||
INSERT INTO `sys_job` VALUES (12, '软件测试', b'1', 5, NULL, 'admin', '2019-03-31 13:39:43', '2020-05-10 19:56:26');
|
||||
INSERT INTO `sys_job` (`job_id`, `name`, `enabled`, `job_sort`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (8, '人事专员', b'1', 3, NULL, NULL, '2019-03-29 14:52:28', NULL);
|
||||
INSERT INTO `sys_job` (`job_id`, `name`, `enabled`, `job_sort`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (10, '产品经理', b'1', 4, NULL, NULL, '2019-03-29 14:55:51', NULL);
|
||||
INSERT INTO `sys_job` (`job_id`, `name`, `enabled`, `job_sort`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (11, '全栈开发', b'1', 2, NULL, 'admin', '2019-03-31 13:39:30', '2020-05-05 11:33:43');
|
||||
INSERT INTO `sys_job` (`job_id`, `name`, `enabled`, `job_sort`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (12, '软件测试', b'1', 5, NULL, 'admin', '2019-03-31 13:39:43', '2020-05-10 19:56:26');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
@ -305,21 +192,27 @@ COMMIT;
|
||||
DROP TABLE IF EXISTS `sys_log`;
|
||||
CREATE TABLE `sys_log` (
|
||||
`log_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
|
||||
`description` varchar(255) DEFAULT NULL,
|
||||
`log_type` varchar(10) DEFAULT NULL,
|
||||
`method` varchar(255) DEFAULT NULL,
|
||||
`params` text DEFAULT NULL,
|
||||
`request_ip` varchar(255) DEFAULT NULL,
|
||||
`time` bigint(20) DEFAULT NULL,
|
||||
`username` varchar(255) DEFAULT NULL,
|
||||
`address` varchar(255) DEFAULT NULL,
|
||||
`browser` varchar(255) DEFAULT NULL,
|
||||
`exception_detail` text DEFAULT NULL,
|
||||
`create_time` datetime DEFAULT NULL,
|
||||
`description` varchar(255) DEFAULT NULL COMMENT '描述',
|
||||
`log_type` varchar(10) NOT NULL COMMENT '日志类型:INFI/ERROR',
|
||||
`method` varchar(255) DEFAULT NULL COMMENT '方法名',
|
||||
`params` text DEFAULT NULL COMMENT '参数',
|
||||
`request_ip` varchar(255) DEFAULT NULL COMMENT '请求IP',
|
||||
`time` bigint(20) DEFAULT NULL COMMENT '执行时间',
|
||||
`username` varchar(255) DEFAULT NULL COMMENT '用户名',
|
||||
`address` varchar(255) DEFAULT NULL COMMENT '地址',
|
||||
`browser` varchar(255) DEFAULT NULL COMMENT '浏览器',
|
||||
`exception_detail` text DEFAULT NULL COMMENT '异常',
|
||||
`create_time` datetime NOT NULL COMMENT '创建时间',
|
||||
PRIMARY KEY (`log_id`) USING BTREE,
|
||||
KEY `log_create_time_index` (`create_time`),
|
||||
KEY `inx_log_type` (`log_type`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=3537 ROW_FORMAT=COMPACT COMMENT='系统日志';
|
||||
KEY `idx_create_time_index` (`create_time`),
|
||||
KEY `idx_log_type` (`log_type`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=3593 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='系统日志';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of sys_log
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for sys_menu
|
||||
@ -347,89 +240,70 @@ CREATE TABLE `sys_menu` (
|
||||
PRIMARY KEY (`menu_id`) USING BTREE,
|
||||
UNIQUE KEY `uniq_title` (`title`),
|
||||
UNIQUE KEY `uniq_name` (`name`),
|
||||
KEY `inx_pid` (`pid`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=118 ROW_FORMAT=COMPACT COMMENT='系统菜单';
|
||||
KEY `idx_pid` (`pid`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=118 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='系统菜单';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of sys_menu
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `sys_menu` VALUES (1, NULL, 7, 0, '系统管理', NULL, NULL, 1, 'system', 'system', b'0', b'0', b'0', NULL, NULL, NULL, '2018-12-18 15:11:29', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (2, 1, 3, 1, '用户管理', 'User', 'system/user/index', 2, 'peoples', 'user', b'0', b'0', b'0', 'user:list', NULL, NULL, '2018-12-18 15:14:44', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (3, 1, 3, 1, '角色管理', 'Role', 'system/role/index', 3, 'role', 'role', b'0', b'0', b'0', 'roles:list', NULL, NULL, '2018-12-18 15:16:07', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (5, 1, 3, 1, '菜单管理', 'Menu', 'system/menu/index', 5, 'menu', 'menu', b'0', b'0', b'0', 'menu:list', NULL, NULL, '2018-12-18 15:17:28', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (6, NULL, 5, 0, '系统监控', NULL, NULL, 10, 'monitor', 'monitor', b'0', b'0', b'0', NULL, NULL, NULL, '2018-12-18 15:17:48', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (7, 6, 0, 1, '操作日志', 'Log', 'monitor/log/index', 11, 'log', 'logs', b'0', b'1', b'0', NULL, NULL, 'admin', '2018-12-18 15:18:26', '2020-06-06 13:11:57');
|
||||
INSERT INTO `sys_menu` VALUES (9, 6, 0, 1, 'SQL监控', 'Sql', 'monitor/sql/index', 18, 'sqlMonitor', 'druid', b'0', b'0', b'0', NULL, NULL, NULL, '2018-12-18 15:19:34', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (10, NULL, 5, 0, '组件管理', NULL, NULL, 50, 'zujian', 'components', b'0', b'0', b'0', NULL, NULL, NULL, '2018-12-19 13:38:16', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (11, 10, 0, 1, '图标库', 'Icons', 'components/icons/index', 51, 'icon', 'icon', b'0', b'0', b'0', NULL, NULL, NULL, '2018-12-19 13:38:49', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (14, 36, 0, 1, '邮件工具', 'Email', 'tools/email/index', 35, 'email', 'email', b'0', b'0', b'0', NULL, NULL, NULL, '2018-12-27 10:13:09', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (15, 10, 0, 1, '富文本', 'Editor', 'components/Editor', 52, 'fwb', 'tinymce', b'0', b'0', b'0', NULL, NULL, NULL, '2018-12-27 11:58:25', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (18, 36, 3, 1, '存储管理', 'Storage', 'tools/storage/index', 34, 'qiniu', 'storage', b'0', b'0', b'0', 'storage:list', NULL, NULL, '2018-12-31 11:12:15', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (19, 36, 0, 1, '支付宝工具', 'AliPay', 'tools/aliPay/index', 37, 'alipay', 'aliPay', b'0', b'0', b'0', NULL, NULL, NULL, '2018-12-31 14:52:38', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (21, NULL, 2, 0, '多级菜单', NULL, '', 900, 'menu', 'nested', b'0', b'0', b'0', NULL, NULL, 'admin', '2019-01-04 16:22:03', '2020-06-21 17:27:35');
|
||||
INSERT INTO `sys_menu` VALUES (22, 21, 2, 0, '二级菜单1', NULL, '', 999, 'menu', 'menu1', b'0', b'0', b'0', NULL, NULL, 'admin', '2019-01-04 16:23:29', '2020-06-21 17:27:20');
|
||||
INSERT INTO `sys_menu` VALUES (23, 21, 0, 1, '二级菜单2', NULL, 'nested/menu2/index', 999, 'menu', 'menu2', b'0', b'0', b'0', NULL, NULL, NULL, '2019-01-04 16:23:57', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (24, 22, 0, 1, '三级菜单1', 'Test', 'nested/menu1/menu1-1', 999, 'menu', 'menu1-1', b'0', b'0', b'0', NULL, NULL, NULL, '2019-01-04 16:24:48', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (27, 22, 0, 1, '三级菜单2', NULL, 'nested/menu1/menu1-2', 999, 'menu', 'menu1-2', b'0', b'0', b'0', NULL, NULL, NULL, '2019-01-07 17:27:32', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (28, 1, 3, 1, '任务调度', 'Timing', 'system/timing/index', 999, 'timing', 'timing', b'0', b'0', b'0', 'timing:list', NULL, NULL, '2019-01-07 20:34:40', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (30, 36, 0, 1, '代码生成', 'GeneratorIndex', 'generator/index', 32, 'dev', 'generator', b'0', b'1', b'0', NULL, NULL, NULL, '2019-01-11 15:45:55', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (32, 6, 0, 1, '异常日志', 'ErrorLog', 'monitor/log/errorLog', 12, 'error', 'errorLog', b'0', b'0', b'0', NULL, NULL, NULL, '2019-01-13 13:49:03', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (33, 10, 0, 1, 'Markdown', 'Markdown', 'components/MarkDown', 53, 'markdown', 'markdown', b'0', b'0', b'0', NULL, NULL, NULL, '2019-03-08 13:46:44', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (34, 10, 0, 1, 'Yaml编辑器', 'YamlEdit', 'components/YamlEdit', 54, 'dev', 'yaml', b'0', b'0', b'0', NULL, NULL, NULL, '2019-03-08 15:49:40', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (35, 1, 3, 1, '部门管理', 'Dept', 'system/dept/index', 6, 'dept', 'dept', b'0', b'0', b'0', 'dept:list', NULL, NULL, '2019-03-25 09:46:00', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (36, NULL, 7, 0, '系统工具', NULL, '', 30, 'sys-tools', 'sys-tools', b'0', b'0', b'0', NULL, NULL, NULL, '2019-03-29 10:57:35', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (37, 1, 3, 1, '岗位管理', 'Job', 'system/job/index', 7, 'Steve-Jobs', 'job', b'0', b'0', b'0', 'job:list', NULL, NULL, '2019-03-29 13:51:18', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (38, 36, 0, 1, '接口文档', 'Swagger', 'tools/swagger/index', 36, 'swagger', 'swagger2', b'0', b'0', b'0', NULL, NULL, NULL, '2019-03-29 19:57:53', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (39, 1, 3, 1, '字典管理', 'Dict', 'system/dict/index', 8, 'dictionary', 'dict', b'0', b'0', b'0', 'dict:list', NULL, NULL, '2019-04-10 11:49:04', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (41, 6, 0, 1, '在线用户', 'OnlineUser', 'monitor/online/index', 10, 'Steve-Jobs', 'online', b'0', b'0', b'0', NULL, NULL, NULL, '2019-10-26 22:08:43', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (44, 2, 0, 2, '用户新增', NULL, '', 2, '', '', b'0', b'0', b'0', 'user:add', NULL, NULL, '2019-10-29 10:59:46', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (45, 2, 0, 2, '用户编辑', NULL, '', 3, '', '', b'0', b'0', b'0', 'user:edit', NULL, NULL, '2019-10-29 11:00:08', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (46, 2, 0, 2, '用户删除', NULL, '', 4, '', '', b'0', b'0', b'0', 'user:del', NULL, NULL, '2019-10-29 11:00:23', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (48, 3, 0, 2, '角色创建', NULL, '', 2, '', '', b'0', b'0', b'0', 'roles:add', NULL, NULL, '2019-10-29 12:45:34', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (49, 3, 0, 2, '角色修改', NULL, '', 3, '', '', b'0', b'0', b'0', 'roles:edit', NULL, NULL, '2019-10-29 12:46:16', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (50, 3, 0, 2, '角色删除', NULL, '', 4, '', '', b'0', b'0', b'0', 'roles:del', NULL, NULL, '2019-10-29 12:46:51', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (52, 5, 0, 2, '菜单新增', NULL, '', 2, '', '', b'0', b'0', b'0', 'menu:add', NULL, NULL, '2019-10-29 12:55:07', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (53, 5, 0, 2, '菜单编辑', NULL, '', 3, '', '', b'0', b'0', b'0', 'menu:edit', NULL, NULL, '2019-10-29 12:55:40', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (54, 5, 0, 2, '菜单删除', NULL, '', 4, '', '', b'0', b'0', b'0', 'menu:del', NULL, NULL, '2019-10-29 12:56:00', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (56, 35, 0, 2, '部门新增', NULL, '', 2, '', '', b'0', b'0', b'0', 'dept:add', NULL, NULL, '2019-10-29 12:57:09', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (57, 35, 0, 2, '部门编辑', NULL, '', 3, '', '', b'0', b'0', b'0', 'dept:edit', NULL, NULL, '2019-10-29 12:57:27', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (58, 35, 0, 2, '部门删除', NULL, '', 4, '', '', b'0', b'0', b'0', 'dept:del', NULL, NULL, '2019-10-29 12:57:41', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (60, 37, 0, 2, '岗位新增', NULL, '', 2, '', '', b'0', b'0', b'0', 'job:add', NULL, NULL, '2019-10-29 12:58:27', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (61, 37, 0, 2, '岗位编辑', NULL, '', 3, '', '', b'0', b'0', b'0', 'job:edit', NULL, NULL, '2019-10-29 12:58:45', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (62, 37, 0, 2, '岗位删除', NULL, '', 4, '', '', b'0', b'0', b'0', 'job:del', NULL, NULL, '2019-10-29 12:59:04', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (64, 39, 0, 2, '字典新增', NULL, '', 2, '', '', b'0', b'0', b'0', 'dict:add', NULL, NULL, '2019-10-29 13:00:17', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (65, 39, 0, 2, '字典编辑', NULL, '', 3, '', '', b'0', b'0', b'0', 'dict:edit', NULL, NULL, '2019-10-29 13:00:42', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (66, 39, 0, 2, '字典删除', NULL, '', 4, '', '', b'0', b'0', b'0', 'dict:del', NULL, NULL, '2019-10-29 13:00:59', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (73, 28, 0, 2, '任务新增', NULL, '', 2, '', '', b'0', b'0', b'0', 'timing:add', NULL, NULL, '2019-10-29 13:07:28', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (74, 28, 0, 2, '任务编辑', NULL, '', 3, '', '', b'0', b'0', b'0', 'timing:edit', NULL, NULL, '2019-10-29 13:07:41', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (75, 28, 0, 2, '任务删除', NULL, '', 4, '', '', b'0', b'0', b'0', 'timing:del', NULL, NULL, '2019-10-29 13:07:54', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (77, 18, 0, 2, '上传文件', NULL, '', 2, '', '', b'0', b'0', b'0', 'storage:add', NULL, NULL, '2019-10-29 13:09:09', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (78, 18, 0, 2, '文件编辑', NULL, '', 3, '', '', b'0', b'0', b'0', 'storage:edit', NULL, NULL, '2019-10-29 13:09:22', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (79, 18, 0, 2, '文件删除', NULL, '', 4, '', '', b'0', b'0', b'0', 'storage:del', NULL, NULL, '2019-10-29 13:09:34', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (80, 6, 0, 1, '服务监控', 'ServerMonitor', 'monitor/server/index', 14, 'codeConsole', 'server', b'0', b'0', b'0', 'monitor:list', NULL, 'admin', '2019-11-07 13:06:39', '2020-05-04 18:20:50');
|
||||
INSERT INTO `sys_menu` VALUES (82, 36, 0, 1, '生成配置', 'GeneratorConfig', 'generator/config', 33, 'dev', 'generator/config/:tableName', b'0', b'1', b'1', '', NULL, NULL, '2019-11-17 20:08:56', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (83, 10, 0, 1, '图表库', 'Echarts', 'components/Echarts', 50, 'chart', 'echarts', b'0', b'1', b'0', '', NULL, NULL, '2019-11-21 09:04:32', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (90, NULL, 5, 1, '运维管理', 'Mnt', '', 20, 'mnt', 'mnt', b'0', b'0', b'0', NULL, NULL, NULL, '2019-11-09 10:31:08', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (92, 90, 3, 1, '服务器', 'ServerDeploy', 'mnt/server/index', 22, 'server', 'mnt/serverDeploy', b'0', b'0', b'0', 'serverDeploy:list', NULL, NULL, '2019-11-10 10:29:25', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (93, 90, 3, 1, '应用管理', 'App', 'mnt/app/index', 23, 'app', 'mnt/app', b'0', b'0', b'0', 'app:list', NULL, NULL, '2019-11-10 11:05:16', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (94, 90, 3, 1, '部署管理', 'Deploy', 'mnt/deploy/index', 24, 'deploy', 'mnt/deploy', b'0', b'0', b'0', 'deploy:list', NULL, NULL, '2019-11-10 15:56:55', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (97, 90, 1, 1, '部署备份', 'DeployHistory', 'mnt/deployHistory/index', 25, 'backup', 'mnt/deployHistory', b'0', b'0', b'0', 'deployHistory:list', NULL, NULL, '2019-11-10 16:49:44', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (98, 90, 3, 1, '数据库管理', 'Database', 'mnt/database/index', 26, 'database', 'mnt/database', b'0', b'0', b'0', 'database:list', NULL, NULL, '2019-11-10 20:40:04', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (102, 97, 0, 2, '删除', NULL, '', 999, '', '', b'0', b'0', b'0', 'deployHistory:del', NULL, NULL, '2019-11-17 09:32:48', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (103, 92, 0, 2, '服务器新增', NULL, '', 999, '', '', b'0', b'0', b'0', 'serverDeploy:add', NULL, NULL, '2019-11-17 11:08:33', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (104, 92, 0, 2, '服务器编辑', NULL, '', 999, '', '', b'0', b'0', b'0', 'serverDeploy:edit', NULL, NULL, '2019-11-17 11:08:57', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (105, 92, 0, 2, '服务器删除', NULL, '', 999, '', '', b'0', b'0', b'0', 'serverDeploy:del', NULL, NULL, '2019-11-17 11:09:15', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (106, 93, 0, 2, '应用新增', NULL, '', 999, '', '', b'0', b'0', b'0', 'app:add', NULL, NULL, '2019-11-17 11:10:03', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (107, 93, 0, 2, '应用编辑', NULL, '', 999, '', '', b'0', b'0', b'0', 'app:edit', NULL, NULL, '2019-11-17 11:10:28', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (108, 93, 0, 2, '应用删除', NULL, '', 999, '', '', b'0', b'0', b'0', 'app:del', NULL, NULL, '2019-11-17 11:10:55', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (109, 94, 0, 2, '部署新增', NULL, '', 999, '', '', b'0', b'0', b'0', 'deploy:add', NULL, NULL, '2019-11-17 11:11:22', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (110, 94, 0, 2, '部署编辑', NULL, '', 999, '', '', b'0', b'0', b'0', 'deploy:edit', NULL, NULL, '2019-11-17 11:11:41', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (111, 94, 0, 2, '部署删除', NULL, '', 999, '', '', b'0', b'0', b'0', 'deploy:del', NULL, NULL, '2019-11-17 11:12:01', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (112, 98, 0, 2, '数据库新增', NULL, '', 999, '', '', b'0', b'0', b'0', 'database:add', NULL, NULL, '2019-11-17 11:12:43', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (113, 98, 0, 2, '数据库编辑', NULL, '', 999, '', '', b'0', b'0', b'0', 'database:edit', NULL, NULL, '2019-11-17 11:12:58', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (114, 98, 0, 2, '数据库删除', NULL, '', 999, '', '', b'0', b'0', b'0', 'database:del', NULL, NULL, '2019-11-17 11:13:14', NULL);
|
||||
INSERT INTO `sys_menu` VALUES (116, 36, 0, 1, '生成预览', 'Preview', 'generator/preview', 999, 'java', 'generator/preview/:tableName', b'0', b'1', b'1', NULL, NULL, NULL, '2019-11-26 14:54:36', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (1, NULL, 7, 0, '系统管理', NULL, NULL, 1, 'system', 'system', b'0', b'0', b'0', NULL, NULL, NULL, '2018-12-18 15:11:29', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (2, 1, 3, 1, '用户管理', 'User', 'system/user/index', 2, 'peoples', 'user', b'0', b'0', b'0', 'user:list', NULL, NULL, '2018-12-18 15:14:44', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (3, 1, 3, 1, '角色管理', 'Role', 'system/role/index', 3, 'role', 'role', b'0', b'0', b'0', 'roles:list', NULL, NULL, '2018-12-18 15:16:07', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (5, 1, 3, 1, '菜单管理', 'Menu', 'system/menu/index', 5, 'menu', 'menu', b'0', b'0', b'0', 'menu:list', NULL, NULL, '2018-12-18 15:17:28', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (6, NULL, 5, 0, '系统监控', NULL, NULL, 10, 'monitor', 'monitor', b'0', b'0', b'0', NULL, NULL, NULL, '2018-12-18 15:17:48', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (7, 6, 0, 1, '操作日志', 'Log', 'monitor/log/index', 11, 'log', 'logs', b'0', b'1', b'0', NULL, NULL, 'admin', '2018-12-18 15:18:26', '2020-06-06 13:11:57');
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (9, 6, 0, 1, 'SQL监控', 'Sql', 'monitor/sql/index', 18, 'sqlMonitor', 'druid', b'0', b'0', b'0', NULL, NULL, NULL, '2018-12-18 15:19:34', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (10, NULL, 5, 0, '组件管理', NULL, NULL, 50, 'zujian', 'components', b'0', b'0', b'0', NULL, NULL, NULL, '2018-12-19 13:38:16', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (11, 10, 0, 1, '图标库', 'Icons', 'components/icons/index', 51, 'icon', 'icon', b'0', b'0', b'0', NULL, NULL, NULL, '2018-12-19 13:38:49', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (14, 36, 0, 1, '邮件工具', 'Email', 'tools/email/index', 35, 'email', 'email', b'0', b'0', b'0', NULL, NULL, NULL, '2018-12-27 10:13:09', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (15, 10, 0, 1, '富文本', 'Editor', 'components/Editor', 52, 'fwb', 'tinymce', b'0', b'0', b'0', NULL, NULL, NULL, '2018-12-27 11:58:25', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (18, 36, 3, 1, '存储管理', 'Storage', 'tools/storage/index', 34, 'qiniu', 'storage', b'0', b'0', b'0', 'storage:list', NULL, NULL, '2018-12-31 11:12:15', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (19, 36, 0, 1, '支付宝工具', 'AliPay', 'tools/aliPay/index', 37, 'alipay', 'aliPay', b'0', b'0', b'0', NULL, NULL, NULL, '2018-12-31 14:52:38', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (21, NULL, 2, 0, '多级菜单', NULL, '', 900, 'menu', 'nested', b'0', b'0', b'0', NULL, NULL, 'admin', '2019-01-04 16:22:03', '2020-06-21 17:27:35');
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (22, 21, 2, 0, '二级菜单1', NULL, '', 999, 'menu', 'menu1', b'0', b'0', b'0', NULL, NULL, 'admin', '2019-01-04 16:23:29', '2020-06-21 17:27:20');
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (23, 21, 0, 1, '二级菜单2', NULL, 'nested/menu2/index', 999, 'menu', 'menu2', b'0', b'0', b'0', NULL, NULL, NULL, '2019-01-04 16:23:57', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (24, 22, 0, 1, '三级菜单1', 'Test', 'nested/menu1/menu1-1', 999, 'menu', 'menu1-1', b'0', b'0', b'0', NULL, NULL, NULL, '2019-01-04 16:24:48', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (27, 22, 0, 1, '三级菜单2', NULL, 'nested/menu1/menu1-2', 999, 'menu', 'menu1-2', b'0', b'0', b'0', NULL, NULL, NULL, '2019-01-07 17:27:32', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (28, 1, 3, 1, '任务调度', 'Timing', 'system/timing/index', 999, 'timing', 'timing', b'0', b'0', b'0', 'timing:list', NULL, NULL, '2019-01-07 20:34:40', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (30, 36, 0, 1, '代码生成', 'GeneratorIndex', 'generator/index', 32, 'dev', 'generator', b'0', b'1', b'0', NULL, NULL, NULL, '2019-01-11 15:45:55', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (32, 6, 0, 1, '异常日志', 'ErrorLog', 'monitor/log/errorLog', 12, 'error', 'errorLog', b'0', b'0', b'0', NULL, NULL, NULL, '2019-01-13 13:49:03', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (33, 10, 0, 1, 'Markdown', 'Markdown', 'components/MarkDown', 53, 'markdown', 'markdown', b'0', b'0', b'0', NULL, NULL, NULL, '2019-03-08 13:46:44', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (34, 10, 0, 1, 'Yaml编辑器', 'YamlEdit', 'components/YamlEdit', 54, 'dev', 'yaml', b'0', b'0', b'0', NULL, NULL, NULL, '2019-03-08 15:49:40', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (35, 1, 3, 1, '部门管理', 'Dept', 'system/dept/index', 6, 'dept', 'dept', b'0', b'0', b'0', 'dept:list', NULL, NULL, '2019-03-25 09:46:00', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (36, NULL, 7, 0, '系统工具', NULL, '', 30, 'sys-tools', 'sys-tools', b'0', b'0', b'0', NULL, NULL, NULL, '2019-03-29 10:57:35', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (37, 1, 3, 1, '岗位管理', 'Job', 'system/job/index', 7, 'Steve-Jobs', 'job', b'0', b'0', b'0', 'job:list', NULL, NULL, '2019-03-29 13:51:18', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (38, 36, 0, 1, '接口文档', 'Swagger', 'tools/swagger/index', 36, 'swagger', 'swagger2', b'0', b'0', b'0', NULL, NULL, NULL, '2019-03-29 19:57:53', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (39, 1, 3, 1, '字典管理', 'Dict', 'system/dict/index', 8, 'dictionary', 'dict', b'0', b'0', b'0', 'dict:list', NULL, NULL, '2019-04-10 11:49:04', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (41, 6, 0, 1, '在线用户', 'OnlineUser', 'monitor/online/index', 10, 'Steve-Jobs', 'online', b'0', b'0', b'0', NULL, NULL, NULL, '2019-10-26 22:08:43', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (44, 2, 0, 2, '用户新增', NULL, '', 2, '', '', b'0', b'0', b'0', 'user:add', NULL, NULL, '2019-10-29 10:59:46', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (45, 2, 0, 2, '用户编辑', NULL, '', 3, '', '', b'0', b'0', b'0', 'user:edit', NULL, NULL, '2019-10-29 11:00:08', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (46, 2, 0, 2, '用户删除', NULL, '', 4, '', '', b'0', b'0', b'0', 'user:del', NULL, NULL, '2019-10-29 11:00:23', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (48, 3, 0, 2, '角色创建', NULL, '', 2, '', '', b'0', b'0', b'0', 'roles:add', NULL, NULL, '2019-10-29 12:45:34', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (49, 3, 0, 2, '角色修改', NULL, '', 3, '', '', b'0', b'0', b'0', 'roles:edit', NULL, NULL, '2019-10-29 12:46:16', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (50, 3, 0, 2, '角色删除', NULL, '', 4, '', '', b'0', b'0', b'0', 'roles:del', NULL, NULL, '2019-10-29 12:46:51', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (52, 5, 0, 2, '菜单新增', NULL, '', 2, '', '', b'0', b'0', b'0', 'menu:add', NULL, NULL, '2019-10-29 12:55:07', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (53, 5, 0, 2, '菜单编辑', NULL, '', 3, '', '', b'0', b'0', b'0', 'menu:edit', NULL, NULL, '2019-10-29 12:55:40', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (54, 5, 0, 2, '菜单删除', NULL, '', 4, '', '', b'0', b'0', b'0', 'menu:del', NULL, NULL, '2019-10-29 12:56:00', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (56, 35, 0, 2, '部门新增', NULL, '', 2, '', '', b'0', b'0', b'0', 'dept:add', NULL, NULL, '2019-10-29 12:57:09', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (57, 35, 0, 2, '部门编辑', NULL, '', 3, '', '', b'0', b'0', b'0', 'dept:edit', NULL, NULL, '2019-10-29 12:57:27', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (58, 35, 0, 2, '部门删除', NULL, '', 4, '', '', b'0', b'0', b'0', 'dept:del', NULL, NULL, '2019-10-29 12:57:41', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (60, 37, 0, 2, '岗位新增', NULL, '', 2, '', '', b'0', b'0', b'0', 'job:add', NULL, NULL, '2019-10-29 12:58:27', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (61, 37, 0, 2, '岗位编辑', NULL, '', 3, '', '', b'0', b'0', b'0', 'job:edit', NULL, NULL, '2019-10-29 12:58:45', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (62, 37, 0, 2, '岗位删除', NULL, '', 4, '', '', b'0', b'0', b'0', 'job:del', NULL, NULL, '2019-10-29 12:59:04', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (64, 39, 0, 2, '字典新增', NULL, '', 2, '', '', b'0', b'0', b'0', 'dict:add', NULL, NULL, '2019-10-29 13:00:17', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (65, 39, 0, 2, '字典编辑', NULL, '', 3, '', '', b'0', b'0', b'0', 'dict:edit', NULL, NULL, '2019-10-29 13:00:42', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (66, 39, 0, 2, '字典删除', NULL, '', 4, '', '', b'0', b'0', b'0', 'dict:del', NULL, NULL, '2019-10-29 13:00:59', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (73, 28, 0, 2, '任务新增', NULL, '', 2, '', '', b'0', b'0', b'0', 'timing:add', NULL, NULL, '2019-10-29 13:07:28', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (74, 28, 0, 2, '任务编辑', NULL, '', 3, '', '', b'0', b'0', b'0', 'timing:edit', NULL, NULL, '2019-10-29 13:07:41', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (75, 28, 0, 2, '任务删除', NULL, '', 4, '', '', b'0', b'0', b'0', 'timing:del', NULL, NULL, '2019-10-29 13:07:54', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (77, 18, 0, 2, '上传文件', NULL, '', 2, '', '', b'0', b'0', b'0', 'storage:add', NULL, NULL, '2019-10-29 13:09:09', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (78, 18, 0, 2, '文件编辑', NULL, '', 3, '', '', b'0', b'0', b'0', 'storage:edit', NULL, NULL, '2019-10-29 13:09:22', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (79, 18, 0, 2, '文件删除', NULL, '', 4, '', '', b'0', b'0', b'0', 'storage:del', NULL, NULL, '2019-10-29 13:09:34', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (80, 6, 0, 1, '服务监控', 'ServerMonitor', 'monitor/server/index', 14, 'codeConsole', 'server', b'0', b'0', b'0', 'monitor:list', NULL, 'admin', '2019-11-07 13:06:39', '2020-05-04 18:20:50');
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (82, 36, 0, 1, '生成配置', 'GeneratorConfig', 'generator/config', 33, 'dev', 'generator/config/:tableName', b'0', b'1', b'1', '', NULL, NULL, '2019-11-17 20:08:56', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (83, 10, 0, 1, '图表库', 'Echarts', 'components/Echarts', 50, 'chart', 'echarts', b'0', b'1', b'0', '', NULL, NULL, '2019-11-21 09:04:32', NULL);
|
||||
INSERT INTO `sys_menu` (`menu_id`, `pid`, `sub_count`, `type`, `title`, `name`, `component`, `menu_sort`, `icon`, `path`, `i_frame`, `cache`, `hidden`, `permission`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (116, 36, 0, 1, '生成预览', 'Preview', 'generator/preview', 999, 'java', 'generator/preview/:tableName', b'0', b'1', b'1', NULL, NULL, NULL, '2019-11-26 14:54:36', NULL);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
@ -454,17 +328,17 @@ CREATE TABLE `sys_quartz_job` (
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建日期',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
PRIMARY KEY (`job_id`) USING BTREE,
|
||||
KEY `inx_is_pause` (`is_pause`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=7 ROW_FORMAT=COMPACT COMMENT='定时任务';
|
||||
KEY `idx_is_pause` (`is_pause`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='定时任务';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of sys_quartz_job
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `sys_quartz_job` VALUES (2, 'testTask', '0/5 * * * * ?', b'1', '测试1', 'run1', 'test', '带参测试,多参使用json', '测试', NULL, NULL, NULL, NULL, 'admin', '2019-08-22 14:08:29', '2020-05-24 13:58:33');
|
||||
INSERT INTO `sys_quartz_job` VALUES (3, 'testTask', '0/5 * * * * ?', b'1', '测试', 'run', '', '不带参测试', 'Zheng Jie', '', '5,6', b'1', NULL, 'admin', '2019-09-26 16:44:39', '2020-05-24 14:48:12');
|
||||
INSERT INTO `sys_quartz_job` VALUES (5, 'Test', '0/5 * * * * ?', b'1', '任务告警测试', 'run', NULL, '测试', 'test', '', NULL, b'1', 'admin', 'admin', '2020-05-05 20:32:41', '2020-05-05 20:36:13');
|
||||
INSERT INTO `sys_quartz_job` VALUES (6, 'testTask', '0/5 * * * * ?', b'1', '测试3', 'run2', NULL, '测试3', 'Zheng Jie', '', NULL, b'1', 'admin', 'admin', '2020-05-05 20:35:41', '2020-05-05 20:36:07');
|
||||
INSERT INTO `sys_quartz_job` (`job_id`, `bean_name`, `cron_expression`, `is_pause`, `job_name`, `method_name`, `params`, `description`, `person_in_charge`, `email`, `sub_task`, `pause_after_failure`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (2, 'testTask', '0/5 * * * * ?', b'1', '测试1', 'run1', 'test', '带参测试,多参使用json', '测试', NULL, NULL, NULL, NULL, 'admin', '2019-08-22 14:08:29', '2020-05-24 13:58:33');
|
||||
INSERT INTO `sys_quartz_job` (`job_id`, `bean_name`, `cron_expression`, `is_pause`, `job_name`, `method_name`, `params`, `description`, `person_in_charge`, `email`, `sub_task`, `pause_after_failure`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (3, 'testTask', '0/5 * * * * ?', b'1', '测试', 'run', '', '不带参测试', 'Zheng Jie', '', '6', b'1', NULL, 'admin', '2019-09-26 16:44:39', '2020-05-24 14:48:12');
|
||||
INSERT INTO `sys_quartz_job` (`job_id`, `bean_name`, `cron_expression`, `is_pause`, `job_name`, `method_name`, `params`, `description`, `person_in_charge`, `email`, `sub_task`, `pause_after_failure`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (5, 'Test', '0/5 * * * * ?', b'1', '任务告警测试', 'run', NULL, '测试', 'test', '', NULL, b'1', 'admin', 'admin', '2020-05-05 20:32:41', '2020-05-05 20:36:13');
|
||||
INSERT INTO `sys_quartz_job` (`job_id`, `bean_name`, `cron_expression`, `is_pause`, `job_name`, `method_name`, `params`, `description`, `person_in_charge`, `email`, `sub_task`, `pause_after_failure`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (6, 'testTask', '0/5 * * * * ?', b'1', '测试3', 'run2', NULL, '测试3', 'Zheng Jie', '', NULL, b'1', 'admin', 'admin', '2020-05-05 20:35:41', '2020-05-05 20:36:07');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
@ -473,17 +347,23 @@ COMMIT;
|
||||
DROP TABLE IF EXISTS `sys_quartz_log`;
|
||||
CREATE TABLE `sys_quartz_log` (
|
||||
`log_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
|
||||
`bean_name` varchar(255) DEFAULT NULL,
|
||||
`create_time` datetime DEFAULT NULL,
|
||||
`cron_expression` varchar(255) DEFAULT NULL,
|
||||
`exception_detail` text DEFAULT NULL,
|
||||
`is_success` bit(1) DEFAULT NULL,
|
||||
`job_name` varchar(255) DEFAULT NULL,
|
||||
`method_name` varchar(255) DEFAULT NULL,
|
||||
`params` varchar(255) DEFAULT NULL,
|
||||
`time` bigint(20) DEFAULT NULL,
|
||||
`bean_name` varchar(255) DEFAULT NULL COMMENT 'Bean名称',
|
||||
`cron_expression` varchar(255) DEFAULT NULL COMMENT 'cron 表达式',
|
||||
`is_success` bit(1) DEFAULT NULL COMMENT '是否执行成功',
|
||||
`job_name` varchar(255) DEFAULT NULL COMMENT '任务名称',
|
||||
`method_name` varchar(255) DEFAULT NULL COMMENT '方法名称',
|
||||
`params` varchar(255) DEFAULT NULL COMMENT '参数',
|
||||
`time` bigint(20) DEFAULT NULL COMMENT '执行耗时',
|
||||
`exception_detail` text DEFAULT NULL COMMENT '异常详情',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
PRIMARY KEY (`log_id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=151 ROW_FORMAT=COMPACT COMMENT='定时任务日志';
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=171 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='定时任务日志';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of sys_quartz_log
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for sys_role
|
||||
@ -501,15 +381,15 @@ CREATE TABLE `sys_role` (
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
PRIMARY KEY (`role_id`) USING BTREE,
|
||||
UNIQUE KEY `uniq_name` (`name`),
|
||||
KEY `role_name_index` (`name`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=3 ROW_FORMAT=COMPACT COMMENT='角色表';
|
||||
KEY `idx_level` (`level`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='角色表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of sys_role
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `sys_role` VALUES (1, '超级管理员', 1, '-', '全部', NULL, 'admin', '2018-11-23 11:04:37', '2020-08-06 16:10:24');
|
||||
INSERT INTO `sys_role` VALUES (2, '普通用户', 2, '-', '本级', NULL, 'admin', '2018-11-23 13:09:06', '2020-09-05 10:45:12');
|
||||
INSERT INTO `sys_role` (`role_id`, `name`, `level`, `description`, `data_scope`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (1, '超级管理员', 1, '-', '全部', NULL, 'admin', '2018-11-23 11:04:37', '2020-08-06 16:10:24');
|
||||
INSERT INTO `sys_role` (`role_id`, `name`, `level`, `description`, `data_scope`, `create_by`, `update_by`, `create_time`, `update_time`) VALUES (2, '普通用户', 2, '-', '本级', NULL, 'admin', '2018-11-23 13:09:06', '2020-09-05 10:45:12');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
@ -517,11 +397,18 @@ COMMIT;
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `sys_roles_depts`;
|
||||
CREATE TABLE `sys_roles_depts` (
|
||||
`role_id` bigint(20) NOT NULL,
|
||||
`dept_id` bigint(20) NOT NULL,
|
||||
`role_id` bigint(20) NOT NULL COMMENT '角色ID',
|
||||
`dept_id` bigint(20) NOT NULL COMMENT '部门ID',
|
||||
PRIMARY KEY (`role_id`,`dept_id`) USING BTREE,
|
||||
KEY `FK7qg6itn5ajdoa9h9o78v9ksur` (`dept_id`) USING BTREE
|
||||
) ENGINE=InnoDB ROW_FORMAT=COMPACT COMMENT='角色部门关联';
|
||||
KEY `idx_role_id` (`role_id`),
|
||||
KEY `idx_dept_id` (`dept_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='角色部门关联';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of sys_roles_depts
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for sys_roles_menus
|
||||
@ -531,113 +418,95 @@ CREATE TABLE `sys_roles_menus` (
|
||||
`menu_id` bigint(20) NOT NULL COMMENT '菜单ID',
|
||||
`role_id` bigint(20) NOT NULL COMMENT '角色ID',
|
||||
PRIMARY KEY (`menu_id`,`role_id`) USING BTREE,
|
||||
KEY `FKcngg2qadojhi3a651a5adkvbq` (`role_id`) USING BTREE
|
||||
) ENGINE=InnoDB ROW_FORMAT=COMPACT COMMENT='角色菜单关联';
|
||||
KEY `idx_menu_id` (`menu_id`),
|
||||
KEY `idx_role_id` (`role_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='角色菜单关联';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of sys_roles_menus
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `sys_roles_menus` VALUES (1, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (2, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (3, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (5, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (6, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (7, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (9, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (10, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (11, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (14, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (15, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (18, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (19, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (21, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (22, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (23, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (24, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (27, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (28, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (30, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (32, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (33, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (34, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (35, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (36, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (37, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (38, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (39, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (41, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (44, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (45, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (46, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (48, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (49, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (50, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (52, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (53, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (54, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (56, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (57, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (58, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (60, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (61, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (62, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (64, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (65, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (66, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (73, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (74, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (75, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (77, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (78, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (79, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (80, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (82, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (83, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (90, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (92, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (93, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (94, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (97, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (98, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (102, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (103, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (104, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (105, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (106, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (107, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (108, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (109, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (110, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (111, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (112, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (113, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (114, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (116, 1);
|
||||
INSERT INTO `sys_roles_menus` VALUES (1, 2);
|
||||
INSERT INTO `sys_roles_menus` VALUES (2, 2);
|
||||
INSERT INTO `sys_roles_menus` VALUES (6, 2);
|
||||
INSERT INTO `sys_roles_menus` VALUES (7, 2);
|
||||
INSERT INTO `sys_roles_menus` VALUES (9, 2);
|
||||
INSERT INTO `sys_roles_menus` VALUES (10, 2);
|
||||
INSERT INTO `sys_roles_menus` VALUES (11, 2);
|
||||
INSERT INTO `sys_roles_menus` VALUES (14, 2);
|
||||
INSERT INTO `sys_roles_menus` VALUES (15, 2);
|
||||
INSERT INTO `sys_roles_menus` VALUES (19, 2);
|
||||
INSERT INTO `sys_roles_menus` VALUES (21, 2);
|
||||
INSERT INTO `sys_roles_menus` VALUES (22, 2);
|
||||
INSERT INTO `sys_roles_menus` VALUES (23, 2);
|
||||
INSERT INTO `sys_roles_menus` VALUES (24, 2);
|
||||
INSERT INTO `sys_roles_menus` VALUES (27, 2);
|
||||
INSERT INTO `sys_roles_menus` VALUES (30, 2);
|
||||
INSERT INTO `sys_roles_menus` VALUES (32, 2);
|
||||
INSERT INTO `sys_roles_menus` VALUES (33, 2);
|
||||
INSERT INTO `sys_roles_menus` VALUES (34, 2);
|
||||
INSERT INTO `sys_roles_menus` VALUES (36, 2);
|
||||
INSERT INTO `sys_roles_menus` VALUES (80, 2);
|
||||
INSERT INTO `sys_roles_menus` VALUES (82, 2);
|
||||
INSERT INTO `sys_roles_menus` VALUES (83, 2);
|
||||
INSERT INTO `sys_roles_menus` VALUES (116, 2);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (1, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (1, 2);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (2, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (2, 2);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (3, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (5, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (6, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (6, 2);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (7, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (7, 2);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (9, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (9, 2);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (10, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (10, 2);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (11, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (11, 2);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (14, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (14, 2);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (15, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (15, 2);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (18, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (19, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (19, 2);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (21, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (21, 2);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (22, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (22, 2);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (23, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (23, 2);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (24, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (24, 2);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (27, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (27, 2);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (28, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (30, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (30, 2);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (32, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (32, 2);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (33, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (33, 2);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (34, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (34, 2);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (35, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (36, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (36, 2);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (37, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (38, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (39, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (41, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (44, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (45, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (46, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (48, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (49, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (50, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (52, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (53, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (54, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (56, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (57, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (58, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (60, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (61, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (62, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (64, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (65, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (66, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (73, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (74, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (75, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (77, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (78, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (79, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (80, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (80, 2);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (82, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (82, 2);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (83, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (83, 2);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (116, 1);
|
||||
INSERT INTO `sys_roles_menus` (`menu_id`, `role_id`) VALUES (116, 2);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
@ -663,20 +532,18 @@ CREATE TABLE `sys_user` (
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建日期',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
PRIMARY KEY (`user_id`) USING BTREE,
|
||||
UNIQUE KEY `UK_kpubos9gc2cvtkb0thktkbkes` (`email`) USING BTREE,
|
||||
UNIQUE KEY `username` (`username`) USING BTREE,
|
||||
UNIQUE KEY `uniq_username` (`username`),
|
||||
UNIQUE KEY `uniq_email` (`email`),
|
||||
KEY `FK5rwmryny6jthaaxkogownknqp` (`dept_id`) USING BTREE,
|
||||
KEY `inx_enabled` (`enabled`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=3 ROW_FORMAT=COMPACT COMMENT='系统用户';
|
||||
UNIQUE KEY `uniq_email` (`email`) USING BTREE,
|
||||
UNIQUE KEY `uniq_username` (`username`) USING BTREE,
|
||||
KEY `idx_dept_id` (`dept_id`) USING BTREE,
|
||||
KEY `idx_enabled` (`enabled`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='系统用户';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of sys_user
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `sys_user` VALUES (1, 2, 'admin', '管理员', '男', '18888888888', '201507802@qq.com', 'avatar-20200806032259161.png', '/Users/jie/Documents/work/me/admin/eladmin/~/avatar/avatar-20200806032259161.png', '$2a$10$Egp1/gvFlt7zhlXVfEFw4OfWQCGPw0ClmMcc6FjTnvXNRVf9zdMRa', b'1', 1, NULL, 'admin', '2020-05-03 16:38:31', '2018-08-23 09:11:56', '2020-09-05 10:43:31');
|
||||
INSERT INTO `sys_user` VALUES (2, 2, 'test', '测试', '男', '19999999999', '231@qq.com', NULL, NULL, '$2a$10$4XcyudOYTSz6fue6KFNMHeUQnCX5jbBQypLEnGk1PmekXt5c95JcK', b'0', 1, 'admin', 'admin', NULL, '2020-05-05 11:15:49', '2020-09-05 10:43:38');
|
||||
INSERT INTO `sys_user` (`user_id`, `dept_id`, `username`, `nick_name`, `gender`, `phone`, `email`, `avatar_name`, `avatar_path`, `password`, `is_admin`, `enabled`, `create_by`, `update_by`, `pwd_reset_time`, `create_time`, `update_time`) VALUES (1, 2, 'admin', '管理员', '男', '18888888888', '201507802@qq.com', 'avatar-20250114101539224.png', '/Users/jie/Documents/work/me/admin/eladmin-mp/eladmin/~/avatar/avatar-20250114101539224.png', '$2a$10$Egp1/gvFlt7zhlXVfEFw4OfWQCGPw0ClmMcc6FjTnvXNRVf9zdMRa', b'1', b'1', NULL, 'admin', '2020-05-03 16:38:31', '2018-08-23 09:11:56', '2020-09-05 10:43:31');
|
||||
INSERT INTO `sys_user` (`user_id`, `dept_id`, `username`, `nick_name`, `gender`, `phone`, `email`, `avatar_name`, `avatar_path`, `password`, `is_admin`, `enabled`, `create_by`, `update_by`, `pwd_reset_time`, `create_time`, `update_time`) VALUES (2, 2, 'test', '测试', '男', '19999999999', '231@qq.com', NULL, NULL, '$2a$10$4XcyudOYTSz6fue6KFNMHeUQnCX5jbBQypLEnGk1PmekXt5c95JcK', b'0', b'1', 'admin', 'admin', NULL, '2020-05-05 11:15:49', '2020-09-05 10:43:38');
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
@ -686,15 +553,17 @@ DROP TABLE IF EXISTS `sys_users_jobs`;
|
||||
CREATE TABLE `sys_users_jobs` (
|
||||
`user_id` bigint(20) NOT NULL COMMENT '用户ID',
|
||||
`job_id` bigint(20) NOT NULL COMMENT '岗位ID',
|
||||
PRIMARY KEY (`user_id`,`job_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
PRIMARY KEY (`user_id`,`job_id`),
|
||||
KEY `idx_user_id` (`user_id`),
|
||||
KEY `idx_job_id` (`job_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci COMMENT='用户与岗位关联表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of sys_users_jobs
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `sys_users_jobs` VALUES (1, 11);
|
||||
INSERT INTO `sys_users_jobs` VALUES (2, 12);
|
||||
INSERT INTO `sys_users_jobs` (`user_id`, `job_id`) VALUES (1, 11);
|
||||
INSERT INTO `sys_users_jobs` (`user_id`, `job_id`) VALUES (2, 12);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
@ -705,15 +574,16 @@ CREATE TABLE `sys_users_roles` (
|
||||
`user_id` bigint(20) NOT NULL COMMENT '用户ID',
|
||||
`role_id` bigint(20) NOT NULL COMMENT '角色ID',
|
||||
PRIMARY KEY (`user_id`,`role_id`) USING BTREE,
|
||||
KEY `FKq4eq273l04bpu4efj0jd0jb98` (`role_id`) USING BTREE
|
||||
) ENGINE=InnoDB ROW_FORMAT=COMPACT COMMENT='用户角色关联';
|
||||
KEY `idx_user_id` (`user_id`),
|
||||
KEY `idx_role_id` (`role_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='用户角色关联';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of sys_users_roles
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `sys_users_roles` VALUES (1, 1);
|
||||
INSERT INTO `sys_users_roles` VALUES (2, 2);
|
||||
INSERT INTO `sys_users_roles` (`user_id`, `role_id`) VALUES (1, 1);
|
||||
INSERT INTO `sys_users_roles` (`user_id`, `role_id`) VALUES (2, 2);
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
@ -733,14 +603,7 @@ CREATE TABLE `tool_alipay_config` (
|
||||
`sign_type` varchar(255) DEFAULT NULL COMMENT '签名方式',
|
||||
`sys_service_provider_id` varchar(255) DEFAULT NULL COMMENT '商户号',
|
||||
PRIMARY KEY (`config_id`) USING BTREE
|
||||
) ENGINE=InnoDB ROW_FORMAT=COMPACT COMMENT='支付宝配置类';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of tool_alipay_config
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
INSERT INTO `tool_alipay_config` VALUES (1, '2016091700532697', 'utf-8', 'JSON', 'https://openapi.alipaydev.com/gateway.do', 'http://api.auauz.net/api/aliPay/notify', 'MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC5js8sInU10AJ0cAQ8UMMyXrQ+oHZEkVt5lBwsStmTJ7YikVYgbskx1YYEXTojRsWCb+SH/kDmDU4pK/u91SJ4KFCRMF2411piYuXU/jF96zKrADznYh/zAraqT6hvAIVtQAlMHN53nx16rLzZ/8jDEkaSwT7+HvHiS+7sxSojnu/3oV7BtgISoUNstmSe8WpWHOaWv19xyS+Mce9MY4BfseFhzTICUymUQdd/8hXA28/H6osUfAgsnxAKv7Wil3aJSgaJczWuflYOve0dJ3InZkhw5Cvr0atwpk8YKBQjy5CdkoHqvkOcIB+cYHXJKzOE5tqU7inSwVbHzOLQ3XbnAgMBAAECggEAVJp5eT0Ixg1eYSqFs9568WdetUNCSUchNxDBu6wxAbhUgfRUGZuJnnAll63OCTGGck+EGkFh48JjRcBpGoeoHLL88QXlZZbC/iLrea6gcDIhuvfzzOffe1RcZtDFEj9hlotg8dQj1tS0gy9pN9g4+EBH7zeu+fyv+qb2e/v1l6FkISXUjpkD7RLQr3ykjiiEw9BpeKb7j5s7Kdx1NNIzhkcQKNqlk8JrTGDNInbDM6inZfwwIO2R1DHinwdfKWkvOTODTYa2MoAvVMFT9Bec9FbLpoWp7ogv1JMV9svgrcF9XLzANZ/OQvkbe9TV9GWYvIbxN6qwQioKCWO4GPnCAQKBgQDgW5MgfhX8yjXqoaUy/d1VjI8dHeIyw8d+OBAYwaxRSlCfyQ+tieWcR2HdTzPca0T0GkWcKZm0ei5xRURgxt4DUDLXNh26HG0qObbtLJdu/AuBUuCqgOiLqJ2f1uIbrz6OZUHns+bT/jGW2Ws8+C13zTCZkZt9CaQsrp3QOGDx5wKBgQDTul39hp3ZPwGNFeZdkGoUoViOSd5Lhowd5wYMGAEXWRLlU8z+smT5v0POz9JnIbCRchIY2FAPKRdVTICzmPk2EPJFxYTcwaNbVqL6lN7J2IlXXMiit5QbiLauo55w7plwV6LQmKm9KV7JsZs5XwqF7CEovI7GevFzyD3w+uizAQKBgC3LY1eRhOlpWOIAhpjG6qOoohmeXOphvdmMlfSHq6WYFqbWwmV4rS5d/6LNpNdL6fItXqIGd8I34jzql49taCmi+A2nlR/E559j0mvM20gjGDIYeZUz5MOE8k+K6/IcrhcgofgqZ2ZED1ksHdB/E8DNWCswZl16V1FrfvjeWSNnAoGAMrBplCrIW5xz+J0Hm9rZKrs+AkK5D4fUv8vxbK/KgxZ2KaUYbNm0xv39c+PZUYuFRCz1HDGdaSPDTE6WeWjkMQd5mS6ikl9hhpqFRkyh0d0fdGToO9yLftQKOGE/q3XUEktI1XvXF0xyPwNgUCnq0QkpHyGVZPtGFxwXiDvpvgECgYA5PoB+nY8iDiRaJNko9w0hL4AeKogwf+4TbCw+KWVEn6jhuJa4LFTdSqp89PktQaoVpwv92el/AhYjWOl/jVCm122f9b7GyoelbjMNolToDwe5pF5RnSpEuDdLy9MfE8LnE3PlbE7E5BipQ3UjSebkgNboLHH/lNZA5qvEtvbfvQ==', 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAut9evKRuHJ/2QNfDlLwvN/S8l9hRAgPbb0u61bm4AtzaTGsLeMtScetxTWJnVvAVpMS9luhEJjt+Sbk5TNLArsgzzwARgaTKOLMT1TvWAK5EbHyI+eSrc3s7Awe1VYGwcubRFWDm16eQLv0k7iqiw+4mweHSz/wWyvBJVgwLoQ02btVtAQErCfSJCOmt0Q/oJQjj08YNRV4EKzB19+f5A+HQVAKy72dSybTzAK+3FPtTtNen/+b5wGeat7c32dhYHnGorPkPeXLtsqqUTp1su5fMfd4lElNdZaoCI7osZxWWUo17vBCZnyeXc9fk0qwD9mK6yRAxNbrY72Xx5VqIqwIDAQAB', 'http://api.auauz.net/api/aliPay/return', 'RSA2', '2088102176044281');
|
||||
COMMIT;
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='支付宝配置类';
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for tool_email_config
|
||||
@ -754,7 +617,13 @@ CREATE TABLE `tool_email_config` (
|
||||
`port` varchar(255) DEFAULT NULL COMMENT '端口',
|
||||
`user` varchar(255) DEFAULT NULL COMMENT '发件者用户名',
|
||||
PRIMARY KEY (`config_id`) USING BTREE
|
||||
) ENGINE=InnoDB ROW_FORMAT=COMPACT COMMENT='邮箱配置';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='邮箱配置';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of tool_email_config
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for tool_local_storage
|
||||
@ -773,7 +642,7 @@ CREATE TABLE `tool_local_storage` (
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建日期',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
PRIMARY KEY (`storage_id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=10 ROW_FORMAT=COMPACT COMMENT='本地存储';
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='本地存储';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of tool_local_storage
|
||||
@ -794,7 +663,13 @@ CREATE TABLE `tool_qiniu_config` (
|
||||
`type` varchar(255) DEFAULT NULL COMMENT '空间类型',
|
||||
`zone` varchar(255) DEFAULT NULL COMMENT '机房',
|
||||
PRIMARY KEY (`config_id`) USING BTREE
|
||||
) ENGINE=InnoDB ROW_FORMAT=COMPACT COMMENT='七牛云配置';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='七牛云配置';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of tool_qiniu_config
|
||||
-- ----------------------------
|
||||
BEGIN;
|
||||
COMMIT;
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for tool_qiniu_content
|
||||
@ -811,7 +686,7 @@ CREATE TABLE `tool_qiniu_content` (
|
||||
`update_time` datetime DEFAULT NULL COMMENT '上传或同步的时间',
|
||||
PRIMARY KEY (`content_id`) USING BTREE,
|
||||
UNIQUE KEY `uniq_name` (`name`)
|
||||
) ENGINE=InnoDB ROW_FORMAT=COMPACT COMMENT='七牛云文件存储';
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=COMPACT COMMENT='七牛云文件存储';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of tool_qiniu_content
|
||||
|
Loading…
Reference in New Issue
Block a user