(3条消息) SAAS云平台搭建札记: (一)浅论SAAS多租户自助云服务平台的产品、服务和订单
public class UserCart { public string UserId { get; set; } /// <summary> /// 设置域名 /// </summary> public string ServiceIndentify { get; set; } public OrderType OrderType { get; set; } public IList<UserCartProduct> UserCartProducts { get; set; } public float TotalPrice { get { if (OrderType == OrderType.Experience) { return 0; } else { return UserCartProducts.Sum(p => p.Price); } } } public virtual IList<UserCartProduct> UserCartProduct { get; set; } } public class UserCartProduct { public string ProductId { get; set; } public int ProductBasePrice { get; set; } public Period Period { get; set; } public DateTime StartDate { get; set; } public DateTime EndDate { get; set; } public IList<string> UserCartProductBasicModules { get; set; } public IList<UserCartAddtionalModule> UserCartProductAddtionalModules { get; set; } public IList<UserCartAddtionalService> UserCartAddtionalServices { get; set; } public IList<UserCartOption> UserCartOptions { get; set; } public float Price { get { return ProductBasePrice + UserCartProductAddtionalModules.Sum(m => m.UintPrice.GetPriceByPeriod(Period)) + UserCartAddtionalServices.Sum(m => m.UintPrice.GetPriceByPeriod(new Period(PeriodType.Times, m.Quantity))) + UserCartOptions.Sum(m => m.UintPrice.GetPriceByPeriod(Period)); } } public virtual UserCart UserCart { get; set; } } public class ModuleBase { public string ModuleId { get; set; } public PeriodPrice UintPrice { get; set; } } public class UserCartAddtionalModule: ModuleBase { } public class UserCartAddtionalService : ModuleBase { public int Quantity { get; set; } } public class UserCartOption: ModuleBase { public string CheckId { get; set; } public string OriginCheckedId { get; set; } public PeriodPrice OriginPeriodPrice { get; set; } }