mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 12:17:24 +00:00
Add file size and redirect status to file model
This commit is contained in:
@@ -24,6 +24,9 @@ type FileView struct {
|
||||
ID string `json:"id"`
|
||||
Filename string `json:"filename"`
|
||||
Description string `json:"description"`
|
||||
Size int64 `json:"size"`
|
||||
IsRedirect bool `json:"is_redirect"`
|
||||
UserID uint `json:"user_id"`
|
||||
}
|
||||
|
||||
func (f *File) ToView() *FileView {
|
||||
@@ -31,5 +34,8 @@ func (f *File) ToView() *FileView {
|
||||
ID: f.UUID,
|
||||
Filename: f.Filename,
|
||||
Description: f.Description,
|
||||
Size: f.Size,
|
||||
IsRedirect: f.RedirectUrl != "",
|
||||
UserID: f.UserID,
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user