feat(trash): 优化回收站物品恢复和永久删除逻辑
- 在 GroupingMapper 和 MarkdownFileMapper 中添加物理删除和恢复的 SQL 操作 - 优化 HomePage组件中的删除操作,删除后刷新分组树并回到主视图 - 在 TrashServiceImpl 中实现物品恢复和永久删除的业务逻辑- 为 TrashItemVo 中的 deletedAt 字段添加 JSON 格式化注解
This commit is contained in:
@@ -2,8 +2,13 @@ package com.test.bijihoudaun.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.test.bijihoudaun.entity.Grouping;
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -12,4 +17,10 @@ public interface GroupingMapper extends BaseMapper<Grouping> {
|
||||
|
||||
@Select("SELECT * FROM grouping WHERE is_deleted = 1")
|
||||
List<Grouping> selectDeleted();
|
||||
|
||||
@Delete("DELETE FROM grouping WHERE id = #{id}")
|
||||
void physicalDeleteById(@Param("id") Long id);
|
||||
|
||||
@Update("UPDATE grouping SET is_deleted = 0, deleted_at = NULL, deleted_by = NULL WHERE id = #{id}")
|
||||
void restoreById(@Param("id") Long id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user