interface AuthedRequest { token?: string user_id?: number } interface BaseResponse { ret: number msg: string data: T } // TODO: PagedData schema interface PagedData { } interface UserSchema { id: number username: string nickname: string avatar: string sex: 0 | 1 | 2 // 0: 未知, 1: 男, 2: 女 email: string mobile: string auth_code: 0 | 1 | 2 // 0: Banned, 1: User, 2: Operator } // Common request and response schemas namespace req { namespace user { /** * @description 用户登录 * @param username 用户名或手机号 * @param password 密码 */ interface Login { username: string password: string } interface SmsLogin { mobile: string } interface SmsLoginVerify { mobile: string sms_code: string } } } namespace resp { namespace user { interface CheckSession { is_login: boolean } interface Login { is_login: boolean token?: string user_id?: number } interface Profile { profile: UserSchema } interface SmsLogin { message: string } interface SmsLoginVerify { token: string person_id: number } } } // Specific modals namespace HunYuan { type Resolution = '768:768' | '768:1024' | '1024:768' namespace Text2Img { interface req { device_id: string prompt: string negative_prompt: string styles: number resolution: string } interface resp { data_id: string | number request_id: string request_image: string } } namespace Img2Text { } }