新增sql和一些标注和发布的接口
This commit is contained in:
parent
2c0812be7b
commit
790ca43496
|
|
@ -1,12 +1,15 @@
|
|||
package com.bonus.ai.controller;
|
||||
|
||||
import com.bonus.ai.domain.AiDataSet;
|
||||
import com.bonus.ai.domain.AnnotationFile;
|
||||
import com.bonus.ai.domain.AnnotationTask;
|
||||
import com.bonus.ai.domain.ReleaseVersion;
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/task")
|
||||
public class AnnotationTaskController {
|
||||
|
|
@ -50,6 +53,15 @@ public class AnnotationTaskController {
|
|||
}
|
||||
|
||||
|
||||
/**标注或审核
|
||||
* @param subTask 标注文件的信息
|
||||
* @return 返回影响的行数或错误信
|
||||
*/
|
||||
@PostMapping("/annotate")
|
||||
public AjaxResult release(@Validated @RequestBody AnnotationFile subTask) {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**发布任务
|
||||
* @param version 发布任务的版本信息
|
||||
* @return 返回影响的行数或错误信
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ import org.springframework.web.multipart.MultipartFile;
|
|||
@RequestMapping("/basicfile")
|
||||
@Slf4j
|
||||
public class BasicFileController {
|
||||
|
||||
|
||||
/**
|
||||
* 获取由我创建和公共文件的列表
|
||||
* @return 返回所有的文件列表
|
||||
|
|
@ -32,6 +34,16 @@ public class BasicFileController {
|
|||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取公共文件的列表
|
||||
* @return 返回所有的文件列表
|
||||
*/
|
||||
@GetMapping("/list/public")
|
||||
public AjaxResult listPublic() {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 创建文件夹
|
||||
* @param folderName 单个文件
|
||||
|
|
|
|||
|
|
@ -0,0 +1,117 @@
|
|||
package com.bonus.ai.domain;
|
||||
|
||||
import com.bonus.ai.domain.enums.AnnotationFileStatus;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class AnnotationFile {
|
||||
AnnotationFile(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 java.util.Date annotationTime;
|
||||
/**审核时间*/
|
||||
private java.util.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;
|
||||
}
|
||||
}
|
||||
|
|
@ -4,6 +4,7 @@ import com.bonus.ai.domain.enums.AnnotationFileStatus;
|
|||
import com.bonus.ai.domain.enums.AnnotationTaskStatus;
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class AnnotationTask extends BaseEntity {
|
||||
|
|
@ -35,30 +36,8 @@ public class AnnotationTask extends BaseEntity {
|
|||
|
||||
/**审核人员列表*/
|
||||
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;
|
||||
private List<AnnotationFile> subAnnotationTasks;
|
||||
|
||||
public List<Long> getReviewers() {
|
||||
return reviewers;
|
||||
|
|
@ -76,11 +55,11 @@ public class AnnotationTask extends BaseEntity {
|
|||
this.annotators = annotators;
|
||||
}
|
||||
|
||||
public List<SubTask> getSubAnnotationTasks() {
|
||||
public List<AnnotationFile> getSubAnnotationTasks() {
|
||||
return subAnnotationTasks;
|
||||
}
|
||||
|
||||
public void setSubAnnotationTasks(List<SubTask> subAnnotationTasks) {
|
||||
public void setSubAnnotationTasks(List<AnnotationFile> subAnnotationTasks) {
|
||||
this.subAnnotationTasks = subAnnotationTasks;
|
||||
}
|
||||
|
||||
|
|
@ -156,4 +135,42 @@ public class AnnotationTask extends BaseEntity {
|
|||
public void setDelFlag(String delFlag) {
|
||||
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 addAnnotator(Long userId){
|
||||
annotators.add(userId);
|
||||
}
|
||||
|
||||
/**添加审核人*/
|
||||
public void addReviewer(Long userId){
|
||||
reviewers.add(userId);
|
||||
}
|
||||
|
||||
/**删除标注人*/
|
||||
public void removeAnnotator(Long userId){
|
||||
annotators.remove(userId);
|
||||
}
|
||||
|
||||
/**删除审核人*/
|
||||
public void removeReviewer(Long userId){
|
||||
reviewers.remove(userId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
407
sql/bonus_ai.sql
407
sql/bonus_ai.sql
|
|
@ -1,262 +1,225 @@
|
|||
SET NAMES utf8mb4;
|
||||
|
||||
drop table if exists ai_service;
|
||||
/*==============================================================*/
|
||||
/* Table: ai_service */
|
||||
/* Table: ai_annotation_task */
|
||||
/*==============================================================*/
|
||||
create table ai_service
|
||||
drop table if exists ai_annotation_task;
|
||||
create table ai_annotation_task
|
||||
(
|
||||
service_id bigint(20) not null comment '服务主键id',
|
||||
service_name varchar(30) comment '服务名称',
|
||||
service_descrip varchar(100) comment '服务描述',
|
||||
create_by varchar(64) not null comment '创建者',
|
||||
create_time datetime default NULL comment '创建时间',
|
||||
update_by varchar(64) not null comment '更新者',
|
||||
update_time datetime default NULL comment '更新时间',
|
||||
del_flag char(1) comment '是否删除(0代表存在 2代表删除)',
|
||||
primary key (service_id)
|
||||
)engine=innodb comment = '服务表';
|
||||
insert into ai_service values(1, '身份证识别', '身份证识别', 'admin', sysdate(), '', null ,'0');
|
||||
insert into ai_service values(2, '发票识别', '发票识别', 'admin', sysdate(), '', null,'0');
|
||||
insert into ai_service values(3, '文本识别', '文本识别', 'admin', sysdate(), '', null,'0');
|
||||
insert into ai_service values(4, '人脸识别', '人脸识别', 'admin', sysdate(), '', null,'0');
|
||||
insert into ai_service values(5, '违章识别', '违章识别', 'admin', sysdate(), '',null ,'0');;
|
||||
|
||||
|
||||
drop table if exists ai_idcardrecognize_result;
|
||||
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 '描述',
|
||||
annotation_scene char(1) comment '标注场景(对应数据集的数据类型)',
|
||||
annotation_type char(2) comment '标注类型(不同数据类型有不同的标注类型,如图片:图像分类,物体检测等)',
|
||||
labels varchar(200) comment '允许的标签集',
|
||||
is_annotation char(1) comment '标注团队id(0未启用,1启用团队)',
|
||||
annotation_status char(1) default '0' comment '0未标注,1正在标注,2已标注,3正在审核,4已审核',
|
||||
del_flag char(1) default '0' comment '是否删除(0代表存在,1代表删除)',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime default null comment '更新时间',
|
||||
create_time datetime default null comment '创建时间',
|
||||
primary key (task_id)
|
||||
)engine=innodb comment = '标注任务';
|
||||
|
||||
/*==============================================================*/
|
||||
/* Table: ai_idcardrecognize_result */
|
||||
/* Table: ai_annotation_task_annotator_map */
|
||||
/*==============================================================*/
|
||||
create table ai_idcardrecognize_result
|
||||
drop table if exists ai_annotation_task_annotator_map;
|
||||
create table ai_annotation_task_annotator_map
|
||||
(
|
||||
result_id bigint(20) not null auto_increment comment '结果id',
|
||||
service_id bigint(20) comment '服务主键id',
|
||||
name varchar(60) comment '姓名',
|
||||
sex char(2) default '男' comment '性别(男,女,其他)',
|
||||
enthnic varchar(20) comment '名族',
|
||||
birthday varchar(30) comment '出生',
|
||||
address varchar(100) comment '住址',
|
||||
idcard_number varchar(20) comment '身份证号',
|
||||
issuing_authority varchar(60) comment '签发机关',
|
||||
idcard_validity varchar(60) comment '有效期',
|
||||
if_complete char(2) default '是' comment '识别是否完整(是或否)',
|
||||
frontImge_address varchar(100) comment '正面原始图片路径',
|
||||
backImg_address varchar(100) comment '反面原始图片路径',
|
||||
recognize_time datetime comment '识别时间',
|
||||
response_long long comment '响应时长(单位秒)',
|
||||
invoke_ip varchar(60) comment '调用服务IP',
|
||||
update_by varchar(30) not null comment '更新者',
|
||||
update_time datetime default NULL comment '更新时间',
|
||||
del_flag char(1) default '0' comment '是否删除(0代表存在,2代表删除)',
|
||||
result_type char(1) default '0' comment '结果类型(0用户登录,1服务注册)',
|
||||
result_status char(1) default '0' comment '识别状态(0成功,1失败)',
|
||||
failure_reason varchar(100) comment '识别失败原因',
|
||||
primary key (result_id)
|
||||
)engine=innodb comment = '身份证识别结果表';
|
||||
|
||||
drop table if exists ai_facerecognize_result;
|
||||
annotator_id bigint(20) not null comment '标注人员',
|
||||
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 '描述',
|
||||
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 '审核时间',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime default null comment '更新时间',
|
||||
create_time datetime default null comment '创建时间',
|
||||
primary key (annotator_id, reviewer_id, task_id, file_id)
|
||||
)engine=innodb comment = '标注人员、审核人员和任务和基础文件的关联关系';
|
||||
|
||||
/*==============================================================*/
|
||||
/* Table: ocr_facerecognize_result */
|
||||
/* Table: ai_annotation_team_member */
|
||||
/*==============================================================*/
|
||||
create table ai_facerecognize_result
|
||||
drop table if exists ai_annotation_team_member;
|
||||
create table ai_annotation_team_member
|
||||
(
|
||||
result_id bigint(20) not null auto_increment comment '结果主键id',
|
||||
face_id bigint(20) comment '人脸库表id',
|
||||
service_id bigint(20) comment '服务id',
|
||||
result_it varchar(64) comment '识别结果',
|
||||
face_address varchar(100) comment '人脸路径',
|
||||
recognize_time datetime comment '识别时间',
|
||||
response_long long comment '响应时长',
|
||||
invoke_ip varchar(60) comment '调用服务IP',
|
||||
update_by varchar(60) not null comment '更新者',
|
||||
update_time datetime default NULL comment '更新时间',
|
||||
del_flag char(1) default '0' comment '是否删除',
|
||||
result_type char(1) default '0' comment '结果类型(0用户登录,1服务注册)',
|
||||
result_status char(1) default '0' comment '识别状态(0成功,1失败)',
|
||||
failure_reason varchar(100) comment '识别失败原因',
|
||||
primary key (result_id)
|
||||
)engine=innodb comment = '人脸识别结果表';
|
||||
member_id bigint(20) not null comment '成员id',
|
||||
role_id char(1) not null comment '角色标志(0 标注,1审核,2管理)',
|
||||
del_flag char(1) default '0' comment '是否删除(0代表存在,1代表删除)',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime default null comment '更新时间',
|
||||
create_time datetime default null comment '创建时间',
|
||||
primary key (member_id, role_id)
|
||||
)
|
||||
engine=innodb comment = '标注人员和角色关联表';
|
||||
|
||||
drop table if exists ai_face_databse;
|
||||
|
||||
/*==============================================================*/
|
||||
/* Table: ai_face_databse */
|
||||
/* Table: ai_basic_file */
|
||||
/*==============================================================*/
|
||||
create table ai_face_databse
|
||||
drop table if exists ai_basic_file;
|
||||
create table ai_basic_file
|
||||
(
|
||||
face_id bigint(20) not null auto_increment comment '主键id',
|
||||
name varchar(10) comment '姓名',
|
||||
sex char(2) default '男' comment '性别',
|
||||
phone varchar(11) default NULL comment '电话号码',
|
||||
idcard_number varchar(20) default null comment '身份证',
|
||||
face_address varchar(100) default null comment '人脸图片路径',
|
||||
create_by varchar(60) default null comment '创建者',
|
||||
create_time datetime default NULL comment '创建时间',
|
||||
update_by varchar(60) not null comment '更新者',
|
||||
update_time datetime default NULL comment '更新时间',
|
||||
del_flag char(1) default '0' comment '是否删除',
|
||||
primary key (face_id)
|
||||
)engine=innodb comment = '人脸库表';
|
||||
file_id bigint(20) not null auto_increment comment '文件id',
|
||||
parent_id bigint(20) not null default 0 comment '父节点id',
|
||||
ancestors varchar(200) comment '祖级列表',
|
||||
file_name varchar(200) comment '文件名',
|
||||
file_url varchar(200) comment '文件网络路径',
|
||||
file_size long comment '文件大小',
|
||||
file_last_modifytime datetime default null comment '文件最后修改时间',
|
||||
upload_time datetime default null comment '上传时间',
|
||||
is_directory char(1) comment '是否文件夹',
|
||||
is_public char(1) default '0' comment '0 no, 1 yes',
|
||||
del_flag char(1) default '0' comment '是否删除(0代表存在,1代表删除)',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime default null comment '记录的插入时间',
|
||||
update_by varchar(64) default '' comment '记录的更新时间',
|
||||
update_time datetime default null comment '更新时间',
|
||||
primary key(file_id)
|
||||
)
|
||||
engine=innodb comment = '文件基础表';
|
||||
|
||||
|
||||
drop table if exists ai_invoicerecognize_result;
|
||||
/*==============================================================*/
|
||||
/* Table: ai_invoicerecognize_result */
|
||||
/* Table: ai_dataset */
|
||||
/*==============================================================*/
|
||||
create table ai_invoicerecognize_result
|
||||
drop table if exists ai_dataset;
|
||||
create table ai_dataset
|
||||
(
|
||||
result_id bigint(20) not null auto_increment comment '结果主键id',
|
||||
service_id bigint(20) comment '服务id',
|
||||
rec_encoding varchar(20) comment '机器编码',
|
||||
invoice_code varchar(20) comment '发票代码',
|
||||
invoice_number varchar(20) comment '发票号码',
|
||||
invoice_date varchar(20) comment '发票日期',
|
||||
invoice_check varchar(30) comment '效验码',
|
||||
invoice_model varchar(30) comment '规格新号',
|
||||
invoice_unit char(5) comment '单位',
|
||||
invoice_amount varchar(10) comment '金额',
|
||||
invoice_rate varchar(10) comment '税率',
|
||||
invoice_pay varchar(10) comment '税额',
|
||||
unit_name varchar(60) comment '单位名称',
|
||||
invoice_ident_num varchar(60) comment '纳税人识别号',
|
||||
address_telep varchar(60) comment '地址电话',
|
||||
bank_account varchar(60) comment '开户行及账号',
|
||||
recognize_time datetime comment '识别时间',
|
||||
invoice_total varchar(30) comment '加税合计',
|
||||
response_long long comment '响应时长',
|
||||
invoke_ip varchar(60) comment '调用服务IP',
|
||||
update_by varchar(64) not null comment '更新者',
|
||||
update_time datetime default NULL comment '更新时间',
|
||||
del_flag char(1) default '0' comment '是否删除',
|
||||
result_type char(1) default '0' comment '结果类型(0用户登录,1服务注册)',
|
||||
result_status char(1) default '0' comment '识别状态(0成功,1失败)',
|
||||
failure_reason varchar(100) comment '识别失败原因',
|
||||
primary key (result_id)
|
||||
)engine=innodb comment = '发票识别结果表';
|
||||
|
||||
|
||||
drop table if exists ai_text_recognize_result;
|
||||
dataset_id bigint(20) not null auto_increment comment '数据集id',
|
||||
dataset_name varchar(200) comment '数据集名称',
|
||||
description varchar(500) comment '描述',
|
||||
data_type char(1) comment '数据类型',
|
||||
data_source char(1) comment '数据来源(0:local,1:obs)',
|
||||
input_path varchar(200) comment '输入路径',
|
||||
output_path varchar(200) comment '输入路径',
|
||||
annotation_status char(1) comment '标注状态(0no, 1 yes)',
|
||||
is_public char(1) default '0' comment '0 no, 1 yes',
|
||||
del_flag char(1) default '0' comment '是否删除(0代表存在,1代表删除)',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime default null comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime default null comment '更新时间',
|
||||
primary key(dataset_id)
|
||||
)
|
||||
engine=innodb comment = '数据集表';
|
||||
|
||||
/*==============================================================*/
|
||||
/* Table: ai_text_recognize_result */
|
||||
/* Table: ai_dataset_file_map */
|
||||
/*==============================================================*/
|
||||
create table ai_text_recognize_result
|
||||
drop table if exists ai_dataset_file_map;
|
||||
create table ai_dataset_file_map
|
||||
(
|
||||
result_id bigint(20) not null auto_increment comment '结果主键id',
|
||||
service_id bigint(20) comment '服务id',
|
||||
recognize_result longtext comment '识别结果',
|
||||
recognize_time datetime comment '识别时间',
|
||||
response_long long comment '响应时长',
|
||||
invoke_ip varchar(60) comment '调用服务IP',
|
||||
update_by varchar(64) not null comment '更新者',
|
||||
update_time datetime default NULL comment '更新时间',
|
||||
del_flag char(1) comment '是否删除',
|
||||
result_type char(1) default '0' comment '结果类型(0用户登录,1服务注册)',
|
||||
result_status char(1) default '0' comment '识别状态(0成功,1失败)',
|
||||
failure_reason varchar(100) comment '识别失败原因',
|
||||
primary key (result_id)
|
||||
)engine=innodb comment = '文本证识别结果表';
|
||||
|
||||
drop table if exists ai_user_service;
|
||||
file_id bigint(20) not null comment '文件id',
|
||||
dataset_id bigint(20) not null comment '数据集id',
|
||||
description varchar(500) comment '描述',
|
||||
del_flag char(1) default '0' comment '是否删除(0代表存在,1代表删除)',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime default null comment '更新时间',
|
||||
create_time datetime default null comment '创建时间',
|
||||
primary key(file_id, dataset_id)
|
||||
)
|
||||
engine=innodb comment = '数据集和文件关联关系表';
|
||||
|
||||
/*==============================================================*/
|
||||
/* Table: ai_user_service */
|
||||
/* Table: ai_dataset_log */
|
||||
/*==============================================================*/
|
||||
create table ai_user_service
|
||||
drop table if exists ai_dataset_log;
|
||||
create table ai_dataset_log
|
||||
(
|
||||
service_id bigint(20) not null comment '服务id',
|
||||
user_id bigint(20) not null comment '用户id',
|
||||
service_key varchar(64) not null comment '服务key',
|
||||
create_by varchar(60) comment '创建者',
|
||||
create_time datetime default NULL comment '创建时间',
|
||||
update_by varchar(60) not null comment '更新者',
|
||||
update_time datetime default NULL comment '更新时间',
|
||||
del_flag char(1) default '0' comment '是否删除',
|
||||
primary key (service_id, user_id, service_key)
|
||||
)engine=innodb comment = '用户和服务注册关系表';
|
||||
|
||||
drop table if exists ai_knowledgebase;
|
||||
log_id bigint(20) not null auto_increment comment '日志id',
|
||||
task_id bigint(20) comment '任务id',
|
||||
dataset_id bigint(20),
|
||||
file_id bigint(20),
|
||||
operation_type varchar(64) comment '操作类型(0代表标注,1代表审核)',
|
||||
operation_by varchar(64) default '' comment '操作人',
|
||||
operation_time datetime default NULL comment '操作时间',
|
||||
operation_result char(1) comment '操作结果(如审核通过,审核不通过)',
|
||||
operation_reason varchar(500) comment '操作原因(如不通过原因)',
|
||||
value_before text comment '操作之前的值',
|
||||
value_after text comment '操作之后的值',
|
||||
del_flag char(1) default '0' comment '是否删除(0代表存在,1代表删除)',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime default null comment '更新时间',
|
||||
create_time datetime default null comment '创建时间',
|
||||
primary key(log_id)
|
||||
)
|
||||
engine=innodb comment = '数据集日志表';
|
||||
|
||||
/*==============================================================*/
|
||||
/* Table: ai_knowledgebase */
|
||||
/* Table: ai_dataset_version */
|
||||
/*==============================================================*/
|
||||
create table ai_knowledgebase
|
||||
drop table if exists ai_dataset_version;
|
||||
create table ai_dataset_version
|
||||
(
|
||||
knowledge_id bigint(20) not null auto_increment comment '知识库id',
|
||||
knowledge_name varchar(60) comment '知识库名称',
|
||||
knowledge_description varchar(100) comment '知识库介绍',
|
||||
knowledge_type char(1) comment '知识库类型(0私有数据库,1公有数据库)',
|
||||
create_by varchar(64) not null comment '创建者',
|
||||
create_time datetime default NULL comment '创建时间',
|
||||
update_by varchar(64) not null comment '更新者',
|
||||
update_time datetime default NULL comment '更新时间',
|
||||
remark varchar(500) character set utf8 default NULL comment '备注',
|
||||
del_flag char(1) comment '是否删除(0代表存在,2代表删除)',
|
||||
primary key(knowledge_id)
|
||||
)engine=innodb comment = '知识库表';
|
||||
|
||||
|
||||
|
||||
drop table if exists ai_chat_window;
|
||||
version_id bigint(20) not null comment '版本id',
|
||||
version_name text comment '版本名称',
|
||||
version_description varchar(200) not null comment '版本描述',
|
||||
dataset_id bigint(20) not null comment '数据集id',
|
||||
task_id bigint(20) not null comment '任务id',
|
||||
del_flag char(1) default '0' comment '是否删除(0代表存在,1代表删除)',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime default null comment '更新时间',
|
||||
create_time datetime default null comment '创建时间',
|
||||
primary key(version_id)
|
||||
)engine=innodb comment = '数据集版本表';
|
||||
|
||||
/*==============================================================*/
|
||||
/* Table: ai_chat_window */
|
||||
/* Table: ai_file_label_map */
|
||||
/*==============================================================*/
|
||||
create table ai_chat_window
|
||||
drop table if exists ai_file_label_map;
|
||||
create table ai_file_label_map
|
||||
(
|
||||
window_id bigint(20) not null auto_increment comment '窗口id',
|
||||
knowledge_id bigint(20) comment '知识库id',
|
||||
window_name varchar(60) comment '窗口名称',
|
||||
chat_type char(1) comment '聊天类型(0 知识库问答,1 llm问答)',
|
||||
customer_id varchar(64) not null comment '客户',
|
||||
create_time datetime comment '创建时间',
|
||||
update_time datetime default NULL comment '更新时间',
|
||||
del_flag char(1) comment '是否删除(0代表存在,2代表删除)',
|
||||
remark varchar(500) character set utf8 default NULL comment '备注',
|
||||
primary key (window_id)
|
||||
)engine=innodb comment = '对话窗口表';
|
||||
|
||||
|
||||
drop table if exists ai_question_answer;
|
||||
file_id bigint(20) not null comment '文件id',
|
||||
label_id bigint(20) not null comment '标签id',
|
||||
del_flag char(1) default '0' comment '是否删除(0代表存在,1代表删除)',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime default null comment '更新时间',
|
||||
create_time datetime default null comment '创建时间',
|
||||
primary key (file_id, label_id)
|
||||
)
|
||||
engine=innodb comment = '文件和标签关联表';
|
||||
|
||||
/*==============================================================*/
|
||||
/* Table: ai_question_answer */
|
||||
/* Table: ai_labels */
|
||||
/*==============================================================*/
|
||||
create table ai_question_answer
|
||||
(
|
||||
record_id bigint(20) not null auto_increment comment '问答id',
|
||||
window_id bigint(20) comment '窗口id',
|
||||
question longtext comment '问题',
|
||||
answer longtext comment '回答',
|
||||
knowledge longtext comment '知识库溯源文档',
|
||||
del_flag char(1) comment '是否删除(0代表存在,2代表删除)',
|
||||
customer_id varchar(64) not null comment '客户',
|
||||
update_time datetime default NULL comment '更新时间',
|
||||
remark varchar(500) character set utf8 default NULL comment '备注',
|
||||
primary key (record_id)
|
||||
)engine=innodb comment = '问答表';
|
||||
|
||||
|
||||
drop table if exists ai_knowledge_file;
|
||||
|
||||
/*==============================================================*/
|
||||
/* Table: ai_knowledge_file */
|
||||
/*==============================================================*/
|
||||
create table ai_knowledge_file
|
||||
drop table if exists ai_labels;
|
||||
create table ai_labels
|
||||
(
|
||||
knowledge_file_id bigint(20) not null auto_increment comment '知识库文件id',
|
||||
file_name varchar(60) comment '文件名称',
|
||||
knowledge_id bigint(20) comment '知识库id',
|
||||
file_path varchar(100) comment '文件地址',
|
||||
file_type varchar(64) comment '文件类型',
|
||||
file_size bigint(4) comment '文件大小(单位字节)',
|
||||
del_flag char(1) comment '是否删除(0代表存在,2代表删除)',
|
||||
create_by varchar(64) not null comment '创建者',
|
||||
create_time datetime default NULL comment '创建时间',
|
||||
update_by varchar(64) not null comment '更新者',
|
||||
update_time datetime default NULL comment '更新时间',
|
||||
remark varchar(500) character set utf8 default NULL comment '备注',
|
||||
primary key (knowledge_file_id)
|
||||
)engine=innodb comment = '知识库文件表';
|
||||
label_id bigint(20) not null auto_increment comment '标签id',
|
||||
ancestors varchar(200) comment '祖级列表',
|
||||
parent_id bigint(20) not null default 0 comment '父节点id',
|
||||
label_name bigint(20) comment '标签名称',
|
||||
del_flag char(1) default '0' comment '是否删除(0代表存在,1代表删除)',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
update_time datetime default null comment '更新时间',
|
||||
create_time datetime default null comment '创建时间',
|
||||
primary key (label_id)
|
||||
)engine=innodb comment = '标签表';
|
||||
|
||||
/*==============================================================*/
|
||||
/* Table: ai_version_file_map */
|
||||
/*==============================================================*/
|
||||
drop table if exists ai_version_file_map;
|
||||
create table ai_version_file_map
|
||||
(
|
||||
version_id bigint(20) not null comment '版本id',
|
||||
file_id bigint(20) not null comment '文件id',
|
||||
annotation_result text comment '标注结果(json串)',
|
||||
primary key(version_id, file_id)
|
||||
)engine=innodb comment = '版本和文件关联表';
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue