SecondParticipant now has extended user object

Этот коммит содержится в:
Shivashis Padhi
2022-07-27 18:41:18 +05:30
родитель 849aea452c
Коммит e94532c862
6 изменённых файлов: 42 добавлений и 23 удалений

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

@@ -90,6 +90,11 @@ type InsightUserInformation struct {
Username string `json:"username"`
}
type TopDMInsightUserInformation struct {
InsightUserInformation
Position string `json:"position"`
}
type DurationPostCount struct {
ChannelID string `db:"channelid"`
// Duration is an ISO8601 date string representing either a day or a day and hour (ex. "2022-05-26" or "2022-05-26T14").
@@ -99,9 +104,9 @@ type DurationPostCount struct {
// Top DMs
type TopDM struct {
MessageCount int64 `json:"post_count"`
Participants string `json:"-"`
SecondParticipant string `json:"second_participant"`
MessageCount int64 `json:"post_count"`
Participants string `json:"-"`
SecondParticipant *TopDMInsightUserInformation `json:"second_participant"`
}
type TopDMList struct {

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

@@ -123,13 +123,13 @@ func TestGetTopThreadListWithPagination(t *testing.T) {
func TestGetTopDMsListWithPagination(t *testing.T) {
dms := []*TopDM{
{SecondParticipant: NewId(), MessageCount: 100},
{SecondParticipant: NewId(), MessageCount: 80},
{SecondParticipant: NewId(), MessageCount: 90},
{SecondParticipant: NewId(), MessageCount: 76},
{SecondParticipant: NewId(), MessageCount: 43},
{SecondParticipant: NewId(), MessageCount: 2},
{SecondParticipant: NewId(), MessageCount: 1},
{SecondParticipant: &TopDMInsightUserInformation{InsightUserInformation: InsightUserInformation{Id: NewId()}}, MessageCount: 100},
{SecondParticipant: &TopDMInsightUserInformation{InsightUserInformation: InsightUserInformation{Id: NewId()}}, MessageCount: 80},
{SecondParticipant: &TopDMInsightUserInformation{InsightUserInformation: InsightUserInformation{Id: NewId()}}, MessageCount: 90},
{SecondParticipant: &TopDMInsightUserInformation{InsightUserInformation: InsightUserInformation{Id: NewId()}}, MessageCount: 76},
{SecondParticipant: &TopDMInsightUserInformation{InsightUserInformation: InsightUserInformation{Id: NewId()}}, MessageCount: 43},
{SecondParticipant: &TopDMInsightUserInformation{InsightUserInformation: InsightUserInformation{Id: NewId()}}, MessageCount: 2},
{SecondParticipant: &TopDMInsightUserInformation{InsightUserInformation: InsightUserInformation{Id: NewId()}}, MessageCount: 1},
}
hasNextTT := []struct {
Description string