lrj
7 小时以前 f04f35b562760afbac0c477357e2a29f77aec3b9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# 用户相关的GraphQL Schema定义
 
# 用户档案响应类型
type UserProfile {
    id: ID!
    name: String!
    avatar: String
    phone: String
    email: String
    school: String
    major: String
    grade: String
    roles: [String!]!
    createdAt: String
    # 角色相关信息
    employee: EmployeeInfo
    judge: JudgeInfo
    player: PlayerInfo
}
 
# 用户统计数据类型
type UserStats {
    totalRegistrations: Int!
    ongoingActivities: Int!
    completedActivities: Int!
    awards: Int!
}
 
# 用户报名记录类型
type UserRegistration {
    id: ID!
    activity: ActivityInfo!
    status: String!
    registrationTime: String!
}
 
# 活动信息类型
type ActivityInfo {
    id: ID!
    title: String!
    coverImage: MediaInfo
    startTime: String!
    status: String!
}
 
# 媒体信息类型
type MediaInfo {
    id: ID!
    name: String!
    path: String!
    fullUrl: String!
    fullThumbUrl: String!
    mediaType: String!
}
 
# 扩展查询类型
extend type Query {
    # 获取当前用户档案
    userProfile: UserProfile
    
    # 获取用户统计数据
    userStats: UserStats
    
    # 获取我的报名记录
    myRegistrations(limit: Int): [UserRegistration!]!
}