SecondParticipant now has extended user object
Этот коммит содержится в:
@@ -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
|
||||
|
||||
Ссылка в новой задаче
Block a user