feat: get news by slug and and author detail

This commit is contained in:
ericprd
2025-03-06 11:06:06 +08:00
parent d217ec8a62
commit 85247643e6
9 changed files with 76 additions and 1 deletions
+8
View File
@@ -16,6 +16,12 @@ type NewsReq struct {
LiveAt string `json:"live_at" validate:"required"`
}
type Staff struct {
ID string `json:"id"`
Name string `json:"name"`
ProfilePicture string `json:"profile_picture"`
}
type News struct {
ID string `json:"id" gorm:"primaryKey"`
Title string `json:"title"`
@@ -29,4 +35,6 @@ type News struct {
LiveAt time.Time `json:"live_at"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Author Staff `json:"author"`
}