Add level in /api/get_user

This commit is contained in:
Howl 2016-05-17 17:00:09 +02:00
parent 32b9d1e2d5
commit a16c196799

View File

@ -5,6 +5,7 @@ import (
"database/sql" "database/sql"
"fmt" "fmt"
"git.zxq.co/ripple/ocl"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/thehowl/go-osuapi" "github.com/thehowl/go-osuapi"
) )
@ -46,6 +47,7 @@ func GetUser(c *gin.Context, db *sql.DB) {
if !display { if !display {
user.Country = "XX" user.Country = "XX"
} }
user.Level = ocl.GetLevelPrecise(user.TotalScore)
c.JSON(200, []osuapi.User{user}) c.JSON(200, []osuapi.User{user})
} }