Files
honoka-chan/internal/handler/api/profile/profile.go
T
YumeMichi f6466989c6 Persist live status and migrate legacy live data
- Add user_live_status to store hi score, hi combo count, and clear count per chart
- Expand user_live_goal to persist achieved live_goal_reward_id entries instead of only coarse goal types
- Update live reward handling to refresh live status and sync newly achieved live goals on every clear
- Return live status and achieved goal ids from stored user data in /api/live/status
- Aggregate profile liveCnt from stored user_live_status instead of hardcoded values
- Load complete-rank thresholds from live info for goal evaluation
- Migrate legacy user_live_record data into user_live_status and backfill achievable live goals on startup

Signed-off-by: Sean Du <do4suki@gmail.com>
2026-06-06 16:25:06 +08:00

22 lines
438 B
Go

package profile
import (
"fmt"
"github.com/gin-gonic/gin"
)
func ProfileApi(ctx *gin.Context, action string, targetUserID int) (res any, err error) {
switch action {
case "cardRanking":
res, err = cardRanking()
case "liveCnt":
res, err = liveCnt(ctx, targetUserID)
case "profileInfo":
res, err = profileInfo(ctx, targetUserID)
default:
err = fmt.Errorf("unimplemented action: profile: %s", action)
}
return res, err
}