feat(功能): 增加笔记重命名和导出功能- 在笔记列表和预览页面添加重命名功能
- 实现笔记内容自动保存机制 -增加笔记导出为 Markdown 文件的功能 - 优化后端接口,支持更新笔记标题
This commit is contained in:
@@ -29,4 +29,10 @@ public interface GroupingService {
|
||||
* @param id
|
||||
*/
|
||||
void deleteGrouping(Long id);
|
||||
|
||||
/**
|
||||
* 批量保存或更新
|
||||
* @param groupings
|
||||
*/
|
||||
void saveOrUpdateBatch(List<Grouping> groupings);
|
||||
}
|
||||
|
||||
@@ -58,4 +58,12 @@ public interface MarkdownFileService extends IService<MarkdownFile> {
|
||||
* @return 文件列表
|
||||
*/
|
||||
List<MarkdownFile> searchByTitle(String keyword);
|
||||
|
||||
/**
|
||||
* 更新Markdown文件标题
|
||||
* @param id 文件ID
|
||||
* @param title 新标题
|
||||
* @return 更新后的文件对象
|
||||
*/
|
||||
MarkdownFile updateMarkdownTitle(Long id, String title);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.springframework.stereotype.Service;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class GroupingServiceImpl
|
||||
public class GroupingServiceImpl
|
||||
extends ServiceImpl<GroupingMapper, Grouping>
|
||||
implements GroupingService {
|
||||
|
||||
@@ -44,4 +44,9 @@ public class GroupingServiceImpl
|
||||
public void deleteGrouping(Long id) {
|
||||
this.removeById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveOrUpdateBatch(List<Grouping> groupings) {
|
||||
super.saveOrUpdateBatch(groupings);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,4 +88,15 @@ public class MarkdownFileServiceImpl
|
||||
queryWrapper.like("title", keyword);
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MarkdownFile updateMarkdownTitle(Long id, String title) {
|
||||
MarkdownFile file = this.getById(id);
|
||||
if (file != null) {
|
||||
file.setTitle(title);
|
||||
file.setUpdatedAt(new Date());
|
||||
this.updateById(file);
|
||||
}
|
||||
return file;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user