175 lines
3.1 KiB
TypeScript
175 lines
3.1 KiB
TypeScript
/**
|
|
* namespace: Api
|
|
*
|
|
* 所有接口相关类型定义
|
|
*/
|
|
declare namespace Api {
|
|
/** 基础类型 */
|
|
namespace Http {
|
|
/** 基础响应 */
|
|
interface BaseResponse<T = any> {
|
|
// 状态码
|
|
code: number
|
|
// 消息
|
|
msg: string
|
|
// 数据
|
|
data: T
|
|
}
|
|
}
|
|
|
|
/** 通用类型 */
|
|
namespace Common {
|
|
/** 分页参数 */
|
|
interface PaginatingParams {
|
|
/** 当前页码 */
|
|
current: number
|
|
/** 每页条数 */
|
|
size: number
|
|
}
|
|
|
|
/** 启用状态 */
|
|
type EnableStatus = '1' | '2'
|
|
}
|
|
|
|
/** 认证类型 */
|
|
namespace Auth {
|
|
/** 登录参数 */
|
|
interface LoginParams {
|
|
account?: string
|
|
password?: string
|
|
feishu_code?: string
|
|
}
|
|
|
|
/** 登录响应 */
|
|
interface LoginResponse {
|
|
data: any
|
|
}
|
|
/** 登录响应 */
|
|
interface registerResponse {
|
|
code: any
|
|
}
|
|
/** 授权响应 */
|
|
interface Authfeishuscope {
|
|
auth_url: any
|
|
}
|
|
}
|
|
|
|
/** 用户类型 */
|
|
namespace User {
|
|
/** 用户信息 */
|
|
interface UserInfo {
|
|
user: any
|
|
userId: number
|
|
userName: string
|
|
roles: string[]
|
|
buttons: string[]
|
|
avatar?: string
|
|
email?: string
|
|
phone?: string
|
|
menu?: any
|
|
}
|
|
|
|
/** 用户列表数据 */
|
|
interface UserListData {
|
|
records: UserInfo[]
|
|
current: number
|
|
size: number
|
|
total: number
|
|
}
|
|
}
|
|
/** 品牌类型 */
|
|
namespace Brand {
|
|
/** 品牌信息 */
|
|
interface BrandInfo {
|
|
data: never[]
|
|
id: number
|
|
name: string
|
|
}
|
|
|
|
/** 品牌列表数据 */
|
|
interface BrandListData {
|
|
records: UserInfo[]
|
|
current: number
|
|
size: number
|
|
total: number
|
|
}
|
|
}
|
|
/** 工单 */
|
|
namespace Work {
|
|
interface WorkInfo {
|
|
attachments: never[]
|
|
id: number
|
|
code: string
|
|
categorie_id: string
|
|
status: number
|
|
content: number
|
|
}
|
|
|
|
/** 品牌列表数据 */
|
|
interface WorkListData {
|
|
data: WorkInfo[]
|
|
current: number
|
|
size: number
|
|
total: number
|
|
}
|
|
/** 添加参数 */
|
|
interface AddParams {
|
|
categorie_id: any
|
|
content: any
|
|
attachment:any
|
|
}
|
|
interface AddResponse {
|
|
code: string
|
|
message: string
|
|
}
|
|
/** 修改状态参数 */
|
|
interface StatusParams {
|
|
id: any
|
|
msg: any
|
|
status:any
|
|
}
|
|
//分类
|
|
interface CategorieInfo {
|
|
id: number
|
|
name: string
|
|
}
|
|
interface CategorieListData {
|
|
data: CategorieInfo[]
|
|
current: number
|
|
size: number
|
|
total: number
|
|
}
|
|
}
|
|
/** 角色 */
|
|
namespace Role {
|
|
/** 品牌信息 */
|
|
interface RoleInfo {
|
|
data: never[]
|
|
id: number
|
|
name: string
|
|
}
|
|
|
|
/** 品牌列表数据 */
|
|
interface RoleListData {
|
|
records: RoleInfo[]
|
|
current: number
|
|
size: number
|
|
total: number
|
|
}
|
|
}
|
|
namespace Crm {
|
|
/** 信息 */
|
|
interface CrmInfo {
|
|
data: never[]
|
|
}
|
|
|
|
/** 列表数据 */
|
|
interface CrmListData {
|
|
data: CrmInfo[]
|
|
current: number
|
|
size: number
|
|
total: number
|
|
}
|
|
}
|
|
}
|