# 比赛管理 GraphQL Schema
|
|
# 比赛响应类型
|
type Activity {
|
id: ID!
|
pid: ID!
|
path: String!
|
name: String!
|
description: String
|
signupDeadline: String!
|
matchTime: String
|
address: String
|
ratingSchemeId: ID!
|
playerMax: Int
|
state: Int!
|
createTime: String!
|
updateTime: String!
|
|
# 关联数据
|
ratingScheme: RatingScheme
|
stages: [Activity!]
|
parent: Activity
|
|
# 统计数据
|
playerCount: Int!
|
stateName: String!
|
}
|
|
# 比赛分页响应
|
type ActivityPageResponse {
|
content: [Activity!]!
|
totalElements: Int!
|
page: Int!
|
size: Int!
|
}
|
|
# 比赛输入类型
|
input ActivityInput {
|
id: ID
|
pid: ID
|
name: String!
|
description: String
|
signupDeadline: String!
|
matchTime: String
|
address: String
|
ratingSchemeId: ID!
|
playerMax: Int
|
state: Int
|
stages: [ActivityStageInput!]
|
judges: [ActivityJudgeInput!]
|
}
|
|
# 比赛阶段输入类型
|
input ActivityStageInput {
|
id: ID
|
name: String!
|
description: String
|
matchTime: String
|
address: String
|
ratingSchemeId: ID
|
playerMax: Int
|
state: Int
|
}
|
|
# 比赛评委输入类型
|
input ActivityJudgeInput {
|
judgeId: ID!
|
judgeName: String!
|
stageIds: [ID!]
|
}
|
|
# 扩展查询
|
extend type Query {
|
# 分页查询比赛列表
|
activities(page: Int!, size: Int!, name: String): ActivityPageResponse!
|
|
# 获取比赛详情
|
activity(id: ID!): Activity
|
|
# 获取所有比赛(用于下拉选择)
|
allActivities: [Activity!]!
|
|
# 获取比赛的所有阶段
|
activityStages(competitionId: ID!): [Activity!]!
|
|
# 获取进行中的比赛
|
ongoingActivities: [Activity!]!
|
}
|
|
# 扩展变更
|
extend type Mutation {
|
# 保存比赛(新增或编辑)
|
saveActivity(input: ActivityInput!): Activity!
|
|
# 删除比赛
|
deleteActivity(id: ID!): Boolean!
|
}
|