爆肝,重构框架,你懂得
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.Json.Serialization;
|
||||
using SqlSugar;
|
||||
using Yi.Framework.Model.Base;
|
||||
|
||||
namespace Yi.Framework.Model.SHOP.Entitys
|
||||
{
|
||||
/// <summary>
|
||||
/// 商品分类表
|
||||
///</summary>
|
||||
[SugarTable("Category")]
|
||||
public partial class CategoryEntity : IBaseModelEntity
|
||||
{
|
||||
public CategoryEntity()
|
||||
{
|
||||
CreateTime = DateTime.Now;
|
||||
}
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
|
||||
public long Id { get; set; }
|
||||
/// <summary>
|
||||
/// 父级id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ParentId")]
|
||||
public long? ParentId { get; set; }
|
||||
/// <summary>
|
||||
/// 分类名称
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CategoryName")]
|
||||
public string CategoryName { get; set; }
|
||||
/// <summary>
|
||||
/// 创建者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateUser")]
|
||||
public long? CreateUser { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateTime")]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 修改者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyUser")]
|
||||
public long? ModifyUser { get; set; }
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyTime")]
|
||||
public DateTime? ModifyTime { get; set; }
|
||||
/// <summary>
|
||||
/// 是否删除
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "IsDeleted")]
|
||||
public bool? IsDeleted { get; set; }
|
||||
/// <summary>
|
||||
/// 租户Id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "TenantId")]
|
||||
public long? TenantId { get; set; }
|
||||
/// <summary>
|
||||
/// 排序字段
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "OrderNum")]
|
||||
public int? OrderNum { get; set; }
|
||||
/// <summary>
|
||||
/// 描述
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Remark")]
|
||||
public string? Remark { get; set; }
|
||||
|
||||
[SugarColumn(IsIgnore = true)]
|
||||
public List<CategoryEntity>? Children { get; set; }
|
||||
|
||||
|
||||
[Navigate(NavigateType.OneToMany, nameof(SpecsGroupEntity.CategoryId))]
|
||||
public List<SpecsGroupEntity>? SpecsGroups { get; set; }
|
||||
}
|
||||
}
|
||||
102
Yi.Framework.Net6/Yi.Framework.Model/SHOP/Entitys/SkuEntity.cs
Normal file
102
Yi.Framework.Net6/Yi.Framework.Model/SHOP/Entitys/SkuEntity.cs
Normal file
@@ -0,0 +1,102 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.Json.Serialization;
|
||||
using SqlSugar;
|
||||
using Yi.Framework.Model.Base;
|
||||
|
||||
namespace Yi.Framework.Model.SHOP.Entitys
|
||||
{
|
||||
/// <summary>
|
||||
/// Sku表
|
||||
///</summary>
|
||||
[SugarTable("Sku")]
|
||||
public partial class SkuEntity : IBaseModelEntity
|
||||
{
|
||||
public SkuEntity()
|
||||
{
|
||||
CreateTime = DateTime.Now;
|
||||
}
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
|
||||
public long Id { get; set; }
|
||||
/// <summary>
|
||||
/// SpuId
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "SpuId")]
|
||||
public long? SpuId { get; set; }
|
||||
/// <summary>
|
||||
/// 库存
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Stock")]
|
||||
public int? Stock { get; set; }
|
||||
/// <summary>
|
||||
/// 价格
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Price")]
|
||||
public int? Price { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateUser")]
|
||||
public long? CreateUser { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateTime")]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 修改者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyUser")]
|
||||
public long? ModifyUser { get; set; }
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyTime")]
|
||||
public DateTime? ModifyTime { get; set; }
|
||||
/// <summary>
|
||||
/// 是否删除
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "IsDeleted")]
|
||||
public bool? IsDeleted { get; set; }
|
||||
/// <summary>
|
||||
/// 租户Id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "TenantId")]
|
||||
public long? TenantId { get; set; }
|
||||
/// <summary>
|
||||
/// 排序字段
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "OrderNum")]
|
||||
public int? OrderNum { get; set; }
|
||||
/// <summary>
|
||||
/// 描述
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Remark")]
|
||||
public string? Remark { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 规格sku信息
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "SpecsSkuInfo", IsJson = true)]
|
||||
public List<SpecsSkuInfoModel>? SpecsSkuInfo { get; set; }
|
||||
/// <summary>
|
||||
/// 规格sku完整信息
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "SpecsSkuAllInfo", IsJson = true)]
|
||||
public List<SpecsSkuAllInfoModel>? SpecsSkuAllInfo { get; set; }
|
||||
}
|
||||
|
||||
public class SpecsSkuAllInfoModel
|
||||
{
|
||||
public string? SpecsGroupName { get; set; }
|
||||
public string? SpecsName { get; set; }
|
||||
}
|
||||
public class SpecsSkuInfoModel
|
||||
{
|
||||
public long? SpecsGroupId { get; set; }
|
||||
public long? SpecsId { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.Json.Serialization;
|
||||
using SqlSugar;
|
||||
using Yi.Framework.Model.Base;
|
||||
|
||||
namespace Yi.Framework.Model.SHOP.Entitys
|
||||
{
|
||||
/// <summary>
|
||||
/// 商品规格表
|
||||
///</summary>
|
||||
[SugarTable("Specs")]
|
||||
public partial class SpecsEntity : IBaseModelEntity
|
||||
{
|
||||
public SpecsEntity()
|
||||
{
|
||||
CreateTime = DateTime.Now;
|
||||
}
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
|
||||
public long Id { get; set; }
|
||||
/// <summary>
|
||||
/// 商品规格组id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "SpecsGroupId")]
|
||||
public long? SpecsGroupId { get; set; }
|
||||
/// <summary>
|
||||
/// 商品规格名
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "SpecsName")]
|
||||
public string SpecsName { get; set; }
|
||||
/// <summary>
|
||||
/// 创建者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateUser")]
|
||||
public long? CreateUser { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateTime")]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 修改者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyUser")]
|
||||
public long? ModifyUser { get; set; }
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyTime")]
|
||||
public DateTime? ModifyTime { get; set; }
|
||||
/// <summary>
|
||||
/// 是否删除
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "IsDeleted")]
|
||||
public bool? IsDeleted { get; set; }
|
||||
/// <summary>
|
||||
/// 租户Id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "TenantId")]
|
||||
public long? TenantId { get; set; }
|
||||
/// <summary>
|
||||
/// 排序字段
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "OrderNum")]
|
||||
public int? OrderNum { get; set; }
|
||||
/// <summary>
|
||||
/// 描述
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Remark")]
|
||||
public string? Remark { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.Json.Serialization;
|
||||
using SqlSugar;
|
||||
using Yi.Framework.Model.Base;
|
||||
|
||||
namespace Yi.Framework.Model.SHOP.Entitys
|
||||
{
|
||||
/// <summary>
|
||||
/// 商品规格组表
|
||||
///</summary>
|
||||
[SugarTable("SpecsGroup")]
|
||||
public partial class SpecsGroupEntity : IBaseModelEntity
|
||||
{
|
||||
public SpecsGroupEntity()
|
||||
{
|
||||
CreateTime = DateTime.Now;
|
||||
}
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
|
||||
public long Id { get; set; }
|
||||
/// <summary>
|
||||
/// 分类id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CategoryId")]
|
||||
public long? CategoryId { get; set; }
|
||||
/// <summary>
|
||||
/// 商品规格组名
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "SpecsGroupName")]
|
||||
public string SpecsGroupName { get; set; }
|
||||
/// <summary>
|
||||
/// 创建者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateUser")]
|
||||
public long? CreateUser { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateTime")]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 修改者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyUser")]
|
||||
public long? ModifyUser { get; set; }
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyTime")]
|
||||
public DateTime? ModifyTime { get; set; }
|
||||
/// <summary>
|
||||
/// 是否删除
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "IsDeleted")]
|
||||
public bool? IsDeleted { get; set; }
|
||||
/// <summary>
|
||||
/// 租户Id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "TenantId")]
|
||||
public long? TenantId { get; set; }
|
||||
/// <summary>
|
||||
/// 排序字段
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "OrderNum")]
|
||||
public int? OrderNum { get; set; }
|
||||
/// <summary>
|
||||
/// 描述
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Remark")]
|
||||
public string? Remark { get; set; }
|
||||
|
||||
[Navigate(NavigateType.OneToMany, nameof(SpecsEntity.SpecsGroupId))]
|
||||
public List<SpecsEntity>? Specses { get; set; }
|
||||
}
|
||||
}
|
||||
108
Yi.Framework.Net6/Yi.Framework.Model/SHOP/Entitys/SpuEntity.cs
Normal file
108
Yi.Framework.Net6/Yi.Framework.Model/SHOP/Entitys/SpuEntity.cs
Normal file
@@ -0,0 +1,108 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text.Json.Serialization;
|
||||
using SqlSugar;
|
||||
using Yi.Framework.Model.Base;
|
||||
|
||||
namespace Yi.Framework.Model.SHOP.Entitys
|
||||
{
|
||||
/// <summary>
|
||||
/// Spu表
|
||||
///</summary>
|
||||
[SugarTable("Spu")]
|
||||
public partial class SpuEntity : IBaseModelEntity
|
||||
{
|
||||
public SpuEntity()
|
||||
{
|
||||
CreateTime = DateTime.Now;
|
||||
}
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
[SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
|
||||
public long Id { get; set; }
|
||||
/// <summary>
|
||||
/// 商品分类Id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CategoryId")]
|
||||
public long? CategoryId { get; set; }
|
||||
/// <summary>
|
||||
/// 商品名称
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "SpuName")]
|
||||
public string? SpuName { get; set; }
|
||||
/// <summary>
|
||||
/// 商品详情
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Details")]
|
||||
public string? Details { get; set; }
|
||||
/// <summary>
|
||||
/// 商品价格
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Price")]
|
||||
public string? Price { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 创建者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateUser")]
|
||||
public long? CreateUser { get; set; }
|
||||
/// <summary>
|
||||
/// 创建时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "CreateTime")]
|
||||
public DateTime? CreateTime { get; set; }
|
||||
/// <summary>
|
||||
/// 修改者
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyUser")]
|
||||
public long? ModifyUser { get; set; }
|
||||
/// <summary>
|
||||
/// 修改时间
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "ModifyTime")]
|
||||
public DateTime? ModifyTime { get; set; }
|
||||
/// <summary>
|
||||
/// 是否删除
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "IsDeleted")]
|
||||
public bool? IsDeleted { get; set; }
|
||||
/// <summary>
|
||||
/// 租户Id
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "TenantId")]
|
||||
public long? TenantId { get; set; }
|
||||
/// <summary>
|
||||
/// 排序字段
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "OrderNum")]
|
||||
public int? OrderNum { get; set; }
|
||||
/// <summary>
|
||||
/// 描述
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "Remark")]
|
||||
public string? Remark { get; set; } /// <summary>
|
||||
/// 规格Spu完整信息
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "SpecsAllInfo", IsJson = true)]
|
||||
public List<SpecsSpuAllInfoModel>? SpecsSpuAllInfo { get; set; }
|
||||
/// <summary>
|
||||
/// 规格Spu信息
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName = "SpecsInfo", IsJson = true)]
|
||||
public List<SpecsSpuInfoModel>? SpecsSpuInfo { get; set; }
|
||||
|
||||
[Navigate(NavigateType.OneToMany, nameof(SkuEntity.SpuId))]
|
||||
public List<SkuEntity>? Skus { get; set; }
|
||||
}
|
||||
|
||||
public class SpecsSpuAllInfoModel
|
||||
{
|
||||
public string? SpecsGroupName { get; set; }
|
||||
public List<string>? SpecsNames { get; set; }
|
||||
}
|
||||
public class SpecsSpuInfoModel
|
||||
{
|
||||
public long? SpecsGroupId { get; set; }
|
||||
public List<long>? SpecsIds { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user