Skip to content

Commit 3911e1e

Browse files
committed
add setting and customer services
1 parent 629416b commit 3911e1e

File tree

68 files changed

+1782
-61
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1782
-61
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
The practical repository uses coolstore domain which is mainly borrowed from `https://github.com/zkavtaskin/Domain-Driven-Design-Example` to demonstrate how to apply Domain Driven Design seamlessly with Clean Architecture.
44

5-
## Show your support
5+
## Give a star ⭐
66

7-
If you **cannot give a star** :star: for `practical-clean-ddd` repository, **try it again**!
7+
A bright future of the .NET Community! What you LIKE or SHARE on `practical-clean-ddd` repository will help to strengthen and spread-out the way YOU develop the cloud-native application with the .NET platform and toolings as well as microservices development on Dapr and Kubernetes with .NET toolkit.
88

9-
Why? Because it doesn't only **help strengthen our .NET community** but also **helps to improve cloud-native apps development on the .NET platform**. Thank you very much :+1:
9+
So if you use this repository for your samples, workshop, your project or whatever you did, please give a star ⭐ for it. Thank you very much :+1:
1010

1111
# Give it a try!
1212

components/appconfig.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apiVersion: dapr.io/v1alpha1
2+
kind: Configuration
3+
metadata:
4+
name: appconfig
5+
spec:
6+
tracing:
7+
samplingRate: "1"

components/pubsub.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: dapr.io/v1alpha1
2+
kind: Component
3+
metadata:
4+
name: pubsub
5+
spec:
6+
type: pubsub.redis
7+
metadata:
8+
- name: redisHost
9+
value: localhost:6379
10+
- name: redisPassword
11+
value: ""

components/statestore.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: dapr.io/v1alpha1
2+
kind: Component
3+
metadata:
4+
name: statestore
5+
spec:
6+
type: state.redis
7+
metadata:
8+
- name: redisHost
9+
value: localhost:6379
10+
- name: redisPassword
11+
value: ""
12+
- name: actorStateStore
13+
value: "false"

coolstore.sln

Lines changed: 53 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProductService.Infrastructu
2626
EndProject
2727
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "N8T.Infrastructure", "src\BuildingBlocks\N8T.Infrastructure\N8T.Infrastructure.csproj", "{FEE450A9-7F98-4869-82C8-9A9F2D862B79}"
2828
EndProject
29-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "N8T.Infrastructure.App", "src\BuildingBlocks\N8T.Infrastructure.App\N8T.Infrastructure.App.csproj", "{CF46C96E-0AF2-4613-9587-6EAB6657B755}"
30-
EndProject
3129
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "N8T.Infrastructure.EfCore", "src\BuildingBlocks\N8T.Infrastructure.EfCore\N8T.Infrastructure.EfCore.csproj", "{0836619C-1F06-4321-8957-5606275590A8}"
3230
EndProject
3331
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "N8T.Infrastructure.OTel", "src\BuildingBlocks\N8T.Infrastructure.OTel\N8T.Infrastructure.OTel.csproj", "{BF32EAF6-F507-4CBC-B3C5-DE2F7E84113E}"
@@ -36,6 +34,24 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "N8T.Core", "src\BuildingBlo
3634
EndProject
3735
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ProductService.Application", "src\Product\ProductService.Application\ProductService.Application.csproj", "{C4F658E6-EE63-4378-94B6-7E18D02E51F2}"
3836
EndProject
37+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CoolStore.AppContracts", "src\BuildingBlocks\CoolStore.AppContracts\CoolStore.AppContracts.csproj", "{923B5A7D-6D76-4A95-9AB8-3099EC740655}"
38+
EndProject
39+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Setting", "Setting", "{EEA08CE8-4834-4D36-ADE0-24F5F471AF6A}"
40+
EndProject
41+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SettingService.Core", "src\Setting\SettingService.Core\SettingService.Core.csproj", "{340E9BEE-1CE0-43EE-A33B-0C039D7FCE5B}"
42+
EndProject
43+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SettingService.Infrastructure", "src\Setting\SettingService.Infrastructure\SettingService.Infrastructure.csproj", "{2561F40E-103B-4E80-B057-91D7AD44E3D9}"
44+
EndProject
45+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SettingService.Application", "src\Setting\SettingService.Application\SettingService.Application.csproj", "{A9F94E23-850D-4750-94C1-9C26B25A3DED}"
46+
EndProject
47+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Customer", "Customer", "{5D18FF27-2948-433A-A40F-77C778A705C1}"
48+
EndProject
49+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomerService.Core", "src\Customer\CustomerService.Core\CustomerService.Core.csproj", "{C2531C6A-185A-4120-B098-946855684626}"
50+
EndProject
51+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CustomerService.Infrastructure", "src\Customer\CustomerService.Infrastructure\CustomerService.Infrastructure.csproj", "{A26F7B4F-F725-4018-954A-C3D7925C2A30}"
52+
EndProject
53+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CustomerService.Application", "src\Customer\CustomerService.Application\CustomerService.Application.csproj", "{4F623591-01CB-4CCE-9BDD-9B0CBC6D8F8E}"
54+
EndProject
3955
Global
4056
GlobalSection(SolutionConfigurationPlatforms) = preSolution
4157
Debug|Any CPU = Debug|Any CPU
@@ -54,10 +70,6 @@ Global
5470
{FEE450A9-7F98-4869-82C8-9A9F2D862B79}.Debug|Any CPU.Build.0 = Debug|Any CPU
5571
{FEE450A9-7F98-4869-82C8-9A9F2D862B79}.Release|Any CPU.ActiveCfg = Release|Any CPU
5672
{FEE450A9-7F98-4869-82C8-9A9F2D862B79}.Release|Any CPU.Build.0 = Release|Any CPU
57-
{CF46C96E-0AF2-4613-9587-6EAB6657B755}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
58-
{CF46C96E-0AF2-4613-9587-6EAB6657B755}.Debug|Any CPU.Build.0 = Debug|Any CPU
59-
{CF46C96E-0AF2-4613-9587-6EAB6657B755}.Release|Any CPU.ActiveCfg = Release|Any CPU
60-
{CF46C96E-0AF2-4613-9587-6EAB6657B755}.Release|Any CPU.Build.0 = Release|Any CPU
6173
{0836619C-1F06-4321-8957-5606275590A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
6274
{0836619C-1F06-4321-8957-5606275590A8}.Debug|Any CPU.Build.0 = Debug|Any CPU
6375
{0836619C-1F06-4321-8957-5606275590A8}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -74,6 +86,34 @@ Global
7486
{C4F658E6-EE63-4378-94B6-7E18D02E51F2}.Debug|Any CPU.Build.0 = Debug|Any CPU
7587
{C4F658E6-EE63-4378-94B6-7E18D02E51F2}.Release|Any CPU.ActiveCfg = Release|Any CPU
7688
{C4F658E6-EE63-4378-94B6-7E18D02E51F2}.Release|Any CPU.Build.0 = Release|Any CPU
89+
{923B5A7D-6D76-4A95-9AB8-3099EC740655}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
90+
{923B5A7D-6D76-4A95-9AB8-3099EC740655}.Debug|Any CPU.Build.0 = Debug|Any CPU
91+
{923B5A7D-6D76-4A95-9AB8-3099EC740655}.Release|Any CPU.ActiveCfg = Release|Any CPU
92+
{923B5A7D-6D76-4A95-9AB8-3099EC740655}.Release|Any CPU.Build.0 = Release|Any CPU
93+
{340E9BEE-1CE0-43EE-A33B-0C039D7FCE5B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
94+
{340E9BEE-1CE0-43EE-A33B-0C039D7FCE5B}.Debug|Any CPU.Build.0 = Debug|Any CPU
95+
{340E9BEE-1CE0-43EE-A33B-0C039D7FCE5B}.Release|Any CPU.ActiveCfg = Release|Any CPU
96+
{340E9BEE-1CE0-43EE-A33B-0C039D7FCE5B}.Release|Any CPU.Build.0 = Release|Any CPU
97+
{2561F40E-103B-4E80-B057-91D7AD44E3D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
98+
{2561F40E-103B-4E80-B057-91D7AD44E3D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
99+
{2561F40E-103B-4E80-B057-91D7AD44E3D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
100+
{2561F40E-103B-4E80-B057-91D7AD44E3D9}.Release|Any CPU.Build.0 = Release|Any CPU
101+
{A9F94E23-850D-4750-94C1-9C26B25A3DED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
102+
{A9F94E23-850D-4750-94C1-9C26B25A3DED}.Debug|Any CPU.Build.0 = Debug|Any CPU
103+
{A9F94E23-850D-4750-94C1-9C26B25A3DED}.Release|Any CPU.ActiveCfg = Release|Any CPU
104+
{A9F94E23-850D-4750-94C1-9C26B25A3DED}.Release|Any CPU.Build.0 = Release|Any CPU
105+
{C2531C6A-185A-4120-B098-946855684626}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
106+
{C2531C6A-185A-4120-B098-946855684626}.Debug|Any CPU.Build.0 = Debug|Any CPU
107+
{C2531C6A-185A-4120-B098-946855684626}.Release|Any CPU.ActiveCfg = Release|Any CPU
108+
{C2531C6A-185A-4120-B098-946855684626}.Release|Any CPU.Build.0 = Release|Any CPU
109+
{A26F7B4F-F725-4018-954A-C3D7925C2A30}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
110+
{A26F7B4F-F725-4018-954A-C3D7925C2A30}.Debug|Any CPU.Build.0 = Debug|Any CPU
111+
{A26F7B4F-F725-4018-954A-C3D7925C2A30}.Release|Any CPU.ActiveCfg = Release|Any CPU
112+
{A26F7B4F-F725-4018-954A-C3D7925C2A30}.Release|Any CPU.Build.0 = Release|Any CPU
113+
{4F623591-01CB-4CCE-9BDD-9B0CBC6D8F8E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
114+
{4F623591-01CB-4CCE-9BDD-9B0CBC6D8F8E}.Debug|Any CPU.Build.0 = Debug|Any CPU
115+
{4F623591-01CB-4CCE-9BDD-9B0CBC6D8F8E}.Release|Any CPU.ActiveCfg = Release|Any CPU
116+
{4F623591-01CB-4CCE-9BDD-9B0CBC6D8F8E}.Release|Any CPU.Build.0 = Release|Any CPU
77117
EndGlobalSection
78118
GlobalSection(SolutionProperties) = preSolution
79119
HideSolutionNode = FALSE
@@ -82,11 +122,17 @@ Global
82122
{5D51CCDB-A06D-4201-AC53-D2279CDF2DCA} = {26B30655-87DA-471F-8CE5-132B4281791F}
83123
{73BD59B3-DB37-4501-A742-8F4D286DF795} = {26B30655-87DA-471F-8CE5-132B4281791F}
84124
{FEE450A9-7F98-4869-82C8-9A9F2D862B79} = {B17CF9E5-E4A8-42B4-A669-7BC41D314D5F}
85-
{CF46C96E-0AF2-4613-9587-6EAB6657B755} = {B17CF9E5-E4A8-42B4-A669-7BC41D314D5F}
86125
{0836619C-1F06-4321-8957-5606275590A8} = {B17CF9E5-E4A8-42B4-A669-7BC41D314D5F}
87126
{BF32EAF6-F507-4CBC-B3C5-DE2F7E84113E} = {B17CF9E5-E4A8-42B4-A669-7BC41D314D5F}
88127
{42928BD7-FE47-43EE-A75E-765E469782B2} = {B17CF9E5-E4A8-42B4-A669-7BC41D314D5F}
89128
{C4F658E6-EE63-4378-94B6-7E18D02E51F2} = {26B30655-87DA-471F-8CE5-132B4281791F}
129+
{923B5A7D-6D76-4A95-9AB8-3099EC740655} = {B17CF9E5-E4A8-42B4-A669-7BC41D314D5F}
130+
{340E9BEE-1CE0-43EE-A33B-0C039D7FCE5B} = {EEA08CE8-4834-4D36-ADE0-24F5F471AF6A}
131+
{2561F40E-103B-4E80-B057-91D7AD44E3D9} = {EEA08CE8-4834-4D36-ADE0-24F5F471AF6A}
132+
{A9F94E23-850D-4750-94C1-9C26B25A3DED} = {EEA08CE8-4834-4D36-ADE0-24F5F471AF6A}
133+
{C2531C6A-185A-4120-B098-946855684626} = {5D18FF27-2948-433A-A40F-77C778A705C1}
134+
{A26F7B4F-F725-4018-954A-C3D7925C2A30} = {5D18FF27-2948-433A-A40F-77C778A705C1}
135+
{4F623591-01CB-4CCE-9BDD-9B0CBC6D8F8E} = {5D18FF27-2948-433A-A40F-77C778A705C1}
90136
EndGlobalSection
91137
GlobalSection(ExtensibilityGlobals) = postSolution
92138
SolutionGuid = {7B983152-0931-4714-9EDE-BD7DE35C758E}

restclient.http

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
@host = http://localhost:5002
2+
@setting-host = http://localhost:5005
3+
@customer-host = http://localhost:5003
24

35
###
46
POST {{host}}/api/products-query HTTP/1.1
@@ -22,6 +24,11 @@ content-type: {{contentType}}
2224
GET {{host}}/api/products/{{id}} HTTP/1.1
2325
content-type: {{contentType}}
2426

27+
###
28+
@country-id = 18a4a8ae-3338-484a-a4ed-6e64d13d84dc
29+
GET {{setting-host}}/api/countries/{{country-id}} HTTP/1.1
30+
content-type: {{contentType}}
31+
2532
###
2633
POST {{host}}/api/products HTTP/1.1
2734
content-type: {{contentType}}
@@ -34,3 +41,16 @@ content-type: {{contentType}}
3441
"productCodeName": "pcode"
3542
}
3643
}
44+
45+
###
46+
POST {{customer-host}}/api/customers HTTP/1.1
47+
content-type: {{contentType}}
48+
49+
{
50+
"model": {
51+
"firstName": "firstName 1",
52+
"lastName": "lastName 1",
53+
"email": "email1@nomail.com",
54+
"countryId": "18a4a8ae-3338-484a-a4ed-6e64d13d84dc"
55+
}
56+
}

rs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,4 @@ Session.vim
5252
no_llvm_build
5353
# Before adding new lines, see the comment at the top.
5454
/*/**/target
55+
/vendor/

src/BuildingBlocks/N8T.Infrastructure.App/AppConsts.cs renamed to src/BuildingBlocks/CoolStore.AppContracts/AppConsts.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
namespace N8T.Infrastructure.App
1+
namespace CoolStore.AppContracts
22
{
33
public class AppConsts
44
{
55
public const string ProductAppName = "productapp";
66
public const string CartAppName = "cartapp";
77
public const string CustomerAppName = "customerapp";
8-
public const string SettingsAppName = "settingsapp";
8+
public const string SettingAppName = "settingapp";
99
}
1010
}

src/BuildingBlocks/N8T.Infrastructure.App/N8T.Infrastructure.App.csproj renamed to src/BuildingBlocks/CoolStore.AppContracts/CoolStore.AppContracts.csproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
<ItemGroup>
1010
<PackageReference Include="AspNetCore.HealthChecks.NpgSql" Version="5.0.1" />
1111
<PackageReference Include="AspNetCore.HealthChecks.Uris" Version="5.0.1" />
12+
<PackageReference Include="RestEase" Version="1.5.2" />
13+
<PackageReference Include="RestEase.HttpClientFactory" Version="1.5.2" />
14+
<PackageReference Include="RestEase.SourceGenerator" Version="1.5.2">
15+
<PrivateAssets>all</PrivateAssets>
16+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
17+
</PackageReference>
1218
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="5.0.1" />
1319
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="5.0.0" />
1420
</ItemGroup>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System;
2+
3+
namespace CoolStore.AppContracts.Dtos
4+
{
5+
public class CountryDto
6+
{
7+
public Guid Id { get; set; } = default!;
8+
public string Name { get; set; } = default!;
9+
}
10+
}

0 commit comments

Comments
 (0)