diff --git a/.gitignore b/.gitignore
index 5ff6309..25e5e64 100644
--- a/.gitignore
+++ b/.gitignore
@@ -35,4 +35,8 @@ build/
.vscode/
### Mac OS ###
-.DS_Store
\ No newline at end of file
+.DS_Store
+
+
+### mybatis plus generator
+/generator/
\ No newline at end of file
diff --git a/aioj-backend-common/aioj-backend-common-mybatis/src/test/java/cn/meowrain/aioj/generator/CodeGenerator.java b/aioj-backend-common/aioj-backend-common-mybatis/src/test/java/cn/meowrain/aioj/generator/CodeGenerator.java
index 3059b50..cd8f068 100644
--- a/aioj-backend-common/aioj-backend-common-mybatis/src/test/java/cn/meowrain/aioj/generator/CodeGenerator.java
+++ b/aioj-backend-common/aioj-backend-common-mybatis/src/test/java/cn/meowrain/aioj/generator/CodeGenerator.java
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.config.OutputFile;
+import com.baomidou.mybatisplus.generator.config.TemplateType;
import com.baomidou.mybatisplus.generator.config.rules.DateType;
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
@@ -20,6 +21,11 @@ import java.util.Collections;
* 3. 修改输出路径和包名
* 4. 运行 main 方法
*
+ *
+ * 生成规则:
+ * - Entity: XxxDO (数据对象)
+ * - Controller: /v1/xxx (RESTful 风格,包含 CRUD)
+ *
*
* @author meowrain
* @since 1.0.0
@@ -28,11 +34,11 @@ public class CodeGenerator {
// ==================== 数据库配置 ====================
/** 数据库地址 */
- private static final String DB_URL = "jdbc:mysql://10.0.0.10:3306/aioj?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai";
+ private static final String DB_URL = "jdbc:mysql://10.0.0.10:3306/aioj_dev?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai";
/** 数据库用户名 */
private static final String DB_USERNAME = "root";
/** 数据库密码 */
- private static final String DB_PASSWORD = "123456";
+ private static final String DB_PASSWORD = "root";
// ==================== 代码生成配置 ====================
/** 作者名 */
@@ -40,17 +46,17 @@ public class CodeGenerator {
/** 父包名 */
private static final String PARENT_PACKAGE = "cn.meowrain.aioj.backend";
/** 模块名 (如: userservice, questionservice) */
- private static final String MODULE_NAME = "userservice";
+ private static final String MODULE_NAME = "fileservice";
/** 要生成的表名 (多个表用逗号分隔) */
- private static final String[] TABLE_NAMES = {"sys_user", "sys_role"};
+ private static final String[] TABLE_NAMES = {"attachment"};
/** 表前缀 (生成时会去掉前缀) */
- private static final String[] TABLE_PREFIX = {"sys_", "t_"};
+ private static final String[] TABLE_PREFIX = {""};
// ==================== 输出路径配置 ====================
/** 代码输出目录 (默认当前项目的 src/main/java) */
- private static final String OUTPUT_DIR = System.getProperty("user.dir") + "/src/main/java";
+ private static final String OUTPUT_DIR = System.getProperty("user.dir") + "/generator/src/main/java";
/** Mapper XML 输出目录 */
- private static final String MAPPER_XML_DIR = System.getProperty("user.dir") + "/src/main/resources/mapper";
+ private static final String MAPPER_XML_DIR = System.getProperty("user.dir") + "/generator/src/main/resources/mapper";
public static void main(String[] args) {
generateCode();
@@ -85,8 +91,9 @@ public class CodeGenerator {
.strategyConfig(builder -> builder
.addInclude(TABLE_NAMES)
.addTablePrefix(TABLE_PREFIX)
- // Entity 策略
+ // Entity 策略: 生成 XxxDO
.entityBuilder()
+ .formatFileName("%sDO") // 实体类后缀改为 DO
.enableLombok()
.enableTableFieldAnnotation()
.naming(NamingStrategy.underline_to_camel)
@@ -108,6 +115,15 @@ public class CodeGenerator {
.controllerBuilder()
.enableRestStyle()
)
+ // 自定义模板 (使用 /templates/ 目录下的模板)
+ .templateConfig(builder -> builder
+ .entity("/templates/entityDO.java")
+ .controller("/templates/controller.java")
+ .service("/templates/service.java")
+ .serviceImpl("/templates/serviceImpl.java")
+ .mapper("/templates/mapper.java")
+ .xml("/templates/mapper.xml")
+ )
// 模板引擎
.templateEngine(new FreemarkerTemplateEngine())
.execute();
@@ -115,5 +131,9 @@ public class CodeGenerator {
System.out.println("========== 代码生成完成 ==========");
System.out.println("输出目录: " + OUTPUT_DIR);
System.out.println("Mapper XML: " + MAPPER_XML_DIR);
+ System.out.println();
+ System.out.println("生成规则:");
+ System.out.println(" - Entity: XxxDO");
+ System.out.println(" - Controller: /v1/xxx (包含 CRUD 增删改查)");
}
}
diff --git a/aioj-backend-common/aioj-backend-common-mybatis/src/test/java/cn/meowrain/aioj/generator/InteractiveCodeGenerator.java b/aioj-backend-common/aioj-backend-common-mybatis/src/test/java/cn/meowrain/aioj/generator/InteractiveCodeGenerator.java
index 5cf0421..d937874 100644
--- a/aioj-backend-common/aioj-backend-common-mybatis/src/test/java/cn/meowrain/aioj/generator/InteractiveCodeGenerator.java
+++ b/aioj-backend-common/aioj-backend-common-mybatis/src/test/java/cn/meowrain/aioj/generator/InteractiveCodeGenerator.java
@@ -17,6 +17,11 @@ import java.util.Scanner;
*
* 运行后会在控制台提示输入相关配置信息
*
+ *
+ * 生成规则:
+ * - Entity: XxxDO (数据对象)
+ * - Controller: /v1/xxx (RESTful 风格,包含 CRUD)
+ *
*
* @author meowrain
* @since 1.0.0
@@ -118,8 +123,9 @@ public class InteractiveCodeGenerator {
builder.addTablePrefix(tablePrefixes);
}
builder
- // Entity 策略
+ // Entity 策略: 生成 XxxDO
.entityBuilder()
+ .formatFileName("%sDO") // 实体类后缀改为 DO
.enableLombok()
.enableTableFieldAnnotation()
.naming(NamingStrategy.underline_to_camel)
@@ -141,6 +147,15 @@ public class InteractiveCodeGenerator {
.controllerBuilder()
.enableRestStyle();
})
+ // 自定义模板 (使用 /templates/ 目录下的模板)
+ .templateConfig(builder -> builder
+ .entity("/templates/entityDO.java")
+ .controller("/templates/controller.java")
+ .service("/templates/service.java")
+ .serviceImpl("/templates/serviceImpl.java")
+ .mapper("/templates/mapper.java")
+ .xml("/templates/mapper.xml")
+ )
// 模板引擎
.templateEngine(new FreemarkerTemplateEngine())
.execute();
@@ -149,5 +164,9 @@ public class InteractiveCodeGenerator {
System.out.println("========== 代码生成完成 ==========");
System.out.println("Java 代码: " + outputDir);
System.out.println("Mapper XML: " + mapperXmlDir);
+ System.out.println();
+ System.out.println("生成规则:");
+ System.out.println(" - Entity: XxxDO");
+ System.out.println(" - Controller: /v1/xxx (包含 CRUD 增删改查)");
}
}
diff --git a/aioj-backend-common/aioj-backend-common-mybatis/src/test/resources/templates/controller.java.ftl b/aioj-backend-common/aioj-backend-common-mybatis/src/test/resources/templates/controller.java.ftl
new file mode 100644
index 0000000..9654299
--- /dev/null
+++ b/aioj-backend-common/aioj-backend-common-mybatis/src/test/resources/templates/controller.java.ftl
@@ -0,0 +1,97 @@
+package ${package.Controller};
+
+import ${package.Entity}.${entity}DO;
+import ${package.Service}.${table.serviceName};
+import cn.meowrain.aioj.backend.framework.result.Result;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import lombok.RequiredArgsConstructor;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * ${table.comment!} 控制器
+ *
+ * @author ${author}
+ * @since ${date}
+ */
+@Tag(name = "${table.comment!}管理")
+@RestController
+@RequestMapping("/v1/<#if controllerMappingHyphenStyle>${controllerMappingHyphen}<#else>${table.entityPath}#if>")
+@RequiredArgsConstructor
+public class ${table.controllerName} {
+
+ private final ${table.serviceName} ${table.entityPath}Service;
+
+ /**
+ * 分页查询${table.comment!}列表
+ */
+ @Operation(summary = "分页查询${table.comment!}列表")
+ @GetMapping("/page")
+ public Result> page(
+ @Parameter(description = "当前页码") @RequestParam(defaultValue = "1") Integer current,
+ @Parameter(description = "每页数量") @RequestParam(defaultValue = "10") Integer size) {
+ Page<${entity}DO> page = new Page<>(current, size);
+ return Result.success(${table.entityPath}Service.page(page));
+ }
+
+ /**
+ * 查询所有${table.comment!}列表
+ */
+ @Operation(summary = "查询所有${table.comment!}列表")
+ @GetMapping("/list")
+ public Result> list() {
+ return Result.success(${table.entityPath}Service.list());
+ }
+
+ /**
+ * 根据ID查询${table.comment!}详情
+ */
+ @Operation(summary = "根据ID查询${table.comment!}详情")
+ @GetMapping("/{id}")
+ public Result<${entity}DO> getById(
+ @Parameter(description = "${table.comment!}ID") @PathVariable Long id) {
+ return Result.success(${table.entityPath}Service.getById(id));
+ }
+
+ /**
+ * 新增${table.comment!}
+ */
+ @Operation(summary = "新增${table.comment!}")
+ @PostMapping
+ public Result save(@RequestBody ${entity}DO entity) {
+ return Result.success(${table.entityPath}Service.save(entity));
+ }
+
+ /**
+ * 修改${table.comment!}
+ */
+ @Operation(summary = "修改${table.comment!}")
+ @PutMapping
+ public Result update(@RequestBody ${entity}DO entity) {
+ return Result.success(${table.entityPath}Service.updateById(entity));
+ }
+
+ /**
+ * 删除${table.comment!}
+ */
+ @Operation(summary = "删除${table.comment!}")
+ @DeleteMapping("/{id}")
+ public Result delete(
+ @Parameter(description = "${table.comment!}ID") @PathVariable Long id) {
+ return Result.success(${table.entityPath}Service.removeById(id));
+ }
+
+ /**
+ * 批量删除${table.comment!}
+ */
+ @Operation(summary = "批量删除${table.comment!}")
+ @DeleteMapping("/batch")
+ public Result deleteBatch(@RequestBody List ids) {
+ return Result.success(${table.entityPath}Service.removeByIds(ids));
+ }
+}
diff --git a/aioj-backend-common/aioj-backend-common-mybatis/src/test/resources/templates/entityDO.java.ftl b/aioj-backend-common/aioj-backend-common-mybatis/src/test/resources/templates/entityDO.java.ftl
new file mode 100644
index 0000000..944d311
--- /dev/null
+++ b/aioj-backend-common/aioj-backend-common-mybatis/src/test/resources/templates/entityDO.java.ftl
@@ -0,0 +1,68 @@
+package ${package.Entity};
+
+<#list table.importPackages as pkg>
+import ${pkg};
+#list>
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * ${table.comment!} 数据访问对象
+ *
+ * @author ${author}
+ * @since ${date}
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("${table.name}")
+public class ${entity}DO implements Serializable {
+
+ @Serial
+ private static final long serialVersionUID = 1L;
+
+<#-- 遍历字段 -->
+<#list table.fields as field>
+ <#if field.keyFlag>
+ /**
+ * ${field.comment}
+ */
+ @TableId(value = "${field.annotationColumnName}", type = IdType.ASSIGN_ID)
+ private ${field.propertyType} ${field.propertyName};
+
+ <#elseif field.propertyName == "delFlag">
+ /**
+ * ${field.comment}
+ */
+ @TableLogic
+ @TableField("${field.annotationColumnName}")
+ private ${field.propertyType} ${field.propertyName};
+
+ <#elseif field.propertyName == "createTime">
+ /**
+ * ${field.comment}
+ */
+ @TableField(value = "${field.annotationColumnName}", fill = FieldFill.INSERT)
+ private ${field.propertyType} ${field.propertyName};
+
+ <#elseif field.propertyName == "updateTime">
+ /**
+ * ${field.comment}
+ */
+ @TableField(value = "${field.annotationColumnName}", fill = FieldFill.INSERT_UPDATE)
+ private ${field.propertyType} ${field.propertyName};
+
+ <#else>
+ /**
+ * ${field.comment}
+ */
+ @TableField("${field.annotationColumnName}")
+ private ${field.propertyType} ${field.propertyName};
+
+ #if>
+#list>
+}
diff --git a/aioj-backend-common/aioj-backend-common-mybatis/src/test/resources/templates/mapper.java.ftl b/aioj-backend-common/aioj-backend-common-mybatis/src/test/resources/templates/mapper.java.ftl
new file mode 100644
index 0000000..35e6e5a
--- /dev/null
+++ b/aioj-backend-common/aioj-backend-common-mybatis/src/test/resources/templates/mapper.java.ftl
@@ -0,0 +1,16 @@
+package ${package.Mapper};
+
+import ${package.Entity}.${entity}DO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * ${table.comment!} Mapper 接口
+ *
+ * @author ${author}
+ * @since ${date}
+ */
+@Mapper
+public interface ${table.mapperName} extends BaseMapper<${entity}DO> {
+
+}
diff --git a/aioj-backend-common/aioj-backend-common-mybatis/src/test/resources/templates/mapper.xml.ftl b/aioj-backend-common/aioj-backend-common-mybatis/src/test/resources/templates/mapper.xml.ftl
new file mode 100644
index 0000000..8b70995
--- /dev/null
+++ b/aioj-backend-common/aioj-backend-common-mybatis/src/test/resources/templates/mapper.xml.ftl
@@ -0,0 +1,33 @@
+
+
+
+
+<#if enableCache>
+
+
+
+#if>
+<#if baseResultMap>
+
+
+<#list table.fields as field>
+<#if field.keyFlag>
+
+<#else>
+
+#if>
+#list>
+
+
+#if>
+<#if baseColumnList>
+
+
+<#list table.commonFields as field>
+ ${field.columnName},
+#list>
+ ${table.fieldNames}
+
+
+#if>
+
diff --git a/aioj-backend-common/aioj-backend-common-mybatis/src/test/resources/templates/service.java.ftl b/aioj-backend-common/aioj-backend-common-mybatis/src/test/resources/templates/service.java.ftl
new file mode 100644
index 0000000..ebe3395
--- /dev/null
+++ b/aioj-backend-common/aioj-backend-common-mybatis/src/test/resources/templates/service.java.ftl
@@ -0,0 +1,14 @@
+package ${package.Service};
+
+import ${package.Entity}.${entity}DO;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * ${table.comment!} 服务接口
+ *
+ * @author ${author}
+ * @since ${date}
+ */
+public interface ${table.serviceName} extends IService<${entity}DO> {
+
+}
diff --git a/aioj-backend-common/aioj-backend-common-mybatis/src/test/resources/templates/serviceImpl.java.ftl b/aioj-backend-common/aioj-backend-common-mybatis/src/test/resources/templates/serviceImpl.java.ftl
new file mode 100644
index 0000000..3a41bce
--- /dev/null
+++ b/aioj-backend-common/aioj-backend-common-mybatis/src/test/resources/templates/serviceImpl.java.ftl
@@ -0,0 +1,22 @@
+package ${package.Service}.impl;
+
+import ${package.Entity}.${entity}DO;
+import ${package.Mapper}.${table.mapperName};
+import ${package.Service}.${table.serviceName};
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+
+/**
+ * ${table.comment!} 服务实现类
+ *
+ * @author ${author}
+ * @since ${date}
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class ${table.serviceImplName} extends ServiceImpl<${table.mapperName}, ${entity}DO> implements ${table.serviceName} {
+
+}
diff --git a/aioj-backend-file-service/src/main/java/cn/meowrain/aioj/backend/fileservice/controller/AttachmentController.java b/aioj-backend-file-service/src/main/java/cn/meowrain/aioj/backend/fileservice/controller/AttachmentController.java
new file mode 100644
index 0000000..2291a9c
--- /dev/null
+++ b/aioj-backend-file-service/src/main/java/cn/meowrain/aioj/backend/fileservice/controller/AttachmentController.java
@@ -0,0 +1,98 @@
+package cn.meowrain.aioj.backend.fileservice.controller;
+
+import cn.meowrain.aioj.backend.fileservice.dao.entity.AttachmentDO;
+import cn.meowrain.aioj.backend.fileservice.service.AttachmentService;
+import cn.meowrain.aioj.backend.framework.core.web.Result;
+import cn.meowrain.aioj.backend.framework.core.web.Results;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import lombok.RequiredArgsConstructor;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ *
+ * 通用附件表 前端控制器
+ *
+ *
+ * @author meowrain
+ * @since 2026-01-10
+ */
+@RestController
+@RequestMapping("/v1/attachment")
+@RequiredArgsConstructor
+public class AttachmentController {
+
+ private final AttachmentService attachmentService;
+
+ /**
+ * 分页查询通用附件表列表
+ */
+ @Operation(summary = "分页查询通用附件表列表")
+ @GetMapping("/page")
+ public Result> page(
+ @Parameter(description = "当前页码") @RequestParam(defaultValue = "1") Integer current,
+ @Parameter(description = "每页数量") @RequestParam(defaultValue = "10") Integer size) {
+ Page page = new Page<>(current, size);
+ return Results.success(attachmentService.page(page));
+ }
+
+ /**
+ * 查询所有通用附件表列表
+ */
+ @Operation(summary = "查询所有通用附件表列表")
+ @GetMapping("/list")
+ public Result> list() {
+ return Results.success(attachmentService.list());
+ }
+
+ /**
+ * 根据ID查询通用附件表详情
+ */
+ @Operation(summary = "根据ID查询通用附件表详情")
+ @GetMapping("/{id}")
+ public Result getById(
+ @Parameter(description = "通用附件表ID") @PathVariable Long id) {
+ return Results.success(attachmentService.getById(id));
+ }
+
+ /**
+ * 新增通用附件表
+ */
+ @Operation(summary = "新增通用附件表")
+ @PostMapping
+ public Result save(@RequestBody AttachmentDO entity) {
+ return Results.success(attachmentService.save(entity));
+ }
+
+ /**
+ * 修改通用附件表
+ */
+ @Operation(summary = "修改通用附件表")
+ @PutMapping
+ public Result update(@RequestBody AttachmentDO entity) {
+ return Results.success(attachmentService.updateById(entity));
+ }
+
+ /**
+ * 删除通用附件表
+ */
+ @Operation(summary = "删除通用附件表")
+ @DeleteMapping("/{id}")
+ public Result delete(
+ @Parameter(description = "通用附件表ID") @PathVariable Long id) {
+ return Results.success(attachmentService.removeById(id));
+ }
+
+ /**
+ * 批量删除通用附件表
+ */
+ @Operation(summary = "批量删除通用附件表")
+ @DeleteMapping("/batch")
+ public Result deleteBatch(@RequestBody List ids) {
+ return Results.success(attachmentService.removeByIds(ids));
+ }
+
+}
diff --git a/aioj-backend-file-service/src/main/java/cn/meowrain/aioj/backend/fileservice/dao/AttachmentDAO.java b/aioj-backend-file-service/src/main/java/cn/meowrain/aioj/backend/fileservice/dao/AttachmentDAO.java
deleted file mode 100644
index 1464bc1..0000000
--- a/aioj-backend-file-service/src/main/java/cn/meowrain/aioj/backend/fileservice/dao/AttachmentDAO.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package cn.meowrain.aioj.backend.fileservice.dao;
-
-import lombok.Data;
-
-@Data
-public class AttachmentDAO {
-
-}
diff --git a/aioj-backend-file-service/src/main/java/cn/meowrain/aioj/backend/fileservice/dao/entity/AttachmentDO.java b/aioj-backend-file-service/src/main/java/cn/meowrain/aioj/backend/fileservice/dao/entity/AttachmentDO.java
new file mode 100644
index 0000000..720ad19
--- /dev/null
+++ b/aioj-backend-file-service/src/main/java/cn/meowrain/aioj/backend/fileservice/dao/entity/AttachmentDO.java
@@ -0,0 +1,119 @@
+package cn.meowrain.aioj.backend.fileservice.dao.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Getter;
+import lombok.Setter;
+import lombok.ToString;
+
+import java.io.Serializable;
+import java.time.LocalDateTime;
+
+/**
+ *
+ * 通用附件表
+ *
+ *
+ * @author meowrain
+ * @since 2026-01-10
+ */
+@Getter
+@Setter
+@ToString
+@TableName("attachment")
+public class AttachmentDO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 主键
+ */
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+
+ /**
+ * 原始文件名
+ */
+ @TableField("file_name")
+ private String fileName;
+
+ /**
+ * 文件后缀名
+ */
+ @TableField("file_extension")
+ private String fileExtension;
+
+ /**
+ * 文件大小(Byte)
+ */
+ @TableField("file_size")
+ private Long fileSize;
+
+ /**
+ * 文件哈希(MD5/SHA256)用于去重
+ */
+ @TableField("file_hash")
+ private String fileHash;
+
+ /**
+ * MIME类型
+ */
+ @TableField("mime_type")
+ private String mimeType;
+
+ /**
+ * 存储方案: LOCAL, OSS, S3, MINIO
+ */
+ @TableField("storage_type")
+ private String storageType;
+
+ /**
+ * 物理存储路径或对象存储Key
+ */
+ @TableField("storage_path")
+ private String storagePath;
+
+ /**
+ * 所属业务模块
+ */
+ @TableField("business_type")
+ private String businessType;
+
+ /**
+ * 所属业务id
+ */
+ @TableField("business_id")
+ private Long businessId;
+
+ /**
+ * 上传者ID
+ */
+ @TableField("user_id")
+ private Long userId;
+
+ /**
+ * 图片宽高、EXIF等元数据
+ */
+ @TableField("image_info")
+ private String imageInfo;
+
+ /**
+ * 逻辑删除(0-正常, 1-已删除)
+ */
+ @TableField("is_deleted")
+ private Byte isDeleted;
+
+ /**
+ * 创建时间
+ */
+ @TableField("created_at")
+ private LocalDateTime createdAt;
+
+ /**
+ * 更新时间
+ */
+ @TableField("updated_at")
+ private LocalDateTime updatedAt;
+}
diff --git a/aioj-backend-file-service/src/main/java/cn/meowrain/aioj/backend/fileservice/dao/mapper/AttachmentMapper.java b/aioj-backend-file-service/src/main/java/cn/meowrain/aioj/backend/fileservice/dao/mapper/AttachmentMapper.java
new file mode 100644
index 0000000..4926d09
--- /dev/null
+++ b/aioj-backend-file-service/src/main/java/cn/meowrain/aioj/backend/fileservice/dao/mapper/AttachmentMapper.java
@@ -0,0 +1,16 @@
+package cn.meowrain.aioj.backend.fileservice.dao.mapper;
+
+import cn.meowrain.aioj.backend.fileservice.dao.entity.AttachmentDO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ *
+ * 通用附件表 Mapper 接口
+ *
+ *
+ * @author meowrain
+ * @since 2026-01-10
+ */
+public interface AttachmentMapper extends BaseMapper {
+
+}
diff --git a/aioj-backend-file-service/src/main/java/cn/meowrain/aioj/backend/fileservice/service/AttachmentService.java b/aioj-backend-file-service/src/main/java/cn/meowrain/aioj/backend/fileservice/service/AttachmentService.java
new file mode 100644
index 0000000..e7f62b1
--- /dev/null
+++ b/aioj-backend-file-service/src/main/java/cn/meowrain/aioj/backend/fileservice/service/AttachmentService.java
@@ -0,0 +1,16 @@
+package cn.meowrain.aioj.backend.fileservice.service;
+
+import cn.meowrain.aioj.backend.fileservice.dao.entity.AttachmentDO;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ *
+ * 通用附件表 服务类
+ *
+ *
+ * @author meowrain
+ * @since 2026-01-10
+ */
+public interface AttachmentService extends IService {
+
+}
diff --git a/aioj-backend-file-service/src/main/java/cn/meowrain/aioj/backend/fileservice/service/impl/AttachmentServiceImpl.java b/aioj-backend-file-service/src/main/java/cn/meowrain/aioj/backend/fileservice/service/impl/AttachmentServiceImpl.java
new file mode 100644
index 0000000..6f4a557
--- /dev/null
+++ b/aioj-backend-file-service/src/main/java/cn/meowrain/aioj/backend/fileservice/service/impl/AttachmentServiceImpl.java
@@ -0,0 +1,20 @@
+package cn.meowrain.aioj.backend.fileservice.service.impl;
+
+import cn.meowrain.aioj.backend.fileservice.dao.entity.AttachmentDO;
+import cn.meowrain.aioj.backend.fileservice.dao.mapper.AttachmentMapper;
+import cn.meowrain.aioj.backend.fileservice.service.AttachmentService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ *
+ * 通用附件表 服务实现类
+ *
+ *
+ * @author meowrain
+ * @since 2026-01-10
+ */
+@Service
+public class AttachmentServiceImpl extends ServiceImpl implements AttachmentService {
+
+}
diff --git a/aioj-backend-file-service/src/main/resources/application-dev.yml b/aioj-backend-file-service/src/main/resources/application-dev.yml
index 9448ab5..019d5c9 100644
--- a/aioj-backend-file-service/src/main/resources/application-dev.yml
+++ b/aioj-backend-file-service/src/main/resources/application-dev.yml
@@ -1,20 +1,4 @@
spring:
- mail:
- host: smtp.qq.com
- port: 465
- username: 2705356115@qq.com
- # 这里使用授权码
- password: yohcndfrlxwcdfed
- default-encoding: UTF-8
- protocol: smtp
- properties:
- mail:
- smtp:
- ssl:
- enable: true # 在 properties 中明确指定
- auth: true
- starttls:
- enable: true # QQ邮箱也支持STARTTLS,但使用465端口时,ssl.enable=true是必须的
data:
redis:
host: 10.0.0.10