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:
Shady Nagy
2020-07-28 23:00:32 +02:00
committed by GitHub
parent b30b0c2eef
commit 4e935df311
29 changed files with 636 additions and 178 deletions

View File

@@ -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";

View File

@@ -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}";
}
}
}

View File

@@ -0,0 +1,9 @@
using System.Threading.Tasks;
namespace Microsoft.eShopWeb.ApplicationCore.Interfaces
{
public interface IFileSystem
{
Task<bool> SavePicture(string pictureName, string pictureBase64);
}
}