Fix:3; Refactor:2; Feat3; Docs:1 #23

Merged
FatttSnake merged 9 commits from FatttSnake into dev 2024-05-06 09:30:17 +08:00
3 changed files with 6 additions and 6 deletions
Showing only changes of commit bdd0197d78 - Show all commits

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 {

View File

@@ -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>