issue # nestjs 로 초기화
This commit is contained in:
15
src/modules/account/account.service.ts
Normal file
15
src/modules/account/account.service.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { Injectable } from "@nestjs/common";
|
||||
import { AccountRepo } from "./account.repo";
|
||||
import { CheckDuplicationRequestDto } from "./dto/checkDuplication/check-duplication-request.dto";
|
||||
import { CheckDuplicationResponseDto } from "./dto/checkDuplication/check-duplication-response.dto";
|
||||
|
||||
@Injectable()
|
||||
export class AccountService {
|
||||
constructor(private readonly accountRepo: AccountRepo) {}
|
||||
|
||||
async checkDuplication(data: CheckDuplicationRequestDto): Promise<CheckDuplicationResponseDto> {
|
||||
const count = await this.accountRepo.checkDuplication(data.type, data.value);
|
||||
|
||||
return { isDuplicated: count > 0 };
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user