Files
Scoreboard/server/internal/dto/results.go
T
AskaEth 8c74a82da4 feat(display): 分项成绩与个人榜也显示单位 logo(个人榜在姓名前)
- 服务端补下发:dto.EventResultRow 与 athleteStandingDTO 各加 logoPath,
  分别取「该行单位」与「该运动员所属单位」的 teams.logo_path;空串统一收敛为 null
- 大屏抽出 TeamLogo.vue(1em / object-fit:contain / 加载失败保留占位、@load 复原),
  原先在积分榜与团体奖牌榜各写一遍的逻辑收敛成一份,四处复用
- 分项成绩页:单位列名字前显示 logo;个人积分榜:运动员姓名前显示其单位 logo
- guards/mock 同步解析与补字段;补 11 条测试(类型解析 + SFC 模板断言)

顺带修:管理端示例数据 athleteStandings 缺新必填字段导致的 vue-tsc 报错。

自检:服务端 11 包全绿;前端 vue-tsc + build、node --test 80/80。
2026-09-10 10:32:19 +08:00

33 lines
1.2 KiB
Go

package dto
// EventResultGroup 是 snapshot.latestResults 的一组「小项 + 组别」成绩,
// 与 web/src/shared/types.ts 的 EventResultGroup 对齐。
type EventResultGroup struct {
EventID int64 `json:"eventId"`
EventCode string `json:"eventCode"`
EventName string `json:"eventName"`
CategoryID int64 `json:"categoryId"`
CategoryName string `json:"categoryName"`
PublishedAt *string `json:"publishedAt"`
Rows []EventResultRow `json:"rows"`
}
// EventResultRow 是组内的一条成绩行;字段与 types.ts 的 EventResultRow 一一对应。
type EventResultRow struct {
EntryID int64 `json:"entryId"`
Rank *int `json:"rank"`
TeamID int64 `json:"teamId"`
TeamCode string `json:"teamCode"`
TeamName string `json:"teamName"`
ShortName *string `json:"shortName"`
LogoPath *string `json:"logoPath"`
AthleteID *int64 `json:"athleteId"`
AthleteName *string `json:"athleteName"`
MemberNames []string `json:"memberNames"`
ResultText string `json:"resultText"`
ResultValue *float64 `json:"resultValue"`
Unit string `json:"unit"`
IsTie bool `json:"isTie"`
Status string `json:"status"`
}