diff --git a/bonus-modules/bonus-ai/src/main/java/com/bonus/ai/controller/DataSetController.java b/bonus-modules/bonus-ai/src/main/java/com/bonus/ai/controller/DataSetController.java new file mode 100644 index 0000000..4e090ae --- /dev/null +++ b/bonus-modules/bonus-ai/src/main/java/com/bonus/ai/controller/DataSetController.java @@ -0,0 +1,302 @@ +package com.bonus.ai.controller; + +import com.bonus.ai.domain.*; +import com.bonus.ai.service.DataSetService; +import com.bonus.common.core.web.domain.AjaxResult; +import com.bonus.common.security.utils.SecurityUtils; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import java.util.List; + +/** + * @author bonus + */ +@RestController +@RequestMapping("/dataSet") +@Slf4j +public class DataSetController { + + @Resource + private DataSetService dataSetService; + + /** + * 根据数据集 ID 查询对应的数据集信息。 + * + * @param datasetId 数据集的唯一标识符 + * @return 返回指定数据集 ID 对应的 DataSetEntity 对象 + */ + @PostMapping("/getDatasetById") + public AjaxResult getDatasetById(Long datasetId) { + return null; + } + + /** + * 查询所有的数据集信息。 + * + * @param entity 包含查询条件的 DataSetEntity 对象 + * @return 返回所有符合条件的数据集的集合 + */ + @PostMapping("/getAllDatasets") + public AjaxResult getAllDatasets(DataSetEntity entity) { + return null; + } + + /** + * 插入新的数据集到数据库。 + * + * @param entity 要插入的 DataSetEntity 对象,包含数据集的详细信息 + * @return 返回插入操作影响的行数(成功插入的记录数,通常为 1) + */ + @PostMapping("/insertDataset") + public AjaxResult insertDataset(DataSetEntity entity) { + return null; + } + + /** + * 更新指定数据集的信息。 + * + * @param entity 要更新的 DataSetEntity 对象,包含数据集 ID 和更新后的详细信息 + * @return 返回更新操作影响的行数(成功更新的记录数,通常为 1) + */ + @PostMapping("/updateDataset") + public AjaxResult updateDataset(DataSetEntity entity) { + return null; + } + + /** + * 根据数据集 ID 删除指定的数据集。 + * + * @param datasetId 数据集的唯一标识符 + * @return 返回删除操作影响的行数(成功删除的记录数,通常为 1) + */ + @PostMapping("/deleteDataset") + public AjaxResult deleteDataset(Long datasetId) { + return null; + } + + /** + * 根据类别 ID 查询类别的详细信息。 + * + * @param categoryId 类别的唯一标识符 + * @return 返回指定类别 ID 对应的 DataSetCategoryEntity 对象 + */ + @PostMapping("/getCategoryById") + public AjaxResult getCategoryById(Long categoryId) { + return null; + } + + /** + * 获取所有符合条件的类别信息。 + * + * @param entity 包含查询条件的 DataSetCategoryEntity 对象 + * @return 返回所有符合条件的类别的列表 + */ + @PostMapping("/getCategories") + public AjaxResult getCategories(DataSetCategoryEntity entity) { + return dataSetService.getCategories(entity); + } + + /** + * 插入新的样本类别数据到数据库。 + * + * @param entity 要插入的 DataSetCategoryEntity 对象,包含类别的详细信息 + * @return 返回插入操作影响的行数(成功插入的记录数,通常为 1) + */ + @PostMapping("/insertCategory") + public AjaxResult insertCategory(DataSetCategoryEntity entity) { + return null; + } + + /** + * 更新指定类别的详细信息。 + * + * @param entity 要更新的 DataSetCategoryEntity 对象,包含类别 ID 和更新后的详细信息 + * @return 返回更新操作影响的行数(成功更新的记录数,通常为 1) + */ + @PostMapping("/updateCategory") + public AjaxResult updateCategory(DataSetCategoryEntity entity) { + return null; + } + + /** + * 根据类别 ID 删除指定的类别。 + * + * @param categoryId 要删除的类别的唯一标识符 + * @return 返回删除操作影响的行数(成功删除的记录数,通常为 1) + */ + @PostMapping("/deleteCategory") + public AjaxResult deleteCategory(Long categoryId) { + return null; + } + + /** + * 根据 ID 查询数据集文件信息 + * + * @param fileId 文件 ID + * @return 数据集文件实体 + */ + @PostMapping("/getFileById") + public AjaxResult getFileById(Long fileId) { + return null; + } + + /** + * 查询所有数据集文件 + * + * @param entity 查询条件 + * @return 数据集文件列表 + */ + @PostMapping("/getAllFiles") + public AjaxResult getAllFiles(DataSetFileEntity entity) { + return null; + } + + /** + * 插入新的数据集文件 + * + * @param entity 数据集文件实体 + * @return 影响的行数 + */ + @PostMapping("/insertFile") + public AjaxResult insertFile(DataSetFileEntity entity) { + return null; + } + + /** + * 更新数据集文件信息 + * + * @param datasetFile 数据集文件实体 + * @return 影响的行数 + */ + @PostMapping("/updateFile") + public AjaxResult updateFile(DataSetFileEntity datasetFile) { + return null; + } + + /** + * 根据 ID 删除数据集文件(逻辑删除) + * + * @param fileId 文件 ID + * @return 影响的行数 + */ + @PostMapping("/deleteFile") + public AjaxResult deleteFile(Long fileId) { + return null; + } + + /** + * 根据 ID 查询任务信息 + * + * @param taskId 任务 ID + * @return 数据集任务实体 + */ + @PostMapping("/getTaskById") + public AjaxResult getTaskById(Long taskId) { + return null; + } + + /** + * 查询所有任务 + * + * @param entity 查询条件 + * @return 数据集任务列表 + */ + @PostMapping("/getAllTasks") + public AjaxResult getAllTasks(DataSetTaskEntity entity) { + return null; + } + + /** + * 插入新的任务 + * + * @param entity 数据集任务实体 + * @return 影响的行数 + */ + @PostMapping("/insertTask") + public AjaxResult insertTask(DataSetTaskEntity entity) { + return null; + } + + /** + * 更新任务信息 + * + * @param datasetTask 数据集任务实体 + * @return 影响的行数 + */ + @PostMapping("/updateTask") + public AjaxResult updateTask(DataSetTaskEntity datasetTask) { + return null; + } + + /** + * 根据 ID 删除任务(逻辑删除) + * + * @param taskId 任务 ID + * @return 影响的行数 + */ + @PostMapping("/deleteTask") + public AjaxResult deleteTask(Long taskId) { + return null; + } + + /** + * 根据 ID 查询日志信息 + * + * @param logId 日志 ID + * @return 数据集日志实体 + */ + @PostMapping("/getLogById") + public AjaxResult getLogById(Long logId) { + return null; + } + + /** + * 查询所有日志 + * + * @param entity 查询条件 + * @return 数据集日志列表 + */ + @PostMapping("/getAllLogs") + public AjaxResult getAllLogs(DataSetLogEntity entity) { + return null; + } + + /** + * 插入新的日志 + * + * @param log 数据集日志实体 + * @return 影响的行数 + */ + @PostMapping("/insertLog") + public AjaxResult insertLog(DataSetLogEntity log) { + return null; + } + + /** + * 更新日志信息 + * + * @param log 数据集日志实体 + * @return 影响的行数 + */ + @PostMapping("/updateLog") + public AjaxResult updateLog(DataSetLogEntity log) { + return null; + } + + /** + * 根据 ID 删除日志 + * + * @param logId 日志 ID + * @return 影响的行数 + */ + @PostMapping("/deleteLog") + public AjaxResult deleteLog(Long logId) { + return null; + } + + +} diff --git a/bonus-modules/bonus-ai/src/main/java/com/bonus/ai/controller/OcrRecogController.java b/bonus-modules/bonus-ai/src/main/java/com/bonus/ai/controller/OcrRecogController.java index 20e2226..7d29e5f 100644 --- a/bonus-modules/bonus-ai/src/main/java/com/bonus/ai/controller/OcrRecogController.java +++ b/bonus-modules/bonus-ai/src/main/java/com/bonus/ai/controller/OcrRecogController.java @@ -7,6 +7,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; + import static com.bonus.common.core.web.domain.AjaxResult.error; /** @@ -17,8 +18,7 @@ import static com.bonus.common.core.web.domain.AjaxResult.error; @RestController @RequestMapping("/ocr") @Slf4j -public class OcrRecogController -{ +public class OcrRecogController { @Autowired private IOcrRecogService ocrRecogService; @@ -27,21 +27,21 @@ public class OcrRecogController public AjaxResult recognition(MultipartFile[] files, String type) { AjaxResult ajax = AjaxResult.success(); try { - if(files !=null) { + if (files != null) { for (MultipartFile file : files) { String contentType = file.getContentType(); - if (!FileTypeUtils.FILE_TYPE_PNG.equals(contentType) && !FileTypeUtils.FILE_TYPE_JPEG.equals(contentType) && !FileTypeUtils.FILE_TYPE_PDF.equals(contentType)) { - return error("仅允许导入doc、jpg、png格式文件"); + if (!FileTypeUtils.FILE_TYPE_PNG.equals(contentType) && !FileTypeUtils.FILE_TYPE_JPEG.equals(contentType)) { + return error("仅允许导入jpg、png格式文件"); } } ajax = ocrRecogService.recognitionCheck(files, type); return AjaxResult.success(ajax); - }else { + } else { return error("规范上传文件类型"); } } catch (Exception e) { e.printStackTrace(); - log.error("数据上传失败:{}",e); + log.error("数据上传失败:{}", e); return error("数据上传失败!!!"); } diff --git a/bonus-modules/bonus-ai/src/main/java/com/bonus/ai/domain/DataSetCategoryEntity.java b/bonus-modules/bonus-ai/src/main/java/com/bonus/ai/domain/DataSetCategoryEntity.java new file mode 100644 index 0000000..fc10634 --- /dev/null +++ b/bonus-modules/bonus-ai/src/main/java/com/bonus/ai/domain/DataSetCategoryEntity.java @@ -0,0 +1,67 @@ +package com.bonus.ai.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * @author bonus + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class DataSetCategoryEntity implements Serializable { + /** + * 类别ID + */ + private Long categoryId; + /** + * 样本类别名称 + */ + private String categoryName; + /** + * 父类别ID,NULL表示顶级类别 + */ + private Long parentId; + /** + * 是否启用(0: 禁用, 1: 启用) + */ + private String enabled; + /** + * 创建人 + */ + private String createdBy; + /** + * 描述 + */ + private String description; + + /** + * 记录创建人姓名 + */ + private String createName; + /** + * 记录创建时间 + */ + private Date createTime; + /** + * 记录更新者 + */ + private String updateBy; + /** + * 记录更新者姓名 + */ + private String updateName; + /** + * 记录更新时间 + */ + private Date updateTime; + + /** 子菜单 */ + private List children = new ArrayList(); +} diff --git a/bonus-modules/bonus-ai/src/main/java/com/bonus/ai/domain/DataSetEntity.java b/bonus-modules/bonus-ai/src/main/java/com/bonus/ai/domain/DataSetEntity.java new file mode 100644 index 0000000..8d25bde --- /dev/null +++ b/bonus-modules/bonus-ai/src/main/java/com/bonus/ai/domain/DataSetEntity.java @@ -0,0 +1,62 @@ +package com.bonus.ai.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author bonus + * 数据集表 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class DataSetEntity implements Serializable { + /** + * 数据集id + */ + private Long datasetId; + /** + * 数据集名称 + */ + private String datasetName; + /** + * 分任务类型id + */ + private Long subTaskTypeId; + /** + * 是否删除(0代表存在,1代表删除) + */ + private String delFlag; + /** + * 数据集描述 + */ + private String description; + /** + * 记录创建者 + */ + private Long createBy; + /** + * 记录创建人姓名 + */ + private String createName; + /** + * 记录创建时间 + */ + private Date createTime; + /** + * 记录更新者 + */ + private String updateBy; + /** + * 记录更新者姓名 + */ + private String updateName; + /** + * 记录更新时间 + */ + private Date updateTime; +} diff --git a/bonus-modules/bonus-ai/src/main/java/com/bonus/ai/domain/DataSetFileEntity.java b/bonus-modules/bonus-ai/src/main/java/com/bonus/ai/domain/DataSetFileEntity.java new file mode 100644 index 0000000..561b4db --- /dev/null +++ b/bonus-modules/bonus-ai/src/main/java/com/bonus/ai/domain/DataSetFileEntity.java @@ -0,0 +1,74 @@ +package com.bonus.ai.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author bonus + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class DataSetFileEntity implements Serializable { + /** + * 数据集文件唯一标识符 + */ + private Long fileId; + /** + * 数据集文件名称 + */ + private String fileName; + /** + * 关联的数据集 ID + */ + private Long datasetId; + /** + * 数据集文件的相对路径 + */ + private String fileAddress; + /** + * 审核状态 + */ + private String isAudited; + /** + * 标注状态 + */ + private String isLabeled; + /** + * 删除标志 + */ + private String delFlag; + /** + * 文件描述信息 + */ + private String description; + /** + * 记录创建者 + */ + private Long createBy; + /** + * 记录创建人姓名 + */ + private String createName; + /** + * 记录创建时间 + */ + private Date createTime; + /** + * 记录更新者 + */ + private String updateBy; + /** + * 记录更新者姓名 + */ + private String updateName; + /** + * 记录更新时间 + */ + private Date updateTime; +} + diff --git a/bonus-modules/bonus-ai/src/main/java/com/bonus/ai/domain/DataSetLogEntity.java b/bonus-modules/bonus-ai/src/main/java/com/bonus/ai/domain/DataSetLogEntity.java new file mode 100644 index 0000000..bd946fd --- /dev/null +++ b/bonus-modules/bonus-ai/src/main/java/com/bonus/ai/domain/DataSetLogEntity.java @@ -0,0 +1,49 @@ +package com.bonus.ai.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * @author bonus + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class DataSetLogEntity { + /** + * 日志唯一标识符 + */ + private Long logId; + /** + * 数据集文件 ID + */ + private Long fileId; + /** + * 操作类型(0 代表标注,1 代表审核) + */ + private String operationType; + /** + * 操作人 + */ + private Long operationBy; + /** + * 操作人 + */ + private String operationName; + /** + * 操作时间 + */ + private Date operationTime; + /** + * 操作结果(如审核通过、审核不通过) + */ + private String operationResult; + /** + * 操作原因(如不通过原因) + */ + private String operationReason; + +} diff --git a/bonus-modules/bonus-ai/src/main/java/com/bonus/ai/domain/DataSetTaskEntity.java b/bonus-modules/bonus-ai/src/main/java/com/bonus/ai/domain/DataSetTaskEntity.java new file mode 100644 index 0000000..ec0078f --- /dev/null +++ b/bonus-modules/bonus-ai/src/main/java/com/bonus/ai/domain/DataSetTaskEntity.java @@ -0,0 +1,61 @@ +package com.bonus.ai.domain; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.Date; + +/** + * @author bonus + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class DataSetTaskEntity implements Serializable { + /** + * 任务唯一标识符 + */ + private Long taskId; + /** + * 任务类型和状态关联 ID + */ + private Long typeStatusId; + /** + * 任务归属人 + */ + private String taskOwner; + /** + * 删除标志 + */ + private String delFlag; + /** + * 描述 + */ + private String description; + /** + * 记录创建者 + */ + private Long createBy; + /** + * 记录创建人姓名 + */ + private String createName; + /** + * 记录创建时间 + */ + private Date createTime; + /** + * 记录更新者 + */ + private String updateBy; + /** + * 记录更新者姓名 + */ + private String updateName; + /** + * 记录更新时间 + */ + private Date updateTime; +} diff --git a/bonus-modules/bonus-ai/src/main/java/com/bonus/ai/mapper/DataSetMapper.java b/bonus-modules/bonus-ai/src/main/java/com/bonus/ai/mapper/DataSetMapper.java new file mode 100644 index 0000000..62cd0b7 --- /dev/null +++ b/bonus-modules/bonus-ai/src/main/java/com/bonus/ai/mapper/DataSetMapper.java @@ -0,0 +1,218 @@ +package com.bonus.ai.mapper; + +import com.bonus.ai.domain.*; +import org.apache.ibatis.annotations.*; +import org.springframework.stereotype.Repository; + +import java.util.List; + +/** + * DataSetMapper 是一个 MyBatis 映射接口,用于与数据库进行交互, + * 主要处理与样本库(数据集)相关的 CRUD 操作。 + * + * @author bonus + */ +@Repository +public interface DataSetMapper { + + /** + * 根据数据集 ID 查询对应的数据集信息。 + * + * @param datasetId 数据集的唯一标识符 + * @return 返回指定数据集 ID 对应的 DataSetEntity 对象 + */ + DataSetEntity getDatasetById(Long datasetId); + + /** + * 查询所有的数据集信息。 + * + * @param entity 包含查询条件的 DataSetEntity 对象 + * @return 返回所有符合条件的数据集的集合 + */ + List getAllDatasets(DataSetEntity entity); + + /** + * 插入新的数据集到数据库。 + * + * @param entity 要插入的 DataSetEntity 对象,包含数据集的详细信息 + * @return 返回插入操作影响的行数(成功插入的记录数,通常为 1) + */ + int insertDataset(DataSetEntity entity); + + /** + * 更新指定数据集的信息。 + * + * @param entity 要更新的 DataSetEntity 对象,包含数据集 ID 和更新后的详细信息 + * @return 返回更新操作影响的行数(成功更新的记录数,通常为 1) + */ + int updateDataset(DataSetEntity entity); + + /** + * 根据数据集 ID 删除指定的数据集。 + * + * @param datasetId 数据集的唯一标识符 + * @return 返回删除操作影响的行数(成功删除的记录数,通常为 1) + */ + int deleteDataset(Long datasetId); + + /** + * 根据类别 ID 查询类别的详细信息。 + * + * @param categoryId 类别的唯一标识符 + * @return 返回指定类别 ID 对应的 DataSetCategoryEntity 对象 + */ + DataSetCategoryEntity getCategoryById(Long categoryId); + + /** + * 获取所有符合条件的类别信息。 + * + * @param entity 包含查询条件的 DataSetCategoryEntity 对象 + * @return 返回所有符合条件的类别的列表 + */ + List getCategories(DataSetCategoryEntity entity); + + /** + * 插入新的样本类别数据到数据库。 + * + * @param entity 要插入的 DataSetCategoryEntity 对象,包含类别的详细信息 + * @return 返回插入操作影响的行数(成功插入的记录数,通常为 1) + */ + int insertCategory(DataSetCategoryEntity entity); + + /** + * 更新指定类别的详细信息。 + * + * @param entity 要更新的 DataSetCategoryEntity 对象,包含类别 ID 和更新后的详细信息 + * @return 返回更新操作影响的行数(成功更新的记录数,通常为 1) + */ + int updateCategory(DataSetCategoryEntity entity); + + /** + * 根据类别 ID 删除指定的类别。 + * + * @param categoryId 要删除的类别的唯一标识符 + * @return 返回删除操作影响的行数(成功删除的记录数,通常为 1) + */ + int deleteCategory(Long categoryId); + + /** + * 根据 ID 查询数据集文件信息 + * + * @param fileId 文件 ID + * @return 数据集文件实体 + */ + DataSetFileEntity getFileById(Long fileId); + + /** + * 查询所有数据集文件 + * + * @param entity 查询条件 + * @return 数据集文件列表 + */ + List getAllFiles(DataSetFileEntity entity); + + /** + * 插入新的数据集文件 + * + * @param entity 数据集文件实体 + * @return 影响的行数 + */ + int insertFile(DataSetFileEntity entity); + + /** + * 更新数据集文件信息 + * + * @param datasetFile 数据集文件实体 + * @return 影响的行数 + */ + int updateFile(DataSetFileEntity datasetFile); + + /** + * 根据 ID 删除数据集文件(逻辑删除) + * + * @param fileId 文件 ID + * @return 影响的行数 + */ + int deleteFile(Long fileId); + + /** + * 根据 ID 查询任务信息 + * + * @param taskId 任务 ID + * @return 数据集任务实体 + */ + DataSetTaskEntity getTaskById(Long taskId); + + /** + * 查询所有任务 + * + * @param entity 查询条件 + * @return 数据集任务列表 + */ + List getAllTasks(DataSetTaskEntity entity); + + /** + * 插入新的任务 + * + * @param entity 数据集任务实体 + * @return 影响的行数 + */ + int insertTask(DataSetTaskEntity entity); + + /** + * 更新任务信息 + * + * @param datasetTask 数据集任务实体 + * @return 影响的行数 + */ + int updateTask(DataSetTaskEntity datasetTask); + + /** + * 根据 ID 删除任务(逻辑删除) + * + * @param taskId 任务 ID + * @return 影响的行数 + */ + int deleteTask(Long taskId); + + + /** + * 根据 ID 查询日志信息 + * + * @param logId 日志 ID + * @return 数据集日志实体 + */ + DataSetLogEntity getLogById(Long logId); + + /** + * 查询所有日志 + * + * @param entity 查询条件 + * @return 数据集日志列表 + */ + List getAllLogs(DataSetLogEntity entity); + + /** + * 插入新的日志 + * + * @param log 数据集日志实体 + * @return 影响的行数 + */ + int insertLog(DataSetLogEntity log); + + /** + * 更新日志信息 + * + * @param log 数据集日志实体 + * @return 影响的行数 + */ + int updateLog(DataSetLogEntity log); + + /** + * 根据 ID 删除日志 + * + * @param logId 日志 ID + * @return 影响的行数 + */ + int deleteLog(Long logId); +} diff --git a/bonus-modules/bonus-ai/src/main/java/com/bonus/ai/service/DataSetService.java b/bonus-modules/bonus-ai/src/main/java/com/bonus/ai/service/DataSetService.java new file mode 100644 index 0000000..99d496f --- /dev/null +++ b/bonus-modules/bonus-ai/src/main/java/com/bonus/ai/service/DataSetService.java @@ -0,0 +1,212 @@ +package com.bonus.ai.service; + +import com.bonus.ai.domain.*; +import com.bonus.common.core.web.domain.AjaxResult; + + +/** + * @author bonus + */ +public interface DataSetService { + + /** + * 根据数据集 ID 查询对应的数据集信息。 + * + * @param datasetId 数据集的唯一标识符 + * @return 返回指定数据集 ID 对应的 DataSetEntity 对象 + */ + AjaxResult getDatasetById(Long datasetId); + + /** + * 查询所有的数据集信息。 + * + * @param entity 包含查询条件的 DataSetEntity 对象 + * @return 返回所有符合条件的数据集的集合 + */ + AjaxResult getAllDatasets(DataSetEntity entity); + + /** + * 插入新的数据集到数据库。 + * + * @param entity 要插入的 DataSetEntity 对象,包含数据集的详细信息 + * @return 返回插入操作影响的行数(成功插入的记录数,通常为 1) + */ + AjaxResult insertDataset(DataSetEntity entity); + + /** + * 更新指定数据集的信息。 + * + * @param entity 要更新的 DataSetEntity 对象,包含数据集 ID 和更新后的详细信息 + * @return 返回更新操作影响的行数(成功更新的记录数,通常为 1) + */ + AjaxResult updateDataset(DataSetEntity entity); + + /** + * 根据数据集 ID 删除指定的数据集。 + * + * @param datasetId 数据集的唯一标识符 + * @return 返回删除操作影响的行数(成功删除的记录数,通常为 1) + */ + AjaxResult deleteDataset(Long datasetId); + + /** + * 根据类别 ID 查询类别的详细信息。 + * + * @param categoryId 类别的唯一标识符 + * @return 返回指定类别 ID 对应的 DataSetCategoryEntity 对象 + */ + AjaxResult getCategoryById(Long categoryId); + + /** + * 获取所有符合条件的类别信息。 + * + * @param entity 包含查询条件的 DataSetCategoryEntity 对象 + * @return 返回所有符合条件的类别的列表 + */ + AjaxResult getCategories(DataSetCategoryEntity entity); + + /** + * 插入新的样本类别数据到数据库。 + * + * @param entity 要插入的 DataSetCategoryEntity 对象,包含类别的详细信息 + * @return 返回插入操作影响的行数(成功插入的记录数,通常为 1) + */ + AjaxResult insertCategory(DataSetCategoryEntity entity); + + /** + * 更新指定类别的详细信息。 + * + * @param entity 要更新的 DataSetCategoryEntity 对象,包含类别 ID 和更新后的详细信息 + * @return 返回更新操作影响的行数(成功更新的记录数,通常为 1) + */ + AjaxResult updateCategory(DataSetCategoryEntity entity); + + /** + * 根据类别 ID 删除指定的类别。 + * + * @param categoryId 要删除的类别的唯一标识符 + * @return 返回删除操作影响的行数(成功删除的记录数,通常为 1) + */ + AjaxResult deleteCategory(Long categoryId); + + /** + * 根据 ID 查询数据集文件信息 + * + * @param fileId 文件 ID + * @return 数据集文件实体 + */ + AjaxResult getFileById(Long fileId); + + /** + * 查询所有数据集文件 + * + * @param entity 查询条件 + * @return 数据集文件列表 + */ + AjaxResult getAllFiles(DataSetFileEntity entity); + + /** + * 插入新的数据集文件 + * + * @param entity 数据集文件实体 + * @return 影响的行数 + */ + AjaxResult insertFile(DataSetFileEntity entity); + + /** + * 更新数据集文件信息 + * + * @param datasetFile 数据集文件实体 + * @return 影响的行数 + */ + AjaxResult updateFile(DataSetFileEntity datasetFile); + + /** + * 根据 ID 删除数据集文件(逻辑删除) + * + * @param fileId 文件 ID + * @return 影响的行数 + */ + AjaxResult deleteFile(Long fileId); + + /** + * 根据 ID 查询任务信息 + * + * @param taskId 任务 ID + * @return 数据集任务实体 + */ + AjaxResult getTaskById(Long taskId); + + /** + * 查询所有任务 + * + * @param entity 查询条件 + * @return 数据集任务列表 + */ + AjaxResult getAllTasks(DataSetTaskEntity entity); + + /** + * 插入新的任务 + * + * @param entity 数据集任务实体 + * @return 影响的行数 + */ + AjaxResult insertTask(DataSetTaskEntity entity); + + /** + * 更新任务信息 + * + * @param datasetTask 数据集任务实体 + * @return 影响的行数 + */ + AjaxResult updateTask(DataSetTaskEntity datasetTask); + + /** + * 根据 ID 删除任务(逻辑删除) + * + * @param taskId 任务 ID + * @return 影响的行数 + */ + AjaxResult deleteTask(Long taskId); + + + /** + * 根据 ID 查询日志信息 + * + * @param logId 日志 ID + * @return 数据集日志实体 + */ + AjaxResult getLogById(Long logId); + + /** + * 查询所有日志 + * + * @param entity 查询条件 + * @return 数据集日志列表 + */ + AjaxResult getAllLogs(DataSetLogEntity entity); + + /** + * 插入新的日志 + * + * @param log 数据集日志实体 + * @return 影响的行数 + */ + AjaxResult insertLog(DataSetLogEntity log); + + /** + * 更新日志信息 + * + * @param log 数据集日志实体 + * @return 影响的行数 + */ + AjaxResult updateLog(DataSetLogEntity log); + + /** + * 根据 ID 删除日志 + * + * @param logId 日志 ID + * @return 影响的行数 + */ + AjaxResult deleteLog(Long logId); +} diff --git a/bonus-modules/bonus-ai/src/main/java/com/bonus/ai/service/impl/DataSetServiceImpl.java b/bonus-modules/bonus-ai/src/main/java/com/bonus/ai/service/impl/DataSetServiceImpl.java new file mode 100644 index 0000000..5ea6dd3 --- /dev/null +++ b/bonus-modules/bonus-ai/src/main/java/com/bonus/ai/service/impl/DataSetServiceImpl.java @@ -0,0 +1,299 @@ +package com.bonus.ai.service.impl; + +import com.bonus.ai.domain.*; +import com.bonus.ai.mapper.DataSetMapper; +import com.bonus.ai.service.DataSetService; +import com.bonus.common.core.web.domain.AjaxResult; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +/** + * @author bonus + */ +@Service +public class DataSetServiceImpl implements DataSetService { + @Resource + private DataSetMapper mapper; + + /** + * 根据数据集 ID 查询对应的数据集信息。 + * + * @param datasetId 数据集的唯一标识符 + * @return 返回指定数据集 ID 对应的 DataSetEntity 对象 + */ + @Override + public AjaxResult getDatasetById(Long datasetId) { + return null; + } + + /** + * 查询所有的数据集信息。 + * + * @param entity 包含查询条件的 DataSetEntity 对象 + * @return 返回所有符合条件的数据集的集合 + */ + @Override + public AjaxResult getAllDatasets(DataSetEntity entity) { + return null; + } + + /** + * 插入新的数据集到数据库。 + * + * @param entity 要插入的 DataSetEntity 对象,包含数据集的详细信息 + * @return 返回插入操作影响的行数(成功插入的记录数,通常为 1) + */ + @Override + public AjaxResult insertDataset(DataSetEntity entity) { + return null; + } + + /** + * 更新指定数据集的信息。 + * + * @param entity 要更新的 DataSetEntity 对象,包含数据集 ID 和更新后的详细信息 + * @return 返回更新操作影响的行数(成功更新的记录数,通常为 1) + */ + @Override + public AjaxResult updateDataset(DataSetEntity entity) { + return null; + } + + /** + * 根据数据集 ID 删除指定的数据集。 + * + * @param datasetId 数据集的唯一标识符 + * @return 返回删除操作影响的行数(成功删除的记录数,通常为 1) + */ + @Override + public AjaxResult deleteDataset(Long datasetId) { + return null; + } + + /** + * 根据类别 ID 查询类别的详细信息。 + * + * @param categoryId 类别的唯一标识符 + * @return 返回指定类别 ID 对应的 DataSetCategoryEntity 对象 + */ + @Override + public AjaxResult getCategoryById(Long categoryId) { + return null; + } + + /** + * 获取所有符合条件的类别信息。 + * + * @param entity 包含查询条件的 DataSetCategoryEntity 对象 + * @return 返回所有符合条件的类别的列表 + */ + @Override + public AjaxResult getCategories(DataSetCategoryEntity entity) { + try { + List categories = mapper.getCategories(entity); + return AjaxResult.success(categories); + } catch (Exception e) { + return AjaxResult.error("获取数据失败"); + } + } + + /** + * 插入新的样本类别数据到数据库。 + * + * @param entity 要插入的 DataSetCategoryEntity 对象,包含类别的详细信息 + * @return 返回插入操作影响的行数(成功插入的记录数,通常为 1) + */ + @Override + public AjaxResult insertCategory(DataSetCategoryEntity entity) { + return null; + } + + /** + * 更新指定类别的详细信息。 + * + * @param entity 要更新的 DataSetCategoryEntity 对象,包含类别 ID 和更新后的详细信息 + * @return 返回更新操作影响的行数(成功更新的记录数,通常为 1) + */ + @Override + public AjaxResult updateCategory(DataSetCategoryEntity entity) { + return null; + } + + /** + * 根据类别 ID 删除指定的类别。 + * + * @param categoryId 要删除的类别的唯一标识符 + * @return 返回删除操作影响的行数(成功删除的记录数,通常为 1) + */ + @Override + public AjaxResult deleteCategory(Long categoryId) { + return null; + } + + /** + * 根据 ID 查询数据集文件信息 + * + * @param fileId 文件 ID + * @return 数据集文件实体 + */ + @Override + public AjaxResult getFileById(Long fileId) { + return null; + } + + /** + * 查询所有数据集文件 + * + * @param entity 查询条件 + * @return 数据集文件列表 + */ + @Override + public AjaxResult getAllFiles(DataSetFileEntity entity) { + return null; + } + + /** + * 插入新的数据集文件 + * + * @param entity 数据集文件实体 + * @return 影响的行数 + */ + @Override + public AjaxResult insertFile(DataSetFileEntity entity) { + return null; + } + + /** + * 更新数据集文件信息 + * + * @param datasetFile 数据集文件实体 + * @return 影响的行数 + */ + @Override + public AjaxResult updateFile(DataSetFileEntity datasetFile) { + return null; + } + + /** + * 根据 ID 删除数据集文件(逻辑删除) + * + * @param fileId 文件 ID + * @return 影响的行数 + */ + @Override + public AjaxResult deleteFile(Long fileId) { + return null; + } + + /** + * 根据 ID 查询任务信息 + * + * @param taskId 任务 ID + * @return 数据集任务实体 + */ + @Override + public AjaxResult getTaskById(Long taskId) { + return null; + } + + /** + * 查询所有任务 + * + * @param entity 查询条件 + * @return 数据集任务列表 + */ + @Override + public AjaxResult getAllTasks(DataSetTaskEntity entity) { + return null; + } + + /** + * 插入新的任务 + * + * @param entity 数据集任务实体 + * @return 影响的行数 + */ + @Override + public AjaxResult insertTask(DataSetTaskEntity entity) { + return null; + } + + /** + * 更新任务信息 + * + * @param datasetTask 数据集任务实体 + * @return 影响的行数 + */ + @Override + public AjaxResult updateTask(DataSetTaskEntity datasetTask) { + return null; + } + + /** + * 根据 ID 删除任务(逻辑删除) + * + * @param taskId 任务 ID + * @return 影响的行数 + */ + @Override + public AjaxResult deleteTask(Long taskId) { + return null; + } + + /** + * 根据 ID 查询日志信息 + * + * @param logId 日志 ID + * @return 数据集日志实体 + */ + @Override + public AjaxResult getLogById(Long logId) { + return null; + } + + /** + * 查询所有日志 + * + * @param entity 查询条件 + * @return 数据集日志列表 + */ + @Override + public AjaxResult getAllLogs(DataSetLogEntity entity) { + return null; + } + + /** + * 插入新的日志 + * + * @param log 数据集日志实体 + * @return 影响的行数 + */ + @Override + public AjaxResult insertLog(DataSetLogEntity log) { + return null; + } + + /** + * 更新日志信息 + * + * @param log 数据集日志实体 + * @return 影响的行数 + */ + @Override + public AjaxResult updateLog(DataSetLogEntity log) { + return null; + } + + /** + * 根据 ID 删除日志 + * + * @param logId 日志 ID + * @return 影响的行数 + */ + @Override + public AjaxResult deleteLog(Long logId) { + return null; + } +} diff --git a/bonus-modules/bonus-ai/src/main/resources/mapper/ai/DataSetMapper.xml b/bonus-modules/bonus-ai/src/main/resources/mapper/ai/DataSetMapper.xml new file mode 100644 index 0000000..7cf74c6 --- /dev/null +++ b/bonus-modules/bonus-ai/src/main/resources/mapper/ai/DataSetMapper.xml @@ -0,0 +1,186 @@ + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO ai_dataset (dataset_name, sub_task_type_id, description, create_by, create_time, + update_by, update_time) + VALUES (#{datasetName}, #{subTaskTypeId}, #{description}, #{createBy}, #{createTime}, #{updateBy}, + #{updateTime}) + + + + + + + + + + + + + + + + + + + UPDATE ai_dataset + SET dataset_name = #{datasetName}, + sub_task_type_id = #{subTaskTypeId}, + del_flag = #{delFlag}, + description = #{description}, + update_by = #{updateBy}, + update_time = #{updateTime} + WHERE dataset_id = #{datasetId} + + + + + + + + UPDATE ai_dataset + SET del_flag = '1' + WHERE dataset_id = #{datasetId} + + + + + + + + + + + + + + + + + + + + + + + + + + +