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,
|
Filename: item.Filename,
|
||||||
FileSize: item.FileSize,
|
FileSize: item.FileSize,
|
||||||
MimeType: item.MimeType,
|
MimeType: item.MimeType,
|
||||||
URL: item.URL,
|
|
||||||
StorageKey: item.StorageKey,
|
StorageKey: item.StorageKey,
|
||||||
Status: item.Status,
|
Status: item.Status,
|
||||||
CreatedAt: item.CreatedAt.Format("2006-01-02 15:04:05"),
|
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"`
|
AssetID string `gorm:"type:varchar(64);not null;uniqueIndex"`
|
||||||
Provider enums.AssetProvider `gorm:"type:varchar(50);not null;default:'';index"`
|
Provider enums.AssetProvider `gorm:"type:varchar(50);not null;default:'';index"`
|
||||||
StorageKey string `gorm:"type:varchar(255);not null;default:'';uniqueIndex:uk_storage_key"`
|
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:''"`
|
Filename string `gorm:"type:varchar(255);not null;default:''"`
|
||||||
FileSize int64 `gorm:"type:bigint;not null;default:0"`
|
FileSize int64 `gorm:"type:bigint;not null;default:0"`
|
||||||
MimeType string `gorm:"type:varchar(100);not null;default:''"`
|
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,
|
AssetID: assetID,
|
||||||
Provider: provider.ProviderType(),
|
Provider: provider.ProviderType(),
|
||||||
StorageKey: key,
|
StorageKey: key,
|
||||||
URL: provider.GetURL(key),
|
|
||||||
Filename: info.Filename,
|
Filename: info.Filename,
|
||||||
FileSize: info.FileSize,
|
FileSize: info.FileSize,
|
||||||
MimeType: info.MimeType,
|
MimeType: info.MimeType,
|
||||||
|
|||||||
Reference in New Issue
Block a user