fix: 修复Spring Boot兼容性问题并添加链接删除功能

主要修改:
1. 降级Spring Boot版本到2.7.18以兼容MyBatis-Plus
2. 修复所有validation包导入路径 (jakarta -> javax)
3. 修复ResponseStatusException API调用
4. 降级Swagger版本以兼容Spring Boot 2.x
5. 添加单个和批量删除链接功能
6. 修复JWT认证中的Claims获取方式
7. 优化代码格式和日志输出

技术细节:
- Spring Boot: 3.3.3 -> 2.7.18
- Swagger: springdoc-openapi-starter-webflux-ui:2.3.0 -> springdoc-openapi-webflux-ui:1.7.0
- 所有javax.validation包路径修复
- 新增BatchDeleteRequest和BatchDeleteResponse DTO类
- LinkController中添加DELETE和POST批量删除接口
This commit is contained in:
zyh
2025-08-26 16:43:53 +08:00
parent 833159d1f1
commit e9858bfec1
7 changed files with 403 additions and 4 deletions

View File

@@ -170,4 +170,31 @@
</if>
</where>
</select>
<delete id="deleteByCodeNo">
DELETE FROM link_task WHERE code_no = #{codeNo}
</delete>
<delete id="deleteByCodeNoAndAgentId">
DELETE FROM link_task WHERE code_no = #{codeNo} AND agent_id = #{agentId}
</delete>
<delete id="batchDeleteByCodeNosAndAgentId">
DELETE FROM link_task
WHERE agent_id = #{agentId}
AND code_no IN
<foreach collection="codeNos" item="codeNo" open="(" close=")" separator=",">
#{codeNo}
</foreach>
</delete>
<select id="findByCodeNosAndAgentId" resultMap="LinkTaskMap">
SELECT id, batch_id, agent_id, code_no, token_hash, expire_at, status, region, machine_id, login_at, refund_at, revoked_at, created_at, updated_at
FROM link_task
WHERE agent_id = #{agentId}
AND code_no IN
<foreach collection="codeNos" item="codeNo" open="(" close=")" separator=",">
#{codeNo}
</foreach>
</select>
</mapper>