惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
Cisco Blogs
Schneier on Security
Schneier on Security
T
Tor Project blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Tenable Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Threat Research - Cisco Blogs
C
CERT Recently Published Vulnerability Notes
Security Latest
Security Latest
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
NISL@THU
NISL@THU
L
Lohrmann on Cybersecurity
Scott Helme
Scott Helme
Webroot Blog
Webroot Blog
Project Zero
Project Zero
Google Online Security Blog
Google Online Security Blog
The Last Watchdog
The Last Watchdog
Spread Privacy
Spread Privacy
Hacker News: Ask HN
Hacker News: Ask HN
PCI Perspectives
PCI Perspectives
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
W
WeLiveSecurity
Attack and Defense Labs
Attack and Defense Labs
D
Darknet – Hacking Tools, Hacker News & Cyber Security
N
News | PayPal Newsroom
Help Net Security
Help Net Security
The Hacker News
The Hacker News
H
Heimdal Security Blog
O
OpenAI News
S
Security @ Cisco Blogs
N
News and Events Feed by Topic
Cyberwarzone
Cyberwarzone
Simon Willison's Weblog
Simon Willison's Weblog
G
GRAHAM CLULEY
www.infosecurity-magazine.com
www.infosecurity-magazine.com
博客园 - 叶小钗
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Hacker News - Newest:
Hacker News - Newest: "LLM"
T
Tailwind CSS Blog
大猫的无限游戏
大猫的无限游戏
A
Arctic Wolf
I
Intezer
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
Security Affairs
P
Proofpoint News Feed
S
Secure Thoughts
腾讯CDC
Google DeepMind News
Google DeepMind News
量子位
罗磊的独立博客

博客园 - thanks

05. 搅拌站ERP系统 — 术语解析与技术备注 03. 搅拌站ERP系统 — 数据库表字段详解与示例数据 04. 搅拌站ERP系统 — 模块业务详解 02. 搅拌站ERP系统 — 核心业务流程 01. 搅拌站ERP系统 — 系统总览与架构 07-紧固件MES系统 — 中小企业实施部署指南 06-紧固件MES系统 — 术语与名词解析 05-紧固件MES系统 — 推荐技术架构与智能制造方案 04-紧固件MES系统 — 重构建议与待开发分析 03-紧固件MES系统 — 模块业务详解 02-紧固件MES系统 — 核心业务流程 01-紧固件MES系统 — 系统总览与架构 VsCode+DeepSeek的AI编程助手初体验 [大数据][机器学习]之Model Card(模型卡片)介绍 Bond——大数据时代的数据交换和存储格式 Spark中的那些坑... 为啥就业这么难——聊聊我在培训机构的所见所闻 微软外服工作札记③——窗口函数的介绍 微软外服工作札记②——聊聊微软的知识管理服务平台和一些编程风格 【非技术】试占12月10日后会发生什么 聊聊我在微软外服大数据分析部门的工作经历及一些个人见解 SAAS云平台搭建札记: (四) AntD For React使用react-router-dom路由接收不同参数页面不刷新的问题 [工作札记]03: 微软Winform窗体中设计上的Bug,会导致程序编译失败,影响范围:到最新的.net4.7.2都有 [工作札记]02: .Net Winform控件TreeView最简递归绑定方法 SAAS云平台搭建札记: (三) AntDesign + .Net Core WebAPI权限控制、动态菜单的生成 [工作札记]01: CS系统中分页控件的制作 【非技术】试占新型肺炎的情况与发展趋势 给培训学校讲解ORM框架的课件 SAAS云平台搭建札记: (二) Linux Ubutu下.Net Core整套运行环境的搭建 开源三维地球GIS引擎Cesium常用功能的开发 Asp.net管理信息系统中数据统计功能的实现
SAAS云平台搭建札记: (一) 浅论SAAS多租户自助云服务平台的产品、服务和订单
thanks · 2019-03-29 · via 博客园 - thanks

    最近在做一个多租户的云SAAS软件自助服务平台,途中遇到很多问题,我会将一些心得、体会逐渐分享出来,和大家一起探讨。这是本系列的第一篇文章。

    大家知道,要做一个全自助服务的SAAS云平台是比较复杂的,稍微有些漏洞,就会被不法分子钻漏洞,牵涉到一些金钱上的纠纷。因此,一开始的设计就比较重要了。说到云自助服务平台,可能和网上购物、在线商城有些类似,但里面提供的是相关服务,还是有些区别的,我在这里先讲几个概念:

  • 产品:产品即服务,即是提供给用户的服务。产品有单价,有些产品是基础产品,用户购买正式产品必须免费提供的,产品可以提供给用户进行试用。
  • 模块:产品包括很多模块,有些模块是必然会提供给用户的,比如 操作人员管理、操作日志 等,还有些模块是可选的,用户针对自己的情况进行购买,类似增值服务,比如移动端、企业主页等。另外还有些一次性的服务,比如系统数据对接硬件设备购买等;
  • 服务:用户所能享受到的服务,有一定的使用期限;
  • 订单:用户根据所拥有的 服务 所下的订单(而不是产品哦,为什么?);
  • 购物车:在用户订单生成前先把产品放在购物车里,购物车有很多类别,有的购物车是对目前服务进行的延期,有些是把试用的产品转为正式,有些是对现有服务模块的增删,牵涉到追加购买等。购物车操作频繁、需要做非常多的校验,要和已经购买的服务做无缝的对接,这也是云SAAS产品和普通电商很大不同的地方。到了订单阶段,就相对比较简单了,生成订单后将购物车清空、可以生成多张订单,支付的时候再做一遍校验。

     总体的概念流程是 服务->产品->购物车->订单->服务

    上一张购物车验证规则的流程图

    一些类(还没有全部完成):

    对实体类的操作大都采用工厂方式:

    购物车类代码:

 1     public class UserCart
 2     {
 3         public string UserId { get; set; }
 4         /// <summary>
 5         /// 设置域名
 6         /// </summary>
 7         public string ServiceIndentify { get; set; }
 8         public OrderType OrderType { get; set; }
 9         public IList<UserCartProduct> UserCartProducts { get; set; }
10         public float TotalPrice
11         {
12             get
13             {
14                 if (OrderType == OrderType.Experience)
15                 {
16                     return 0;
17                 }
18                 else
19                 {
20                     return UserCartProducts.Sum(p => p.Price);
21                 }
22             }
23         }
24         public virtual IList<UserCartProduct> UserCartProduct { get; set; }
25     }
26 
27     public class UserCartProduct
28     {
29         public string ProductId { get; set; }
30         public int ProductBasePrice { get; set; }
31         public Period Period { get; set; }
32         public DateTime StartDate { get; set; }
33         public DateTime EndDate { get; set; }
34         public IList<string> UserCartProductBasicModules { get; set; }
35         public IList<UserCartAddtionalModule> UserCartProductAddtionalModules { get; set; }
36         public IList<UserCartAddtionalService> UserCartAddtionalServices { get; set; }
37         public IList<UserCartOption> UserCartOptions { get; set; }
38         public float Price
39         {
40             get
41             {
42                 return ProductBasePrice
43                     + UserCartProductAddtionalModules.Sum(m => m.UintPrice.GetPriceByPeriod(Period))
44                     + UserCartAddtionalServices.Sum(m => m.UintPrice.GetPriceByPeriod(new Period(PeriodType.Times, m.Quantity)))
45                     + UserCartOptions.Sum(m => m.UintPrice.GetPriceByPeriod(Period));
46             }
47         }
48         public virtual UserCart UserCart { get; set; }
49     }
50 
51     public class ModuleBase
52     {
53         public string ModuleId { get; set; }
54         
55         public PeriodPrice UintPrice { get; set; }
56 
57     }
58 
59     public class UserCartAddtionalModule: ModuleBase
60     {
61     }
62 
63     public class UserCartAddtionalService : ModuleBase
64     {
65         public int Quantity { get; set; }
66     }
67 
68     public class UserCartOption: ModuleBase
69     {
70         public string CheckId { get; set; }
71         public string OriginCheckedId { get; set; }
72         public PeriodPrice OriginPeriodPrice { get; set; }
73     }

View Code

    其他类类似。

    大家对这块有什么好的意见和建议,希望能够提出来。

    SAAS云平台搭建札记系列文章:

    SAAS云平台搭建札记: (一)浅论SAAS多租户自助云服务平台的产品、服务和订单

    SAAS云平台搭建札记: (二)Linux Unbutu下.Net Core整套运行环境的搭建

    SAAS云平台搭建札记: (三) AntDesign + .Net Core WebAPI权限控制、动态菜单的生成

    SAAS云平台搭建札记: (四) AntD For React使用react-router-dom路由接收不同参数页面不刷新的问题