import { CallApiOptions, EasyApiFunc } from "@rockyf/easy-api" export declare namespace testApi3 { interface User { /**用户ID*/ id: number /**用户名*/ name: string /**邮箱地址*/ email: string /**头像URL*/ avatar?: string status?: UserStatus /**创建时间*/ createdAt?: string /**更新时间*/ updatedAt?: string } interface CreateUserRequest { /**用户名*/ name: string /**邮箱地址*/ email: string /**头像URL*/ avatar?: string } interface UpdateUserRequest { /**用户名*/ name?: string /**邮箱地址*/ email?: string /**头像URL*/ avatar?: string status?: UserStatus } /**用户状态*/ type UserStatus = "active" | "inactive" | "banned" interface Post { /**文章ID*/ id: number /**文章标题*/ title: string /**文章内容*/ content: string /**作者ID*/ authorId: number author?: User /**标签列表*/ tags?: string[] /**发布时间*/ publishedAt?: string } interface users_get_req { /**页码*/ page?: number /**每页大小*/ size?: number } interface users_get_resp { code?: number message?: string data?: User[] } interface users_post_resp { code?: number message?: string data?: User } interface users_getById_path_req { /**用户ID*/ id: number } interface users_getById_resp { code?: number message?: string data?: User } interface users_putById_path_req { /**用户ID*/ id: number } interface users_putById_resp { code?: number message?: string data?: User } interface users_deleteById_path_req { /**用户ID*/ id: number } interface users_deleteById_resp { code?: number message?: string } interface posts_get_resp { code?: number message?: string data?: Post[] } type IApis = { /**User*/ users: { /** * 获取用户列表 * @desc GET /users */ get: ((params?: users_get_req, options?: CallApiOptions) => Promise) & EasyApiFunc /** * 创建用户 * @desc POST /users */ post: ((params: CreateUserRequest, options?: CallApiOptions) => Promise) & EasyApiFunc /** * 获取用户详情 * @desc GET /users/{id} */ getById: ((id: users_getById_path_req['id'], params?: any, options?: CallApiOptions) => Promise) & EasyApiFunc /** * 更新用户 * @desc PUT /users/{id} */ putById: ((id: users_putById_path_req['id'], params: UpdateUserRequest, options?: CallApiOptions) => Promise) & EasyApiFunc /** * 删除用户 * @desc DELETE /users/{id} */ deleteById: ((id: users_deleteById_path_req['id'], params?: any, options?: CallApiOptions) => Promise) & EasyApiFunc } /**Post*/ posts: { /** * 获取文章列表 * @desc GET /posts */ get: ((params?: any, options?: CallApiOptions) => Promise) & EasyApiFunc } } }