1. 移除二维码默认示例查询方式
This commit is contained in:
@@ -2,6 +2,8 @@ package com.zt.plat.module.infra.service.file;
|
|||||||
|
|
||||||
import cn.hutool.core.io.resource.ResourceUtil;
|
import cn.hutool.core.io.resource.ResourceUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import com.google.common.cache.CacheLoader;
|
||||||
|
import com.google.common.cache.LoadingCache;
|
||||||
import com.zt.plat.framework.common.pojo.PageResult;
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
import com.zt.plat.framework.common.util.json.JsonUtils;
|
import com.zt.plat.framework.common.util.json.JsonUtils;
|
||||||
import com.zt.plat.framework.common.util.validation.ValidationUtils;
|
import com.zt.plat.framework.common.util.validation.ValidationUtils;
|
||||||
@@ -14,8 +16,6 @@ import com.zt.plat.module.infra.framework.file.core.client.FileClient;
|
|||||||
import com.zt.plat.module.infra.framework.file.core.client.FileClientConfig;
|
import com.zt.plat.module.infra.framework.file.core.client.FileClientConfig;
|
||||||
import com.zt.plat.module.infra.framework.file.core.client.FileClientFactory;
|
import com.zt.plat.module.infra.framework.file.core.client.FileClientFactory;
|
||||||
import com.zt.plat.module.infra.framework.file.core.enums.FileStorageEnum;
|
import com.zt.plat.module.infra.framework.file.core.enums.FileStorageEnum;
|
||||||
import com.google.common.cache.CacheLoader;
|
|
||||||
import com.google.common.cache.LoadingCache;
|
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import jakarta.validation.Validator;
|
import jakarta.validation.Validator;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
@@ -172,7 +172,7 @@ public class FileConfigServiceImpl implements FileConfigService {
|
|||||||
// 校验存在
|
// 校验存在
|
||||||
validateFileConfigExists(id);
|
validateFileConfigExists(id);
|
||||||
// 上传文件
|
// 上传文件
|
||||||
byte[] content = ResourceUtil.readBytes("file/erweima.jpg");
|
byte[] content = ResourceUtil.readBytes("file/bg1.png");
|
||||||
return getFileClient(id).upload(content, IdUtil.fastSimpleUUID() + ".jpg", "image/jpeg");
|
return getFileClient(id).upload(content, IdUtil.fastSimpleUUID() + ".jpg", "image/jpeg");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 6.4 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 18 KiB |
@@ -41,7 +41,7 @@ public class FtpFileClientTest {
|
|||||||
client.init();
|
client.init();
|
||||||
// 上传文件
|
// 上传文件
|
||||||
String path = IdUtil.fastSimpleUUID() + ".jpg";
|
String path = IdUtil.fastSimpleUUID() + ".jpg";
|
||||||
byte[] content = ResourceUtil.readBytes("file/erweima.jpg");
|
byte[] content = ResourceUtil.readBytes("file/bg1.png");
|
||||||
String fullPath = client.upload(content, path, "image/jpeg");
|
String fullPath = client.upload(content, path, "image/jpeg");
|
||||||
System.out.println("访问地址:" + fullPath);
|
System.out.println("访问地址:" + fullPath);
|
||||||
if (false) {
|
if (false) {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ public class LocalFileClientTest {
|
|||||||
client.init();
|
client.init();
|
||||||
// 上传文件
|
// 上传文件
|
||||||
String path = IdUtil.fastSimpleUUID() + ".jpg";
|
String path = IdUtil.fastSimpleUUID() + ".jpg";
|
||||||
byte[] content = ResourceUtil.readBytes("file/erweima.jpg");
|
byte[] content = ResourceUtil.readBytes("file/bg1.png");
|
||||||
String fullPath = client.upload(content, path, "image/jpeg");
|
String fullPath = client.upload(content, path, "image/jpeg");
|
||||||
System.out.println("访问地址:" + fullPath);
|
System.out.println("访问地址:" + fullPath);
|
||||||
client.delete(path);
|
client.delete(path);
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ public class S3FileClientTest {
|
|||||||
client.init();
|
client.init();
|
||||||
// 上传文件
|
// 上传文件
|
||||||
String path = IdUtil.fastSimpleUUID() + ".jpg";
|
String path = IdUtil.fastSimpleUUID() + ".jpg";
|
||||||
byte[] content = ResourceUtil.readBytes("file/erweima.jpg");
|
byte[] content = ResourceUtil.readBytes("file/bg1.png");
|
||||||
String fullPath = client.upload(content, path, "image/jpeg");
|
String fullPath = client.upload(content, path, "image/jpeg");
|
||||||
System.out.println("访问地址:" + fullPath);
|
System.out.println("访问地址:" + fullPath);
|
||||||
// 读取文件
|
// 读取文件
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public class SftpFileClientTest {
|
|||||||
client.init();
|
client.init();
|
||||||
// 上传文件
|
// 上传文件
|
||||||
String path = IdUtil.fastSimpleUUID() + ".jpg";
|
String path = IdUtil.fastSimpleUUID() + ".jpg";
|
||||||
byte[] content = ResourceUtil.readBytes("file/erweima.jpg");
|
byte[] content = ResourceUtil.readBytes("file/bg1.png");
|
||||||
String fullPath = client.upload(content, path, "image/jpeg");
|
String fullPath = client.upload(content, path, "image/jpeg");
|
||||||
System.out.println("访问地址:" + fullPath);
|
System.out.println("访问地址:" + fullPath);
|
||||||
if (false) {
|
if (false) {
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ public class FileServiceImplTest extends BaseDbUnitTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testCreateFile_success_01() throws Exception {
|
public void testCreateFile_success_01() throws Exception {
|
||||||
// 准备参数
|
// 准备参数
|
||||||
byte[] content = ResourceUtil.readBytes("file/erweima.jpg");
|
byte[] content = ResourceUtil.readBytes("file/bg1.png");
|
||||||
String name = "单测文件名";
|
String name = "单测文件名";
|
||||||
String directory = randomString();
|
String directory = randomString();
|
||||||
String type = "image/jpeg";
|
String type = "image/jpeg";
|
||||||
@@ -122,7 +122,7 @@ public class FileServiceImplTest extends BaseDbUnitTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testCreateFile_success_02() throws Exception {
|
public void testCreateFile_success_02() throws Exception {
|
||||||
// 准备参数
|
// 准备参数
|
||||||
byte[] content = ResourceUtil.readBytes("file/erweima.jpg");
|
byte[] content = ResourceUtil.readBytes("file/bg1.png");
|
||||||
// mock Master 文件客户端
|
// mock Master 文件客户端
|
||||||
String type = "image/jpeg";
|
String type = "image/jpeg";
|
||||||
FileClient client = mock(FileClient.class);
|
FileClient client = mock(FileClient.class);
|
||||||
@@ -318,7 +318,7 @@ public class FileServiceImplTest extends BaseDbUnitTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testCreateFile_withSameHash() throws Exception {
|
public void testCreateFile_withSameHash() throws Exception {
|
||||||
// 准备参数
|
// 准备参数
|
||||||
byte[] content = ResourceUtil.readBytes("file/erweima.jpg");
|
byte[] content = ResourceUtil.readBytes("file/bg1.png");
|
||||||
String name = "单测文件名";
|
String name = "单测文件名";
|
||||||
String directory = randomString();
|
String directory = randomString();
|
||||||
String type = "image/jpeg";
|
String type = "image/jpeg";
|
||||||
|
|||||||
Reference in New Issue
Block a user