Add /preview/* routes

This commit is contained in:
2024-06-12 00:35:06 +02:00
parent 64709920f7
commit 80b1351bd2
9 changed files with 924 additions and 102 deletions

View File

@@ -116,6 +116,13 @@ func (u User) MaxTimestampDiffHours() int {
return 24
}
func (u User) JSONPreview() UserPreviewJSON {
return UserPreviewJSON{
UserID: u.UserID,
Username: u.Username,
}
}
type UserJSON struct {
UserID UserID `json:"user_id"`
Username *string `json:"username"`
@@ -137,6 +144,11 @@ type UserJSON struct {
MaxUserMessageIDLength int `json:"max_user_message_id_length"`
}
type UserPreviewJSON struct {
UserID UserID `json:"user_id"`
Username *string `json:"username"`
}
type UserJSONWithClientsAndKeys struct {
UserJSON
Clients []ClientJSON `json:"clients"`