Fix warnings
This commit is contained in:
@@ -99,14 +99,14 @@ func AddUser(username string, password []byte) error {
|
||||
}
|
||||
|
||||
// AddAdmin register a user and set his role to admin
|
||||
func AddAdmin(username string, password []byte) error {
|
||||
/*func AddAdmin(username string, password []byte) error {
|
||||
user := &User{
|
||||
Username: username,
|
||||
Password: password,
|
||||
Role: adminRole,
|
||||
}
|
||||
return db.Save(user).Error
|
||||
}
|
||||
}*/
|
||||
|
||||
// GameInfoById return information of a game
|
||||
func GameInfoById(userId, gameId int) (*Game, error) {
|
||||
|
||||
@@ -3,20 +3,20 @@ package database
|
||||
import "time"
|
||||
|
||||
type User struct {
|
||||
ID int `json:"id"`
|
||||
Username string `json:"username"`
|
||||
Role string `json:"role"`
|
||||
Password []byte `json:"-"`
|
||||
ID int `json:"id"`
|
||||
IsAdmin bool `json:"is_admin" gorm:"-:all"`
|
||||
}
|
||||
|
||||
type Game struct {
|
||||
ID int `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Revision int `json:"rev"`
|
||||
PathStorage string `json:"-"`
|
||||
Hash *string `json:"hash"`
|
||||
LastUpdate *time.Time `json:"last_update"`
|
||||
ID int `json:"id"`
|
||||
Revision int `json:"rev"`
|
||||
UserId int `json:"-"`
|
||||
Available bool `json:"available"`
|
||||
Hash *string `json:"hash"`
|
||||
LastUpdate *time.Time `json:"last_update"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user