Skip to content

Commit

Permalink
Add StatusMessage to UserSummary
Browse files Browse the repository at this point in the history
  • Loading branch information
benpate committed Sep 9, 2024
1 parent a78bf58 commit ac47c86
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions model/userSummary.go
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
package model

import "go.mongodb.org/mongo-driver/bson/primitive"
import (
"go.mongodb.org/mongo-driver/bson/primitive"
)

// UserSummary is used as a lightweight, read-only summary of a user record.
type UserSummary struct {
UserID primitive.ObjectID `bson:"_id"`
IconID primitive.ObjectID `bson:"iconId"`
DisplayName string `bson:"displayName"`
EmailAddress string `bson:"emailAddress"`
Username string `bson:"username"`
ProfileURL string `bson:"profileUrl"`
UserID primitive.ObjectID `bson:"_id"`
IconID primitive.ObjectID `bson:"iconId"`
DisplayName string `bson:"displayName"`
EmailAddress string `bson:"emailAddress"`
Username string `bson:"username"`
ProfileURL string `bson:"profileUrl"`
StatusMessage string `bson:"statusMessage"`
}

func NewUserSummary() UserSummary {
return UserSummary{
UserID: primitive.NewObjectID(),
IconID: primitive.NilObjectID,
DisplayName: "",
EmailAddress: "",
Username: "",
ProfileURL: "",
UserID: primitive.NewObjectID(),
IconID: primitive.NilObjectID,
DisplayName: "",
EmailAddress: "",
Username: "",
ProfileURL: "",
StatusMessage: "",
}
}

func UserSummaryFields() []string {
return []string{"_id", "displayName", "emailAddress", "username", "iconId", "profileUrl"}
return []string{"_id", "displayName", "emailAddress", "username", "iconId", "profileUrl", "statusMessage"}
}

func (userSummary UserSummary) Fields() []string {
Expand Down

0 comments on commit ac47c86

Please sign in to comment.