pull/254/head
xjs 3 years ago
parent 04969a5460
commit cc92b37d9f

@ -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"
@ -244,6 +264,7 @@ export default {
title: "", title: "",
// //
open: false, open: false,
openNoJson: false,
// nullinput // nullinput
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
@ -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,6 +85,8 @@ public class IndexController {
@GetMapping("showData") @GetMapping("showData")
@ApiOperation("展示数据") @ApiOperation("展示数据")
public AjaxResult showWbSearch() throws ExecutionException, InterruptedException { public AjaxResult showWbSearch() throws ExecutionException, InterruptedException {
Map<Object, Object> map = null;
try {
CompletableFuture<List<ApiTopsearchWeibo>> weiboListFuture = CompletableFuture.supplyAsync(() -> CompletableFuture<List<ApiTopsearchWeibo>> weiboListFuture = CompletableFuture.supplyAsync(() ->
apiTopsearchWeiboService.showWbSearch(), executor); apiTopsearchWeiboService.showWbSearch(), executor);
@ -119,7 +121,7 @@ public class IndexController {
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())
@ -131,6 +133,9 @@ public class IndexController {
.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…
Cancel
Save