Skip to content

Commit fe0e17d

Browse files
committed
Update
1 parent 19bd26f commit fe0e17d

1 file changed

Lines changed: 38 additions & 35 deletions

File tree

Lines changed: 38 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,45 @@
1-
using System.Threading.Tasks;
21
using CapTest.Order.Service;
32
using Microsoft.AspNetCore.Mvc;
43

5-
namespace CapTest.Order.Host.Controllers
4+
namespace CapTest.Order.Host.Controllers;
5+
6+
[ApiController]
7+
[Route("[controller]")]
8+
public class OrderController : ControllerBase
69
{
7-
[ApiController]
8-
[Route("[controller]")]
9-
public class OrderController : ControllerBase
10+
private readonly OrderService _orderService;
11+
12+
public OrderController(OrderService orderService)
13+
{
14+
_orderService = orderService;
15+
}
16+
17+
#region Methods
18+
19+
[HttpPost]
20+
[Route("{id}")]
21+
public Task<string> CreateAsync(int id)
1022
{
11-
private readonly OrderService _orderService;
12-
13-
public OrderController(OrderService orderService)
14-
{
15-
_orderService = orderService;
16-
}
17-
18-
[HttpPost]
19-
[Route("{id}")]
20-
public async Task<string> CreateAsync(int id)
21-
{
22-
return await _orderService.Create(id);
23-
}
24-
25-
[HttpPost]
26-
[Route("CreateWithTransaction/{id}")]
27-
public async Task<string> CreateWithTransactionAsync(int id)
28-
{
29-
return await _orderService.CreateWithoutCapPgsql(id);
30-
}
31-
32-
[HttpPost]
33-
[Route("CreateMessageWithHeaders")]
34-
// ReSharper disable once InconsistentNaming
35-
public async Task<IActionResult> CreateTTLMessage()
36-
{
37-
await _orderService.CreateMessageWithHeaders();
38-
39-
return Ok();
40-
}
23+
return _orderService.Create(id);
4124
}
25+
26+
[HttpPost]
27+
[Route("CreateMessageWithHeaders")]
28+
// ReSharper disable once InconsistentNaming
29+
public async Task<IActionResult> CreateTTLMessage()
30+
{
31+
await _orderService.CreateMessageWithHeaders();
32+
33+
return Ok();
34+
}
35+
36+
[HttpPost]
37+
[Route("CreateWithTransaction/{id}")]
38+
public Task<string> CreateWithTransactionAsync(int id)
39+
{
40+
return _orderService.CreateWithoutCapPgsql(id);
41+
}
42+
43+
#endregion
44+
4245
}

0 commit comments

Comments
 (0)