add 新增 ruoyi-doc 模块 集成 Knife4j
parent
94c732c439
commit
ac4005c9dd
@ -1,15 +0,0 @@
|
|||||||
package com.ruoyi.common.swagger.annotation;
|
|
||||||
|
|
||||||
import com.ruoyi.common.swagger.config.SwaggerAutoConfiguration;
|
|
||||||
import org.springframework.context.annotation.Import;
|
|
||||||
|
|
||||||
import java.lang.annotation.*;
|
|
||||||
|
|
||||||
@Target({ElementType.TYPE})
|
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
|
||||||
@Documented
|
|
||||||
@Inherited
|
|
||||||
@Import({SwaggerAutoConfiguration.class})
|
|
||||||
public @interface EnableCustomSwagger2 {
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,20 +0,0 @@
|
|||||||
package com.ruoyi.common.swagger.config;
|
|
||||||
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
|
||||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* swagger 资源映射路径
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
@Configuration
|
|
||||||
public class SwaggerWebConfiguration implements WebMvcConfigurer {
|
|
||||||
@Override
|
|
||||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
|
||||||
/** swagger-ui 地址 */
|
|
||||||
registry.addResourceHandler("/swagger-ui/**")
|
|
||||||
.addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,3 +1,2 @@
|
|||||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
|
||||||
com.ruoyi.common.swagger.config.SwaggerAutoConfiguration,\
|
com.ruoyi.common.swagger.config.SwaggerAutoConfiguration
|
||||||
com.ruoyi.common.swagger.config.SwaggerWebConfiguration
|
|
||||||
|
|||||||
@ -1,73 +0,0 @@
|
|||||||
package com.ruoyi.gateway.config;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.cloud.gateway.config.GatewayProperties;
|
|
||||||
import org.springframework.cloud.gateway.route.RouteLocator;
|
|
||||||
import org.springframework.cloud.gateway.support.NameUtils;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
import org.springframework.web.reactive.config.ResourceHandlerRegistry;
|
|
||||||
import org.springframework.web.reactive.config.WebFluxConfigurer;
|
|
||||||
import springfox.documentation.swagger.web.SwaggerResource;
|
|
||||||
import springfox.documentation.swagger.web.SwaggerResourcesProvider;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 聚合系统接口
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
public class SwaggerProvider implements SwaggerResourcesProvider, WebFluxConfigurer {
|
|
||||||
/**
|
|
||||||
* Swagger2默认的url后缀
|
|
||||||
*/
|
|
||||||
public static final String SWAGGER2URL = "/v2/api-docs";
|
|
||||||
/**
|
|
||||||
* 网关路由
|
|
||||||
*/
|
|
||||||
@Autowired
|
|
||||||
private RouteLocator routeLocator;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private GatewayProperties gatewayProperties;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 聚合其他服务接口
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<SwaggerResource> get() {
|
|
||||||
List<SwaggerResource> resourceList = new ArrayList<>();
|
|
||||||
List<String> routes = new ArrayList<>();
|
|
||||||
// 获取网关中配置的route
|
|
||||||
routeLocator.getRoutes().subscribe(route -> routes.add(route.getId()));
|
|
||||||
gatewayProperties.getRoutes().stream()
|
|
||||||
.filter(routeDefinition -> routes
|
|
||||||
.contains(routeDefinition.getId()))
|
|
||||||
.forEach(routeDefinition -> routeDefinition.getPredicates().stream()
|
|
||||||
.filter(predicateDefinition -> "Path".equalsIgnoreCase(predicateDefinition.getName()))
|
|
||||||
.filter(predicateDefinition -> !"ruoyi-auth".equalsIgnoreCase(routeDefinition.getId()))
|
|
||||||
.forEach(predicateDefinition -> resourceList
|
|
||||||
.add(swaggerResource(routeDefinition.getId(), predicateDefinition.getArgs()
|
|
||||||
.get(NameUtils.GENERATED_NAME_PREFIX + "0").replace("/**", SWAGGER2URL)))));
|
|
||||||
return resourceList;
|
|
||||||
}
|
|
||||||
|
|
||||||
private SwaggerResource swaggerResource(String name, String location) {
|
|
||||||
SwaggerResource swaggerResource = new SwaggerResource();
|
|
||||||
swaggerResource.setName(name);
|
|
||||||
swaggerResource.setLocation(location);
|
|
||||||
swaggerResource.setSwaggerVersion("2.0");
|
|
||||||
return swaggerResource;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
|
||||||
/** swagger-ui 地址 */
|
|
||||||
registry.addResourceHandler("/swagger-ui/**")
|
|
||||||
.addResourceLocations("classpath:/META-INF/resources/webjars/springfox-swagger-ui/");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,48 +0,0 @@
|
|||||||
package com.ruoyi.gateway.handler;
|
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.http.HttpStatus;
|
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import reactor.core.publisher.Mono;
|
|
||||||
import springfox.documentation.swagger.web.*;
|
|
||||||
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/swagger-resources")
|
|
||||||
public class SwaggerHandler {
|
|
||||||
@Autowired(required = false)
|
|
||||||
private SecurityConfiguration securityConfiguration;
|
|
||||||
|
|
||||||
@Autowired(required = false)
|
|
||||||
private UiConfiguration uiConfiguration;
|
|
||||||
|
|
||||||
private final SwaggerResourcesProvider swaggerResources;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
public SwaggerHandler(SwaggerResourcesProvider swaggerResources) {
|
|
||||||
this.swaggerResources = swaggerResources;
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/configuration/security")
|
|
||||||
public Mono<ResponseEntity<SecurityConfiguration>> securityConfiguration() {
|
|
||||||
return Mono.just(new ResponseEntity<>(
|
|
||||||
Optional.ofNullable(securityConfiguration).orElse(SecurityConfigurationBuilder.builder().build()),
|
|
||||||
HttpStatus.OK));
|
|
||||||
}
|
|
||||||
|
|
||||||
@GetMapping("/configuration/ui")
|
|
||||||
public Mono<ResponseEntity<UiConfiguration>> uiConfiguration() {
|
|
||||||
return Mono.just(new ResponseEntity<>(
|
|
||||||
Optional.ofNullable(uiConfiguration).orElse(UiConfigurationBuilder.builder().build()), HttpStatus.OK));
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("rawtypes")
|
|
||||||
@GetMapping("")
|
|
||||||
public Mono<ResponseEntity> swaggerResources() {
|
|
||||||
return Mono.just((new ResponseEntity<>(swaggerResources.get(), HttpStatus.OK)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,71 +0,0 @@
|
|||||||
import request from '@/utils/request'
|
|
||||||
|
|
||||||
// 查询定时任务调度列表
|
|
||||||
export function listJob(query) {
|
|
||||||
return request({
|
|
||||||
url: '/schedule/job/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询定时任务调度详细
|
|
||||||
export function getJob(jobId) {
|
|
||||||
return request({
|
|
||||||
url: '/schedule/job/' + jobId,
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 新增定时任务调度
|
|
||||||
export function addJob(data) {
|
|
||||||
return request({
|
|
||||||
url: '/schedule/job',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 修改定时任务调度
|
|
||||||
export function updateJob(data) {
|
|
||||||
return request({
|
|
||||||
url: '/schedule/job',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 删除定时任务调度
|
|
||||||
export function delJob(jobId) {
|
|
||||||
return request({
|
|
||||||
url: '/schedule/job/' + jobId,
|
|
||||||
method: 'delete'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 任务状态修改
|
|
||||||
export function changeJobStatus(jobId, status) {
|
|
||||||
const data = {
|
|
||||||
jobId,
|
|
||||||
status
|
|
||||||
}
|
|
||||||
return request({
|
|
||||||
url: '/schedule/job/changeStatus',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// 定时任务立即执行一次
|
|
||||||
export function runJob(jobId, jobGroup) {
|
|
||||||
const data = {
|
|
||||||
jobId,
|
|
||||||
jobGroup
|
|
||||||
}
|
|
||||||
return request({
|
|
||||||
url: '/schedule/job/run',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@ -1,26 +0,0 @@
|
|||||||
import request from '@/utils/request'
|
|
||||||
|
|
||||||
// 查询调度日志列表
|
|
||||||
export function listJobLog(query) {
|
|
||||||
return request({
|
|
||||||
url: '/schedule/job/log/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 删除调度日志
|
|
||||||
export function delJobLog(jobLogId) {
|
|
||||||
return request({
|
|
||||||
url: '/schedule/job/log/' + jobLogId,
|
|
||||||
method: 'delete'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 清空调度日志
|
|
||||||
export function cleanJobLog() {
|
|
||||||
return request({
|
|
||||||
url: '/schedule/job/log/clean',
|
|
||||||
method: 'delete'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@ -1,299 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
|
||||||
<el-form-item label="任务名称" prop="jobName">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.jobName"
|
|
||||||
placeholder="请输入任务名称"
|
|
||||||
clearable
|
|
||||||
size="small"
|
|
||||||
style="width: 240px"
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="任务组名" prop="jobGroup">
|
|
||||||
<el-select
|
|
||||||
v-model="queryParams.jobGroup"
|
|
||||||
placeholder="请任务组名"
|
|
||||||
clearable
|
|
||||||
size="small"
|
|
||||||
style="width: 240px"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="dict in dict.type.sys_job_group"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="执行状态" prop="status">
|
|
||||||
<el-select
|
|
||||||
v-model="queryParams.status"
|
|
||||||
placeholder="请选择执行状态"
|
|
||||||
clearable
|
|
||||||
size="small"
|
|
||||||
style="width: 240px"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="dict in dict.type.sys_common_status"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="执行时间">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="dateRange"
|
|
||||||
size="small"
|
|
||||||
style="width: 240px"
|
|
||||||
value-format="yyyy-MM-dd"
|
|
||||||
type="daterange"
|
|
||||||
range-separator="-"
|
|
||||||
start-placeholder="开始日期"
|
|
||||||
end-placeholder="结束日期"
|
|
||||||
></el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="danger"
|
|
||||||
plain
|
|
||||||
icon="el-icon-delete"
|
|
||||||
size="mini"
|
|
||||||
:disabled="multiple"
|
|
||||||
@click="handleDelete"
|
|
||||||
v-hasPermi="['monitor:job:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="danger"
|
|
||||||
plain
|
|
||||||
icon="el-icon-delete"
|
|
||||||
size="mini"
|
|
||||||
@click="handleClean"
|
|
||||||
v-hasPermi="['monitor:job:remove']"
|
|
||||||
>清空</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="warning"
|
|
||||||
plain
|
|
||||||
icon="el-icon-download"
|
|
||||||
size="mini"
|
|
||||||
@click="handleExport"
|
|
||||||
v-hasPermi="['monitor:job:export']"
|
|
||||||
>导出</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="warning"
|
|
||||||
plain
|
|
||||||
icon="el-icon-close"
|
|
||||||
size="mini"
|
|
||||||
@click="handleClose"
|
|
||||||
>关闭</el-button>
|
|
||||||
</el-col>
|
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="jobLogList" @selection-change="handleSelectionChange">
|
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
|
||||||
<el-table-column label="日志编号" width="80" align="center" prop="jobLogId" />
|
|
||||||
<el-table-column label="任务名称" align="center" prop="jobName" :show-overflow-tooltip="true" />
|
|
||||||
<el-table-column label="任务组名" align="center" prop="jobGroup" :show-overflow-tooltip="true">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<dict-tag :options="dict.type.sys_job_group" :value="scope.row.jobGroup"/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="调用目标字符串" align="center" prop="invokeTarget" :show-overflow-tooltip="true" />
|
|
||||||
<el-table-column label="日志信息" align="center" prop="jobMessage" :show-overflow-tooltip="true" />
|
|
||||||
<el-table-column label="执行状态" align="center" prop="status">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<dict-tag :options="dict.type.sys_common_status" :value="scope.row.status"/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="执行时间" align="center" prop="createTime" width="180">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-view"
|
|
||||||
@click="handleView(scope.row)"
|
|
||||||
v-hasPermi="['monitor:job:query']"
|
|
||||||
>详细</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<pagination
|
|
||||||
v-show="total>0"
|
|
||||||
:total="total"
|
|
||||||
:page.sync="queryParams.pageNum"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 调度日志详细 -->
|
|
||||||
<el-dialog title="调度日志详细" :visible.sync="open" width="700px" append-to-body>
|
|
||||||
<el-form ref="form" :model="form" label-width="100px" size="mini">
|
|
||||||
<el-row>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="日志序号:">{{ form.jobLogId }}</el-form-item>
|
|
||||||
<el-form-item label="任务名称:">{{ form.jobName }}</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="任务分组:">{{ form.jobGroup }}</el-form-item>
|
|
||||||
<el-form-item label="执行时间:">{{ form.createTime }}</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="调用方法:">{{ form.invokeTarget }}</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="日志信息:">{{ form.jobMessage }}</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="执行状态:">
|
|
||||||
<div v-if="form.status == 0">正常</div>
|
|
||||||
<div v-else-if="form.status == 1">失败</div>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="24">
|
|
||||||
<el-form-item label="异常信息:" v-if="form.status == 1">{{ form.exceptionInfo }}</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
|
||||||
<div slot="footer" class="dialog-footer">
|
|
||||||
<el-button @click="open = false">关 闭</el-button>
|
|
||||||
</div>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { getJob} from "@/api/monitor/job";
|
|
||||||
import { listJobLog, delJobLog, cleanJobLog } from "@/api/monitor/jobLog";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: "JobLog",
|
|
||||||
dicts: ['sys_common_status', 'sys_job_group'],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
// 遮罩层
|
|
||||||
loading: true,
|
|
||||||
// 选中数组
|
|
||||||
ids: [],
|
|
||||||
// 非多个禁用
|
|
||||||
multiple: true,
|
|
||||||
// 显示搜索条件
|
|
||||||
showSearch: true,
|
|
||||||
// 总条数
|
|
||||||
total: 0,
|
|
||||||
// 调度日志表格数据
|
|
||||||
jobLogList: [],
|
|
||||||
// 是否显示弹出层
|
|
||||||
open: false,
|
|
||||||
// 日期范围
|
|
||||||
dateRange: [],
|
|
||||||
// 表单参数
|
|
||||||
form: {},
|
|
||||||
// 查询参数
|
|
||||||
queryParams: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
jobName: undefined,
|
|
||||||
jobGroup: undefined,
|
|
||||||
status: undefined
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
const jobId = this.$route.query.jobId;
|
|
||||||
if (jobId !== undefined && jobId != 0) {
|
|
||||||
getJob(jobId).then(response => {
|
|
||||||
this.queryParams.jobName = response.data.jobName;
|
|
||||||
this.queryParams.jobGroup = response.data.jobGroup;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.getList();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
/** 查询调度日志列表 */
|
|
||||||
getList() {
|
|
||||||
this.loading = true;
|
|
||||||
listJobLog(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
|
||||||
this.jobLogList = response.rows;
|
|
||||||
this.total = response.total;
|
|
||||||
this.loading = false;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
},
|
|
||||||
// 返回按钮
|
|
||||||
handleClose() {
|
|
||||||
const obj = { path: "/monitor/job" };
|
|
||||||
this.$tab.closeOpenPage(obj);
|
|
||||||
},
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
handleQuery() {
|
|
||||||
this.queryParams.pageNum = 1;
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
resetQuery() {
|
|
||||||
this.dateRange = [];
|
|
||||||
this.resetForm("queryForm");
|
|
||||||
this.handleQuery();
|
|
||||||
},
|
|
||||||
// 多选框选中数据
|
|
||||||
handleSelectionChange(selection) {
|
|
||||||
this.ids = selection.map(item => item.jobLogId);
|
|
||||||
this.multiple = !selection.length;
|
|
||||||
},
|
|
||||||
/** 详细按钮操作 */
|
|
||||||
handleView(row) {
|
|
||||||
this.open = true;
|
|
||||||
this.form = row;
|
|
||||||
},
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
handleDelete(row) {
|
|
||||||
const jobLogIds = this.ids;
|
|
||||||
this.$modal.confirm('是否确认删除调度日志编号为"' + jobLogIds + '"的数据项?').then(function() {
|
|
||||||
return delJobLog(jobLogIds);
|
|
||||||
}).then(() => {
|
|
||||||
this.getList();
|
|
||||||
this.$modal.msgSuccess("删除成功");
|
|
||||||
}).catch(() => {});
|
|
||||||
},
|
|
||||||
/** 清空按钮操作 */
|
|
||||||
handleClean() {
|
|
||||||
this.$modal.confirm('是否确认清空所有调度日志数据项?').then(function() {
|
|
||||||
return cleanJobLog();
|
|
||||||
}).then(() => {
|
|
||||||
this.getList();
|
|
||||||
this.$modal.msgSuccess("清空成功");
|
|
||||||
}).catch(() => {});
|
|
||||||
},
|
|
||||||
/** 导出按钮操作 */
|
|
||||||
handleExport() {
|
|
||||||
this.download('schedule/job/log/export', {
|
|
||||||
...this.queryParams
|
|
||||||
}, `log_${new Date().getTime()}.xlsx`)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
@ -0,0 +1,88 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-visual</artifactId>
|
||||||
|
<version>0.3.0</version>
|
||||||
|
</parent>
|
||||||
|
<artifactId>ruoyi-doc</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
|
||||||
|
</properties>
|
||||||
|
<dependencies>
|
||||||
|
|
||||||
|
<!-- SpringCloud Alibaba Nacos -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- SpringCloud Alibaba Nacos Config -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- SpringBoot Actuator -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- knife4j -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.xiaoymin</groupId>
|
||||||
|
<artifactId>knife4j-aggregation-spring-boot-starter</artifactId>
|
||||||
|
<version>${knife4j-aggregation.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ruoyi</groupId>
|
||||||
|
<artifactId>ruoyi-common-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<finalName>${project.artifactId}</finalName>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<version>${spring-boot.version}</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>repackage</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<!-- docker -->
|
||||||
|
<plugin>
|
||||||
|
<groupId>com.spotify</groupId>
|
||||||
|
<artifactId>docker-maven-plugin</artifactId>
|
||||||
|
<version>${docker.plugin.version}</version>
|
||||||
|
<configuration>
|
||||||
|
<imageName>${docker.namespace}/${project.artifactId}:${project.version}</imageName>
|
||||||
|
<dockerDirectory>${project.basedir}</dockerDirectory>
|
||||||
|
<dockerHost>${docker.registry.host}</dockerHost>
|
||||||
|
<registryUrl>${docker.registry.url}</registryUrl>
|
||||||
|
<serverId>${docker.registry.url}</serverId>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<targetPath>/</targetPath>
|
||||||
|
<directory>${project.build.directory}</directory>
|
||||||
|
<include>${project.build.finalName}.jar</include>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</project>
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
package com.ruoyi.doc;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 文档服务
|
||||||
|
*
|
||||||
|
* @author Lion Li
|
||||||
|
*/
|
||||||
|
@SpringBootApplication
|
||||||
|
public class RuoyiDocApplication {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(RuoyiDocApplication.class, args);
|
||||||
|
System.out.println("(♥◠‿◠)ノ゙ 文档中心 启动成功 ლ(´ڡ`ლ)゙ ");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,23 @@
|
|||||||
|
server:
|
||||||
|
port: 18000
|
||||||
|
|
||||||
|
# knife4j聚合配置
|
||||||
|
knife4j:
|
||||||
|
enableAggregation: true
|
||||||
|
# cloud模式
|
||||||
|
cloud:
|
||||||
|
# 是否启用
|
||||||
|
enable: true
|
||||||
|
# 网关地址
|
||||||
|
gatewayUri: 127.0.0.1:8080
|
||||||
|
# 需要聚合的服务集合
|
||||||
|
routes:
|
||||||
|
- name: 系统服务
|
||||||
|
uri: ${knife4j.cloud.gatewayUri}
|
||||||
|
location: /system/v2/api-docs
|
||||||
|
- name: 代码生成
|
||||||
|
uri: ${knife4j.cloud.gatewayUri}
|
||||||
|
location: /code/v2/api-docs
|
||||||
|
- name: 文件服务
|
||||||
|
uri: ${knife4j.cloud.gatewayUri}
|
||||||
|
location: /file/v2/api-docs
|
||||||
@ -0,0 +1,33 @@
|
|||||||
|
# Tomcat
|
||||||
|
server:
|
||||||
|
port: 9300
|
||||||
|
|
||||||
|
# Spring
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
# 应用名称
|
||||||
|
name: ruoyi-doc
|
||||||
|
profiles:
|
||||||
|
# 环境配置
|
||||||
|
active: @profiles.active@
|
||||||
|
|
||||||
|
--- # nacos 配置
|
||||||
|
spring:
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
# nacos 服务地址
|
||||||
|
server-addr: @nacos.server@
|
||||||
|
discovery:
|
||||||
|
# 注册组
|
||||||
|
group: @nacos.discovery.group@
|
||||||
|
namespace: ${spring.profiles.active}
|
||||||
|
config:
|
||||||
|
# 配置组
|
||||||
|
group: @nacos.config.group@
|
||||||
|
namespace: ${spring.profiles.active}
|
||||||
|
# 配置文件格式
|
||||||
|
file-extension: yml
|
||||||
|
# 共享配置
|
||||||
|
shared-configs:
|
||||||
|
- data-id: application.${spring.cloud.nacos.config.file-extension}
|
||||||
|
refresh: true
|
||||||
@ -0,0 +1,97 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||||
|
<!-- 日志存放路径 -->
|
||||||
|
<property name="log.path" value="logs/ruoyi-doc"/>
|
||||||
|
<!-- 日志输出格式 -->
|
||||||
|
<property name="console.log.pattern"
|
||||||
|
value="%red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}%n) - %msg%n"/>
|
||||||
|
<property name="log.pattern" value="%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"/>
|
||||||
|
|
||||||
|
<!-- 控制台输出 -->
|
||||||
|
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder>
|
||||||
|
<pattern>${console.log.pattern}</pattern>
|
||||||
|
<charset>utf-8</charset>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 控制台输出 -->
|
||||||
|
<appender name="file_console" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/console.log</file>
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<!-- 日志文件名格式 -->
|
||||||
|
<fileNamePattern>${log.path}/console.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<!-- 日志最大 1天 -->
|
||||||
|
<maxHistory>1</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
<charset>utf-8</charset>
|
||||||
|
</encoder>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||||
|
<!-- 过滤的级别 -->
|
||||||
|
<level>INFO</level>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 系统日志输出 -->
|
||||||
|
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/info.log</file>
|
||||||
|
<!-- 循环政策:基于时间创建日志文件 -->
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<!-- 日志文件名格式 -->
|
||||||
|
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<!-- 日志最大的历史 60天 -->
|
||||||
|
<maxHistory>60</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<!-- 过滤的级别 -->
|
||||||
|
<level>INFO</level>
|
||||||
|
<!-- 匹配时的操作:接收(记录) -->
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/error.log</file>
|
||||||
|
<!-- 循环政策:基于时间创建日志文件 -->
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<!-- 日志文件名格式 -->
|
||||||
|
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<!-- 日志最大的历史 60天 -->
|
||||||
|
<maxHistory>60</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<!-- 过滤的级别 -->
|
||||||
|
<level>ERROR</level>
|
||||||
|
<!-- 匹配时的操作:接收(记录) -->
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 系统模块日志级别控制 -->
|
||||||
|
<logger name="com.ruoyi" level="info"/>
|
||||||
|
<!-- Spring日志级别控制 -->
|
||||||
|
<logger name="org.springframework" level="warn"/>
|
||||||
|
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="console"/>
|
||||||
|
</root>
|
||||||
|
|
||||||
|
<!--系统操作日志-->
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="file_info"/>
|
||||||
|
<appender-ref ref="file_error"/>
|
||||||
|
<appender-ref ref="file_console"/>
|
||||||
|
</root>
|
||||||
|
</configuration>
|
||||||
Loading…
Reference in New Issue