17 Commits

Author SHA1 Message Date
0898855108 Merge branch '6170' into prod 2025-11-28 10:18:54 +08:00
92b65ce6df Merge branch 'dyf-device' into prod 2025-11-27 11:01:58 +08:00
82399cffed Merge branch 'dyf-device' into prod 2025-08-25 14:33:52 +08:00
5538ac96e5 晶全日志配置 2025-08-06 09:48:00 +08:00
b703f80355 晶全日志配置 2025-08-06 09:44:52 +08:00
b3b249ea07 日志配置 2025-08-06 09:20:41 +08:00
aff424e73b Merge branch 'main' into prod 2025-08-06 09:18:43 +08:00
dc513a858a Merge branch 'main' into prod 2025-08-04 09:08:34 +08:00
df5ce7ddd9 Merge branch 'main' into prod 2025-07-31 09:21:10 +08:00
2174dfdb4d Merge branch 'main' into prod 2025-07-23 19:24:27 +08:00
2800b89e06 Merge branch 'main' into prod 2025-07-23 10:55:30 +08:00
637e46c510 Merge branch 'main' into prod 2025-07-21 08:40:34 +08:00
31c2158c8e Merge branch 'main' into prod 2025-07-19 10:22:33 +08:00
c7c21dc358 Merge branch 'main' into prod 2025-07-18 15:17:54 +08:00
a7e0803b00 Merge branch 'main' into prod 2025-07-17 16:42:14 +08:00
55cacbd322 Merge branch 'main' into prod 2025-07-17 09:24:45 +08:00
99ec6eaff0 prod 2025-07-15 08:40:20 +08:00
6 changed files with 18 additions and 37 deletions

View File

@ -11,7 +11,6 @@ import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.io.IOException;
import java.util.List; import java.util.List;
/** /**
@ -40,7 +39,7 @@ public class AppFileController extends BaseController {
* 上传文件 * 上传文件
*/ */
@PostMapping("/upload") @PostMapping("/upload")
public R<Void> upload(@Validated @ModelAttribute AppFileDto bo) throws IOException { public R<Void> upload(@Validated @ModelAttribute AppFileDto bo) {
return toAjax(appFileService.add(bo)); return toAjax(appFileService.add(bo));
} }

View File

@ -8,7 +8,6 @@ import com.fuyuanshen.common.core.exception.ServiceException;
import com.fuyuanshen.common.oss.core.OssClient; import com.fuyuanshen.common.oss.core.OssClient;
import com.fuyuanshen.common.oss.factory.OssFactory; import com.fuyuanshen.common.oss.factory.OssFactory;
import com.fuyuanshen.common.satoken.utils.AppLoginHelper; import com.fuyuanshen.common.satoken.utils.AppLoginHelper;
import com.fuyuanshen.equipment.utils.FileHashUtil;
import com.fuyuanshen.system.domain.vo.SysOssVo; import com.fuyuanshen.system.domain.vo.SysOssVo;
import com.fuyuanshen.system.service.ISysOssService; import com.fuyuanshen.system.service.ISysOssService;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
@ -16,7 +15,6 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.util.List; import java.util.List;
/** /**
@ -33,38 +31,24 @@ public class AppFileService {
private final IAppBusinessFileService appBusinessFileService; private final IAppBusinessFileService appBusinessFileService;
private final FileHashUtil fileHashUtil;
private final ISysOssService ossService;
public List<AppFileVo> list(AppBusinessFileBo bo) { public List<AppFileVo> list(AppBusinessFileBo bo) {
// bo.setCreateBy(AppLoginHelper.getUserId()); // bo.setCreateBy(AppLoginHelper.getUserId());
return appBusinessFileService.queryAppFileList(bo); return appBusinessFileService.queryAppFileList(bo);
} }
public Boolean add(AppFileDto bo) {
/**
* APP文件上传
*/
public Boolean add(AppFileDto bo) throws IOException {
MultipartFile[] files = bo.getFiles(); MultipartFile[] files = bo.getFiles();
if (files == null || files.length == 0) { if(files == null || files.length == 0){
throw new ServiceException("请选择要上传的文件"); throw new ServiceException("请选择要上传的文件");
} }
if (files.length > 5) { if(files.length > 5){
throw new ServiceException("最多只能上传5个文件"); throw new ServiceException("最多只能上传5个文件");
} }
for (int i = 0; i < files.length; i++) { for (int i = 0; i < files.length; i++) {
MultipartFile file = files[i]; MultipartFile file = files[i];
// 上传文件 // 上传文件
// SysOssVo upload = sysOssService.upload(file); SysOssVo upload = sysOssService.upload(file);
String fileHash = fileHashUtil.hash(file);
SysOssVo upload = ossService.updateHash(file, fileHash);
// 强制将HTTP替换为HTTPS
if (upload.getUrl() != null && upload.getUrl().startsWith("http://")) {
upload.setUrl(upload.getUrl().replaceFirst("^http://", "https://"));
}
if (upload == null) { if (upload == null) {
return false; return false;
@ -82,7 +66,6 @@ public class AppFileService {
return true; return true;
} }
public Boolean delete(Long[] ids) { public Boolean delete(Long[] ids) {
AppBusinessFileBo bo = new AppBusinessFileBo(); AppBusinessFileBo bo = new AppBusinessFileBo();
// bo.setCreateBy(AppLoginHelper.getUserId()); // bo.setCreateBy(AppLoginHelper.getUserId());
@ -96,5 +79,4 @@ public class AppFileService {
} }
return appBusinessFileService.deleteWithValidByIds(List.of(ids), true); return appBusinessFileService.deleteWithValidByIds(List.of(ids), true);
} }
} }

View File

@ -8,8 +8,8 @@ spring.boot.admin.client:
metadata: metadata:
username: ${spring.boot.admin.client.username} username: ${spring.boot.admin.client.username}
userpassword: ${spring.boot.admin.client.password} userpassword: ${spring.boot.admin.client.password}
username: @monitor.username@ username: ${monitor.username}
password: @monitor.password@ password: ${monitor.password}
--- # snail-job 配置 --- # snail-job 配置
snail-job: snail-job:

View File

@ -11,8 +11,8 @@ spring.boot.admin.client:
metadata: metadata:
username: ${spring.boot.admin.client.username} username: ${spring.boot.admin.client.username}
userpassword: ${spring.boot.admin.client.password} userpassword: ${spring.boot.admin.client.password}
username: @monitor.username@ username: ${monitor.username}
password: @monitor.password@ password: ${monitor.password}
--- # snail-job 配置 --- # snail-job 配置
snail-job: snail-job:

View File

@ -72,10 +72,10 @@ public class SysOssVo implements Serializable {
* 服务商 * 服务商
*/ */
private String service; private String service;
/** /**
* 内容哈希 * 内容哈希
*/ */
private String fileHash; private String fileHash;
} }

16
pom.xml
View File

@ -85,10 +85,10 @@
<monitor.username>fys</monitor.username> <monitor.username>fys</monitor.username>
<monitor.password>123456</monitor.password> <monitor.password>123456</monitor.password>
</properties> </properties>
<activation> <!-- <activation> -->
<!-- 默认环境 --> <!-- &lt;!&ndash; 默认环境 &ndash;&gt; -->
<activeByDefault>true</activeByDefault> <!-- <activeByDefault>true</activeByDefault> -->
</activation> <!-- </activation> -->
</profile> </profile>
<profile> <profile>
<id>prod</id> <id>prod</id>
@ -98,10 +98,10 @@
<monitor.username>fys</monitor.username> <monitor.username>fys</monitor.username>
<monitor.password>123456</monitor.password> <monitor.password>123456</monitor.password>
</properties> </properties>
<!-- <activation> --> <activation>
<!-- &lt;!&ndash; 默认环境 &ndash;&gt; --> <!-- 默认环境 -->
<!-- <activeByDefault>true</activeByDefault> --> <activeByDefault>true</activeByDefault>
<!-- </activation> --> </activation>
</profile> </profile>
<profile> <profile>
<id>jingquan</id> <id>jingquan</id>