import { CheckDuplicationRequest, SendVerificationCodeRequest, VerifyCodeRequest, SignupRequest, LoginRequest, SendResetPasswordCodeRequest, VerifyResetPasswordCodeRequest, ResetPasswordRequest } from "@/data/request"; import { CheckDuplicationResponse, SendVerificationCodeResponse, VerifyCodeResponse, SignupResponse, LoginResponse, SendResetPasswordCodeResponse, VerifyResetPasswordCodeResponse, ResetPasswordResponse } from "@/data/response"; import { BaseNetwork } from "./BaseNetwork"; export class AccountNetwork extends BaseNetwork { private baseUrl = "/account"; async checkDuplication(data: CheckDuplicationRequest) { const { type, value } = data; return await this.get( `${this.baseUrl}/check-duplication?type=${type}&value=${value}` , { authPass: true } ); } async sendVerificationCode(data: SendVerificationCodeRequest) { return await this.post( this.baseUrl + "/send-verification-code" , data , { authPass: true } ); } async verifyCode(data: VerifyCodeRequest) { return await this.post( this.baseUrl + "/verify-code" , data , { authPass: true } ); } async signup(data: SignupRequest) { return await this.post( this.baseUrl + "/signup" , data , { authPass: true } ); } async login(data: LoginRequest) { return await this.post( this.baseUrl + "/login" , data , { authPass: true } ); } async sendResetPasswordCode(data: SendResetPasswordCodeRequest) { return await this.post( this.baseUrl + '/send-reset-password-code', data ); } async verifyResetPasswordCode(data: VerifyResetPasswordCodeRequest) { return await this.post( this.baseUrl + '/verify-reset-password-code', data ); } async resetPassword(data: ResetPasswordRequest) { return await this.post( this.baseUrl + '/reset-password', data ); } }