File tree Expand file tree Collapse file tree 5 files changed +36
-24
lines changed
BuildingBlocks/CoolStore.AppContracts/RestApi
Product/ProductService.Application/V1/Endpoints/IntegrationEvents
Setting/SettingService.Application/Endpoints/V1/Queries Expand file tree Collapse file tree 5 files changed +36
-24
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ content-type: {{contentType}}
1212
1313###
1414@country-id = 18a4a8ae-3338-484a-a4ed-6e64d13d84dc
15- GET {{host }}/setting-api/countries/{{country-id}} HTTP/1.1
15+ GET {{host }}/setting-api/v1/ countries/{{country-id}} HTTP/1.1
1616content-type: {{contentType}}
1717
1818###
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ namespace CoolStore.AppContracts.RestApi
88{
99 public interface ICountryApi
1010 {
11- [ Get ( "api/countries/{countryId}" ) ]
11+ [ Get ( "api/v1/ countries/{countryId}" ) ]
1212 Task < ResultModel < CountryDto > > GetCountryByIdAsync ( [ Path ] Guid countryId ) ;
1313 }
1414}
Original file line number Diff line number Diff line change 1+ using System . Threading ;
2+ using System . Threading . Tasks ;
3+ using CoolStore . AppContracts . IntegrationEvents ;
4+ using Dapr ;
5+ using Microsoft . AspNetCore . Mvc ;
6+ using N8T . Infrastructure . Endpoint ;
7+
8+ namespace ProductService . Application . V1 . Endpoints . IntegrationEvents
9+ {
10+ [ ApiVersionNeutral ]
11+ [ ApiExplorerSettings ( IgnoreApi = true ) ]
12+ [ Route ( "api/v1/[controller]" ) ]
13+ public class CustomerCreated : BaseAsyncEndpoint . WithRequest < CustomerCreatedIntegrationEvent > . WithoutResponse
14+ {
15+ // [HttpPost("CustomerCreated")]
16+ // [Topic("pubsub", "CustomerCreatedIntegrationEvent")]
17+ // public override async Task HandleAsync(CustomerCreatedIntegrationEvent @event)
18+ // {
19+ // // TODO: this is an example for pub/sub
20+ // }
21+
22+ [ HttpPost ( "CustomerCreated" ) ]
23+ [ Topic ( "pubsub" , "CustomerCreatedIntegrationEvent" ) ]
24+ public override async Task < ActionResult > HandleAsync ( CustomerCreatedIntegrationEvent @event ,
25+ CancellationToken cancellationToken = new ( ) )
26+ {
27+ // TODO: this is an example for pub/sub
28+ return Ok ( ) ;
29+ }
30+ }
31+ }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1111using N8T . Infrastructure . Endpoint ;
1212using SettingService . Core . Entities ;
1313
14- namespace SettingService . Application . Endpoints . Queries
14+ namespace SettingService . Application . Endpoints . V1 . Queries
1515{
1616 public class GetCountryById : BaseAsyncEndpoint . WithRequest < Guid > . WithResponse < CountryDto >
1717 {
18- [ HttpGet ( "/api/countries/{id:guid}" ) ]
18+ [ ApiVersion ( "1.0" ) ]
19+ [ HttpGet ( "/api/v{version:apiVersion}/countries/{id:guid}" ) ]
1920 public override async Task < ActionResult < CountryDto > > HandleAsync ( Guid id ,
2021 CancellationToken cancellationToken = new ( ) )
2122 {
You can’t perform that action at this time.
0 commit comments