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"` } // entryHeatPayload 是批量设置批次的请求体:heat 为 null / 缺省表示清除批次(未分批)。 type entryHeatPayload struct { EntryIDs []int64 `json:"entryIds"` Heat *int64 `json:"heat"` 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"` } // displayCommandInput 是大屏控制指令的请求体。 type displayCommandInput struct { Action string `json:"action"` Payload any `json:"payload"` // Targets 是要定向控制的大屏实例 id(GET /api/display/instances 的 id); // 留空表示广播给所有大屏——公告这类全屏指令走的就是广播。 Targets []string `json:"targets"` 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"` // FontTitle / FontBody 是字体 id;null 表示不改动(清空要传空串)。 FontTitle *string `json:"fontTitle"` FontBody *string `json:"fontBody"` // LiveEvents 是「实时赛况」人工指定的当前项目 id(最多 2 个)。 // nil 表示不改动;传 [] 表示清空人工指定。 LiveEvents *[]int64 `json:"liveEvents"` // LiveSource 是当前项目的判定方式(manual / auto);nil 表示不改动。 LiveSource *string `json:"liveSource"` } type settingsStandingsPatch struct { IndividualToTeamWeight *float64 `json:"individualToTeamWeight"` RankingMode *string `json:"rankingMode"` ShowIndividualBoard *bool `json:"showIndividualBoard"` ShowIndividualMedals *bool `json:"showIndividualMedals"` } type categoriesPayload struct { Categories []categoryDTO `json:"categories"` } type channelsPayload struct { Channels []channelDTO `json:"channels"` } // ---------- 用户管理 ---------- type createUserInput struct { Username string `json:"username"` DisplayName string `json:"displayName"` Role string `json:"role"` Password string `json:"password"` RequestID string `json:"requestId"` } // updateUserInput 只带需要改的字段:nil 表示保持原值。 type updateUserInput struct { DisplayName *string `json:"displayName"` Role *string `json:"role"` Active *bool `json:"active"` RequestID string `json:"requestId"` } // resetUserPasswordInput 的 password 留空时由服务端随机生成。 type resetUserPasswordInput struct { Password string `json:"password"` RequestID string `json:"requestId"` }