feat(note): 实现笔记发布功能并优化数据模型

- 新增笔记发布接口,支持图文和视频类型
- 引入分布式ID生成器和KV存储服务
- 修改笔记、频道、话题等实体类使用LocalDateTime
- 添加频道-话题关联表及相应服务实现
- 更新数据库表结构,增加笔记内容UUID字段
- 完善笔记发布时的内容校验和异常处理
- 配置网关路由支持新的笔记服务路径
- 优化MyBatis Mapper扫描和Feign客户端配置
This commit is contained in:
Hanserwei
2025-10-08 19:37:35 +08:00
parent 665ea930fd
commit dd63d30792
32 changed files with 430 additions and 28 deletions

View File

@@ -27,12 +27,12 @@ public class NoteContentServiceImpl implements NoteContentService {
@Override
public Response<?> addNoteContent(AddNoteContentReqDTO addNoteContentReqDTO) {
// 笔记ID
Long noteId = addNoteContentReqDTO.getNoteId();
String noteId = addNoteContentReqDTO.getUuid();
// 笔记内容
String content = addNoteContentReqDTO.getContent();
NoteContentDO noteContent = NoteContentDO.builder()
.id(UUID.randomUUID())
.id(UUID.fromString(noteId))
.content(content)
.build();
@@ -44,7 +44,7 @@ public class NoteContentServiceImpl implements NoteContentService {
@Override
public Response<FindNoteContentRspDTO> findNoteContent(FindNoteContentReqDTO findNoteContentReqDTO) {
// 笔记ID
String noteId = findNoteContentReqDTO.getNoteId();
String noteId = findNoteContentReqDTO.getUuid();
Optional<NoteContentDO> optional = noteContentRepository.findById(UUID.fromString(noteId));
if (optional.isEmpty()){
throw new ApiException(ResponseCodeEnum.NOTE_CONTENT_NOT_FOUND);
@@ -60,7 +60,7 @@ public class NoteContentServiceImpl implements NoteContentService {
@Override
public Response<?> deleteNoteContent(DeleteNoteContentReqDTO deleteNoteContentReqDTO) {
String noteId = deleteNoteContentReqDTO.getNoteId();
String noteId = deleteNoteContentReqDTO.getUuid();
noteContentRepository.deleteById(UUID.fromString(noteId));
return Response.success();
}