[MM-59367] export: enable exporting thread followers for CRT (#27623)

Этот коммит содержится в:
Ibrahim Serdar Acikgoz
2024-08-29 14:06:41 +02:00
коммит произвёл GitHub
родитель 3dc0e63c03
Коммит d5cc2eb2f6
17 изменённых файлов: 1430 добавлений и 63 удалений

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

@@ -3,6 +3,8 @@
package model
import "net/http"
// Thread tracks the metadata associated with a root post and its reply posts.
//
// Note that Thread metadata does not exist until the first reply to a root post.
@@ -126,3 +128,21 @@ type ThreadMembership struct {
// threads with the mention count.
UnreadMentions int64 `json:"unread_mentions"`
}
func (o *ThreadMembership) IsValid() *AppError {
if !IsValidId(o.PostId) {
return NewAppError("ThreadMembership.IsValid", "model.thread.is_valid.post_id.app_error", nil, "", http.StatusBadRequest)
}
if !IsValidId(o.UserId) {
return NewAppError("ThreadMembership.IsValid", "model.thread.is_valid.user_id.app_error", nil, "", http.StatusBadRequest)
}
return nil
}
type ThreadMembershipForExport struct {
Username string `json:"user_name"`
LastViewed int64 `json:"last_viewed"`
UnreadMentions int64 `json:"unread_mentions"`
}