mirror of
https://github.com/wgh136/nysoure.git
synced 2025-12-16 15:51:14 +00:00
Add gallery
This commit is contained in:
@@ -21,6 +21,7 @@ type Resource struct {
|
||||
Downloads uint
|
||||
Comments uint
|
||||
ModifiedTime time.Time
|
||||
Gallery []uint `gorm:"serializer:json"`
|
||||
}
|
||||
|
||||
type Link struct {
|
||||
@@ -52,6 +53,7 @@ type ResourceDetailView struct {
|
||||
Downloads uint `json:"downloads"`
|
||||
Comments uint `json:"comments"`
|
||||
Related []ResourceView `json:"related"`
|
||||
Gallery []uint `json:"gallery"`
|
||||
}
|
||||
|
||||
func (r *Resource) ToView() ResourceView {
|
||||
@@ -104,5 +106,6 @@ func (r *Resource) ToDetailView() ResourceDetailView {
|
||||
Views: r.Views,
|
||||
Downloads: r.Downloads,
|
||||
Comments: r.Comments,
|
||||
Gallery: r.Gallery,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user