using System; using System.Collections.Generic; using System.Linq; using System.Text; using Newtonsoft.Json; using NPoco; namespace POSV.Entity { [Serializable] [JsonObject(MemberSerialization.OptIn)] [TableName("pos_product_image")] [PrimaryKey(new string[] { "id" } , AutoIncrement = false)] public class ProductImage:BaseEntity { public ProductImage() { } /// /// 租户ID /// [JsonProperty(PropertyName = "tenantId")] [Column("tenantId")] public string TenantId { get; set; } /// /// 商品Id /// [JsonProperty(PropertyName = "productId")] [Column("productId")] public string ProductId { get; set; } /// /// 图片宽度 /// [JsonProperty(PropertyName = "width")] [Column("width")] public int Width { get; set; } /// /// 图片高度 /// [JsonProperty(PropertyName = "height")] [Column("height")] public int Height { get; set; } /// /// 存储组名 /// [JsonProperty(PropertyName = "groupName")] [Column("groupName")] public string GroupName { get; set; } /// /// 存储文件名 /// [JsonProperty(PropertyName = "storageFileName")] [Column("storageFileName")] public string StorageFileName { get; set; } /// /// 文件类型 /// [JsonProperty(PropertyName = "mimeType")] [Column("mimeType")] public string MimeType { get; set; } /// /// 文件大小 /// [JsonProperty(PropertyName = "length")] [Column("length")] public int Length { get; set; } /// /// 显示序号 /// [JsonProperty(PropertyName = "orderNo")] [Column("orderNo")] public int OrderNo { get; set; } /// /// 扩展字段1 /// [JsonProperty(PropertyName = "ext1")] [Column("ext1")] public string Ext1 { get; set; } /// /// 扩展字段2 /// [JsonProperty(PropertyName = "ext2")] [Column("ext2")] public string Ext2 { get; set; } /// /// 扩展字段3 /// [JsonProperty(PropertyName = "ext3")] [Column("ext3")] public string Ext3 { get; set; } /// /// 文件服务地址 /// [JsonProperty(PropertyName = "dfsAccessDomain")] [Column("dfsAccessDomain")] public string DfsAccessDomain { get; set; } /// /// 下载地址 /// [JsonProperty(PropertyName = "url")] [Ignore] public string Url { get { var url = string.Format("{0}/{1}/{2}", this.DfsAccessDomain, this.GroupName, this.StorageFileName); //七牛云存储的适配 if (string.IsNullOrEmpty(this.GroupName)) { url = string.Format("{0}",this.StorageFileName); } return url; } } } }