2021-08-28 18:41:34 +03:00
|
|
|
package repositories
|
|
|
|
|
|
|
|
import "time"
|
|
|
|
|
2021-10-04 11:40:53 +03:00
|
|
|
// DB Structs
|
|
|
|
// DB Structs
|
|
|
|
// DB Structs
|
|
|
|
|
2021-08-28 18:41:34 +03:00
|
|
|
type Post struct {
|
|
|
|
ID int `json:"id"`
|
2021-08-31 19:48:02 +03:00
|
|
|
IsParent bool `json:"-"`
|
|
|
|
ParentID int `json:"parentId"`
|
|
|
|
IsDeleted bool `json:"-"`
|
2021-08-28 18:41:34 +03:00
|
|
|
Title string `json:"title"`
|
|
|
|
Text string `json:"text"`
|
|
|
|
IsSage bool `json:"isSage"`
|
|
|
|
Files []File `json:"files"`
|
|
|
|
CreatedAt time.Time `json:"createdAt"`
|
2021-08-31 19:48:02 +03:00
|
|
|
UpdatedAt time.Time `json:"-"`
|
2021-08-28 18:41:34 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
type File struct {
|
|
|
|
ID int `json:"-"`
|
|
|
|
PostID int `json:"-"`
|
|
|
|
CreatedAt time.Time `json:"-"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
Ext string `json:"-"`
|
|
|
|
Size int `json:"size"`
|
|
|
|
}
|
2021-09-10 02:17:45 +03:00
|
|
|
|
2021-10-04 11:40:53 +03:00
|
|
|
// HTML Templates Structs
|
|
|
|
// HTML Templates Structs
|
|
|
|
// HTML Templates Structs
|
|
|
|
|
2021-10-06 11:50:19 +03:00
|
|
|
// post-form.html
|
2021-10-04 11:40:53 +03:00
|
|
|
type HtmlFormData struct {
|
|
|
|
FirstPostID int
|
|
|
|
CaptchaID string
|
|
|
|
}
|
|
|
|
|
2021-10-06 11:50:19 +03:00
|
|
|
// thread.html
|
2021-10-04 11:40:53 +03:00
|
|
|
type GetThreadHtmlData struct {
|
|
|
|
Thread []Post
|
|
|
|
FormData HtmlFormData
|
|
|
|
}
|
|
|
|
|
2021-10-06 11:50:19 +03:00
|
|
|
// index.html
|
2021-10-04 11:40:53 +03:00
|
|
|
type GetThreadsHtmlData struct {
|
2021-09-10 02:17:45 +03:00
|
|
|
Threads []Post
|
|
|
|
PagesCount int
|
|
|
|
Page int
|
2021-10-04 11:40:53 +03:00
|
|
|
FormData HtmlFormData
|
2021-09-10 02:17:45 +03:00
|
|
|
}
|
2021-10-06 11:50:19 +03:00
|
|
|
|
|
|
|
// 400.html
|
|
|
|
type BadRequestHtmlData struct {
|
|
|
|
Message string
|
|
|
|
}
|
|
|
|
|
|
|
|
var InvalidTitleOrTextErrorMessage = "TITLE OR TEXT SHOULD NOT BE EMPTY"
|
|
|
|
var InvalidCaptchaErrorMessage = "INVALID CAPTCHA"
|
2021-10-10 10:41:36 +03:00
|
|
|
var InvalidFileSizeMessage = "FILE SIZE EXCIDED (3MB PER FILE)"
|