Image added (#434)
* Image added * ImageMaximumBytes * FileController remove Authorized * ApplicationCore.Constants.AuthorizationConstants.AUTH_KEY * SavePicture in the interface. * IFileSystem in Core * WebFileSystem in Infrastructure * PictureUri removed from UpdateCatalogItemRequest * Modal scroll fix
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
{
|
||||
public class AuthorizationConstants
|
||||
{
|
||||
public const string AUTH_KEY = "AuthKeyOfDoomThatMustBeAMinimumNumberOfBytes";
|
||||
|
||||
// TODO: Don't use this in production
|
||||
public const string DEFAULT_PASSWORD = "Pass@word1";
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Ardalis.GuardClauses;
|
||||
using System;
|
||||
using Ardalis.GuardClauses;
|
||||
using Microsoft.eShopWeb.ApplicationCore.Interfaces;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -54,5 +55,15 @@ namespace Microsoft.eShopWeb.ApplicationCore.Entities
|
||||
Guard.Against.Zero(catalogTypeId, nameof(catalogTypeId));
|
||||
CatalogTypeId = catalogTypeId;
|
||||
}
|
||||
|
||||
public void UpdatePictureUri(string pictureName)
|
||||
{
|
||||
if (string.IsNullOrEmpty(pictureName))
|
||||
{
|
||||
PictureUri = string.Empty;
|
||||
return;
|
||||
}
|
||||
PictureUri = $"images\\products\\{pictureName}?{new DateTime().Ticks}";
|
||||
}
|
||||
}
|
||||
}
|
||||
9
src/ApplicationCore/Interfaces/IFileSystem.cs
Normal file
9
src/ApplicationCore/Interfaces/IFileSystem.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Microsoft.eShopWeb.ApplicationCore.Interfaces
|
||||
{
|
||||
public interface IFileSystem
|
||||
{
|
||||
Task<bool> SavePicture(string pictureName, string pictureBase64);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user