feat: meta readme
This commit is contained in:
parent
c413c22201
commit
1428d90361
@ -12,6 +12,7 @@ type Meta struct {
|
|||||||
Hide string `json:"hide"`
|
Hide string `json:"hide"`
|
||||||
Upload bool `json:"upload"`
|
Upload bool `json:"upload"`
|
||||||
OnlyShows string `json:"only_shows"`
|
OnlyShows string `json:"only_shows"`
|
||||||
|
Readme string `json:"readme"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetMetaByPath(path string) (*Meta, error) {
|
func GetMetaByPath(path string) (*Meta, error) {
|
||||||
|
@ -60,6 +60,7 @@ type Meta struct {
|
|||||||
Driver string `json:"driver"`
|
Driver string `json:"driver"`
|
||||||
Upload bool `json:"upload"`
|
Upload bool `json:"upload"`
|
||||||
Total int `json:"total"`
|
Total int `json:"total"`
|
||||||
|
Readme string `json:"readme"`
|
||||||
//Pages int `json:"pages"`
|
//Pages int `json:"pages"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,8 +76,10 @@ func Path(c *gin.Context) {
|
|||||||
_, ok := c.Get("admin")
|
_, ok := c.Get("admin")
|
||||||
meta, _ := model.GetMetaByPath(req.Path)
|
meta, _ := model.GetMetaByPath(req.Path)
|
||||||
upload := false
|
upload := false
|
||||||
if meta != nil && meta.Upload {
|
readme := ""
|
||||||
upload = true
|
if meta != nil {
|
||||||
|
upload = meta.Upload
|
||||||
|
readme = meta.Readme
|
||||||
}
|
}
|
||||||
err := CheckPagination(&req)
|
err := CheckPagination(&req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -137,6 +140,7 @@ func Path(c *gin.Context) {
|
|||||||
Driver: driverName,
|
Driver: driverName,
|
||||||
Upload: upload,
|
Upload: upload,
|
||||||
Total: total,
|
Total: total,
|
||||||
|
Readme: readme,
|
||||||
},
|
},
|
||||||
Files: files,
|
Files: files,
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user