From 2fe3b4972f02be8b0c6143325d541ddda4b91559 Mon Sep 17 00:00:00 2001 From: vulonkaaz <7442677+vulonkaaz@users.noreply.github.com> Date: Wed, 19 Jun 2024 17:44:29 +0200 Subject: Initial version --- models/post.go | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 models/post.go (limited to 'models') diff --git a/models/post.go b/models/post.go new file mode 100644 index 0000000..5bbd21f --- /dev/null +++ b/models/post.go @@ -0,0 +1,33 @@ +package models + +import ( + "database/sql" + "github.com/lib/pq" + "time" + "html/template" +) + +type Post struct { + Id int `db:"id"` + Board string `db:"board"` + Picture template.URL `db:"picture"` + Thread sql.NullInt32 `db:"thread"` + ReplyTo sql.NullInt32 `db:"reply_to"` + IpAddress sql.NullString `db:"ip_address"` + Special sql.NullString `db:"special"` + CreatedAt time.Time `db:"created_at"` + UpdatedAt pq.NullTime `db:"updated_at"` +} + +type Thread struct { + Id int `db:"id"` + Board string `db:"board"` + Picture template.URL `db:"picture"` + Thread sql.NullInt32 `db:"thread"` + ReplyTo sql.NullInt32 `db:"reply_to"` + IpAddress sql.NullString `db:"ip_address"` + Special sql.NullString `db:"special"` + CreatedAt time.Time `db:"created_at"` + UpdatedAt pq.NullTime `db:"updated_at"` + Replies int `db:"replies"` +} -- cgit v1.2.3