This commit is contained in:
parent
04969a5460
commit
cc92b37d9f
|
|
@ -137,16 +137,16 @@
|
||||||
<el-table-column label="API名称" align="center" prop="apiName" :show-overflow-tooltip="true"/>
|
<el-table-column label="API名称" align="center" prop="apiName" :show-overflow-tooltip="true"/>
|
||||||
<el-table-column label="请求URL" align="center" prop="url" :show-overflow-tooltip="true"/>
|
<el-table-column label="请求URL" align="center" prop="url" :show-overflow-tooltip="true"/>
|
||||||
<el-table-column label="请求方法" align="center" prop="method" :show-overflow-tooltip="true"/>
|
<el-table-column label="请求方法" align="center" prop="method" :show-overflow-tooltip="true"/>
|
||||||
<!-- <el-table-column label="请求参数" align="center" prop="request" :show-overflow-tooltip="true">
|
<!-- <el-table-column label="请求参数" align="center" prop="request" :show-overflow-tooltip="true">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ scope.row.request !== "" ? scope.row.request : "-" }}</span>
|
<span>{{ scope.row.request !== "" ? scope.row.request : "-" }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="响应参数" align="center" prop="response" :show-overflow-tooltip="true">
|
<el-table-column label="响应参数" align="center" prop="response" :show-overflow-tooltip="true">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ scope.row.response !== "" ? scope.row.response : "-" }}</span>
|
<span>{{ scope.row.response !== "" ? scope.row.response : "-" }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>-->
|
</el-table-column>-->
|
||||||
<el-table-column label="创建时间" align="center" prop="createTime" :show-overflow-tooltip="true"/>
|
<el-table-column label="创建时间" align="center" prop="createTime" :show-overflow-tooltip="true"/>
|
||||||
<el-table-column label="是否请求成功" align="center" prop="isSuccess" :show-overflow-tooltip="true">
|
<el-table-column label="是否请求成功" align="center" prop="isSuccess" :show-overflow-tooltip="true">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
|
@ -206,6 +206,26 @@
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<el-dialog title="内容详细" :visible.sync="openNoJson" width="700px" append-to-body>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
请求参数:
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
{{ this.request || '---'}}
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
响应参数:
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
{{ this.response }}
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="openNoJson = false">关 闭</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
<pagination
|
<pagination
|
||||||
v-show="total>0"
|
v-show="total>0"
|
||||||
:total="total"
|
:total="total"
|
||||||
|
|
@ -217,7 +237,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {listLog, delLog, getApiName,getInfo} from "@/api/business/log/apilog";
|
import {listLog, delLog, getApiName, getInfo} from "@/api/business/log/apilog";
|
||||||
import {pickerOptions} from "@/layout/mixin/PickerOptions"
|
import {pickerOptions} from "@/layout/mixin/PickerOptions"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
@ -244,6 +264,7 @@ export default {
|
||||||
title: "",
|
title: "",
|
||||||
// 是否显示弹出层
|
// 是否显示弹出层
|
||||||
open: false,
|
open: false,
|
||||||
|
openNoJson: false,
|
||||||
// 查询参数 需要给一个null值,否则input框等无法输入
|
// 查询参数 需要给一个null值,否则input框等无法输入
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
|
|
@ -302,8 +323,8 @@ export default {
|
||||||
|
|
||||||
dateQuery() {
|
dateQuery() {
|
||||||
//清空时间参数
|
//清空时间参数
|
||||||
this.queryParams.createTime=null
|
this.queryParams.createTime = null
|
||||||
this.queryParams.endCreateTime=null
|
this.queryParams.endCreateTime = null
|
||||||
|
|
||||||
this.handleQuery();
|
this.handleQuery();
|
||||||
},
|
},
|
||||||
|
|
@ -316,8 +337,8 @@ export default {
|
||||||
/** 详细按钮操作 */
|
/** 详细按钮操作 */
|
||||||
handleView(id) {
|
handleView(id) {
|
||||||
|
|
||||||
getInfo(id).then(res =>{
|
getInfo(id).then(res => {
|
||||||
this.form=res.data
|
this.form = res.data
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this.request = JSON.parse(this.form.request)
|
this.request = JSON.parse(this.form.request)
|
||||||
|
|
@ -330,6 +351,10 @@ export default {
|
||||||
message: '参数不是json格式!!!',
|
message: '参数不是json格式!!!',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.request=this.form.request
|
||||||
|
this.response=this.form.response
|
||||||
|
this.openNoJson = true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,91 @@
|
||||||
|
package com.xjs.utils;
|
||||||
|
|
||||||
|
import javax.imageio.ImageIO;
|
||||||
|
import java.awt.image.BufferedImage;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验图片相关工具类
|
||||||
|
* @author xiejs
|
||||||
|
* @since 2022-07-02
|
||||||
|
*/
|
||||||
|
public class CheckImagesFormatUtil {
|
||||||
|
/**
|
||||||
|
* 图片的像素判断
|
||||||
|
* @param file 文件
|
||||||
|
* @param imageWidth 图片宽度
|
||||||
|
* @param imageHeight 图片高度
|
||||||
|
* @return true:上传图片宽度和高度都小于等于规定最大值
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
|
public static boolean checkImageElement(File file, int imageWidth, int imageHeight) throws IOException {
|
||||||
|
Boolean result = false;
|
||||||
|
if (!file.exists()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
BufferedImage bufferedImage = ImageIO.read(file);
|
||||||
|
int width = bufferedImage.getWidth();
|
||||||
|
int height = bufferedImage.getHeight();
|
||||||
|
if (bufferedImage != null && height == imageHeight && width == imageWidth) {
|
||||||
|
result = true;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验图片比例
|
||||||
|
* @param file 图片
|
||||||
|
* @param imageWidth 宽
|
||||||
|
* @param imageHeight 高
|
||||||
|
* @return true:符合要求
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
|
public static boolean checkImageScale(File file, int imageWidth, int imageHeight) throws IOException {
|
||||||
|
Boolean result = false;
|
||||||
|
if (!file.exists()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
BufferedImage bufferedImage = ImageIO.read(file);
|
||||||
|
int width = bufferedImage.getWidth();
|
||||||
|
int height = bufferedImage.getHeight();
|
||||||
|
if (imageHeight != 0 && height != 0) {
|
||||||
|
int scale1 = imageHeight / imageWidth;
|
||||||
|
int scale2 = height / width;
|
||||||
|
if (scale1 == scale2) {
|
||||||
|
result = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验图片的大小
|
||||||
|
* @param file 文件
|
||||||
|
* @param imageSize 图片最大值(KB)
|
||||||
|
* @return true:上传图片小于图片的最大值
|
||||||
|
*/
|
||||||
|
public static boolean checkImageSize(File file, Long imageSize) {
|
||||||
|
if (!file.exists()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Long size = file.length() / 1024; // 图片大小
|
||||||
|
if (imageSize == null) {
|
||||||
|
imageSize = 5 * 1024L;
|
||||||
|
} else {
|
||||||
|
imageSize = imageSize * 1024;
|
||||||
|
}
|
||||||
|
if (size > imageSize) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (imageSize == null) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (size.intValue() <= imageSize) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -85,52 +85,57 @@ public class IndexController {
|
||||||
@GetMapping("showData")
|
@GetMapping("showData")
|
||||||
@ApiOperation("展示数据")
|
@ApiOperation("展示数据")
|
||||||
public AjaxResult showWbSearch() throws ExecutionException, InterruptedException {
|
public AjaxResult showWbSearch() throws ExecutionException, InterruptedException {
|
||||||
CompletableFuture<List<ApiTopsearchWeibo>> weiboListFuture = CompletableFuture.supplyAsync(() ->
|
Map<Object, Object> map = null;
|
||||||
apiTopsearchWeiboService.showWbSearch(), executor);
|
try {
|
||||||
|
CompletableFuture<List<ApiTopsearchWeibo>> weiboListFuture = CompletableFuture.supplyAsync(() ->
|
||||||
|
apiTopsearchWeiboService.showWbSearch(), executor);
|
||||||
|
|
||||||
CompletableFuture<List<CopyWritingNetworkDTO>> networkDTOListFuture = CompletableFuture.supplyAsync(indexController::getCopyWritingNetworkList, executor);
|
CompletableFuture<List<CopyWritingNetworkDTO>> networkDTOListFuture = CompletableFuture.supplyAsync(indexController::getCopyWritingNetworkList, executor);
|
||||||
|
|
||||||
CompletableFuture<List<CopyWriting>> yunListFuture = CompletableFuture.supplyAsync(() ->
|
CompletableFuture<List<CopyWriting>> yunListFuture = CompletableFuture.supplyAsync(() ->
|
||||||
copyWritingService.NeteaseHotWord(), executor);
|
copyWritingService.NeteaseHotWord(), executor);
|
||||||
|
|
||||||
CompletableFuture<Map<Object, Object>> logCountFuture = CompletableFuture.supplyAsync(indexController::getLogCount, executor);
|
CompletableFuture<Map<Object, Object>> logCountFuture = CompletableFuture.supplyAsync(indexController::getLogCount, executor);
|
||||||
|
|
||||||
CompletableFuture<Integer> loginCountFuture = CompletableFuture.supplyAsync(indexController::getLoginCount, executor);
|
CompletableFuture<Integer> loginCountFuture = CompletableFuture.supplyAsync(indexController::getLoginCount, executor);
|
||||||
|
|
||||||
CompletableFuture<List<SysOperLog>> sysOperLogFuture = CompletableFuture.supplyAsync(indexController::getSysOperLog, executor);
|
CompletableFuture<List<SysOperLog>> sysOperLogFuture = CompletableFuture.supplyAsync(indexController::getSysOperLog, executor);
|
||||||
|
|
||||||
CompletableFuture<List<EnglishWordDTO>> englishFuture = CompletableFuture.supplyAsync(indexController::getEnglish, executor);
|
CompletableFuture<List<EnglishWordDTO>> englishFuture = CompletableFuture.supplyAsync(indexController::getEnglish, executor);
|
||||||
|
|
||||||
CompletableFuture<Map<String, List<String>>> beautyPictureFuture = CompletableFuture.supplyAsync(indexController::getBeautyPictureList, executor);
|
CompletableFuture<Map<String, List<String>>> beautyPictureFuture = CompletableFuture.supplyAsync(indexController::getBeautyPictureList, executor);
|
||||||
|
|
||||||
CompletableFuture<Map<Object, Object>> newsFuture = CompletableFuture.supplyAsync(indexController::getNews, executor);
|
CompletableFuture<Map<Object, Object>> newsFuture = CompletableFuture.supplyAsync(indexController::getNews, executor);
|
||||||
|
|
||||||
CompletableFuture<IPInfoVo> ipInfoFuture = CompletableFuture.supplyAsync(indexController::getIpInfo, executor);
|
CompletableFuture<IPInfoVo> ipInfoFuture = CompletableFuture.supplyAsync(indexController::getIpInfo, executor);
|
||||||
|
|
||||||
CompletableFuture.allOf(
|
CompletableFuture.allOf(
|
||||||
weiboListFuture,
|
weiboListFuture,
|
||||||
networkDTOListFuture,
|
networkDTOListFuture,
|
||||||
yunListFuture,
|
yunListFuture,
|
||||||
logCountFuture,
|
logCountFuture,
|
||||||
sysOperLogFuture,
|
sysOperLogFuture,
|
||||||
englishFuture,
|
englishFuture,
|
||||||
newsFuture,
|
newsFuture,
|
||||||
beautyPictureFuture,
|
beautyPictureFuture,
|
||||||
ipInfoFuture
|
ipInfoFuture
|
||||||
).get();
|
).get();
|
||||||
|
|
||||||
Map<Object, Object> map = MapUtil.builder()
|
map = MapUtil.builder()
|
||||||
.put("weiboList", weiboListFuture.get())
|
.put("weiboList", weiboListFuture.get())
|
||||||
.put("networkDTOList", networkDTOListFuture.get())
|
.put("networkDTOList", networkDTOListFuture.get())
|
||||||
.put("yunList", yunListFuture.get())
|
.put("yunList", yunListFuture.get())
|
||||||
.put("logCount", logCountFuture.get())
|
.put("logCount", logCountFuture.get())
|
||||||
.put("loginCount", loginCountFuture.get())
|
.put("loginCount", loginCountFuture.get())
|
||||||
.put("sysOperLog", sysOperLogFuture.get())
|
.put("sysOperLog", sysOperLogFuture.get())
|
||||||
.put("englishWord", englishFuture.get())
|
.put("englishWord", englishFuture.get())
|
||||||
.put("news", newsFuture.get())
|
.put("news", newsFuture.get())
|
||||||
.put("beautyPicture", beautyPictureFuture.get())
|
.put("beautyPicture", beautyPictureFuture.get())
|
||||||
.put("ipInfo", ipInfoFuture.get())
|
.put("ipInfo", ipInfoFuture.get())
|
||||||
.build();
|
.build();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
return AjaxResult.success(map);
|
return AjaxResult.success(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue