Thumbnail

This commit is contained in:
LittleSheep 2024-08-11 01:22:55 +08:00
parent 2fbf7c4808
commit 6e14684539
3 changed files with 10 additions and 0 deletions

View File

@ -60,6 +60,7 @@ type Post struct {
} }
type PostStoryBody struct { type PostStoryBody struct {
Thumbnail *uint `json:"thumbnail"`
Title *string `json:"title"` Title *string `json:"title"`
Content string `json:"content"` Content string `json:"content"`
Location *string `json:"location"` Location *string `json:"location"`
@ -67,6 +68,7 @@ type PostStoryBody struct {
} }
type PostArticleBody struct { type PostArticleBody struct {
Thumbnail *uint `json:"thumbnail"`
Title string `json:"title"` Title string `json:"title"`
Description *string `json:"description"` Description *string `json:"description"`
Content string `json:"content"` Content string `json:"content"`

View File

@ -24,6 +24,7 @@ func createArticle(c *fiber.Ctx) error {
Title string `json:"title" validate:"required,max=1024"` Title string `json:"title" validate:"required,max=1024"`
Description *string `json:"description"` Description *string `json:"description"`
Content string `json:"content" validate:"required"` Content string `json:"content" validate:"required"`
Thumbnail *uint `json:"thumbnail"`
Attachments []uint `json:"attachments"` Attachments []uint `json:"attachments"`
Tags []models.Tag `json:"tags"` Tags []models.Tag `json:"tags"`
Categories []models.Category `json:"categories"` Categories []models.Category `json:"categories"`
@ -41,6 +42,7 @@ func createArticle(c *fiber.Ctx) error {
} }
body := models.PostArticleBody{ body := models.PostArticleBody{
Thumbnail: data.Thumbnail,
Title: data.Title, Title: data.Title,
Description: data.Description, Description: data.Description,
Content: data.Content, Content: data.Content,
@ -104,6 +106,7 @@ func editArticle(c *fiber.Ctx) error {
Title string `json:"title" validate:"required,max=1024"` Title string `json:"title" validate:"required,max=1024"`
Description *string `json:"description"` Description *string `json:"description"`
Content string `json:"content" validate:"required"` Content string `json:"content" validate:"required"`
Thumbnail *uint `json:"thumbnail"`
Attachments []uint `json:"attachments"` Attachments []uint `json:"attachments"`
Tags []models.Tag `json:"tags"` Tags []models.Tag `json:"tags"`
Categories []models.Category `json:"categories"` Categories []models.Category `json:"categories"`
@ -143,6 +146,7 @@ func editArticle(c *fiber.Ctx) error {
} }
body := models.PostArticleBody{ body := models.PostArticleBody{
Thumbnail: data.Thumbnail,
Title: data.Title, Title: data.Title,
Description: data.Description, Description: data.Description,
Content: data.Content, Content: data.Content,

View File

@ -24,6 +24,7 @@ func createStory(c *fiber.Ctx) error {
Title *string `json:"title"` Title *string `json:"title"`
Content string `json:"content" validate:"required,max=4096"` Content string `json:"content" validate:"required,max=4096"`
Location *string `json:"location"` Location *string `json:"location"`
Thumbnail *uint `json:"thumbnail"`
Attachments []uint `json:"attachments"` Attachments []uint `json:"attachments"`
Tags []models.Tag `json:"tags"` Tags []models.Tag `json:"tags"`
Categories []models.Category `json:"categories"` Categories []models.Category `json:"categories"`
@ -43,6 +44,7 @@ func createStory(c *fiber.Ctx) error {
} }
body := models.PostStoryBody{ body := models.PostStoryBody{
Thumbnail: data.Thumbnail,
Title: data.Title, Title: data.Title,
Content: data.Content, Content: data.Content,
Location: data.Location, Location: data.Location,
@ -122,6 +124,7 @@ func editStory(c *fiber.Ctx) error {
var data struct { var data struct {
Title *string `json:"title"` Title *string `json:"title"`
Content string `json:"content" validate:"required,max=4096"` Content string `json:"content" validate:"required,max=4096"`
Thumbnail *uint `json:"thumbnail"`
Location *string `json:"location"` Location *string `json:"location"`
Attachments []uint `json:"attachments"` Attachments []uint `json:"attachments"`
Tags []models.Tag `json:"tags"` Tags []models.Tag `json:"tags"`
@ -162,6 +165,7 @@ func editStory(c *fiber.Ctx) error {
} }
body := models.PostStoryBody{ body := models.PostStoryBody{
Thumbnail: data.Thumbnail,
Title: data.Title, Title: data.Title,
Content: data.Content, Content: data.Content,
Location: data.Location, Location: data.Location,