feat(note): 新增笔记创建和编辑功能

- 实现了笔记创建和编辑的前端逻辑
- 更新了相关的后端接口和数据库操作
- 优化了分组获取和展示逻辑
-调整了 Markdown 文件更新接口
This commit is contained in:
ikmkj
2025-07-30 07:48:38 +08:00
parent 431e3dea1c
commit 57fb74dc49
9 changed files with 95 additions and 65 deletions

View File

@@ -10,6 +10,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
@Tag(name = "markdown接口")
@@ -61,21 +62,10 @@ public class MarkdownController {
}
@Operation(summary = "更新Markdown文件")
@Parameters({
@Parameter(name = "id", description = "Markdown文件ID", required = true),
@Parameter(name = "content", description = "Markdown文件内容", required = true)
})
@PostMapping("/{id}")
public R<MarkdownFile> updateMarkdown(
@PathVariable String id,
String content) {
long l = Long.parseLong(id);
MarkdownFile file = markdownFileService.updateMarkdownContent(l, content);
if (file != null) {
return R.success(file);
}
return R.fail();
@PostMapping("/updateMarkdown")
public R<MarkdownFile> updateMarkdown(@RequestBody MarkdownFile markdownFile) {
MarkdownFile file = markdownFileService.updateMarkdownContent(markdownFile);
return R.success(file);
}
@Operation(summary = "获取所有Markdown文件")