lrj
1 天以前 8337c34fcc761d07acaad796d10f3e12e9bbe2d1
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# 用户相关的GraphQL Schema定义
 
# 用户档案响应类型
type UserProfile {
    id: ID!
    name: String!
    avatar: String
    phone: String
    email: String
    school: String
    major: String
    grade: String
    gender: String
    birthday: 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!
}
 
# 用户项目类型
type UserProject {
    id: ID!
    projectName: String!
    activityName: String!
    status: String!
    statusText: String!
    createTime: String!
    submissionFiles: [SubmissionMediaResponse]
}
 
# 用户输入类型
input UserInput {
    name: String!
    avatar: String
    phone: String!
    gender: String!
    birthday: String
}
 
# 用户信息响应类型
type UserProfileInfo {
    id: ID!
    name: String!
    avatar: String
    phone: String!
    gender: String!
    birthday: String
    wxOpenId: String
    unionId: String
}
 
# 扩展查询类型
extend type Query {
    # 获取当前用户档案
    userProfile: UserProfile
    
    # 获取用户统计数据
    userStats: UserStats
    
    # 获取我的报名记录
    myRegistrations(limit: Int): [UserRegistration!]!
    
    # 获取我的项目列表
    myProjects: [UserProject!]!
}
 
# 扩展变更类型
extend type Mutation {
    # 保存用户信息
    saveUserInfo(input: UserInput!): UserProfileInfo!
}