修改校验文件名字

master
Diyu0904 2025-03-21 14:11:02 +08:00
parent a3a0435850
commit 9b675ab620
3 changed files with 8 additions and 3 deletions

View File

@ -27,4 +27,6 @@ public interface ModelVersionMapper extends BaseMapper<ModelVersion> {
ModelVersion selectByProductId(@Param("id") Long id); ModelVersion selectByProductId(@Param("id") Long id);
ModelVersion selectByEncryptionFileName(@Param("name") String name);
} }

View File

@ -38,14 +38,14 @@ public class FileServiceImpl implements FileService {
if (type.equals("model")) { if (type.equals("model")) {
ModelVersion modelVersion = versionMapper.selectByFileName(name); ModelVersion modelVersion = versionMapper.selectByEncryptionFileName(name);
if (modelVersion == null) { if (modelVersion == null) {
return AjaxResult.error("文件不存在"); return AjaxResult.error("文件不存在");
} }
return AjaxResult.success(modelVersion); return AjaxResult.success(modelVersion);
}else if (type.equals("workflow")){ } else if (type.equals("workflow")){
WorkFlowVersion workFlowVersion = workFlowVersionMapper.selectByFileName(name); WorkFlowVersion workFlowVersion = workFlowVersionMapper.selectByFileName(name);
if (workFlowVersion == null) { if (workFlowVersion == null) {

View File

@ -49,7 +49,7 @@
</update> </update>
<select id="selectByFileName" resultType="com.mcwl.resource.domain.ModelVersion"> <select id="selectByFileName" resultType="com.mcwl.resource.domain.ModelVersion">
select key_rate,is_encrypt from model_version where encryption_file_name = #{name} select key_rate,is_encrypt from model_version where file_name = #{name}
</select> </select>
<select id="selectByHash" resultType="com.mcwl.resource.domain.ModelVersion"> <select id="selectByHash" resultType="com.mcwl.resource.domain.ModelVersion">
select * from model_version where file_hash = #{hashCode} select * from model_version where file_hash = #{hashCode}
@ -58,5 +58,8 @@
<select id="selectByProductId" resultType="com.mcwl.resource.domain.ModelVersion"> <select id="selectByProductId" resultType="com.mcwl.resource.domain.ModelVersion">
SELECT * FROM model_version WHERE model_id = #{id} LIMIT 1 SELECT * FROM model_version WHERE model_id = #{id} LIMIT 1
</select> </select>
<select id="selectByEncryptionFileName" resultType="com.mcwl.resource.domain.ModelVersion">
select key_rate,is_encrypt from encryption_file_name where file_name = #{name}
</select>
</mapper> </mapper>