增加项目,分层
This commit is contained in:
1 parent
6e995a5bdb
commit
0a3e5af6a9
234 files changed
+26994
-1
No files matched your search
@@ -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; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user