refactor(database): 更新数据库配置和实体映射

- 修改数据库连接URL地址
- 为所有实体类添加@TableField注解映射数据库字段
- 使用反引号标识符包裹表名和字段名
- 更新SQL查询语句使用明确字段列表
- 在配置文件中启用MyBatis安全模式防止SQL注入
- 添加MarkdownFileVO中groupingName字段的exist = false标识
This commit is contained in:
ikmkj
2026-01-08 19:44:22 +08:00
parent 363918b3f7
commit 95393ab517
14 changed files with 93 additions and 38 deletions

View File

@@ -14,15 +14,20 @@ import java.util.Date;
@Data
@Schema(name = "文本实体")
@TableName("markdown_file")
@TableName("`markdown_file`")
public class MarkdownFile implements Serializable {
@Schema(description = "文本id",implementation = Long.class)
@TableId(type = IdType.AUTO)
@JsonFormat(shape = JsonFormat.Shape.STRING) // 仅作用于此字段
@TableField("id")
private Long id;
@Schema(description = "分组表id",implementation = Long.class)
@TableField("grouping_id")
private Long groupingId;
@Schema(description = "文本标题",implementation = String.class)
@TableField("`title`")
private String title;
@Schema(description = " 文件名(带.md后缀用于存储和识别",implementation = String.class)
@@ -30,22 +35,31 @@ public class MarkdownFile implements Serializable {
private String fileName;
@Schema(description = "Markdown内容存储实际文档内容",implementation = String.class)
@TableField("`content`")
private String content;
@Schema(description = "创建时间",implementation = Date.class)
@TableField("created_at")
private Date createdAt;
@Schema(description = "更新时间",implementation = Date.class)
@TableField("updated_at")
private Date updatedAt;
@Schema(description = "是否删除 0-未删除 1-已删除", implementation = Integer.class)
@TableLogic
@TableField("is_deleted")
private Integer isDeleted;
@Schema(description = "删除时间", implementation = Date.class)
@TableField("deleted_at")
private Date deletedAt;
@Schema(description = "删除人ID", implementation = Long.class)
@TableField("deleted_by")
private Long deletedBy;
@Schema(description = "是否私密 0-公开 1-私密", implementation = Integer.class)
@TableField("is_private")
private Integer isPrivate;
}
}