Commit 797f6ac9 authored by Nikitha Moosapet's avatar Nikitha Moosapet

[nmoosapet]Implemented Order-History Functionality to get the order history by...

[nmoosapet]Implemented Order-History Functionality to get the order history by userId from OMS product team
parent 1b82c0bc
package com.nisum.ecomservice.controller;
import com.nisum.ecomservice.dto.CartDTO;
import com.nisum.ecomservice.dto.Order;
import com.nisum.ecomservice.dto.OrderRequest;
import com.nisum.ecomservice.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
......@@ -20,7 +22,8 @@ public class OrdersController {
return orderService.postOrder(orderRequest);
}
@GetMapping("/byUser/{userId}")
private Flux<Order> getUserOrderHistory(@PathVariable String userId){
return orderService.getOrderFromOmsAPI(userId);
private ResponseEntity<Flux<Order>> getUserOrderHistory(@PathVariable String userId){
return ResponseEntity.ok(orderService.getOrderFromOmsAPI(userId));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment