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 {
|
||||
|
||||
@@ -195,6 +195,7 @@
|
||||
<choose>
|
||||
<when test="operator == null">
|
||||
and tsu.username = #{username}
|
||||
and t_b_tool_main.publish != 0
|
||||
</when>
|
||||
<otherwise>
|
||||
<choose>
|
||||
@@ -206,11 +207,13 @@
|
||||
</when>
|
||||
<otherwise>
|
||||
and tsu.username = #{username}
|
||||
and t_b_tool_main.publish != 0
|
||||
</otherwise>
|
||||
</choose>
|
||||
</otherwise>
|
||||
</choose>
|
||||
</where>
|
||||
order by t_b_tool_main.id desc
|
||||
limit 1
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user