initial: add login

This commit is contained in:
Tran Anh Tuan
2025-10-29 17:47:45 +07:00
parent 45dc7d1ff8
commit 79959a3050
19 changed files with 864 additions and 67 deletions

View File

@@ -0,0 +1,7 @@
import { api } from "@/config";
import { API_PATH_LOGIN } from "@/constants";
export async function login(body: Model.LoginRequestBody) {
console.log("Login request body:", body);
return api.post<Model.LoginResponse>(API_PATH_LOGIN, body);
}

3
controller/index.ts Normal file
View File

@@ -0,0 +1,3 @@
import * as AuthController from "./AuthController";
export { AuthController };

9
controller/typings.d.ts vendored Normal file
View File

@@ -0,0 +1,9 @@
declare namespace Model {
interface LoginRequestBody {
username: string;
password: string;
}
interface LoginResponse {
token?: string;
}
}