// ---- Generic API result wrapper ---- export interface ApiResult { code: number message: string data: T | null } // ---- Auth ---- export interface UserLoginDto { username: string password: string } export interface LoginVo { token: string username: string role: string } export type ApiResultLoginVo = ApiResult // ---- Book ---- export interface Book { id: number | null name: string author: string stock: number } export type ApiResultBook = ApiResult export type ApiResultListBook = ApiResult export interface BookAddDto { name: string author: string stock: number } export interface BookUpdateDto { name: string author: string } // ---- Borrow / MyBorrow ---- export interface BookBorrowVo { id: number name: string author: string } export interface MyBorrowVo { id: number bookBorrowVo: BookBorrowVo borrowTime: string returnTime: string | null status: string } export type ApiResultMyBorrowVo = ApiResult export type ApiResultListMyBorrowVo = ApiResult // ---- Admin Borrow ---- export interface UserBorrowVo { id: number username: string role: string } export interface BorrowInfoVo { id: number bookBorrowVo: BookBorrowVo userBorrowVo: UserBorrowVo borrowTime: string returnTime: string | null status: string } export type ApiResultBorrowInfoVo = ApiResult export type ApiResultListBorrowInfoVo = ApiResult // ---- Utils ---- export type ApiResultString = ApiResult