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( `${this.baseUrl}${AccountApi.checkDuplication}?type=${type}&value=${value}` , { authPass: true } ); } async sendVerificationCode(data: DTO.SendEmailVerificationCodeRequest) { return await this.post( `${this.baseUrl}${AccountApi.sendEmailVerificationCode}` , data , { authPass: true } ); } async verifyCode(data: DTO.VerifyEmailVerificationCodeRequest) { return await this.post( `${this.baseUrl}${AccountApi.verifyEmailVerificationCode}` , data , { authPass: true } ); } async signup(data: DTO.SignupRequest) { return await this.post( `${this.baseUrl}${AccountApi.signup}` , data , { authPass: true } ); } async login(data: DTO.LoginRequest) { return await this.post( `${this.baseUrl}${AccountApi.login}` , data , { authPass: true } ); } async sendPasswordResetCode(data: DTO.SendPasswordResetCodeRequest) { return await this.post( `${this.baseUrl}${AccountApi.sendPasswordResetCode}`, data ); } async verifyPasswordResetCode(data: DTO.VerifyPasswordResetCodeRequest) { return await this.post( `${this.baseUrl}${AccountApi.verifyPasswordResetCode}`, data ); } async resetPassword(data: DTO.ResetPasswordRequest) { return await this.post( `${this.baseUrl}${AccountApi.resetPassword}`, data ); } }