Went through the model and added all missing fields.

Except user.Password/MfaSecret/AuthData and session.TeamMembers.

```release-note
NONE
```
Этот коммит содержится в:
Agniva De Sarker
2022-07-18 11:10:58 +05:30
коммит произвёл GitHub
родитель 2aaf4cf0fb
Коммит ae482e6214
7 изменённых файлов: 126 добавлений и 4 удалений

Просмотреть файл

@@ -225,6 +225,14 @@ func (o *Channel) LastRootPostAt_() float64 {
return float64(o.LastRootPostAt)
}
func (o *Channel) ExtraUpdateAt_() float64 {
return float64(o.ExtraUpdateAt)
}
func (o *Channel) Props_() StringInterface {
return StringInterface(o.Props)
}
func (o *Channel) DeepCopy() *Channel {
copy := *o
if copy.SchemeId != nil {

Просмотреть файл

@@ -444,6 +444,18 @@ func (r *Role) Patch(patch *RolePatch) {
}
}
func (r *Role) CreateAt_() float64 {
return float64(r.CreateAt)
}
func (r *Role) UpdateAt_() float64 {
return float64(r.UpdateAt)
}
func (r *Role) DeleteAt_() float64 {
return float64(r.DeleteAt)
}
// MergeChannelHigherScopedPermissions is meant to be invoked on a channel scheme's role and merges the higher-scoped
// channel role's permissions.
func (r *Role) MergeChannelHigherScopedPermissions(higherScopedPermissions *RolePermissions) {

Просмотреть файл

@@ -244,3 +244,7 @@ func (s *Session) CreateAt_() float64 {
func (s *Session) ExpiresAt_() float64 {
return float64(s.ExpiresAt)
}
func (s *Session) LastActivityAt_() float64 {
return float64(s.LastActivityAt)
}

Просмотреть файл

@@ -477,10 +477,34 @@ func (u *User) DeleteAt_() float64 {
return float64(u.DeleteAt)
}
func (u *User) LastPictureUpdateAt() float64 {
func (u *User) UpdateAt_() float64 {
return float64(u.UpdateAt)
}
func (u *User) LastPictureUpdate_() float64 {
return float64(u.LastPictureUpdate)
}
func (u *User) LastPasswordUpdate_() float64 {
return float64(u.LastPasswordUpdate)
}
func (u *User) FailedAttempts_() float64 {
return float64(u.FailedAttempts)
}
func (u *User) LastActivityAt_() float64 {
return float64(u.LastActivityAt)
}
func (u *User) BotLastIconUpdate_() float64 {
return float64(u.BotLastIconUpdate)
}
func (u *User) TermsOfServiceCreateAt_() float64 {
return float64(u.TermsOfServiceCreateAt)
}
// PreUpdate should be run before updating the user in the db.
func (u *User) PreUpdate() {
u.Username = SanitizeUnicode(u.Username)

Просмотреть файл

@@ -186,6 +186,20 @@ func (si StringInterface) Value() (driver.Value, error) {
return string(j), err
}
func (StringInterface) ImplementsGraphQLType(name string) bool {
return name == "StringInterface"
}
func (si *StringInterface) UnmarshalGraphQL(input any) error {
json, ok := input.(map[string]any)
if !ok {
return errors.New("wrong type")
}
*si = json
return nil
}
var translateFunc i18n.TranslateFunc
var translateFuncOnce sync.Once