mirror of https://github.com/doccano/doccano.git
Hironsan
1 year ago
10 changed files with 32 additions and 69 deletions
Split View
Diff Options
-
13frontend/components/member/FormCreate.vue
-
7frontend/components/tasks/toolbar/forms/FormComment.vue
-
7frontend/domain/models/user/userRepository.ts
-
1frontend/nuxt.config.js
-
32frontend/plugins/repositories.ts
-
3frontend/plugins/services.ts
-
7frontend/repositories/user/apiUserRepository.ts
-
16frontend/services/application/user/userApplicationService.ts
-
13frontend/services/application/user/userData.ts
-
2frontend/store/auth.js
@ -1,7 +0,0 @@ |
|||
import { UserItem } from '~/domain/models/user/user' |
|||
|
|||
export interface UserRepository { |
|||
getMe(): Promise<UserItem> |
|||
|
|||
list(query: string): Promise<UserItem[]> |
|||
} |
@ -1,16 +0,0 @@ |
|||
import { UserDTO } from './userData' |
|||
import { UserRepository } from '~/domain/models/user/userRepository' |
|||
|
|||
export class UserApplicationService { |
|||
constructor(private readonly repository: UserRepository) {} |
|||
|
|||
public async getMyProfile(): Promise<UserDTO> { |
|||
const item = await this.repository.getMe() |
|||
return new UserDTO(item) |
|||
} |
|||
|
|||
public async list(query: string): Promise<UserDTO[]> { |
|||
const items = await this.repository.list(query) |
|||
return items.map((item) => new UserDTO(item)) |
|||
} |
|||
} |
@ -1,13 +0,0 @@ |
|||
import { UserItem } from '~/domain/models/user/user' |
|||
|
|||
export class UserDTO { |
|||
id: number |
|||
username: string |
|||
isStaff: boolean |
|||
|
|||
constructor(item: UserItem) { |
|||
this.id = item.id |
|||
this.username = item.username |
|||
this.isStaff = item.isStaff |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save