feat(asset): remove URL field from Asset model and related functions
This commit is contained in:
@@ -15,7 +15,6 @@ func BuildAsset(item *models.Asset) response.AssetResponse {
|
||||
Filename: item.Filename,
|
||||
FileSize: item.FileSize,
|
||||
MimeType: item.MimeType,
|
||||
URL: item.URL,
|
||||
StorageKey: item.StorageKey,
|
||||
Status: item.Status,
|
||||
CreatedAt: item.CreatedAt.Format("2006-01-02 15:04:05"),
|
||||
|
||||
@@ -304,7 +304,6 @@ type Asset struct {
|
||||
AssetID string `gorm:"type:varchar(64);not null;uniqueIndex"`
|
||||
Provider enums.AssetProvider `gorm:"type:varchar(50);not null;default:'';index"`
|
||||
StorageKey string `gorm:"type:varchar(255);not null;default:'';uniqueIndex:uk_storage_key"`
|
||||
URL string `gorm:"type:varchar(255);not null;default:''"`
|
||||
Filename string `gorm:"type:varchar(255);not null;default:''"`
|
||||
FileSize int64 `gorm:"type:bigint;not null;default:0"`
|
||||
MimeType string `gorm:"type:varchar(100);not null;default:''"`
|
||||
|
||||
@@ -107,7 +107,6 @@ func (s *assetService) Upload(reader io.Reader, info storage.UploadInfo) (*model
|
||||
AssetID: assetID,
|
||||
Provider: provider.ProviderType(),
|
||||
StorageKey: key,
|
||||
URL: provider.GetURL(key),
|
||||
Filename: info.Filename,
|
||||
FileSize: info.FileSize,
|
||||
MimeType: info.MimeType,
|
||||
|
||||
Reference in New Issue
Block a user