aboutsummaryrefslogtreecommitdiff
path: root/internal/model
diff options
context:
space:
mode:
Diffstat (limited to 'internal/model')
-rw-r--r--internal/model/item.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/internal/model/item.go b/internal/model/item.go
new file mode 100644
index 0000000..c18d830
--- /dev/null
+++ b/internal/model/item.go
@@ -0,0 +1,24 @@
+package model
+
+import (
+ "fmt"
+ "time"
+)
+
+type Item struct {
+ ID string
+ Date time.Time
+ Title string
+ Summary string
+ Link string
+ Img string
+}
+
+func (it *Item) BuildMessage() string {
+ return fmt.Sprintf(
+ `<b>%s</b><br /><br />%s<br />Читать дальше: <a href="%[3]s">%[3]s</a>`,
+ it.Title,
+ it.Summary,
+ it.Link,
+ )
+}