Add level in /api/get_user

This commit is contained in:
Howl 2016-05-17 17:00:09 +02:00
parent 32b9d1e2d5
commit a16c196799
1 changed files with 2 additions and 0 deletions

View File

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