CreateUser test

This commit is contained in:
2022-11-24 12:53:27 +01:00
parent 37e09d6532
commit 6d80638cf8
14 changed files with 511 additions and 79 deletions

View File

@@ -42,6 +42,13 @@ func (u User) JSON() UserJSON {
}
}
func (u User) JSONWithClients(clients []Client) UserJSONWithClients {
return UserJSONWithClients{
UserJSON: u.JSON(),
Clients: langext.ArrMap(clients, func(v Client) ClientJSON { return v.JSON() }),
}
}
func (u User) MaxContentLength() int {
if u.IsPro {
return 16384
@@ -99,6 +106,11 @@ type UserJSON struct {
DefaultChannel string `json:"default_channel"`
}
type UserJSONWithClients struct {
UserJSON
Clients []ClientJSON `json:"clients"`
}
type UserDB struct {
UserID UserID `db:"user_id"`
Username *string `db:"username"`