add sessions interface
This commit is contained in:
parent
bf4b92b296
commit
e8adbe4653
@ -20,5 +20,8 @@ type JSSessionInterface struct {
|
|||||||
GameID string `json:"gameId"`
|
GameID string `json:"gameId"`
|
||||||
SessionId string `json:"sessionId"`
|
SessionId string `json:"sessionId"`
|
||||||
Expires time.Time `json:"expires"`
|
Expires time.Time `json:"expires"`
|
||||||
Assets GameInterfaceAssets `json:"assets"`
|
Title string `json:"title"`
|
||||||
|
Icon string `json:"icon"`
|
||||||
|
Description string `json:"description"`
|
||||||
|
Backgrounds []string `json:"backgrounds"`
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,19 @@ func FindSessionByID(sessionId string, sessions []Session) Session {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetJSSessionInterface(s Session) JSSessionInterface {
|
||||||
|
newInterface := JSSessionInterface{ //TODO: If session icon empty - use game icon
|
||||||
|
GameID: s.GameId,
|
||||||
|
SessionId: s.SessionId,
|
||||||
|
Expires: time.Time{},
|
||||||
|
Title: s.Assets.Title,
|
||||||
|
Icon: s.Assets.Icon,
|
||||||
|
Description: s.Assets.Description,
|
||||||
|
Backgrounds: []string{}, //TODO: Complete
|
||||||
|
}
|
||||||
|
return newInterface
|
||||||
|
}
|
||||||
|
|
||||||
var FakeSessions = Sessions{ //TODO: Move to front
|
var FakeSessions = Sessions{ //TODO: Move to front
|
||||||
Sessions: []Session{
|
Sessions: []Session{
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user