Skip to content

NaturalDragon/surgingDemo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

 

  这是基于surging微服务引擎的一个框架,支持MySQL、SqlServer、Oracle,框架面向接口化编程,降低单元之间的耦合,采用autofac实现依赖注入,autoMapper实现数据传输dto与实体entity之间的映射,FluentValidation实现服务端数据校验。

  surging传送门:https://github.com/dotnetcore/surging

  框架github地址:https://github.com/NaturalDragon/surgingDemo

  • 1.项目结构

参照DDD目录结构(但不完全实现DDD思想)。

00.Surging.Core为surging源码。

01.Infrastructure为 EF CORE 的仓储封装,以及一些常用类库的封装。

02.Domain为实体。

03.Application业务代码实现层。

04.Modules为surging路由RoutePath。

05.ServerHost为surging引擎服务。

06.Presentation包括surging网关以及一个简单的react前端示例。

  • 2. 框架环境

vs2019、consul、rabbitMQ、redis。

  • 3. 数据库文件

       ./db文件夹中存放有OrderInfo.sql(MySql)、Organization.sql(MySql)、Product.sql(SqlServer),分别对应ServerHost里面MicroService.ServerHost.Order、MicroService.ServerHost.Org、MicroService.ServerHost.Product三个引擎服务,生成数据库后修改各个引擎服务里面的appsettings.json 里面的connectionString。

  • 4.运行

  ServerHost/MicroService.ServerHost.Order >dotnet run --Configuration Release

  ServerHost/MicroService.ServerHost.Org >dotnet run --Configuration Release

  ServerHost/MicroService.ServerHost.Product >dotnet run --Configuration Release

  Presentation/Surging.ApiGateway >dotnet run --Configuration Release

  Presentation/App>npm install 或者yarn install 

  Presentation/App>npm start

前端启动后访问http://localhost:8000/#/app/product 默认账号密码admin、123456

运行效果如图:

 

 

 

 

 

 

 

 

 

  

 

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published