Feat: options to disable preview in file sharing

This commit is contained in:
HFO4
2020-01-29 11:03:09 +08:00
parent 1ff4d59978
commit 68704f8646
7 changed files with 47 additions and 14 deletions

View File

@@ -17,6 +17,7 @@ type ShareCreateService struct {
RemainDownloads int `json:"downloads"`
Expire int `json:"expire"`
Score int `json:"score" binding:"gte=0"`
Preview bool `json:"preview"`
}
// Create 创建新分享
@@ -52,6 +53,7 @@ func (service *ShareCreateService) Create(c *gin.Context) serializer.Response {
SourceID: service.SourceID,
Score: service.Score,
RemainDownloads: -1,
PreviewEnabled: service.Preview,
}
// 如果开启了自动过期