mirror of https://github.com/doccano/doccano.git
pythondatasetnatural-language-processingdata-labelingmachine-learningannotation-tooldatasetsactive-learningtext-annotation
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.
23 lines
522 B
23 lines
522 B
import { RoleItem } from '@/models/role'
|
|
import { RoleItemListRepository } from '@/repositories/role/interface'
|
|
|
|
export class RoleDTO {
|
|
id: number
|
|
rolename: string
|
|
|
|
constructor(item: RoleItem) {
|
|
this.id = item.id
|
|
this.rolename = item.name
|
|
}
|
|
}
|
|
|
|
export class RoleApplicationService {
|
|
constructor(
|
|
private readonly repository: RoleItemListRepository
|
|
) {}
|
|
|
|
public async list(): Promise<RoleDTO[]> {
|
|
const items = await this.repository.list()
|
|
return items.map(item => new RoleDTO(item))
|
|
}
|
|
}
|