feat: add readme field to list resp

This commit is contained in:
Noah Hsu
2022-06-30 15:41:58 +08:00
parent e614faa99b
commit 35b04ffa9c
5 changed files with 23 additions and 11 deletions

View File

@ -59,7 +59,7 @@ func whetherHide(user *model.User, meta *model.Meta, path string) bool {
return false
}
// if meta doesn't apply to sub_folder, don't hide
if !utils.PathEqual(meta.Path, path) && !meta.SubFolder {
if !utils.PathEqual(meta.Path, path) && !meta.HSub {
return false
}
// if is guest, hide

View File

@ -1,11 +1,14 @@
package model
type Meta struct {
ID uint `json:"id" gorm:"primaryKey"`
Path string `json:"path" gorm:"unique" binding:"required"`
Password string `json:"password"`
Write bool `json:"upload"`
Hide string `json:"hide"`
SubFolder bool `json:"sub_folder"`
Readme string `json:"readme"`
ID uint `json:"id" gorm:"primaryKey"`
Path string `json:"path" gorm:"unique" binding:"required"`
Password string `json:"password"`
PSub bool `json:"p_sub"`
Write bool `json:"write"`
WSub bool `json:"w_sub"`
Hide string `json:"hide"`
HSub bool `json:"h_sub"`
Readme string `json:"readme"`
RSub bool `json:"r_sub"`
}