fix: resolve homepage 404 and add mock data for user portrait
Add landing page, fix type errors, mark dynamic API route, and refactor user portrait page. Co-authored-by: null <4804959+fnvtk@users.noreply.github.com>
This commit is contained in:
58
types/device.ts
Normal file
58
types/device.ts
Normal file
@@ -0,0 +1,58 @@
|
||||
export type DeviceStatus = "online" | "offline" | "unknown"
|
||||
|
||||
export interface Device {
|
||||
id: string
|
||||
name: string
|
||||
wechatId?: string
|
||||
group?: string
|
||||
tags?: string[]
|
||||
status: DeviceStatus
|
||||
lastSeen?: string
|
||||
}
|
||||
|
||||
export interface CreateDeviceParams {
|
||||
name: string
|
||||
wechatId?: string
|
||||
group?: string
|
||||
tags?: string[]
|
||||
}
|
||||
|
||||
export interface UpdateDeviceParams extends Partial<CreateDeviceParams> {
|
||||
id: string
|
||||
}
|
||||
|
||||
export interface QueryDeviceParams {
|
||||
keyword?: string
|
||||
tags?: string[]
|
||||
dateRange?: { start: string; end: string }
|
||||
page?: number
|
||||
pageSize?: number
|
||||
}
|
||||
|
||||
export interface DeviceStats {
|
||||
id: string
|
||||
tasksToday: number
|
||||
uptimePercent: number
|
||||
}
|
||||
|
||||
export interface DeviceTaskRecord {
|
||||
id: string
|
||||
deviceId: string
|
||||
type: string
|
||||
status: "success" | "failed"
|
||||
time: string
|
||||
}
|
||||
|
||||
export interface PaginatedResponse<T> {
|
||||
items: T[]
|
||||
total: number
|
||||
page: number
|
||||
pageSize: number
|
||||
totalPages: number
|
||||
}
|
||||
|
||||
export interface ApiResponse<T> {
|
||||
code: number
|
||||
message: string
|
||||
data: T | null
|
||||
}
|
||||
60
types/scenario.ts
Normal file
60
types/scenario.ts
Normal file
@@ -0,0 +1,60 @@
|
||||
export type ScenarioStatus = "draft" | "running" | "paused" | "completed"
|
||||
|
||||
export interface ScenarioBase {
|
||||
id: string
|
||||
name: string
|
||||
type: string
|
||||
status: ScenarioStatus
|
||||
creator: string
|
||||
createdAt: string
|
||||
updatedAt: string
|
||||
description?: string
|
||||
}
|
||||
|
||||
export interface CreateScenarioParams {
|
||||
name: string
|
||||
type: string
|
||||
description?: string
|
||||
}
|
||||
|
||||
export interface UpdateScenarioParams extends Partial<CreateScenarioParams> {
|
||||
id: string
|
||||
}
|
||||
|
||||
export interface QueryScenarioParams {
|
||||
type?: string
|
||||
status?: ScenarioStatus
|
||||
keyword?: string
|
||||
dateRange?: { start: string; end: string }
|
||||
page?: number
|
||||
pageSize?: number
|
||||
}
|
||||
|
||||
export interface ScenarioStats {
|
||||
id: string
|
||||
impressions: number
|
||||
clicks: number
|
||||
conversions: number
|
||||
}
|
||||
|
||||
export interface AcquisitionRecord {
|
||||
id: string
|
||||
scenarioId: string
|
||||
userId: string
|
||||
time: string
|
||||
channel: string
|
||||
}
|
||||
|
||||
export interface PaginatedResponse<T> {
|
||||
items: T[]
|
||||
total: number
|
||||
page: number
|
||||
pageSize: number
|
||||
totalPages: number
|
||||
}
|
||||
|
||||
export interface ApiResponse<T> {
|
||||
code: number
|
||||
message: string
|
||||
data: T | null
|
||||
}
|
||||
Reference in New Issue
Block a user