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

@@ -3,6 +3,7 @@ package com.hanserwei.hannote.kv.api;
import com.hanserwei.framework.common.response.Response;
import com.hanserwei.hannote.kv.constant.ApiConstants;
import com.hanserwei.hannote.kv.dto.req.AddNoteContentReqDTO;
import com.hanserwei.hannote.kv.dto.req.DeleteNoteContentReqDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@@ -19,6 +20,6 @@ public interface KeyValueFeignApi {
Response<?> findNoteContent(@RequestBody AddNoteContentReqDTO addNoteContentReqDTO);
@PostMapping(value = PREFIX + "/note/content/delete")
Response<?> deleteNoteContent(@RequestBody AddNoteContentReqDTO addNoteContentReqDTO);
Response<?> deleteNoteContent(@RequestBody DeleteNoteContentReqDTO deleteNoteContentReqDTO);
}

View File

@@ -13,8 +13,8 @@ import lombok.NoArgsConstructor;
@Builder
public class AddNoteContentReqDTO {
@NotNull(message = "笔记 ID 不能为空")
private Long noteId;
@NotNull(message = "笔记内容 UUID 不能为空")
private String uuid;
@NotBlank(message = "笔记内容不能为空")
private String content;

View File

@@ -12,7 +12,7 @@ import lombok.NoArgsConstructor;
@Builder
public class DeleteNoteContentReqDTO {
@NotBlank(message = "笔记 ID 不能为空")
private String noteId;
@NotBlank(message = "笔记 UUID 不能为空")
private String uuid;
}

View File

@@ -12,7 +12,7 @@ import lombok.NoArgsConstructor;
@Builder
public class FindNoteContentReqDTO {
@NotBlank(message = "笔记 ID 不能为空")
private String noteId;
@NotBlank(message = "笔记 UUID 不能为空")
private String uuid;
}