время в топе и тэги креативов
This commit is contained in:
@@ -2,20 +2,22 @@ package domain
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type Post struct {
|
||||
ID uuid.UUID
|
||||
ChannelID uuid.UUID
|
||||
MessageID int
|
||||
Text string
|
||||
Link string
|
||||
Views int
|
||||
ID uuid.UUID
|
||||
ChannelID uuid.UUID
|
||||
MessageID int
|
||||
Text string
|
||||
Link string
|
||||
Views int
|
||||
PublishedAt time.Time
|
||||
}
|
||||
|
||||
func NewPost(channel Channel, messageID int, text string, views int) Post {
|
||||
func NewPost(channel Channel, messageID int, text string, views int, publishedAt time.Time) Post {
|
||||
link := ""
|
||||
if channel.Username != "" {
|
||||
link = fmt.Sprintf("https://t.me/%s/%d", channel.Username, messageID)
|
||||
@@ -23,11 +25,12 @@ func NewPost(channel Channel, messageID int, text string, views int) Post {
|
||||
link = fmt.Sprintf("https://t.me/c/%d/%d", ChannelIDFromChatID(channel.TelegramID), messageID)
|
||||
}
|
||||
return Post{
|
||||
ID: uuid.New(),
|
||||
ChannelID: channel.ID,
|
||||
MessageID: messageID,
|
||||
Text: text,
|
||||
Link: link,
|
||||
Views: views,
|
||||
ID: uuid.New(),
|
||||
ChannelID: channel.ID,
|
||||
MessageID: messageID,
|
||||
Text: text,
|
||||
Link: link,
|
||||
Views: views,
|
||||
PublishedAt: publishedAt,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user