提交代码实现v1.0
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package com.labelsys.backend.dto.common;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "分页结果")
|
||||
public record PageResult<T>(
|
||||
@Schema(description = "当前页记录") List<T> records,
|
||||
@Schema(description = "总记录数") Long total,
|
||||
@Schema(description = "页码") Integer pageNo,
|
||||
@Schema(description = "每页数量") Integer pageSize
|
||||
) {
|
||||
public static <T> PageResult<T> from(IPage<T> page) {
|
||||
return new PageResult<>(page.getRecords(), page.getTotal(), (int) page.getCurrent(), (int) page.getSize());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.labelsys.backend.dto.request;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "标注结果分页查询请求")
|
||||
public record AnnotationResultPageQuery(
|
||||
@Schema(description = "任务ID") Long taskId,
|
||||
@Schema(description = "资源ID") Long resourceId,
|
||||
@Schema(description = "是否需要人工审核") Boolean requiresManualReview,
|
||||
@Schema(description = "运行态状态") String runtimeStatus,
|
||||
@Schema(description = "页码") Integer pageNo,
|
||||
@Schema(description = "每页数量") Integer pageSize
|
||||
) {
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.labelsys.backend.dto.request;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "标注任务分页查询请求")
|
||||
public record AnnotationTaskPageQuery(
|
||||
@Schema(description = "关键字") String keyword,
|
||||
@Schema(description = "任务类型") String taskType,
|
||||
@Schema(description = "任务状态") String taskStatus,
|
||||
@Schema(description = "资源ID") Long resourceId,
|
||||
@Schema(description = "是否已删除") Boolean isDeleted,
|
||||
@Schema(description = "页码") Integer pageNo,
|
||||
@Schema(description = "每页数量") Integer pageSize
|
||||
) {
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.labelsys.backend.dto.request;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "创建标注任务请求")
|
||||
public record CreateAnnotationTaskRequest(
|
||||
@Schema(description = "任务名称") @NotBlank(message = "任务名称不能为空") String taskName,
|
||||
@Schema(description = "行业类型") String industryType,
|
||||
@Schema(description = "任务类型") String taskType,
|
||||
@Schema(description = "资源ID列表") @NotEmpty(message = "资源列表不能为空") List<Long> resourceIds,
|
||||
@Schema(description = "抽取模型配置") @Valid TaskModelConfigRequest extractModel,
|
||||
@Schema(description = "校验模型配置") @Valid TaskModelConfigRequest verifyModel,
|
||||
@Schema(description = "抽取提示词配置") @Valid PromptConfigOptionRequest extractPrompt,
|
||||
@Schema(description = "校验提示词配置") @Valid PromptConfigOptionRequest verifyPrompt
|
||||
) {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.labelsys.backend.dto.request;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
|
||||
@Schema(description = "手动模型配置请求")
|
||||
public record ManualModelConfigRequest(
|
||||
@Schema(description = "模型名称") @NotBlank(message = "模型名称不能为空") String modelName,
|
||||
@Schema(description = "模型地址") @NotBlank(message = "模型地址不能为空") String modelUrl,
|
||||
@Schema(description = "模型密钥") @NotBlank(message = "模型密钥不能为空") String apiKey
|
||||
) {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.labelsys.backend.dto.request;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
|
||||
@Schema(description = "合并审核结果请求")
|
||||
public record MergeReviewResultRequest(
|
||||
@Schema(description = "差异摘要 JSON") @NotBlank(message = "差异摘要不能为空") String diffSummary,
|
||||
@Schema(description = "最终问答内容 JSON") @NotBlank(message = "问答内容不能为空") String qaContentJson,
|
||||
@Schema(description = "审核备注") String reviewComment
|
||||
) {
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.labelsys.backend.dto.request;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "任务提示词配置请求")
|
||||
public record PromptConfigOptionRequest(
|
||||
@Schema(description = "已选择的提示词配置名称") String selectedConfigName,
|
||||
@Schema(description = "手动输入的提示词内容") String promptText
|
||||
) {
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.labelsys.backend.dto.request;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
|
||||
@Schema(description = "保存系统配置请求")
|
||||
public record SaveSysConfigRequest(
|
||||
@Schema(description = "配置类型") @NotBlank(message = "配置类型不能为空") String configType,
|
||||
@Schema(description = "配置名称") @NotBlank(message = "配置名称不能为空") String configName,
|
||||
@Schema(description = "配置值") @NotBlank(message = "配置值不能为空") String configValue,
|
||||
@Schema(description = "配置状态") @NotBlank(message = "配置状态不能为空") String status
|
||||
) {
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.labelsys.backend.dto.request;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "资源分页查询请求")
|
||||
public record SourceResourcePageQuery(
|
||||
@Schema(description = "关键字") String keyword,
|
||||
@Schema(description = "资源类型") String resourceType,
|
||||
@Schema(description = "资源状态") String sourceStatus,
|
||||
@Schema(description = "页码") Integer pageNo,
|
||||
@Schema(description = "每页数量") Integer pageSize
|
||||
) {
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.labelsys.backend.dto.request;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
@Data
|
||||
@Schema(description = "资源上传请求")
|
||||
public class SourceUploadRequest {
|
||||
|
||||
@Schema(description = "资源名称")
|
||||
private String resourceName;
|
||||
|
||||
@Schema(description = "资源类型:TEXT、IMAGE、VIDEO")
|
||||
private String resourceType;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "上传文件")
|
||||
private MultipartFile file;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.labelsys.backend.dto.request;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "系统配置分页查询请求")
|
||||
public record SysConfigPageQuery(
|
||||
@Schema(description = "配置类型") String configType,
|
||||
@Schema(description = "配置名称") String configName,
|
||||
@Schema(description = "配置状态") String status,
|
||||
@Schema(description = "页码") Integer pageNo,
|
||||
@Schema(description = "每页数量") Integer pageSize
|
||||
) {
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.labelsys.backend.dto.request;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
|
||||
@Schema(description = "任务模型配置请求")
|
||||
public record TaskModelConfigRequest(
|
||||
@Schema(description = "配置模式:SELECT 或 MANUAL") @NotBlank(message = "配置模式不能为空") String mode,
|
||||
@Schema(description = "已选择的配置名称") String selectedConfigName,
|
||||
@Schema(description = "手动录入的模型配置") @Valid ManualModelConfigRequest manualConfig
|
||||
) {
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.labelsys.backend.dto.request;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.Valid;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "更新标注任务请求")
|
||||
public record UpdateAnnotationTaskRequest(
|
||||
@Schema(description = "行业类型") String industryType,
|
||||
@Schema(description = "任务类型") String taskType,
|
||||
@Schema(description = "资源ID列表") @NotEmpty(message = "资源列表不能为空") List<Long> resourceIds,
|
||||
@Schema(description = "抽取模型配置") @Valid TaskModelConfigRequest extractModel,
|
||||
@Schema(description = "校验模型配置") @Valid TaskModelConfigRequest verifyModel,
|
||||
@Schema(description = "抽取提示词配置") @Valid PromptConfigOptionRequest extractPrompt,
|
||||
@Schema(description = "校验提示词配置") @Valid PromptConfigOptionRequest verifyPrompt
|
||||
) {
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.labelsys.backend.dto.response;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "标注结果比对响应")
|
||||
public record AnnotationResultCompareResponse(
|
||||
@Schema(description = "结果ID") Long id,
|
||||
@Schema(description = "任务ID") Long taskId,
|
||||
@Schema(description = "资源ID") Long resourceId,
|
||||
@Schema(description = "问答内容 JSON") String qaContentJson,
|
||||
@Schema(description = "差异摘要 JSON") String diffSummary,
|
||||
@Schema(description = "问答存储模式") String qaContentStorageMode,
|
||||
@Schema(description = "外置问答文件路径") String qaContentFilePath,
|
||||
@Schema(description = "资源预览路径") String sourcePreviewPath
|
||||
) {
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.labelsys.backend.dto.response;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "标注结果响应")
|
||||
public record AnnotationResultResponse(
|
||||
@Schema(description = "结果ID") Long id,
|
||||
@Schema(description = "任务ID") Long taskId,
|
||||
@Schema(description = "资源ID") Long resourceId,
|
||||
@Schema(description = "运行态状态") String runtimeStatus,
|
||||
@Schema(description = "是否需要人工审核") Boolean requiresManualReview,
|
||||
@Schema(description = "是否已删除") Boolean isDeleted,
|
||||
@Schema(description = "问答存储模式") String qaContentStorageMode,
|
||||
@Schema(description = "审核备注") String reviewComment,
|
||||
@Schema(description = "审核时间") LocalDateTime reviewedAt,
|
||||
@Schema(description = "创建时间") LocalDateTime createdAt
|
||||
) {
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.labelsys.backend.dto.response;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "标注任务响应")
|
||||
public record AnnotationTaskResponse(
|
||||
@Schema(description = "任务ID") Long id,
|
||||
@Schema(description = "任务名称") String taskName,
|
||||
@Schema(description = "行业类型") String industryType,
|
||||
@Schema(description = "任务类型") String taskType,
|
||||
@Schema(description = "任务状态") String taskStatus,
|
||||
@Schema(description = "资源ID列表") List<Long> resourceIds,
|
||||
@Schema(description = "抽取模型配置") TaskModelConfigResponse extractModel,
|
||||
@Schema(description = "校验模型配置") TaskModelConfigResponse verifyModel,
|
||||
@Schema(description = "抽取提示词配置") TaskPromptConfigResponse extractPrompt,
|
||||
@Schema(description = "校验提示词配置") TaskPromptConfigResponse verifyPrompt,
|
||||
@Schema(description = "创建时间") LocalDateTime createdAt,
|
||||
@Schema(description = "更新时间") LocalDateTime updatedAt
|
||||
) {
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.labelsys.backend.dto.response;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "合并审核结果响应")
|
||||
public record MergeReviewResultResponse(
|
||||
@Schema(description = "运行态结果ID") Long resultId,
|
||||
@Schema(description = "历史结果ID") Long historyId,
|
||||
@Schema(description = "归档原因") String archiveReason,
|
||||
@Schema(description = "归档时间") LocalDateTime archivedAt
|
||||
) {
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.labelsys.backend.dto.response;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "资源响应")
|
||||
public record SourceResourceResponse(
|
||||
@Schema(description = "资源ID") Long id,
|
||||
@Schema(description = "资源名称") String resourceName,
|
||||
@Schema(description = "资源类型") String resourceType,
|
||||
@Schema(description = "桶名称") String bucketName,
|
||||
@Schema(description = "文件路径") String filePath,
|
||||
@Schema(description = "文件大小") Long fileSize,
|
||||
@Schema(description = "资源状态") String sourceStatus,
|
||||
@Schema(description = "存储提供方") String storageProvider,
|
||||
@Schema(description = "备注") String remark,
|
||||
@Schema(description = "创建人名称") String creatorName,
|
||||
@Schema(description = "创建时间") LocalDateTime createdAt,
|
||||
@Schema(description = "更新时间") LocalDateTime updatedAt
|
||||
) {
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.labelsys.backend.dto.response;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "资源上传响应")
|
||||
public record SourceUploadResponse(
|
||||
@Schema(description = "资源ID") Long id,
|
||||
@Schema(description = "资源名称") String resourceName,
|
||||
@Schema(description = "资源类型") String resourceType,
|
||||
@Schema(description = "桶名称") String bucketName,
|
||||
@Schema(description = "文件路径") String filePath,
|
||||
@Schema(description = "文件大小") Long fileSize,
|
||||
@Schema(description = "资源状态") String sourceStatus,
|
||||
@Schema(description = "创建时间") LocalDateTime createdAt
|
||||
) {
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.labelsys.backend.dto.response;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "系统配置响应")
|
||||
public record SysConfigResponse(
|
||||
@Schema(description = "配置ID") Long id,
|
||||
@Schema(description = "配置类型") String configType,
|
||||
@Schema(description = "配置名称") String configName,
|
||||
@Schema(description = "配置值") String configValue,
|
||||
@Schema(description = "配置状态") String status,
|
||||
@Schema(description = "创建人ID") Long creatorId,
|
||||
@Schema(description = "创建时间") LocalDateTime createdAt,
|
||||
@Schema(description = "更新时间") LocalDateTime updatedAt
|
||||
) {
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.labelsys.backend.dto.response;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "任务模型配置响应")
|
||||
public record TaskModelConfigResponse(
|
||||
@Schema(description = "配置ID") Long configId,
|
||||
@Schema(description = "配置名称") String configName,
|
||||
@Schema(description = "模型名称") String modelName,
|
||||
@Schema(description = "模型地址") String modelUrl,
|
||||
@Schema(description = "脱敏后的模型密钥") String maskedApiKey
|
||||
) {
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.labelsys.backend.dto.response;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "任务提示词配置响应")
|
||||
public record TaskPromptConfigResponse(
|
||||
@Schema(description = "配置ID") Long configId,
|
||||
@Schema(description = "配置名称") String configName,
|
||||
@Schema(description = "提示词内容") String promptText
|
||||
) {
|
||||
}
|
||||
Reference in New Issue
Block a user