Use structs lib to map models to DB. Fix #1266

This commit is contained in:
Deluan
2021-08-01 01:21:20 -04:00
parent 344d7a4392
commit c831dc4cdf
22 changed files with 207 additions and 235 deletions
+11 -11
View File
@@ -5,17 +5,17 @@ import (
)
type Player struct {
ID string `json:"id" orm:"column(id)"`
Name string `json:"name"`
UserAgent string `json:"userAgent"`
UserName string `json:"userName"`
Client string `json:"client"`
IPAddress string `json:"ipAddress"`
LastSeen time.Time `json:"lastSeen"`
TranscodingId string `json:"transcodingId"`
MaxBitRate int `json:"maxBitRate"`
ReportRealPath bool `json:"reportRealPath"`
ScrobbleEnabled bool `json:"scrobbleEnabled"`
ID string `structs:"id" json:"id" orm:"column(id)"`
Name string `structs:"name" json:"name"`
UserAgent string `structs:"user_agent" json:"userAgent"`
UserName string `structs:"user_name" json:"userName"`
Client string `structs:"client" json:"client"`
IPAddress string `structs:"ip_address" json:"ipAddress"`
LastSeen time.Time `structs:"last_seen" json:"lastSeen"`
TranscodingId string `structs:"transcoding_id" json:"transcodingId"`
MaxBitRate int `structs:"max_bit_rate" json:"maxBitRate"`
ReportRealPath bool `structs:"report_real_path" json:"reportRealPath"`
ScrobbleEnabled bool `structs:"scrobble_enabled" json:"scrobbleEnabled"`
}
type Players []Player