Skip to content

Commit

Permalink
Score.Details as json.RawMessage
Browse files Browse the repository at this point in the history
傻逼洛谷 API,空的比赛分数映射给我返回一个 []
  • Loading branch information
wxh06 committed Nov 8, 2023
1 parent 2880147 commit 526d3c9
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions pkg/luogu/response.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package luogu

import "encoding/json"

// https://github.com/0f-0b/luogu-api-docs/blob/main/luogu-api.d.ts

type DataResponse[T any] struct {
Expand Down Expand Up @@ -111,14 +113,16 @@ type ContestData[T map[string]any] struct {
UserElo struct{} `json:"userElo"`
}

type ScoreDetails map[string]struct {
Score int `json:"score"`
RunningTime int `json:"runningTime"`
}

type Score struct {
Details map[string]struct {
Score int `json:"score"`
RunningTime int `json:"runningTime"`
} `json:"details"`
User UserSummary `json:"user"`
Score int `json:"score"`
RunningTime int `json:"runningTime"`
Details json.RawMessage `json:"details"`
User UserSummary `json:"user"`
Score int `json:"score"`
RunningTime int `json:"runningTime"`
}

type GetScoreboardResponse struct {
Expand Down

0 comments on commit 526d3c9

Please sign in to comment.