Compare commits

...

2 Commits

Author SHA1 Message Date
yang 0d29d79af6 Merge branch 'feature/community-center' into preview 2025-03-29 18:01:55 +08:00
Diyu0904 fca80acccb 修改模型点赞bug
模型/工作流新增下载次数
2025-03-29 17:54:37 +08:00
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,"该模型加密未完成,请稍后再试"); return R.fail(HttpStatus.SHOW_ERROR_MSG,"该模型加密未完成,请稍后再试");
} }
updateModel(modelProduct);
return R.ok(modelVersion.getEncryptionFilePath(),modelVersion.getEncryptionFileName()); return R.ok(modelVersion.getEncryptionFilePath(),modelVersion.getEncryptionFileName());
} }
updateModel(modelProduct);
return R.ok(modelVersion.getFilePath(),modelVersion.getFileName()); 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 modelDownloadNum = modelMapper.sumNumber(userId);
//
// 模型运行次数 // 模型运行次数
Long modelRunNum = modelMapper.sumRunNumber(userId); Long modelRunNum = modelMapper.sumRunNumber(userId);

View File

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

View File

@ -25,6 +25,6 @@
</select> </select>
<select id="selectModelLikeById" resultType="com.mcwl.resource.domain.WorkFlowLike"> <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> </select>
</mapper> </mapper>