添加项目文件。

This commit is contained in:
2025-12-02 13:10:10 +08:00
parent 93a2382a16
commit 289aa4cbe7
400 changed files with 91177 additions and 0 deletions

View File

@@ -0,0 +1,77 @@
using Atomx.Utils.Extension;
namespace Atomx.Admin.Client.Models
{
/// <summary>
/// 产品SKU信息模型
/// </summary>
public class ProductSkuModel : IEquatable<ProductSkuModel>
{
/// <summary>
/// 属性ID
/// </summary>
public long AttributeId { get; set; }
/// <summary>
/// 属性名称
/// </summary>
public string AttributeName { get; set; } = string.Empty;
/// <summary>
/// 属性值ID
/// </summary>
public long ValueId { get; set; }
/// <summary>
/// 属性值 Name
/// </summary>
public string ValueName { get; set; } = string.Empty;
/// <summary>
/// 重量
/// </summary>
public decimal Weight { get; set; }
/// <summary>
/// 重量单位,1毫克mg2克g,3千克kg,4吨t5磅lb6盎司oz
/// </summary>
public int WeightUnit { get; set; }
public bool Equals(ProductSkuModel? other)
{
if (other is null) return false;
if (ValueId != other.ValueId)
{
return AttributeId == other.AttributeId &&
ValueId == other.ValueId &&
Weight.RemoveTrailingZeros() == other.Weight.RemoveTrailingZeros() &&
WeightUnit == other.WeightUnit &&
AttributeName == other.AttributeName &&
ValueName == other.ValueName;
}
else
{
return AttributeId == other.AttributeId &&
ValueId == other.ValueId &&
AttributeName == other.AttributeName;
}
}
public override bool Equals(object obj) => Equals(obj as ProductSkuModel);
public override int GetHashCode()
{
unchecked
{
int hash = 17;
hash = hash * 23 + AttributeId.GetHashCode();
hash = hash * 23 + ValueId.GetHashCode();
hash = hash * 23 + Weight.GetHashCode();
hash = hash * 23 + WeightUnit.GetHashCode();
hash = hash * 23 + (AttributeName?.GetHashCode() ?? 0);
hash = hash * 23 + (ValueName?.GetHashCode() ?? 0);
return hash;
}
}
}
}