| | |
| | | # 比赛管理 GraphQL Schema |
| | | extend type Query { |
| | | activity(id: ID!): Activity |
| | | activities(page: Int!, size: Int!, name: String): PageResponse |
| | | allActivities: [Activity] |
| | | allActivityStages: [Activity] |
| | | activityStages(activityId: ID!): [Activity] |
| | | ongoingActivities: [Activity] |
| | | # 微信端获取活动列表 |
| | | getActivities: [Activity] |
| | | # 获取主办方统计数据 |
| | | organizerStats: OrganizerStatsResponse |
| | | } |
| | | |
| | | # 比赛响应类型 |
| | | extend type Mutation { |
| | | saveActivity(input: ActivityInput!): Activity |
| | | deleteActivity(id: ID!): Boolean |
| | | } |
| | | |
| | | type Activity { |
| | | id: ID! |
| | | pid: ID! |
| | | path: String! |
| | | name: String! |
| | | id: ID |
| | | pid: ID |
| | | path: String |
| | | name: String |
| | | description: String |
| | | signupDeadline: String! |
| | | signupDeadline: String |
| | | matchTime: String |
| | | address: String |
| | | ratingSchemeId: ID! |
| | | ratingSchemeId: ID |
| | | ratingScheme: RatingSchemeResponse |
| | | playerCount: Int |
| | | playerMax: Int |
| | | state: Int! |
| | | sortOrder: Int |
| | | createTime: String! |
| | | updateTime: String! |
| | | |
| | | # 关联数据 |
| | | ratingScheme: RatingScheme |
| | | stages: [Activity!] |
| | | parent: Activity |
| | | judges: [ActivityJudgeResponse!]! |
| | | |
| | | # 媒体文件 |
| | | state: Int |
| | | stateName: String |
| | | createTime: String |
| | | updateTime: String |
| | | coverImage: MediaResponse |
| | | images: [MediaResponse!]! |
| | | videos: [MediaResponse!]! |
| | | |
| | | # 统计数据 |
| | | playerCount: Int! |
| | | stateName: String! |
| | | images: [MediaResponse] |
| | | videos: [MediaResponse] |
| | | stages: [Activity] |
| | | parent: Activity |
| | | judges: [ActivityJudgeResponse] |
| | | } |
| | | |
| | | # 比赛分页响应 |
| | | type ActivityPageResponse { |
| | | content: [Activity!]! |
| | | totalElements: Int! |
| | | page: Int! |
| | | size: Int! |
| | | type PageResponse { |
| | | content: [Activity] |
| | | page: Int |
| | | size: Int |
| | | total: Int |
| | | totalPages: Int |
| | | totalElements: Int |
| | | number: Int |
| | | first: Boolean |
| | | last: Boolean |
| | | } |
| | | |
| | | # 比赛评委响应类型 |
| | | type ActivityJudgeResponse { |
| | | id: ID! |
| | | name: String! |
| | | phone: String |
| | | description: String |
| | | stageIds: [ID!]! |
| | | } |
| | | |
| | | # 比赛输入类型 |
| | | input ActivityInput { |
| | | id: ID |
| | | pid: ID |
| | | name: String! |
| | | description: String |
| | | signupDeadline: String! |
| | | signupDeadline: String |
| | | matchTime: String |
| | | address: String |
| | | ratingSchemeId: ID! |
| | | ratingSchemeId: ID |
| | | playerMax: Int |
| | | sortOrder: Int |
| | | state: Int |
| | | stages: [ActivityStageInput!] |
| | | judges: [ActivityJudgeInput!] |
| | | stages: [ActivityStageInput] |
| | | judges: [ActivityJudgeInput] |
| | | } |
| | | |
| | | # 比赛阶段输入类型 |
| | | input ActivityStageInput { |
| | | id: ID |
| | | name: String! |
| | |
| | | address: String |
| | | ratingSchemeId: ID |
| | | playerMax: Int |
| | | state: Int |
| | | sortOrder: Int |
| | | state: Int |
| | | } |
| | | |
| | | # 比赛评委输入类型 |
| | | input ActivityJudgeInput { |
| | | judgeId: ID! |
| | | judgeName: String! |
| | | stageIds: [ID!] |
| | | judgeName: String |
| | | stageIds: [ID] |
| | | } |
| | | |
| | | # 扩展查询 |
| | | extend type Query { |
| | | # 分页查询比赛列表 |
| | | activities(page: Int!, size: Int!, name: String): ActivityPageResponse! |
| | | |
| | | # 获取比赛详情 |
| | | activity(id: ID!): Activity |
| | | |
| | | # 获取所有比赛(用于下拉选择) |
| | | allActivities: [Activity!]! |
| | | |
| | | # 获取比赛的所有阶段 |
| | | activityStages(activityId: ID!): [Activity!]! |
| | | |
| | | # 获取进行中的比赛 |
| | | ongoingActivities: [Activity!]! |
| | | type ActivityJudgeResponse { |
| | | id: ID |
| | | name: String |
| | | phone: String |
| | | description: String |
| | | stageIds: [ID] |
| | | } |
| | | |
| | | # 扩展变更 |
| | | extend type Mutation { |
| | | # 保存比赛(新增或编辑) |
| | | saveActivity(input: ActivityInput!): Activity! |
| | | |
| | | # 删除比赛 |
| | | deleteActivity(id: ID!): Boolean! |
| | | # 活动详情和状态响应类型(微信端使用) |
| | | type ActivityDetailAndStatusResponse { |
| | | activity: Activity |
| | | registrationStatus: String |
| | | canRegister: Boolean |
| | | playerRegistration: ActivityPlayer |
| | | } |
| | | |
| | | # 主办方统计响应类型 |
| | | type OrganizerStatsResponse { |
| | | activeActivities: Int! |
| | | totalParticipants: Int! |
| | | totalActivities: Int! |
| | | } |