mirror of https://github.com/doccano/doccano.git
pythondatasetsactive-learningtext-annotationdatasetnatural-language-processingdata-labelingmachine-learningannotation-tool
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.8 KiB
56 lines
1.8 KiB
import { ProjectReadItem, CurrentUsersRole, ProjectType } from '~/domain/models/project/project'
|
|
import { FormatItem } from '~/domain/models/document/format'
|
|
|
|
|
|
export class FormatDTO {
|
|
example: string
|
|
type: string
|
|
text: string
|
|
extension: string
|
|
|
|
constructor(item: FormatItem) {
|
|
this.example = item.example
|
|
this.type = item.type
|
|
this.text = item.text
|
|
this.extension = item.extension
|
|
}
|
|
}
|
|
|
|
|
|
export class ProjectDTO {
|
|
id: number
|
|
name: string
|
|
description: string
|
|
guideline: string
|
|
current_users_role: CurrentUsersRole
|
|
projectType: ProjectType
|
|
updatedAt: string
|
|
enableRandomizeDocOrder: boolean
|
|
enableShareAnnotation: boolean
|
|
singleClassClassification: boolean
|
|
pageLink: string
|
|
downloadFormats: FormatDTO[]
|
|
uploadFormats: FormatDTO[]
|
|
permitApprove: Boolean
|
|
filterOption: String
|
|
|
|
constructor(item: ProjectReadItem) {
|
|
this.id = item.id
|
|
this.name = item.name
|
|
this.description = item.description
|
|
this.guideline = item.guideline
|
|
this.current_users_role = item.current_users_role
|
|
this.projectType = item.project_type
|
|
this.updatedAt = item.updated_at
|
|
this.enableRandomizeDocOrder = item.randomize_document_order
|
|
this.enableShareAnnotation = item.collaborative_annotation
|
|
this.singleClassClassification = item.single_class_classification
|
|
this.pageLink = item.annotationPageLink
|
|
this.downloadFormats = item.downloadFormats.map(f => new FormatDTO(f))
|
|
this.uploadFormats = item.uploadFormats.map(f => new FormatDTO(f))
|
|
this.permitApprove = item.permitApprove
|
|
this.filterOption = item.filterOption
|
|
}
|
|
}
|
|
|
|
export type ProjectWriteDTO = Pick<ProjectDTO, 'id' | 'name' | 'description' | 'guideline' | 'projectType' | 'enableRandomizeDocOrder' | 'enableShareAnnotation' | 'singleClassClassification'>
|