scores 主键改用 UUID v7

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
fish
2026-05-03 15:02:08 +08:00
parent 220f4acc45
commit 961ab8224e
4 changed files with 5 additions and 10 deletions

View File

@@ -32,12 +32,7 @@ func (d *Deps) ListScores(w http.ResponseWriter, r *http.Request) {
}
func (d *Deps) GetScore(w http.ResponseWriter, r *http.Request) {
idStr := chi.URLParam(r, "id")
id, err := strconv.ParseInt(idStr, 10, 64)
if err != nil {
writeErr(w, http.StatusBadRequest, "invalid id")
return
}
id := chi.URLParam(r, "id")
row, err := d.Futures.GetScore(id)
if err != nil {
writeErr(w, http.StatusNotFound, err.Error())