文章目录
- 项目地址
- 一、Ticketing模块拆分
-
- [1.1 创建web api](#1.1 创建web api)
-
- [1. 添加引用](#1. 添加引用)
- [2. 添加需要的包和配置](#2. 添加需要的包和配置)
- [3. program.cs](#3. program.cs)
- [4. docker-compose修改](#4. docker-compose修改)
项目地址
- 教程作者:
- 教程地址:
- 代码仓库地址:
-
所用到的框架和插件:
dbt
airflow
一、Ticketing模块拆分
1.1 创建web api

1. 添加引用
<ItemGroup>
<ProjectReference Include="..\..\Modules\Ticketing\Evently.Modules.Ticketing.Infrastructure\Evently.Modules.Ticketing.Infrastructure.csproj" />
</ItemGroup>
- 删除program.cs里没有用的服务
2. 添加需要的包和配置
-
Ticketing的webapi和Event.api一样,直接复制粘贴
-
将Event.api里的appsettings复制到改web api只留下自己相关的
appsettings.development.json
{
"ConnectionStrings": {
"Database": "Host=evently.database;Port=5432;Database=evently;Username=postgres;Password=postgres;Include Error Detail=true",
"Cache": "evently.redis:6379",
"Queue": "amqp://evently-queue:5672"
},
"Authentication": {
"Audience": "account",
"TokenValidationParameters": {
"ValidIssuers": [ "http://evently.identity:8080/realms/evently", "http://localhost:18080/realms/evently" ]
},
"MetadataAddress": "http://evently.identity:8080/realms/evently/.well-known/openid-configuration",
"RequireHttpsMetadata": false
},
"KeyCloak": {
"HealthUrl": "http://evently.identity:8080/health/"
},
"Serilog": {
"Using": [
"Serilog.Sinks.Console",
"Serilog.Sinks.Seq"
],
"MinimumLevel": {
"Default": "Information",
"Override": {
"Microsoft": "Information",
"Evently.Modules.Ticketing.Infrastructure.Outbox": "Warning",
"Evently.Modules.Ticketing.Infrastructure.Inbox": "Warning"
}
},
"WriteTo": [
{ "Name": "Console" },
{
"Name": "Seq",
"Args": { "serverUrl": "http://evently.seq:5341" }
}
],
"Enrich": [ "FromLogContext", "WithMachineName", "WithThreadId" ],
"Properties": {
"Application": "Evently.Ticketing.Api"
}
},
"OTEL_EXPORTER_OTLP_ENDPOINT": "http://evently.jaeger:4317"
}
3. program.cs
- 删除所有需要其他模块的配置
4. docker-compose修改
