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.

18 lines
510 B

  1. import { UserDTO } from './userData'
  2. import { UserRepository } from '~/domain/models/user/userRepository'
  3. export class UserApplicationService {
  4. constructor(
  5. private readonly repository: UserRepository
  6. ) {}
  7. public async getMyProfile(): Promise<UserDTO> {
  8. const item = await this.repository.getMe()
  9. return new UserDTO(item)
  10. }
  11. public async list(query: string): Promise<UserDTO[]> {
  12. const items = await this.repository.list(query)
  13. return items.map(item => new UserDTO(item))
  14. }
  15. }