新增sql和一些标注和发布的接口
This commit is contained in:
parent
424e79e74c
commit
ec8c285f3b
|
|
@ -5,7 +5,7 @@
|
|||
<parent>
|
||||
<groupId>com.bonus</groupId>
|
||||
<artifactId>bonus-modules</artifactId>
|
||||
<version>24.9.0-SNAPSHOT</version>
|
||||
<version>24.10.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
|
|
|
|||
|
|
@ -15,30 +15,13 @@ import java.util.List;
|
|||
public class AnnotationTaskController {
|
||||
|
||||
/**
|
||||
* 获取所有的任务列表
|
||||
* @return 返回所有的任务列表
|
||||
* 查看由我创建的任务列表和我参与的或全部任务列表
|
||||
* 统一获取文件列表
|
||||
* @param type 参数类型:myCreated - 由我创建的任务列表, myParticipated - 由我参与的任务列表, all - 用户创建和公共文件
|
||||
* @return 返回满足条件的任务列表
|
||||
*/
|
||||
@GetMapping("/list/")
|
||||
public AjaxResult list() {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看由我创建的任务
|
||||
* @return 返回我创建的任务列表
|
||||
*/
|
||||
@GetMapping("/list/created")
|
||||
public AjaxResult getTasksCreatedByMe() {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看由我参与的任务
|
||||
* @return 返回我参与的任务列表
|
||||
*/
|
||||
|
||||
@GetMapping("/list/participated")
|
||||
public AjaxResult getTasksParticipatedByMe() {
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(@RequestParam String type) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
|
@ -71,7 +54,7 @@ public class AnnotationTaskController {
|
|||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**新增数据集
|
||||
/**创建标注任务
|
||||
* @param task 新增的数据集信息
|
||||
* @return 返回影响的行数或错误信
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,11 +1,16 @@
|
|||
package com.bonus.ai.controller;
|
||||
|
||||
import com.bonus.ai.domain.AiDataSet;
|
||||
import com.bonus.ai.domain.BasicFile;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 基础文件管理控制层,获取指定存储方式的文件列表等
|
||||
* @author wangvivi
|
||||
|
|
@ -16,41 +21,54 @@ import org.springframework.web.multipart.MultipartFile;
|
|||
public class BasicFileController {
|
||||
|
||||
|
||||
/**
|
||||
* 获取由我创建和公共文件的列表
|
||||
* @return 返回所有的文件列表
|
||||
*/
|
||||
@GetMapping("/list/")
|
||||
public AjaxResult list() {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取由我创建和公共文件树
|
||||
* 统一获取文件列表
|
||||
* @param type 参数类型:my - 当前用户创建的文件, public - 公共文件, all - 用户创建和公共文件
|
||||
* @return 符合条件的文件列表
|
||||
*/
|
||||
@GetMapping("/list/")
|
||||
public AjaxResult getFilesList(@RequestParam String type) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
/**
|
||||
* 统一获取文件列表树
|
||||
* @param type 文件类型:my - 当前用户创建的文件, public - 公共文件, all - 用户创建和公共文件
|
||||
* @return 返回所有的文件树
|
||||
*/
|
||||
@GetMapping("/tree/")
|
||||
public AjaxResult tree() {
|
||||
public AjaxResult tree(@RequestParam String type) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取公共文件的列表
|
||||
* @return 返回所有的文件列表
|
||||
* 根据文件编号获取文件详情
|
||||
* @param fileId 文件编号
|
||||
* @return 返回文件详情
|
||||
*/
|
||||
@GetMapping("/list/public")
|
||||
public AjaxResult listPublic() {
|
||||
return AjaxResult.success();
|
||||
@GetMapping(value = "/{fileId}")
|
||||
public AjaxResult getInfo(@PathVariable Long fileId) {
|
||||
return AjaxResult.success(new BasicFile());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置或取消文件的公共状态,如果是文件夹则同时设置整个文件夹里所有文件夹的属性
|
||||
* @param fileId 文件的ID
|
||||
* @param isPublic 是否设置为公共文件:true - 设置为公共文件, false - 取消公共状态
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PostMapping("/set-public")
|
||||
public AjaxResult setFilePublicStatus(@RequestParam Long fileId, @RequestParam Boolean isPublic){
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建文件夹
|
||||
* @param folderName 单个文件
|
||||
* @return 文件夹网络路径
|
||||
*/
|
||||
@PostMapping("/createFolder")
|
||||
@ApiOperation("创建文件夹")
|
||||
public AjaxResult createFolder(@RequestParam("folderName") String folderName)
|
||||
{
|
||||
return AjaxResult.success("创建文件夹");
|
||||
|
|
@ -87,4 +105,13 @@ public class BasicFileController {
|
|||
return AjaxResult.success("文件上传成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 多文件下载
|
||||
* @param response 请求响应,按照文件目录结构打包下载,如果是文件夹则打包下载文件夹下的所有文件
|
||||
* @param objectKeys,除mongodb 存fileid之外,其他均存上传文件的网络路径
|
||||
*/
|
||||
@GetMapping("/downloadFiles")
|
||||
public void downloadFile(HttpServletResponse response, @RequestParam List<Long> objectKeys) throws IOException {}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,10 +17,12 @@ import org.springframework.web.bind.annotation.*;
|
|||
public class DatasetController {
|
||||
/**
|
||||
* 查看由我创建的数据集和公共数据集
|
||||
* 统一获取文件列表
|
||||
* @param type 参数类型:my - 当前用户创建的文件, public - 公共文件, all - 用户创建和公共文件
|
||||
* @return 返回满足条件的数据集列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list() {
|
||||
public AjaxResult list(@RequestParam String type) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
|
@ -34,6 +36,16 @@ public class DatasetController {
|
|||
return AjaxResult.success(new AiDataSet());
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置或取消数据集的公共状态
|
||||
* @param datasetId 数据集的ID
|
||||
* @param isPublic 是否设置为公共文件:true - 设置为公共文件, false - 取消公共状态
|
||||
* @return 操作结果
|
||||
*/
|
||||
@PostMapping("/set-public")
|
||||
public AjaxResult setDatasetPublicStatus(@RequestParam Long datasetId, @RequestParam Boolean isPublic){
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**发布数据集
|
||||
* @param version 发布数据集的版本信息
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ public class AiDataSet extends BaseEntity {
|
|||
|
||||
/**数据集ID*/
|
||||
private Long datasetId;
|
||||
/**数据集UUID*/
|
||||
private String datasetUuid;
|
||||
/**数据集名称*/
|
||||
private String datasetName;
|
||||
/**数据集描述*/
|
||||
|
|
|
|||
|
|
@ -30,6 +30,9 @@ public class AnnotationFile {
|
|||
/**标注来源,0人工标注,1智能标注*/
|
||||
private String annotationSource;
|
||||
|
||||
/**审核驳回原因*/
|
||||
private String auditFailedReason;
|
||||
|
||||
/**标注时间*/
|
||||
private java.util.Date annotationTime;
|
||||
/**审核时间*/
|
||||
|
|
@ -114,4 +117,12 @@ public class AnnotationFile {
|
|||
public void setDatasetId(Long datasetId) {
|
||||
this.datasetId = datasetId;
|
||||
}
|
||||
|
||||
public String getAuditFailedReason() {
|
||||
return auditFailedReason;
|
||||
}
|
||||
|
||||
public void setAuditFailedReason(String auditFailedReason) {
|
||||
this.auditFailedReason = auditFailedReason;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.bonus.common.core.web.domain.BaseEntity;
|
|||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class AnnotationTask extends BaseEntity {
|
||||
|
||||
|
|
@ -13,6 +14,8 @@ public class AnnotationTask extends BaseEntity {
|
|||
private Long taskId;
|
||||
/**数据集id*/
|
||||
private Long datasetId;
|
||||
/**任务uuid*/
|
||||
private String taskUuid ;
|
||||
/**标注团队id,为0表示未启用标注团队,否则启用标注团队的关联id*/
|
||||
private Long annotationTeamId;
|
||||
/**任务名称*/
|
||||
|
|
@ -31,28 +34,20 @@ public class AnnotationTask extends BaseEntity {
|
|||
/**删除标志(0代表存在 1代表删除) */
|
||||
private String delFlag;
|
||||
|
||||
/**标注人员列表*/
|
||||
private List<Long> annotators;
|
||||
/**分配前标注人员列表和每人分配的文件数*/
|
||||
private Map<Long, Integer> annotators;
|
||||
|
||||
/**审核人员列表*/
|
||||
private List<Long> reviewers;
|
||||
/**分配前审核人员列表和每人分配的文件数*/
|
||||
private Map<Long, Integer> reviewers;
|
||||
/**分配后子任务*/
|
||||
private List<AnnotationFile> subAnnotationTasks;
|
||||
|
||||
public List<Long> getReviewers() {
|
||||
return reviewers;
|
||||
public AnnotationTaskStatus getAnnotationTaskStatus() {
|
||||
return annotateTaskStatus;
|
||||
}
|
||||
|
||||
public void setReviewers(List<Long> reviewers) {
|
||||
this.reviewers = reviewers;
|
||||
}
|
||||
|
||||
public List<Long> getAnnotators() {
|
||||
return annotators;
|
||||
}
|
||||
|
||||
public void setAnnotators(List<Long> annotators) {
|
||||
this.annotators = annotators;
|
||||
public void setAnnotationTaskStatus(AnnotationTaskStatus annotateTaskStatus) {
|
||||
this.annotateTaskStatus = annotateTaskStatus;
|
||||
}
|
||||
|
||||
public List<AnnotationFile> getSubAnnotationTasks() {
|
||||
|
|
@ -136,7 +131,24 @@ public class AnnotationTask extends BaseEntity {
|
|||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
/**自动分配任务*/
|
||||
// /**自动分配任务*/
|
||||
// public void assignFilesToSubTasks(List<Long> fileIds){
|
||||
// int annotatorSize = annotators.size();
|
||||
// int reviewerSize = reviewers.size();
|
||||
//
|
||||
// for (int i = 0; i < fileIds.size(); i++) {
|
||||
// Long fileId = fileIds.get(i);
|
||||
//
|
||||
// // 通过轮询分配标注人和审核人
|
||||
// Long annotatorId = annotators.get(i % annotatorSize);
|
||||
// Long reviewerId = reviewers.get(i % reviewerSize);
|
||||
//
|
||||
// // 创建子任务
|
||||
// AnnotationFile subTask = new AnnotationFile(taskId,datasetId, annotatorId, reviewerId, fileId);
|
||||
// subAnnotationTasks.add(subTask);
|
||||
// }
|
||||
// }
|
||||
|
||||
public void assignFilesToSubTasks(List<Long> fileIds){
|
||||
int annotatorSize = annotators.size();
|
||||
int reviewerSize = reviewers.size();
|
||||
|
|
@ -145,8 +157,8 @@ public class AnnotationTask extends BaseEntity {
|
|||
Long fileId = fileIds.get(i);
|
||||
|
||||
// 通过轮询分配标注人和审核人
|
||||
Long annotatorId = annotators.get(i % annotatorSize);
|
||||
Long reviewerId = reviewers.get(i % reviewerSize);
|
||||
Long annotatorId = Long.valueOf(annotators.get(i % annotatorSize));
|
||||
Long reviewerId = Long.valueOf(reviewers.get(i % reviewerSize));
|
||||
|
||||
// 创建子任务
|
||||
AnnotationFile subTask = new AnnotationFile(taskId,datasetId, annotatorId, reviewerId, fileId);
|
||||
|
|
@ -155,13 +167,13 @@ public class AnnotationTask extends BaseEntity {
|
|||
}
|
||||
|
||||
/**添加标注人*/
|
||||
public void addAnnotator(Long userId){
|
||||
annotators.add(userId);
|
||||
public void addAnnotator(Long userId, Integer fileCount){
|
||||
annotators.put(userId, fileCount);
|
||||
}
|
||||
|
||||
/**添加审核人*/
|
||||
public void addReviewer(Long userId){
|
||||
reviewers.add(userId);
|
||||
public void addReviewer(Long userId, Integer fileCount){
|
||||
reviewers.put(userId, fileCount);
|
||||
}
|
||||
|
||||
/**删除标注人*/
|
||||
|
|
@ -173,4 +185,29 @@ public class AnnotationTask extends BaseEntity {
|
|||
public void removeReviewer(Long userId){
|
||||
reviewers.remove(userId);
|
||||
}
|
||||
|
||||
public String getTaskUuid() {
|
||||
return taskUuid;
|
||||
}
|
||||
|
||||
public void setTaskUuid(String taskUuid) {
|
||||
this.taskUuid = taskUuid;
|
||||
}
|
||||
|
||||
public void setAnnotators(Map<Long, Integer> annotators) {
|
||||
this.annotators = annotators;
|
||||
}
|
||||
|
||||
public Map<Long, Integer> getAnnotators() {
|
||||
return this.annotators;
|
||||
}
|
||||
|
||||
public void setReviewers(Map<Long, Integer> reviewers) {
|
||||
this.reviewers = reviewers;
|
||||
}
|
||||
|
||||
|
||||
public Map<Long, Integer> getReviewers() {
|
||||
return this.reviewers;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@ create table ai_annotation_task
|
|||
task_id bigint(20) not null auto_increment comment '任务id',
|
||||
dataset_id bigint(20) not null comment '数据集id',
|
||||
task_name varchar(64) comment '任务名称',
|
||||
description varchar(500) comment '描述',
|
||||
task_uuid varchar(64) comment '任务唯一标识id',
|
||||
description varchar(500) default '' comment '描述',
|
||||
annotation_scene char(1) comment '标注场景(对应数据集的数据类型)',
|
||||
annotation_type char(2) comment '标注类型(不同数据类型有不同的标注类型,如图片:图像分类,物体检测等)',
|
||||
labels varchar(200) comment '允许的标签集',
|
||||
|
|
@ -31,13 +32,14 @@ create table ai_annotation_task_annotator_map
|
|||
reviewer_id bigint(20) not null comment '审核人员',
|
||||
task_id bigint(20) not null comment '任务id',
|
||||
file_id bigint(20) not null comment '文件id',
|
||||
description varchar(500) comment '描述',
|
||||
description varchar(500) default '' comment '描述',
|
||||
annotation_status char(1) comment '0未标注,1正在标注,2已标注,3正在审核,4 审核驳回,5已审核',
|
||||
annotation_result text comment '标注结果(json串)',
|
||||
annotation_resource char(1) comment '0人工标注,1智能标注',
|
||||
del_flag char(1) default '0' comment '是否删除(0代表存在,1代表删除)',
|
||||
annotation_time datetime default null comment '标注时间',
|
||||
review_time datetime default null comment '审核时间',
|
||||
audit_failed_reason varchar(200) default '' comment '审核驳回原因',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime default null comment '更新时间',
|
||||
|
|
@ -94,8 +96,9 @@ drop table if exists ai_dataset;
|
|||
create table ai_dataset
|
||||
(
|
||||
dataset_id bigint(20) not null auto_increment comment '数据集id',
|
||||
dataset_uuid varchar(64) comment '数据集唯一标识id',
|
||||
dataset_name varchar(200) comment '数据集名称',
|
||||
description varchar(500) comment '描述',
|
||||
description varchar(500) default '' comment '描述',
|
||||
data_type char(1) comment '数据类型',
|
||||
data_source char(1) comment '数据来源(0:local,1:obs)',
|
||||
input_path varchar(200) comment '输入路径',
|
||||
|
|
|
|||
Loading…
Reference in New Issue