- M3 认证/权限/审计/限流 + 全部 REST 接口 - M4 管理面板(MIUIx + 成绩录入/积分榜下钻/大屏控制) - M5a 大屏页面(六页 + 明细覆盖层 + 缩放适配) - M6 WebSocket 实时同步中心 - M7 xlsx 导出 + 赛事包 zip + 备份 - 规则包 YAML 导入导出(差异预览) - 字体 vendor 子集化(4 套 x2 字重) - 集成:realtime/export/rules 接入 main+httpapi;backup 子命令 - 修复:中间件包装 ResponseWriter 丢失 Hijacker,导致 WS 握手 501
109 lines
3.1 KiB
Go
109 lines
3.1 KiB
Go
package httpapi
|
|
|
|
// 本文件是各写接口的请求体契约;字段名与 web/src/shared/types.ts 对齐。
|
|
|
|
type loginInput struct {
|
|
Username string `json:"username"`
|
|
Password string `json:"password"`
|
|
RequestID string `json:"requestId"`
|
|
}
|
|
|
|
type saveDraftPayload struct {
|
|
EventID int64 `json:"eventId"`
|
|
CategoryID *int64 `json:"categoryId"`
|
|
Results []draftResultInput `json:"results"`
|
|
RequestID string `json:"requestId"`
|
|
}
|
|
|
|
type draftResultInput struct {
|
|
EntryID int64 `json:"entryId"`
|
|
Rank *int `json:"rank"`
|
|
ResultText *string `json:"resultText"`
|
|
ResultValue *float64 `json:"resultValue"`
|
|
Unit *string `json:"unit"`
|
|
IsTie bool `json:"isTie"`
|
|
Status string `json:"status"`
|
|
PointsOverride *float64 `json:"pointsOverride"`
|
|
Note *string `json:"note"`
|
|
}
|
|
|
|
type publishPayload struct {
|
|
EventID int64 `json:"eventId"`
|
|
CategoryID *int64 `json:"categoryId"`
|
|
RequestID string `json:"requestId"`
|
|
}
|
|
|
|
type voidResultPayload struct {
|
|
Reason string `json:"reason"`
|
|
RequestID string `json:"requestId"`
|
|
}
|
|
|
|
type adjustmentInput struct {
|
|
TeamID int64 `json:"teamId"`
|
|
Delta float64 `json:"delta"`
|
|
Category string `json:"category"`
|
|
Reason string `json:"reason"`
|
|
EventID *int64 `json:"eventId"`
|
|
RequestID string `json:"requestId"`
|
|
}
|
|
|
|
type recordBreakInput struct {
|
|
EventID int64 `json:"eventId"`
|
|
EntryID int64 `json:"entryId"`
|
|
Level string `json:"level"`
|
|
ResultValue float64 `json:"resultValue"`
|
|
ResultText string `json:"resultText"`
|
|
RequestID string `json:"requestId"`
|
|
}
|
|
|
|
type displayCommandInput struct {
|
|
Action string `json:"action"`
|
|
Payload any `json:"payload"`
|
|
RequestID string `json:"requestId"`
|
|
}
|
|
|
|
type voidAdjustmentPayload struct {
|
|
Reason string `json:"reason"`
|
|
RequestID string `json:"requestId"`
|
|
}
|
|
|
|
type settingsPatch struct {
|
|
Event *settingsEventPatch `json:"event"`
|
|
Display *settingsDisplayPatch `json:"display"`
|
|
Standings *settingsStandingsPatch `json:"standings"`
|
|
DefaultProfileID *int64 `json:"defaultProfileId"`
|
|
RequireApproval *bool `json:"requireApproval"`
|
|
RequestID string `json:"requestId"`
|
|
}
|
|
|
|
type settingsEventPatch struct {
|
|
Name *string `json:"name"`
|
|
Subtitle *string `json:"subtitle"`
|
|
Host *string `json:"host"`
|
|
LogoPath *string `json:"logoPath"`
|
|
PrimaryColor *string `json:"primaryColor"`
|
|
}
|
|
|
|
type settingsDisplayPatch struct {
|
|
Background *string `json:"background"`
|
|
Logo *string `json:"logo"`
|
|
Title *string `json:"title"`
|
|
Subtitle *string `json:"subtitle"`
|
|
PrimaryColor *string `json:"primaryColor"`
|
|
RotateSeconds *float64 `json:"rotateSeconds"`
|
|
}
|
|
|
|
type settingsStandingsPatch struct {
|
|
IndividualToTeamWeight *float64 `json:"individualToTeamWeight"`
|
|
RankingMode *string `json:"rankingMode"`
|
|
ShowIndividualBoard *bool `json:"showIndividualBoard"`
|
|
}
|
|
|
|
type categoriesPayload struct {
|
|
Categories []categoryDTO `json:"categories"`
|
|
}
|
|
|
|
type channelsPayload struct {
|
|
Channels []channelDTO `json:"channels"`
|
|
}
|