парсер
This commit is contained in:
27
tg_parser/internal/domain/post.go
Normal file
27
tg_parser/internal/domain/post.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package domain
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type Post struct {
|
||||
ID uuid.UUID
|
||||
ChannelID uuid.UUID
|
||||
MessageID int
|
||||
Text string
|
||||
Link string
|
||||
Views int
|
||||
}
|
||||
|
||||
func NewPost(channel Channel, messageID int, text string, views int) Post {
|
||||
return Post{
|
||||
ID: uuid.New(),
|
||||
ChannelID: channel.ID,
|
||||
MessageID: messageID,
|
||||
Text: text,
|
||||
Link: fmt.Sprintf("https://t.me/%s/%d", channel.Username, messageID),
|
||||
Views: views,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user