提交数据集后端代码
This commit is contained in:
parent
f32ea7511c
commit
24cb3096a6
|
|
@ -9,7 +9,6 @@ import com.bonus.common.core.web.page.TableDataInfo;
|
||||||
import com.bonus.common.log.annotation.SysLog;
|
import com.bonus.common.log.annotation.SysLog;
|
||||||
import com.bonus.common.log.enums.OperaType;
|
import com.bonus.common.log.enums.OperaType;
|
||||||
import com.bonus.common.security.annotation.RequiresPermissions;
|
import com.bonus.common.security.annotation.RequiresPermissions;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,33 @@
|
||||||
package com.bonus.ai.controller.dataset;
|
package com.bonus.ai.controller.dataset;
|
||||||
|
|
||||||
|
import com.bonus.ai.domain.dataset.AnnotationSubTaskEntity;
|
||||||
import com.bonus.ai.domain.dataset.DataSetEntity;
|
import com.bonus.ai.domain.dataset.AnnotationTaskEntity;
|
||||||
|
import com.bonus.ai.service.DataSetBasicFileService;
|
||||||
|
import com.bonus.ai.service.dataset.AnnotationTaskService;
|
||||||
import com.bonus.common.core.web.controller.BaseController;
|
import com.bonus.common.core.web.controller.BaseController;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author bonus
|
* @author bonus
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/annotationTask")
|
@RequestMapping("/annotationTask")
|
||||||
public class AnnotationTaskController extends BaseController {
|
public class AnnotationTaskController extends BaseController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private AnnotationTaskService annotationTaskService;
|
||||||
|
|
||||||
/**创建标注任务
|
/**创建标注任务
|
||||||
* @param task 新增的数据集信息
|
* @param task 新增的数据集信息
|
||||||
* @return 返回影响的行数或错误信
|
* @return 返回影响的行数或错误信
|
||||||
*/
|
*/
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
public AjaxResult add(@Validated @RequestBody DataSetEntity.AnnotationTaskEntity task) {
|
public AjaxResult add(@Validated @RequestBody AnnotationTaskEntity task) {
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -28,7 +36,7 @@ public class AnnotationTaskController extends BaseController {
|
||||||
* @return 返回影响的行数或错误信
|
* @return 返回影响的行数或错误信
|
||||||
*/
|
*/
|
||||||
@PostMapping("/edit")
|
@PostMapping("/edit")
|
||||||
public AjaxResult edit(@Validated @RequestBody DataSetEntity.AnnotationTaskEntity task) {
|
public AjaxResult edit(@Validated @RequestBody AnnotationTaskEntity task) {
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -37,7 +45,7 @@ public class AnnotationTaskController extends BaseController {
|
||||||
* @param taskId 修改的任务
|
* @param taskId 修改的任务
|
||||||
* @return 返回影响的行数或错误信
|
* @return 返回影响的行数或错误信
|
||||||
*/
|
*/
|
||||||
@DeleteMapping("/{taskId}")
|
@PostMapping("/delete/{taskId}")
|
||||||
public AjaxResult remove(@PathVariable Long taskId) {
|
public AjaxResult remove(@PathVariable Long taskId) {
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
@ -60,7 +68,7 @@ public class AnnotationTaskController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@GetMapping(value = "/{taskId}")
|
@GetMapping(value = "/{taskId}")
|
||||||
public AjaxResult getInfo(@PathVariable Long taskId) {
|
public AjaxResult getInfo(@PathVariable Long taskId) {
|
||||||
return AjaxResult.success(new DataSetEntity.AnnotationTaskEntity());
|
return AjaxResult.success(new AnnotationTaskEntity());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -69,17 +77,17 @@ public class AnnotationTaskController extends BaseController {
|
||||||
* @return 返回影响的行数或错误信
|
* @return 返回影响的行数或错误信
|
||||||
*/
|
*/
|
||||||
@PostMapping("/manualAnnotate")
|
@PostMapping("/manualAnnotate")
|
||||||
public AjaxResult manualAnnotate(@Validated @RequestBody DataSetEntity.AnnotationTaskFileAnnotator subTask) {
|
public AjaxResult manualAnnotate(@Validated @RequestBody AnnotationSubTaskEntity subTask) {
|
||||||
|
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**智能标注
|
/**智能标注,预留接口
|
||||||
* @param subTask 标注文件的信息
|
* @param subTask 标注文件的信息
|
||||||
* @return 返回影响的行数或错误信
|
* @return 返回影响的行数或错误信
|
||||||
*/
|
*/
|
||||||
@PostMapping("/aiAnnotate")
|
@PostMapping("/aiAnnotate")
|
||||||
public AjaxResult aiAnnotate(@Validated @RequestBody DataSetEntity.AnnotationTaskFileAnnotator subTask) {
|
public AjaxResult aiAnnotate(@Validated @RequestBody AnnotationSubTaskEntity subTask) {
|
||||||
|
|
||||||
return AjaxResult.success();
|
return AjaxResult.success();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,11 @@ import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.common.security.utils.SecurityUtils;
|
import com.bonus.common.security.utils.SecurityUtils;
|
||||||
import com.bonus.system.api.domain.SysUser;
|
import com.bonus.system.api.domain.SysUser;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import com.bonus.common.core.utils.StringUtils;
|
import com.bonus.common.core.utils.StringUtils;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -20,7 +20,7 @@ import java.util.List;
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class DatasetController extends BaseController {
|
public class DatasetController extends BaseController {
|
||||||
|
|
||||||
@Autowired
|
@Resource
|
||||||
private DatasetService datasetService;
|
private DatasetService datasetService;
|
||||||
|
|
||||||
/**创建数据集
|
/**创建数据集
|
||||||
|
|
|
||||||
|
|
@ -1,69 +0,0 @@
|
||||||
package com.bonus.ai.domain.dataset;
|
|
||||||
|
|
||||||
import com.bonus.ai.domain.enums.AnnotationFileStatus;
|
|
||||||
import com.bonus.ai.domain.enums.AnnotationTaskStatus;
|
|
||||||
import com.bonus.common.core.web.domain.BaseEntity;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
public class AnnotationTask extends BaseEntity {
|
|
||||||
|
|
||||||
/**任务名称*/
|
|
||||||
private Long taskId;
|
|
||||||
/**数据集id*/
|
|
||||||
private Long datasetId;
|
|
||||||
/**标注团队id,为0表示未启用标注团队,1启用标注团队*/
|
|
||||||
private String isStartTeam;
|
|
||||||
/**任务名称*/
|
|
||||||
private String taskName;
|
|
||||||
/**任务描述*/
|
|
||||||
private String taskDesc;
|
|
||||||
/**标注场景 数据类型:0图片,1视频 ,2音频,3自由格式*/
|
|
||||||
private String annotateScene;
|
|
||||||
/**标注类型:图像分类,物体检测等*/
|
|
||||||
private String annotateType;
|
|
||||||
/**标签集合,标签之间用逗号分隔*/
|
|
||||||
private String labels;
|
|
||||||
|
|
||||||
/**在线标注工具里关联的项目id*/
|
|
||||||
Long projectId;
|
|
||||||
|
|
||||||
AnnotationTaskStatus annotateTaskStatus;
|
|
||||||
|
|
||||||
/**删除标志(0代表存在 1代表删除) */
|
|
||||||
private String delFlag;
|
|
||||||
|
|
||||||
/**标注人员列表*/
|
|
||||||
private List<Long> annotators;
|
|
||||||
|
|
||||||
/**审核人员列表*/
|
|
||||||
private List<Long> reviewers;
|
|
||||||
|
|
||||||
|
|
||||||
public class SubTask{
|
|
||||||
/**标注人员id*/
|
|
||||||
private Long annotatorId;
|
|
||||||
/**审核人员id*/
|
|
||||||
private Long reviewerId;
|
|
||||||
/**文件id*/
|
|
||||||
private Long fileId;
|
|
||||||
|
|
||||||
/**文件标注状态*/
|
|
||||||
private AnnotationFileStatus annotateFileStatus;
|
|
||||||
/**标注结果*/
|
|
||||||
private String annotationResult;
|
|
||||||
/**标注来源,0人工标注,1智能标注*/
|
|
||||||
private String annotationSource;
|
|
||||||
|
|
||||||
/**标注时间*/
|
|
||||||
private java.util.Date annotationTime;
|
|
||||||
/**审核时间*/
|
|
||||||
private java.util.Date reviewTime;;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**分配后子任务*/
|
|
||||||
private List<SubTask> subAnnotationTasks;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -46,208 +46,6 @@ public class DataSetEntity extends BaseEntity {
|
||||||
/**创建数据集时是否已标注,0未标注,1已标注*/
|
/**创建数据集时是否已标注,0未标注,1已标注*/
|
||||||
private String isAnnotated;
|
private String isAnnotated;
|
||||||
|
|
||||||
|
/**数据集关联的文件id*/
|
||||||
private Long[] fileIds;
|
private Long[] fileIds;
|
||||||
|
|
||||||
@Data
|
|
||||||
public static class AnnotationTaskEntity extends BaseEntity {
|
|
||||||
|
|
||||||
/**任务名称*/
|
|
||||||
private Long taskId;
|
|
||||||
/**数据集id*/
|
|
||||||
private Long datasetId;
|
|
||||||
/**任务uuid*/
|
|
||||||
private String taskUuid ;
|
|
||||||
/**标注团队id,为0表示未启用标注团队,否则启用标注团队的关联id*/
|
|
||||||
private Long annotationTeamId;
|
|
||||||
/**任务名称*/
|
|
||||||
private String taskName;
|
|
||||||
/**任务描述*/
|
|
||||||
private String taskDesc;
|
|
||||||
/**标注场景 数据类型:0图片,1视频 ,2音频,3自由格式*/
|
|
||||||
private String annotateScene;
|
|
||||||
/**标注类型:图像分类,物体检测等*/
|
|
||||||
private String annotateType;
|
|
||||||
/**标签集合,标签之间用逗号分隔*/
|
|
||||||
private String labels;
|
|
||||||
|
|
||||||
AnnotationTaskStatus annotateTaskStatus;
|
|
||||||
|
|
||||||
/**删除标志(0代表存在 1代表删除) */
|
|
||||||
private String delFlag;
|
|
||||||
|
|
||||||
/**分配前标注人员列表和每人分配的文件数*/
|
|
||||||
private Map<Long, Integer> annotators;
|
|
||||||
|
|
||||||
/**分配前审核人员列表和每人分配的文件数*/
|
|
||||||
private Map<Long, Integer> reviewers;
|
|
||||||
/**分配后子任务*/
|
|
||||||
private List<AnnotationTaskFileAnnotator> subAnnotationTasks;
|
|
||||||
|
|
||||||
public AnnotationTaskStatus getAnnotationTaskStatus() {
|
|
||||||
return annotateTaskStatus;
|
|
||||||
}
|
|
||||||
|
|
||||||
// /**自动分配任务*/
|
|
||||||
// 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();
|
|
||||||
|
|
||||||
// for (int i = 0; i < fileIds.size(); i++) {
|
|
||||||
// Long fileId = fileIds.get(i);
|
|
||||||
//
|
|
||||||
// // 通过轮询分配标注人和审核人
|
|
||||||
// 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);
|
|
||||||
// subAnnotationTasks.add(subTask);
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 标注任务,文件和标注人和审核人关系类
|
|
||||||
* */
|
|
||||||
public static class AnnotationTaskFileAnnotator {
|
|
||||||
AnnotationTaskFileAnnotator(Long taskId, Long datasetId, Long annotatorId, Long reviewerId, Long fileId){
|
|
||||||
this.taskId = taskId;
|
|
||||||
this.datasetId = datasetId;
|
|
||||||
this.annotatorId = annotatorId;
|
|
||||||
this.reviewerId = reviewerId;
|
|
||||||
this.fileId = fileId;
|
|
||||||
}
|
|
||||||
/**任务名称*/
|
|
||||||
private Long taskId;
|
|
||||||
/**数据集id*/
|
|
||||||
private Long datasetId;
|
|
||||||
/**标注人员id*/
|
|
||||||
private Long annotatorId;
|
|
||||||
/**审核人员id*/
|
|
||||||
private Long reviewerId;
|
|
||||||
/**文件id*/
|
|
||||||
private Long fileId;
|
|
||||||
|
|
||||||
/**文件标注状态*/
|
|
||||||
private AnnotationFileStatus annotateFileStatus;
|
|
||||||
/**标注结果*/
|
|
||||||
private String annotationResult;
|
|
||||||
/**标注来源,0人工标注,1智能标注*/
|
|
||||||
private String annotationSource;
|
|
||||||
|
|
||||||
/**审核驳回原因*/
|
|
||||||
private String auditFailedReason;
|
|
||||||
|
|
||||||
/**标注时间*/
|
|
||||||
private Date annotationTime;
|
|
||||||
/**审核时间*/
|
|
||||||
private Date reviewTime;;
|
|
||||||
|
|
||||||
public AnnotationFileStatus getAnnotateFileStatus() {
|
|
||||||
return annotateFileStatus;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAnnotateFileStatus(AnnotationFileStatus annotateFileStatus) {
|
|
||||||
this.annotateFileStatus = annotateFileStatus;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAnnotationResult() {
|
|
||||||
return annotationResult;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAnnotationResult(String annotationResult) {
|
|
||||||
this.annotationResult = annotationResult;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAnnotationSource() {
|
|
||||||
return annotationSource;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAnnotationSource(String annotationSource) {
|
|
||||||
this.annotationSource = annotationSource;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getAnnotationTime() {
|
|
||||||
return annotationTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAnnotationTime(Date annotationTime) {
|
|
||||||
this.annotationTime = annotationTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getReviewTime() {
|
|
||||||
return reviewTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setReviewTime(Date reviewTime) {
|
|
||||||
this.reviewTime = reviewTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getAnnotatorId() {
|
|
||||||
return annotatorId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAnnotatorId(Long annotatorId) {
|
|
||||||
this.annotatorId = annotatorId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getReviewerId() {
|
|
||||||
return reviewerId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setReviewerId(Long reviewerId) {
|
|
||||||
this.reviewerId = reviewerId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getFileId() {
|
|
||||||
return fileId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFileId(Long fileId) {
|
|
||||||
this.fileId = fileId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getTaskId() {
|
|
||||||
return taskId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTaskId(Long taskId) {
|
|
||||||
this.taskId = taskId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getDatasetId() {
|
|
||||||
return datasetId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDatasetId(Long datasetId) {
|
|
||||||
this.datasetId = datasetId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAuditFailedReason() {
|
|
||||||
return auditFailedReason;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAuditFailedReason(String auditFailedReason) {
|
|
||||||
this.auditFailedReason = auditFailedReason;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package com.bonus.ai.mapper;
|
package com.bonus.ai.mapper;
|
||||||
|
|
||||||
import com.bonus.ai.domain.dataset.AnnotationTask;
|
import com.bonus.ai.domain.dataset.AnnotationTaskEntity;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -17,14 +17,14 @@ public interface AnnotationTaskMapper
|
||||||
* @param annotationTask 标注任务实体
|
* @param annotationTask 标注任务实体
|
||||||
* @return 影响的行数
|
* @return 影响的行数
|
||||||
*/
|
*/
|
||||||
int insertAnnotationTask(AnnotationTask annotationTask);
|
int insertAnnotationTask(AnnotationTaskEntity annotationTask);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据任务ID更新标注任务
|
* 根据任务ID更新标注任务
|
||||||
* @param annotationTask 标注任务实体
|
* @param annotationTask 标注任务实体
|
||||||
* @return 影响的行数
|
* @return 影响的行数
|
||||||
*/
|
*/
|
||||||
int updateAnnotationTaskById(AnnotationTask annotationTask);
|
int updateAnnotationTaskById(AnnotationTaskEntity annotationTask);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据任务ID删除标注任务 (逻辑删除)
|
* 根据任务ID删除标注任务 (逻辑删除)
|
||||||
|
|
@ -38,12 +38,12 @@ public interface AnnotationTaskMapper
|
||||||
* @param taskId 任务ID
|
* @param taskId 任务ID
|
||||||
* @return 标注任务实体
|
* @return 标注任务实体
|
||||||
*/
|
*/
|
||||||
AnnotationTask selectAnnotationTaskById(Long taskId);
|
AnnotationTaskEntity selectAnnotationTaskById(Long taskId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询标注任务列表
|
* 查询标注任务列表
|
||||||
* @param annotationTask 查询条件
|
* @param annotationTask 查询条件
|
||||||
* @return 标注任务列表
|
* @return 标注任务列表
|
||||||
*/
|
*/
|
||||||
List<AnnotationTask> selectAnnotationTaskList(AnnotationTask annotationTask);
|
List<AnnotationTaskEntity> selectAnnotationTaskList(AnnotationTaskEntity annotationTask);
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,96 @@
|
||||||
|
package com.bonus.ai.service.Impl.dataset;
|
||||||
|
|
||||||
|
import com.bonus.ai.config.MinioConfig;
|
||||||
|
import com.bonus.ai.config.OnlineAnnotateConfig;
|
||||||
|
import com.bonus.ai.domain.dataset.AnnotationSubTaskEntity;
|
||||||
|
import com.bonus.ai.domain.dataset.AnnotationTaskEntity;
|
||||||
|
import com.bonus.ai.domain.dataset.DataSetEntity;
|
||||||
|
import com.bonus.ai.service.dataset.AnnotationTaskService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class AnnotationTaskServiceImpl implements AnnotationTaskService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private RestTemplate restTemplate;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private OnlineAnnotateConfig onlineAnnotateConfig;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手工标注
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void manualAnnotate(AnnotationSubTaskEntity subTask) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AI标注
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void aiAnnotate(AnnotationSubTaskEntity subTask) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取任务列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public DataSetEntity getTaskList(String type) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新任务
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateTask(AnnotationTaskEntity task){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建标注任务
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int createTask(AnnotationTaskEntity task) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据taskid 删除任务
|
||||||
|
* @param taskId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteTaskById(Long taskId) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取任务详情
|
||||||
|
* @param taskId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AnnotationTaskEntity getTaskInfo(Long taskId) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查任务名称是否重复
|
||||||
|
* @param task
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean checkTaskNameUnique(AnnotationTaskEntity task){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -11,10 +11,8 @@ import com.bonus.common.core.utils.StringUtils;
|
||||||
import com.bonus.common.security.utils.SecurityUtils;
|
import com.bonus.common.security.utils.SecurityUtils;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import com.bonus.common.security.utils.SecurityUtils;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
@ -27,14 +25,11 @@ public class DatasetServiceImpl implements DatasetService {
|
||||||
final String LISTTYPE_MY = "my";
|
final String LISTTYPE_MY = "my";
|
||||||
final String LISTTYPE_PUBLIC = "public";
|
final String LISTTYPE_PUBLIC = "public";
|
||||||
|
|
||||||
@Autowired
|
@Resource
|
||||||
private DatasetMapper datasetMapper;
|
private DatasetMapper datasetMapper;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private DatasetFileMapper datasetFileMapper;
|
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
OnlineAnnotateConfig onlineAnnotateConfig;
|
private DatasetFileMapper datasetFileMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# Tomcat
|
# Tomcat
|
||||||
server:
|
server:
|
||||||
port: 18083
|
port: 18089
|
||||||
# Spring
|
# Spring
|
||||||
spring:
|
spring:
|
||||||
servlet:
|
servlet:
|
||||||
|
|
@ -21,12 +21,12 @@ spring:
|
||||||
password: nacos
|
password: nacos
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 192.168.0.14:8848
|
||||||
namespace: db93cb6f-e0b3-4f24-a5fc-72f5562f5676
|
namespace: f648524d-0a7b-449e-8f92-64e05236fd51
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 192.168.0.14:8848
|
||||||
namespace: db93cb6f-e0b3-4f24-a5fc-72f5562f5676
|
namespace: f648524d-0a7b-449e-8f92-64e05236fd51
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
<mapper namespace="com.bonus.ai.mapper.AnnotationTaskMapper">
|
<mapper namespace="com.bonus.ai.mapper.AnnotationTaskMapper">
|
||||||
|
|
||||||
<!-- 插入标注任务 -->
|
<!-- 插入标注任务 -->
|
||||||
<insert id="insertAnnotationTask" parameterType="com.bonus.ai.domain.dataset.AnnotationTask">
|
<insert id="insertAnnotationTask" parameterType="com.bonus.ai.domain.dataset.AnnotationTaskEntity">
|
||||||
INSERT INTO ai_annotation_task (dataset_id, task_name, task_uuid, description,
|
INSERT INTO ai_annotation_task (dataset_id, task_name, task_uuid, description,
|
||||||
annotation_scene, annotation_type, labels, is_annotation,
|
annotation_scene, annotation_type, labels, is_annotation,
|
||||||
annotation_status, project_id, del_flag, create_by, create_time, update_by, update_time)
|
annotation_status, project_id, del_flag, create_by, create_time, update_by, update_time)
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<!-- 根据任务ID更新标注任务 -->
|
<!-- 根据任务ID更新标注任务 -->
|
||||||
<update id="updateAnnotationTaskById" parameterType="com.bonus.ai.domain.dataset.AnnotationTask">
|
<update id="updateAnnotationTaskById" parameterType="com.bonus.ai.domain.dataset.AnnotationTaskEntity">
|
||||||
UPDATE ai_annotation_task
|
UPDATE ai_annotation_task
|
||||||
SET dataset_id = #{datasetId},
|
SET dataset_id = #{datasetId},
|
||||||
task_name = #{taskName},
|
task_name = #{taskName},
|
||||||
|
|
@ -43,7 +43,7 @@
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<!-- 根据任务ID查询标注任务 -->
|
<!-- 根据任务ID查询标注任务 -->
|
||||||
<select id="selectAnnotationTaskById" parameterType="long" resultType="com.bonus.ai.domain.dataset.AnnotationTask">
|
<select id="selectAnnotationTaskById" parameterType="long" resultType="com.bonus.ai.domain.dataset.AnnotationTaskEntity">
|
||||||
SELECT task_id AS taskId, dataset_id AS datasetId, task_name AS taskName, task_uuid AS taskUuid,
|
SELECT task_id AS taskId, dataset_id AS datasetId, task_name AS taskName, task_uuid AS taskUuid,
|
||||||
description AS taskDesc, annotation_scene AS annotateScene, annotation_type AS annotateType,
|
description AS taskDesc, annotation_scene AS annotateScene, annotation_type AS annotateType,
|
||||||
labels, is_annotation AS isStartTeam, annotation_status AS annotateTaskStatus,
|
labels, is_annotation AS isStartTeam, annotation_status AS annotateTaskStatus,
|
||||||
|
|
@ -54,7 +54,7 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 查询标注任务列表 -->
|
<!-- 查询标注任务列表 -->
|
||||||
<select id="selectAnnotationTaskList" parameterType="com.bonus.ai.domain.dataset.AnnotationTask" resultType="com.bonus.ai.domain.dataset.AnnotationTask">
|
<select id="selectAnnotationTaskList" parameterType="com.bonus.ai.domain.dataset.AnnotationTaskEntity" resultType="com.bonus.ai.domain.dataset.AnnotationTaskEntity">
|
||||||
SELECT task_id AS taskId, dataset_id AS datasetId, task_name AS taskName, task_uuid AS taskUuid,
|
SELECT task_id AS taskId, dataset_id AS datasetId, task_name AS taskName, task_uuid AS taskUuid,
|
||||||
description AS taskDesc, annotation_scene AS annotateScene, annotation_type AS annotateType,
|
description AS taskDesc, annotation_scene AS annotateScene, annotation_type AS annotateType,
|
||||||
labels, is_annotation AS isStartTeam, annotation_status AS annotateTaskStatus,
|
labels, is_annotation AS isStartTeam, annotation_status AS annotateTaskStatus,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue