微信小程序后端框架 | C# ASP.NET服务端WebApi快速开发框架平台

微信小程序后端框架 | C# ASP.NET服务端WebApi快速开发框架平台





一、产品介绍
CSFramework.WebApi是服务端快速开发框架(后端框架),借助ASP.NET WebAPI底层架构的强大编程能力,封装成为可复用的以及可定制开发的服务端软件模板,CSFramework.WebApi提供可复用的软件架构和开发包,为用户快速轻松搭建基于HTTP协议、HTTPS协议以及支持多种客户端(如:APP、B/S、C/S、微信公众号、微信小程序等)各种跨平台移动终端的服务端应用程序。
服务端应用开发、后端接口开发是软件项目重要工作环节,服务端注重业务逻辑、数据处理和数据分析、算法等方面的设计和服务,前端主要体现在用户体验、界面操作和数据采集方面。前端软件系统和后端服务架构共同搭建跨平台大型数据管理应用系统。
CSFramework.COM致力于C/S系统快速开发框架以及后端开发框架WebApi框架产品方面的技术研究,先后发布多个软件产品,结合成熟的技术经验和项目经验,以及专注、专业、始终如一的创新精神和工匠精神,分享成功、创造卓越!盛情打造全新作品,为C/S框架网用户提供更多优秀的作品是我们努力奋斗目标。
WebApi应用场景

二、架构图 (Architecture)





三、客户端请求流程 (Client Request)


客户端发起请求 -> 构建Request对象,封装账号信息以及业务数据 -> 序列化成为JSON/XML文本格式 -> 使用HTTPPOST 或 HTTPGET 方式向服务端提交数据 -> 服务端接收到请求信息。
四、服务端处理流程 (Server Process)


服务端接收请求 -> 记录IP访问日志(可配置) -> 进行安全检查 -> 命令工厂创建命令实例(Command Object) -> 由命令处理程序(CommandHandler)执行命令 -> 调用数据访问层 -> 提交数据。
五、命令处理机制 (Commands)


六、数据访问层(DAL Data Access Layer)




七、安全机制 (System Security)


1.User - 用户账号:通过用户账号和密码确保有效访问,系统支持用户账号、手机号、邮箱登录。
2.Token - 令牌机制:通过令牌机制确保有效访问。用户登录成功,系统自动分配随机令牌编号。
3.ApiKey - 开发者账号:WebApi接口常用安全机制,使用公钥+私钥加密方式,确保系统安全。
4.Data Sign - 数据签名:WebApi接口常用安全机制,使用公钥+私钥加密方式,确保系统安全。
5.Blacklist - 黑名单:针对黑名单用户限制访问或操作,此功能可配置使用。
6.Throttle - 限流控制:有效避免频繁访问、恶意访问WebApi接口,此功能可配置使用。
7.ApiLog - 接口访问日志:针对任何Http请求,服务端会记录接口访问记录,此功能可配置使用。
8.Login Log - 系统登录日志:记录用户登入或登出系统的信息。
9.数据加密/解密:提供CryptoHelper工具类,以及4种对称加密工具。
八、ORM模型(ORM Model)



九、跨平台服务端 (Cross Platform Server)


操作数据库代码示例:

十、WebApi服务器宿主(Server Hosting)


开发模式必须使用自承载模式,主要方便开发人员进行系统调试、功能测试、断点跟踪和开发。

基于IIS(Internet Information Server)服务器承载WepApi服务。要求IIS版本在7.0或更高,应用程序池设置为.NetFramework 4.5。

基于Windows服务承载WebApi服务。首先要安装服务,运行程序目录下的_Install.bat批处理文件,命令窗体显示安装情况,安装完成后,打开Windows服务管理器,找到安装的服务(如:CSFramework.WebAPI.服务器,见下图),在属性页将启动类型设置为“自动(延迟启动)“。

十一、解决方案(VS2015 Solution)








十二、压力测试报告(Testing Report)


















十三、开发环境与配置
1. 操作系统:Windows 7,8,10或更高版本
2. 开发工具:Visual Studio 2015或更高版本
3. 数据库:Microsoft SQL Server 2008~2012或更高版本
4. WebApi IIS承载:IIS 7.0或更高版本
5. .Net Framework运行环境:4.0或更高版本


<本文完>
参考文章:
微信小程序使用https协议的WebApi后端应用服务(Win服务宿主或自承载)
WebApi开发框架成功案例:车货匹配类微信小程序
WebApi开发框架应用电商微信小程序成功案例
WebApi后端框架服务端框架开发微信小程序订阅消息接口
C#.NET WebApi开发框架成功案例-物流行业TMS系统+APP+微信小程序
.NET WebApi后端开发框架-微信小程序消息订阅与推送案例详解
CSFramework WebApi服务端框架开发微信支付接口成功案例

扫一扫加微信:



版权声明:本文为开发框架文库发布内容,转载请附上原文出处连接
NewDoc C/S框架网