Use sqlx instead of sql. Rewrite of most clusterfucks incoming
This commit is contained in:
@@ -5,6 +5,8 @@ import (
|
||||
"database/sql"
|
||||
"fmt"
|
||||
|
||||
"github.com/jmoiron/sqlx"
|
||||
|
||||
"git.zxq.co/ripple/rippleapi/common"
|
||||
"git.zxq.co/ripple/schiavolib"
|
||||
"golang.org/x/crypto/bcrypt"
|
||||
@@ -204,7 +206,7 @@ func TokenFixPrivilegesGET(md common.MethodData) common.CodeMessager {
|
||||
return common.SimpleResponse(200, "Privilege fixing started!")
|
||||
}
|
||||
|
||||
func fixPrivileges(user int, db *sql.DB) {
|
||||
func fixPrivileges(user int, db *sqlx.DB) {
|
||||
var wc string
|
||||
var params = make([]interface{}, 0, 1)
|
||||
if user != 0 {
|
||||
|
@@ -8,26 +8,6 @@ import (
|
||||
"git.zxq.co/ripple/rippleapi/common"
|
||||
)
|
||||
|
||||
type score struct {
|
||||
ID int `json:"id"`
|
||||
BeatmapMD5 string `json:"beatmap_md5"`
|
||||
Score int64 `json:"score"`
|
||||
MaxCombo int `json:"max_combo"`
|
||||
FullCombo bool `json:"full_combo"`
|
||||
Mods int `json:"mods"`
|
||||
Count300 int `json:"count_300"`
|
||||
Count100 int `json:"count_100"`
|
||||
Count50 int `json:"count_50"`
|
||||
CountGeki int `json:"count_geki"`
|
||||
CountKatu int `json:"count_katu"`
|
||||
CountMiss int `json:"count_miss"`
|
||||
Time time.Time `json:"time"`
|
||||
PlayMode int `json:"play_mode"`
|
||||
Accuracy float64 `json:"accuracy"`
|
||||
PP float32 `json:"pp"`
|
||||
Completed int `json:"completed"`
|
||||
}
|
||||
|
||||
type userScore struct {
|
||||
score
|
||||
Beatmap beatmap `json:"beatmap"`
|
||||
|
Reference in New Issue
Block a user