Browse Source

Changes in Ordering microservice

pull/49/merge
Cesar De la Torre 8 years ago
parent
commit
4a20329413
3 changed files with 13 additions and 6 deletions
  1. +9
    -6
      src/Services/Ordering/Ordering.API/Controllers/OrderingController.cs
  2. +2
    -0
      src/Services/Ordering/Ordering.API/docker-compose.debug.yml
  3. +2
    -0
      src/Services/Ordering/Ordering.API/docker-compose.yml

+ 9
- 6
src/Services/Ordering/Ordering.API/Controllers/OrderingController.cs View File

@ -58,26 +58,29 @@ namespace Microsoft.eShopOnContainers.Services.Ordering.API.Controllers
// POST api/ordering/orders/create
[HttpPut("orders/create")]
public async Task<int> Post([FromBody]Order order)
public async Task<IActionResult> Post([FromBody]Order order)
{
_orderRepository.Add(order);
return await _orderRepository.UnitOfWork.CommitAsync();
int numChanges = await _orderRepository.UnitOfWork.CommitAsync();
return Ok(numChanges);
}
// PUT api/ordering/orders/xxxOrderGUIDxxxx/update
[HttpPut("orders/{orderId:Guid}/update")]
public async Task<int> UpdateOrder(Guid orderID, [FromBody] Order orderToUpdate)
public async Task<IActionResult> UpdateOrder(Guid orderID, [FromBody] Order orderToUpdate)
{
_orderRepository.Update(orderToUpdate);
return await _orderRepository.UnitOfWork.CommitAsync();
int numChanges = await _orderRepository.UnitOfWork.CommitAsync();
return Ok(numChanges);
}
// DELETE api/ordering/orders/xxxOrderGUIDxxxx
[HttpDelete("orders/{orderId:Guid}/remove")]
public async Task<int> Remove(Guid id)
public async Task<IActionResult> Remove(Guid id)
{
await _orderRepository.Remove(id);
return await _orderRepository.UnitOfWork.CommitAsync();
int numChanges = await _orderRepository.UnitOfWork.CommitAsync();
return Ok(numChanges);
}


+ 2
- 0
src/Services/Ordering/Ordering.API/docker-compose.debug.yml View File

@ -12,3 +12,5 @@ services:
- "80:80"
volumes:
- .:/app
extra_hosts:
- "CESARDLBOOKVHD:10.0.75.1"

+ 2
- 0
src/Services/Ordering/Ordering.API/docker-compose.yml View File

@ -8,3 +8,5 @@ services:
dockerfile: Dockerfile
ports:
- "80:80"
extra_hosts:
- "CESARDLBOOKVHD:10.0.75.1"

Loading…
Cancel
Save