216 lines
4.1 KiB
TypeScript
216 lines
4.1 KiB
TypeScript
export type UserRole = "consumer" | "player" | "owner"
|
|
export type VerificationStatus = "pending" | "approved" | "rejected"
|
|
|
|
export interface User {
|
|
id: string
|
|
username: string
|
|
nickname: string
|
|
avatar: string
|
|
role: UserRole
|
|
verifiedRoles?: UserRole[]
|
|
verificationStatus?: Partial<Record<UserRole, VerificationStatus>>
|
|
phone?: string
|
|
bio?: string
|
|
createdAt: string
|
|
}
|
|
|
|
export interface Game {
|
|
id: string
|
|
name: string
|
|
icon: string
|
|
category: "MOBA" | "FPS" | "动作" | "RPG"
|
|
}
|
|
|
|
export interface PlayerService {
|
|
id: string
|
|
playerId: string
|
|
gameId: string
|
|
gameName: string
|
|
title: string
|
|
description: string
|
|
price: number
|
|
unit: "局" | "星" | "次"
|
|
rankRange?: string
|
|
availability: string[]
|
|
}
|
|
|
|
export interface Player {
|
|
id: string
|
|
user: User
|
|
rating: number
|
|
totalOrders: number
|
|
completionRate: number
|
|
status: "available" | "busy" | "offline"
|
|
games: string[]
|
|
services: PlayerService[]
|
|
shopId?: string
|
|
shopName?: string
|
|
tags: string[]
|
|
}
|
|
|
|
export interface Shop {
|
|
id: string
|
|
owner: User
|
|
name: string
|
|
banner?: string
|
|
description: string
|
|
rating: number
|
|
totalOrders: number
|
|
playerCount: number
|
|
commissionType: "fixed" | "percentage"
|
|
commissionValue: number
|
|
allowMultiShop: boolean
|
|
allowIndependentOrders: boolean
|
|
dispatchMode: "manual" | "auto"
|
|
announcements: string[]
|
|
templateConfig: ShopTemplateConfig
|
|
}
|
|
|
|
export interface ShopTemplateConfig {
|
|
sections: ShopSection[]
|
|
}
|
|
|
|
export interface ShopSection {
|
|
type: "banner" | "intro" | "services" | "players" | "announcements" | "reviews"
|
|
enabled: boolean
|
|
order: number
|
|
}
|
|
|
|
export type OrderStatus =
|
|
| "pending_payment"
|
|
| "pending_accept"
|
|
| "in_progress"
|
|
| "pending_close"
|
|
| "pending_review"
|
|
| "disputed"
|
|
| "completed"
|
|
| "cancelled"
|
|
|
|
export interface Order {
|
|
id: string
|
|
consumerId: string
|
|
consumerName: string
|
|
playerId: string
|
|
playerName: string
|
|
shopId?: string
|
|
shopName?: string
|
|
service: PlayerService
|
|
status: OrderStatus
|
|
totalPrice: number
|
|
note?: string
|
|
createdAt: string
|
|
acceptedAt?: string
|
|
closedAt?: string
|
|
completedAt?: string
|
|
}
|
|
|
|
export interface Review {
|
|
id: string
|
|
orderId: string
|
|
fromUserId: string
|
|
fromUserName: string
|
|
fromUserAvatar: string
|
|
toUserId: string
|
|
rating: number
|
|
content?: string
|
|
sealed: boolean
|
|
createdAt: string
|
|
}
|
|
|
|
export interface Dispute {
|
|
id: string
|
|
orderId: string
|
|
initiatorId: string
|
|
initiatorName: string
|
|
reason: string
|
|
evidence: string[]
|
|
status: "open" | "reviewing" | "resolved" | "appealed"
|
|
result?: "full_refund" | "full_payment" | "partial_refund"
|
|
createdAt: string
|
|
}
|
|
|
|
interface BaseChatSession {
|
|
id: string
|
|
participants: { id: string; name: string; avatar: string }[]
|
|
lastMessage?: string
|
|
lastMessageAt?: string
|
|
unreadCount: number
|
|
readonly: boolean
|
|
}
|
|
|
|
export interface OrderChatSession extends BaseChatSession {
|
|
type: "order"
|
|
orderId: string
|
|
}
|
|
|
|
export interface ConsultationChatSession extends BaseChatSession {
|
|
type: "consultation"
|
|
orderId?: never
|
|
}
|
|
|
|
export type ChatSession = OrderChatSession | ConsultationChatSession
|
|
|
|
export interface ChatMessage {
|
|
id: string
|
|
sessionId: string
|
|
senderId: string
|
|
senderName: string
|
|
senderAvatar: string
|
|
type: "text" | "image" | "system"
|
|
content: string
|
|
createdAt: string
|
|
}
|
|
|
|
export interface Post {
|
|
id: string
|
|
author: User
|
|
authorRole: UserRole
|
|
title: string
|
|
content: string
|
|
images: string[]
|
|
tags: string[]
|
|
linkedOrderId?: string
|
|
quotedPostId?: string
|
|
likeCount: number
|
|
commentCount: number
|
|
liked: boolean
|
|
pinned: boolean
|
|
createdAt: string
|
|
}
|
|
|
|
export interface Comment {
|
|
id: string
|
|
postId: string
|
|
author: User
|
|
content: string
|
|
likeCount: number
|
|
liked: boolean
|
|
createdAt: string
|
|
}
|
|
|
|
export interface Notification {
|
|
id: string
|
|
type: "order" | "community" | "system"
|
|
title: string
|
|
content: string
|
|
read: boolean
|
|
link?: string
|
|
createdAt: string
|
|
}
|
|
|
|
export interface WalletTransaction {
|
|
id: string
|
|
type: "topup" | "payment" | "income" | "withdrawal" | "refund"
|
|
amount: number
|
|
description: string
|
|
createdAt: string
|
|
}
|
|
|
|
export interface Favorite {
|
|
id: string
|
|
userId: string
|
|
targetType: "player" | "shop"
|
|
targetId: string
|
|
createdAt: string
|
|
}
|