Fix(EditService): Fix get wrong tool detail

Fix get wrong tool detail in source page
This commit is contained in:
2024-04-26 16:31:44 +08:00
parent eeb3c0a687
commit bdd0197d78
3 changed files with 6 additions and 6 deletions

View File

@@ -69,5 +69,5 @@ interface EditMapper : BaseMapper<Tool> {
@Param("ver") ver: String,
@Param("platform") platform: ToolBase.Platform,
@Param("operator") operator: String?
): List<Tool>?
): Tool?
}

View File

@@ -219,12 +219,9 @@ class EditServiceImpl(
if (username == "!" && WebUtil.getLoginUserId() == null) {
throw NoRecordFoundException()
}
val toolList = baseMapper.selectDetail(username, toolId, ver, platform, WebUtil.getLoginUsername())
if (toolList.isNullOrEmpty()) {
throw NoRecordFoundException()
}
return toolList.first().let(ToolConverter::toolToToolVo)
return baseMapper.selectDetail(username, toolId, ver, platform, WebUtil.getLoginUsername())
?.let(ToolConverter::toolToToolVo) ?: throw NoRecordFoundException()
}
override fun submit(id: Long): Boolean {