- 로그인 화면 기능 로직 1차 구현 중
This commit is contained in:
41
src/network/AccountNetwork.ts
Normal file
41
src/network/AccountNetwork.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
import {
|
||||
CheckDuplicationRequest,
|
||||
SendVerificationCodeRequest,
|
||||
VerifyCodeRequest,
|
||||
SignupRequest,
|
||||
LoginRequest
|
||||
} from "@/data/request";
|
||||
import {
|
||||
CheckDuplicationResponse,
|
||||
SendVerificationCodeResponse,
|
||||
VerifyCodeResponse,
|
||||
SignupResponse,
|
||||
LoginResponse
|
||||
} 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.instance.get<CheckDuplicationResponse>(`${this.baseUrl}/check-duplication?type=${type}&value=${value}`);
|
||||
}
|
||||
|
||||
async sendVerificationCode(data: SendVerificationCodeRequest) {
|
||||
return await this.instance.post<SendVerificationCodeResponse>(this.baseUrl + "/send-verification-code", data);
|
||||
}
|
||||
|
||||
async verifyCode(data: VerifyCodeRequest) {
|
||||
return await this.instance.post<VerifyCodeResponse>(this.baseUrl + "/verify-code", data);
|
||||
}
|
||||
|
||||
async signup(data: SignupRequest) {
|
||||
return await this.instance.post<SignupResponse>(this.baseUrl + "/signup", data);
|
||||
}
|
||||
|
||||
async login(data: LoginRequest) {
|
||||
return await this.instance.post<LoginResponse>(this.baseUrl + "/login", data);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user