修改模型点赞bug

模型/工作流新增下载次数
master
Diyu0904 2025-03-29 17:54:37 +08:00
parent ef36122845
commit fca80acccb
4 changed files with 18 additions and 1 deletions

View File

@ -157,10 +157,21 @@ public class ModelVersionServiceImpl extends ServiceImpl< ModelVersionMapper,Mo
return R.fail(HttpStatus.SHOW_ERROR_MSG,"该模型加密未完成,请稍后再试");
}
updateModel(modelProduct);
return R.ok(modelVersion.getEncryptionFilePath(),modelVersion.getEncryptionFileName());
}
updateModel(modelProduct);
return R.ok(modelVersion.getFilePath(),modelVersion.getFileName());
}
/**
*
* @param modelProduct
*/
private void updateModel(ModelProduct modelProduct){
modelProduct.setNumbers(modelProduct.getNumbers()+1);
modelMapper.updateById(modelProduct);
}
}

View File

@ -117,6 +117,8 @@ public class SysUserAttentionServiceImpl extends ServiceImpl<SysUserAttentionMap
// 模型下载数
Long modelDownloadNum = modelMapper.sumNumber(userId);
//
// 模型运行次数
Long modelRunNum = modelMapper.sumRunNumber(userId);

View File

@ -76,6 +76,10 @@ public class WorkFlowVersionServiceImpl implements WorkFlowVersionService {
return R.fail(HttpStatus.SHOW_ERROR_MSG,"该文件不允许下载");
}
//更新下载次数
workFlow.setDownloadNumber(workFlow.getDownloadNumber()+1);
workFlowMapper.updateById(workFlow);
return R.ok(workFlowVersion.getFilePath(), workFlowVersion.getFileName());
}
}

View File

@ -25,6 +25,6 @@
</select>
<select id="selectModelLikeById" resultType="com.mcwl.resource.domain.WorkFlowLike">
select * from model_like where user_id = #{userId} and model_id = #{id}
select * from model_like where user_id = #{userId} and model_id = #{id} and del_flag = 0
</select>
</mapper>