Merge branch 'test' into test-dsc

* test:
  修复BUG710,添加文件下载次数统计
  修改私服地址,把 seata-dm 项目从 dsc挪过来
  feat(gateway): 添加API客户端凭证加密功能支持
  bmp 已挪到 ztcloud-dist 仓库
  修改发布信息
  增加快照仓库
  恢复 erp 模块数据权限
  从maven模块中移除 zt-server
  修改版本号
  feat:登陆用户的部门数据权限接口增加角色参数;获取当前用户可访问的顶级部门列表不校验数据权限
  no message
This commit is contained in:
ranke
2026-01-15 14:51:00 +08:00
26 changed files with 156 additions and 24 deletions

View File

@@ -34,4 +34,7 @@ public class FileRespDTO {
@Schema(description = "文件内容", requiredMode = Schema.RequiredMode.REQUIRED)
private byte[] content;
@Schema(description = "文件下载次数")
private Integer downloadCount;
}

View File

@@ -133,6 +133,10 @@ public class FileController {
response.setStatus(HttpStatus.NOT_FOUND.value());
return;
}
// 统计下载次数
fileService.incDownloadCount(configId,path);
writeAttachment(response, path, content);
}

View File

@@ -99,4 +99,7 @@ public class FileRespVO {
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
private LocalDateTime createTime;
@Schema(description = "下载次数")
private Integer downloadCount;
}

View File

@@ -65,6 +65,11 @@ public class FileDO extends BaseDO {
*/
private String aesIv;
/**
* 文件下载次数统计
*/
private Integer downloadCount;
/**
* 是否加密
* <p>

View File

@@ -6,6 +6,8 @@ import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.zt.plat.module.infra.controller.admin.file.vo.file.FilePageReqVO;
import com.zt.plat.module.infra.dal.dataobject.file.FileDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;
/**
* 文件操作 Mapper
@@ -32,4 +34,7 @@ public interface FileMapper extends BaseMapperX<FileDO> {
return selectFirstOne(FileDO::getHash, hash);
}
@Update("UPDATE INFRA_FILE SET DOWNLOAD_COUNT = DOWNLOAD_COUNT + 1 WHERE CONFIG_ID = #{configId} AND PATH = #{path}")
int incDownloadCount(@Param("configId") Long configId, @Param("path") String path);
}

View File

@@ -112,4 +112,11 @@ public interface FileService {
FileDO getActiveFileById(Long fileId);
boolean verifyCode(Long fileId, Long userId, String code) throws Exception;
/**
* 更新文件下载次数
* @param configId
* @param path
*/
void incDownloadCount(Long configId, String path);
}

View File

@@ -334,4 +334,9 @@ public class FileServiceImpl implements FileService {
}
}
@Override
public void incDownloadCount(Long configId, String path) {
fileMapper.incDownloadCount(configId, path);
}
}