Пример #1
0
 /**
  * Update Current Order status. Make it available to Ninja for pickup.
  *
  * @return order list
  */
 @RequestMapping(
     value = "/{orderId}",
     method = RequestMethod.PUT,
     produces = Constants.APPLICATION_JSON)
 public ResponseEntity<BaseDTO> updateStatus(
     @PathVariable String merchantId, @PathVariable String orderId, @RequestParam String status) {
   try {
     String merId = super.beginMerchantSession(merchantId);
     com.yoku.server.core.services.order.Order service =
         new com.yoku.server.core.services.order.Order();
     service.updateStatusByMerchant(merId, orderId, status);
   } catch (LoginSessionException e) {
     logger.error(e.getMessage(), e);
   }
   return null;
 }
Пример #2
0
 /**
  * Read all orders for current merchant.
  *
  * @return order list
  */
 @RequestMapping(value = "/all", method = RequestMethod.GET, produces = Constants.APPLICATION_JSON)
 public ResponseEntity<BaseDTO> readAll(
     @PathVariable String merchantId, @RequestParam String status) {
   OrderDetailsResponseDTO response = null;
   HttpStatus httpStatus = null;
   try {
     String merId = super.beginMerchantSession(merchantId);
     com.yoku.server.core.services.order.Order service =
         new com.yoku.server.core.services.order.Order();
     response = service.readAll(merId, status);
     httpStatus = HttpStatus.OK;
   } catch (LoginSessionException e) {
     httpStatus = HttpStatus.BAD_REQUEST;
     logger.error(e.getMessage(), e);
   }
   return super.buildResponse(httpStatus, response);
 }