-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore; namespacing for catalog API endpoints
- Loading branch information
1 parent
d0de96e
commit 2bc6c84
Showing
4 changed files
with
19 additions
and
19 deletions.
There are no files selected for viewing
10 changes: 5 additions & 5 deletions
10
...og/Catalog.Api/HttpApi/PriceCommandApi.cs → ...log.Api/HttpApi/Prices/PriceCommandApi.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
using Catalog.Api.Commands; | ||
using Catalog.Prices; | ||
using Eventuous; | ||
using Eventuous.AspNetCore.Web; | ||
using Microsoft.AspNetCore.Mvc; | ||
using static Catalog.Api.Commands.PriceCommands; | ||
|
||
namespace Catalog.Api.HttpApi; | ||
namespace Catalog.Api.HttpApi.Prices; | ||
|
||
[Route("/price")] | ||
public class PriceCommandApi(ICommandService<Price> service) : CommandHttpApiBase<Price>(service) | ||
{ | ||
[HttpPost] | ||
[Route("initialize")] | ||
public Task<ActionResult<Result>> Draft([FromBody] Initialize cmd, CancellationToken ct) | ||
public Task<ActionResult<Result>> Draft([FromBody] PriceCommands.Initialize cmd, CancellationToken ct) | ||
=> Handle(cmd, ct); | ||
|
||
[HttpPost] | ||
[Route("activate")] | ||
public Task<ActionResult<Result>> Activate([FromBody] Activate cmd, CancellationToken ct) | ||
public Task<ActionResult<Result>> Activate([FromBody] PriceCommands.Activate cmd, CancellationToken ct) | ||
=> Handle(cmd, ct); | ||
|
||
[HttpPost] | ||
[Route("deprecate")] | ||
public Task<ActionResult<Result>> Deprecate([FromBody] Deprecate cmd, CancellationToken ct) | ||
public Task<ActionResult<Result>> Deprecate([FromBody] PriceCommands.Deprecate cmd, CancellationToken ct) | ||
=> Handle(cmd, ct); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 12 additions & 12 deletions
24
.../Catalog.Api/HttpApi/ProductCommandApi.cs → ...Api/HttpApi/Products/ProductCommandApi.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,61 @@ | ||
using Catalog.Api.Commands; | ||
using Catalog.Products; | ||
using Eventuous; | ||
using Eventuous.AspNetCore.Web; | ||
using Microsoft.AspNetCore.Mvc; | ||
using static Catalog.Api.Commands.ProductCommands; | ||
|
||
namespace Catalog.Api.HttpApi; | ||
namespace Catalog.Api.HttpApi.Products; | ||
|
||
[Route("/product")] | ||
public class ProductCommandApi(ICommandService<Product> service) : CommandHttpApiBase<Product>(service) | ||
{ | ||
[HttpPost] | ||
[Route("draft-with-id")] | ||
public Task<ActionResult<Result>> Draft([FromBody] DraftWithProvidedId cmd, CancellationToken ct) | ||
public Task<ActionResult<Result>> Draft([FromBody] ProductCommands.DraftWithProvidedId cmd, CancellationToken ct) | ||
=> Handle(cmd, ct); | ||
|
||
[HttpPost] | ||
[Route("draft")] | ||
public Task<ActionResult<Result>> Draft([FromBody] Draft cmd, CancellationToken ct) | ||
public Task<ActionResult<Result>> Draft([FromBody] ProductCommands.Draft cmd, CancellationToken ct) | ||
=> Handle(cmd, ct); | ||
|
||
[HttpPost] | ||
[Route("activate")] | ||
public Task<ActionResult<Result>> Activate([FromBody] Activate cmd, CancellationToken ct) | ||
public Task<ActionResult<Result>> Activate([FromBody] ProductCommands.Activate cmd, CancellationToken ct) | ||
=> Handle(cmd, ct); | ||
|
||
[HttpPost] | ||
[Route("archive")] | ||
public Task<ActionResult<Result>> Archive([FromBody] Archive cmd, CancellationToken ct) | ||
public Task<ActionResult<Result>> Archive([FromBody] ProductCommands.Archive cmd, CancellationToken ct) | ||
=> Handle(cmd, ct); | ||
|
||
[HttpPost] | ||
[Route("cancel")] | ||
public Task<ActionResult<Result>> Cancel([FromBody] Cancel cmd, CancellationToken ct) | ||
public Task<ActionResult<Result>> Cancel([FromBody] ProductCommands.Cancel cmd, CancellationToken ct) | ||
=> Handle(cmd, ct); | ||
|
||
[HttpPost] | ||
[Route("adjust-description")] | ||
public Task<ActionResult<Result>> AdjustDescription([FromBody] AdjustDescription cmd, CancellationToken ct) | ||
public Task<ActionResult<Result>> AdjustDescription([FromBody] ProductCommands.AdjustDescription cmd, CancellationToken ct) | ||
=> Handle(cmd, ct); | ||
|
||
[HttpPost] | ||
[Route("adjust-name")] | ||
public Task<ActionResult<Result>> AdjustName([FromBody] AdjustName cmd, CancellationToken ct) | ||
public Task<ActionResult<Result>> AdjustName([FromBody] ProductCommands.AdjustName cmd, CancellationToken ct) | ||
=> Handle(cmd, ct); | ||
|
||
[HttpPost] | ||
[Route("adjust-brand")] | ||
public Task<ActionResult<Result>> AdjustBrand([FromBody] AdjustBrand cmd, CancellationToken ct) | ||
public Task<ActionResult<Result>> AdjustBrand([FromBody] ProductCommands.AdjustBrand cmd, CancellationToken ct) | ||
=> Handle(cmd, ct); | ||
|
||
[HttpPost] | ||
[Route("take-measurement")] | ||
public Task<ActionResult<Result>> TakeMeasurement([FromBody] TakeMeasurement cmd, CancellationToken ct) | ||
public Task<ActionResult<Result>> TakeMeasurement([FromBody] ProductCommands.TakeMeasurement cmd, CancellationToken ct) | ||
=> Handle(cmd, ct); | ||
|
||
[HttpPost] | ||
[Route("remove-measurement")] | ||
public Task<ActionResult<Result>> RemoveMeasurement([FromBody] RemoveMeasurement cmd, CancellationToken ct) | ||
public Task<ActionResult<Result>> RemoveMeasurement([FromBody] ProductCommands.RemoveMeasurement cmd, CancellationToken ct) | ||
=> Handle(cmd, ct); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters