增加项目,分层
This commit is contained in:
1 parent
6e995a5bdb
commit
0a3e5af6a9
234 files changed
+26994
-1
No files matched your search
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Store.Product.Models.Product.Image
|
||||
{
|
||||
/// <summary>
|
||||
/// 商品详情图片
|
||||
/// </summary>
|
||||
public class ContentImage : ProductImage
|
||||
{
|
||||
//public override ImageType ImageType => ImageType.Content;
|
||||
|
||||
public ContentImage(string url) : base(url)
|
||||
{
|
||||
Gid = Guid.NewGuid().ToString();
|
||||
}
|
||||
public string Gid { get; }
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Store.Product.Models.Product.Image
|
||||
{
|
||||
public class MainImage : ProductImage
|
||||
{
|
||||
public override ProductImageType ImageType => ProductImageType.Main;
|
||||
public MainImage()
|
||||
{
|
||||
|
||||
}
|
||||
public MainImage(string url) : base(url)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
using Newtonsoft.Json;
|
||||
using Store.Management.Framework.Helpers;
|
||||
using System.Drawing;
|
||||
|
||||
namespace Store.Product.Models.Product.Image
|
||||
{
|
||||
/// <summary>
|
||||
/// 商品图片
|
||||
/// </summary>
|
||||
public class ProductImage
|
||||
{
|
||||
|
||||
public ProductImage()
|
||||
{
|
||||
|
||||
}
|
||||
public ProductImage(string url)
|
||||
{
|
||||
ImgUrl = url;
|
||||
}
|
||||
//public ProductImage(string url, ImageType type)
|
||||
//{
|
||||
// ImgUrl = url;
|
||||
// ImageType = type;
|
||||
//}
|
||||
/// <summary>
|
||||
/// 图片类型
|
||||
/// </summary>
|
||||
public virtual ProductImageType ImageType { get; protected set; } = ProductImageType.None;
|
||||
/// <summary>
|
||||
/// 文件名
|
||||
/// </summary>
|
||||
public string FileName { get; set; }
|
||||
/// <summary>
|
||||
/// 图片源路径
|
||||
/// </summary>
|
||||
public string ImgUrl { get; set; }
|
||||
|
||||
private byte[] _imgbyte;
|
||||
/// <summary>
|
||||
/// 图片流
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public byte[] ImgByte
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_imgbyte == null)
|
||||
{
|
||||
_imgbyte = ImageHelper.DownloadImage(ImgUrl);
|
||||
}
|
||||
return _imgbyte;
|
||||
}
|
||||
set
|
||||
{
|
||||
_imgbyte = value;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 上传后图片路径
|
||||
/// </summary>
|
||||
public string UploadImgUrl { get; set; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace Store.Product.Models.Product.Image
|
||||
{
|
||||
/// <summary>
|
||||
/// 图片类型
|
||||
/// </summary>
|
||||
public enum ProductImageType
|
||||
{
|
||||
None,
|
||||
Main,
|
||||
Sku,
|
||||
Content
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Store.Product.Models.Product.Image
|
||||
{
|
||||
public class SkuImage : ProductImage
|
||||
{
|
||||
public override ProductImageType ImageType => ProductImageType.Sku;
|
||||
public SkuImage()
|
||||
{
|
||||
|
||||
}
|
||||
public SkuImage(string url) : base(url)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user