Files
scheduler-front/src/network/AccountNetwork.ts
geonhee-min 60e9d2a631
All checks were successful
Test CI / build (push) Successful in 28s
issue #
- DTO 패키지 레지스트리 전환 중
2025-12-16 17:26:58 +09:00

79 lines
2.1 KiB
TypeScript

import { BaseNetwork } from "./BaseNetwork";
import { HttpApiUrl, SchedulerDTO as DTO } from "@baekyangdan/core-utils";
const AccountApi = HttpApiUrl.Account;
export class AccountNetwork extends BaseNetwork {
private baseUrl = AccountApi.base;
async checkDuplication(data: DTO.CheckDuplicationRequest) {
const { type, value } = data;
return await this.get<DTO.CheckDuplicationResponse>(
`${this.baseUrl}${AccountApi.checkDuplication}?type=${type}&value=${value}`
, {
authPass: true
}
);
}
async sendVerificationCode(data: DTO.SendEmailVerificationCodeRequest) {
return await this.post<DTO.SendEmailVerificationCodeResponse>(
`${this.baseUrl}${AccountApi.sendEmailVerificationCode}`
, data
, {
authPass: true
}
);
}
async verifyCode(data: DTO.VerifyEmailVerificationCodeRequest) {
return await this.post<DTO.VerifyEmailVerificationCodeResponse>(
`${this.baseUrl}${AccountApi.verifyEmailVerificationCode}`
, data
, {
authPass: true
}
);
}
async signup(data: DTO.SignupRequest) {
return await this.post<DTO.SignupResponse>(
`${this.baseUrl}${AccountApi.signup}`
, data
, {
authPass: true
}
);
}
async login(data: DTO.LoginRequest) {
return await this.post<DTO.LoginResponse>(
`${this.baseUrl}${AccountApi.login}`
, data
, {
authPass: true
}
);
}
async sendPasswordResetCode(data: DTO.SendPasswordResetCodeRequest) {
return await this.post<DTO.SendPasswordResetCodeResponse>(
`${this.baseUrl}${AccountApi.sendPasswordResetCode}`,
data
);
}
async verifyPasswordResetCode(data: DTO.VerifyPasswordResetCodeRequest) {
return await this.post<DTO.VerifyPasswordResetCodeResponse>(
`${this.baseUrl}${AccountApi.verifyPasswordResetCode}`,
data
);
}
async resetPassword(data: DTO.ResetPasswordRequest) {
return await this.post<DTO.ResetPasswordResponse>(
`${this.baseUrl}${AccountApi.resetPassword}`,
data
);
}
}