优化
This commit is contained in:
@@ -20,7 +20,7 @@ import org.springframework.stereotype.Component;
|
|||||||
@Component
|
@Component
|
||||||
public class NettyTcpServer {
|
public class NettyTcpServer {
|
||||||
|
|
||||||
@Value("${tcp.server.port:9005}")
|
@Value("${tcp.server.port:27526}")
|
||||||
private int port;
|
private int port;
|
||||||
|
|
||||||
@Value("${tcp.server.boss-threads:1}")
|
@Value("${tcp.server.boss-threads:1}")
|
||||||
|
|||||||
@@ -6,9 +6,6 @@ import io.netty.channel.Channel;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.x.file.storage.core.FileInfo;
|
import org.dromara.x.file.storage.core.FileInfo;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.HttpHeaders;
|
|
||||||
import org.springframework.http.MediaType;
|
|
||||||
import org.springframework.http.ResponseEntity;
|
|
||||||
import org.springframework.mock.web.MockMultipartFile;
|
import org.springframework.mock.web.MockMultipartFile;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
@@ -136,8 +133,7 @@ public class VmCommandController {
|
|||||||
// 将文件转换为MultipartFile
|
// 将文件转换为MultipartFile
|
||||||
File file = imagePath.toFile();
|
File file = imagePath.toFile();
|
||||||
FileInputStream input = new FileInputStream(file);
|
FileInputStream input = new FileInputStream(file);
|
||||||
MultipartFile multipartFile = new MockMultipartFile(
|
MultipartFile multipartFile = new MockMultipartFile(file.getName(), // 文件名
|
||||||
file.getName(), // 文件名
|
|
||||||
file.getName(), // 原始文件名
|
file.getName(), // 原始文件名
|
||||||
"image/bmp", // 内容类型
|
"image/bmp", // 内容类型
|
||||||
input // 文件输入流
|
input // 文件输入流
|
||||||
|
|||||||
Reference in New Issue
Block a user