Fix(EditService): Fix get wrong tool detail
Fix get wrong tool detail in source page
This commit is contained in:
@@ -69,5 +69,5 @@ interface EditMapper : BaseMapper<Tool> {
|
||||
@Param("ver") ver: String,
|
||||
@Param("platform") platform: ToolBase.Platform,
|
||||
@Param("operator") operator: String?
|
||||
): List<Tool>?
|
||||
): Tool?
|
||||
}
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user