fixed timestamp bug

This commit is contained in:
2026-09-06 22:32:43 +08:00
parent 60f1d942cd
commit 35f0ba6133

View File

@@ -12,6 +12,7 @@ import (
"os" "os"
"path/filepath" "path/filepath"
"slices" "slices"
"strconv"
"time" "time"
"github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2"
@@ -282,8 +283,8 @@ func get(c *fiber.Ctx) error {
if sbMap, ok := m["masterSeasonBasicMap"].(map[string]any); ok { if sbMap, ok := m["masterSeasonBasicMap"].(map[string]any); ok {
for _, v := range sbMap["entries"].(map[string]any) { for _, v := range sbMap["entries"].(map[string]any) {
s := v.(map[string]any) s := v.(map[string]any)
startAt := int64(s["startAt"].(float64)) startAt, _ := strconv.ParseInt(s["startAt"].(string), 10, 64)
endAt := int64(s["endAt"].(float64)) endAt, _ := strconv.ParseInt(s["endAt"].(string), 10, 64)
if startAt <= now && now < endAt { if startAt <= now && now < endAt {
seasonId = s["seasonId"] seasonId = s["seasonId"]
break break
@@ -482,8 +483,8 @@ func get(c *fiber.Ctx) error {
if entries, ok := deMap["entries"].([]any); ok { if entries, ok := deMap["entries"].([]any); ok {
for _, v := range entries { for _, v := range entries {
e := v.(map[string]any) e := v.(map[string]any)
startAt := int64(e["startAt"].(float64)) startAt, _ := strconv.ParseInt(e["startAt"].(string), 10, 64)
endAt := int64(e["endAt"].(float64)) endAt, _ := strconv.ParseInt(e["endAt"].(string), 10, 64)
if startAt <= now && now >= endAt { if startAt <= now && now >= endAt {
id := fmt.Sprintf("%v", e["decoEffectId"]) id := fmt.Sprintf("%v", e["decoEffectId"])
decoEffectEntries[id] = map[string]any{"userId": userid, "decoEffectId": e["decoEffectId"]} decoEffectEntries[id] = map[string]any{"userId": userid, "decoEffectId": e["decoEffectId"]}