Skip to content

Commit 1428d90

Browse files
committed
feat: meta readme
1 parent c413c22 commit 1428d90

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

model/meta.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ type Meta struct {
1212
Hide string `json:"hide"`
1313
Upload bool `json:"upload"`
1414
OnlyShows string `json:"only_shows"`
15+
Readme string `json:"readme"`
1516
}
1617

1718
func GetMetaByPath(path string) (*Meta, error) {

server/controllers/path.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ type Meta struct {
6060
Driver string `json:"driver"`
6161
Upload bool `json:"upload"`
6262
Total int `json:"total"`
63+
Readme string `json:"readme"`
6364
//Pages int `json:"pages"`
6465
}
6566

@@ -75,8 +76,10 @@ func Path(c *gin.Context) {
7576
_, ok := c.Get("admin")
7677
meta, _ := model.GetMetaByPath(req.Path)
7778
upload := false
78-
if meta != nil && meta.Upload {
79-
upload = true
79+
readme := ""
80+
if meta != nil {
81+
upload = meta.Upload
82+
readme = meta.Readme
8083
}
8184
err := CheckPagination(&req)
8285
if err != nil {
@@ -137,6 +140,7 @@ func Path(c *gin.Context) {
137140
Driver: driverName,
138141
Upload: upload,
139142
Total: total,
143+
Readme: readme,
140144
},
141145
Files: files,
142146
},

0 commit comments

Comments
 (0)