src/main/java/com/kshrd/derphsar_api/rest/restcontroller/OrderDetailRestController.java
/**
     * Post a shop
     *
     * @param orderDetailFirstRequest - Shop request model
     * @return - Return response message
     */
Post a shop
@param orderDetailFirstRequest - Shop request model
@return - Return response message
Post a shop @param orderDetailFirstRequest - Shop request model @return - Return response message
@PostMapping("/orderdetails")
    @ApiOperation(value = "add products to cart", response = OrderDetailFilterResponse.class)
    public ResponseEntity<BaseApiNoPaginationResponse<OrderDetailFilterResponse>> addProductToCart(@RequestBody OrderDetailFirstRequest orderDetailFirstRequest){
        ModelMapper mapper = new ModelMapper();
        UUID uuid = UUID.randomUUID();
        BaseApiNoPaginationResponse<OrderDetailFilterResponse> response = new BaseApiNoPaginationResponse<>();
        OrderDetailDto orderDetailDto = mapper.map(orderDetailFirstRequest,OrderDetailDto.class);
        if(orderDetailFirstRequest.getQuatity() != 0 ){
            orderDetailDto.setItemId("DP"+uuid.toString().substring(0,10));
            orderDetailDto.setStatus(true);
            Timestamp timestamp = new Timestamp(System.currentTimeMillis());
            Date date = new Date(timestamp.getTime());
            orderDetailDto.setOrderDate(date);
            OrderDetailDto orderDetailDto1 = orderDetailServiceImp.addProductToCart(orderDetailDto);
            OrderDetailFilterResponse orderDetailFilterResponse = mapper.map(orderDetailDto1, OrderDetailFilterResponse.class);
            response.setMessage(message.inserted("OrderDetail"));
            response.setData(orderDetailFilterResponse);
            response.setStatus(HttpStatus.CREATED);
        }else {
            response.setMessage(message.insertError("OrderDetail"));
            response.setStatus(HttpStatus.BAD_REQUEST);
        }
        response.setTime(new Timestamp(System.currentTimeMillis()));
        return ResponseEntity.ok(response);
    }
@ PostMapping ( "/orderdetails" ) @ ApiOperation ( value = "add products to cart" , response = OrderDetailFilterResponse . class ) public ResponseEntity < BaseApiNoPaginationResponse < OrderDetailFilterResponse > > addProductToCart ( @ RequestBody OrderDetailFirstRequest orderDetailFirstRequest ) { ModelMapper mapper = new ModelMapper ( ) ; UUID uuid = UUID . randomUUID ( ) ; BaseApiNoPaginationResponse < OrderDetailFilterResponse > response = new BaseApiNoPaginationResponse < > ( ) ; OrderDetailDto orderDetailDto = mapper . map ( orderDetailFirstRequest , OrderDetailDto . class ) ; if ( orderDetailFirstRequest . getQuatity ( ) != 0 ) { orderDetailDto . setItemId ( "DP" + uuid . toString ( ) . substring ( 0 , 10 ) ) ; orderDetailDto . setStatus ( true ) ; Timestamp timestamp = new Timestamp ( System . currentTimeMillis ( ) ) ; Date date = new Date ( timestamp . getTime ( ) ) ; orderDetailDto . setOrderDate ( date ) ; OrderDetailDto orderDetailDto1 = orderDetailServiceImp . addProductToCart ( orderDetailDto ) ; OrderDetailFilterResponse orderDetailFilterResponse = mapper . map ( orderDetailDto1 , OrderDetailFilterResponse . class ) ; response . setMessage ( message . inserted ( "OrderDetail" ) ) ; response . setData ( orderDetailFilterResponse ) ; response . setStatus ( HttpStatus . CREATED ) ; } else { response . setMessage ( message . insertError ( "OrderDetail" ) ) ; response . setStatus ( HttpStatus . BAD_REQUEST ) ; } response . setTime ( new Timestamp ( System . currentTimeMillis ( ) ) ) ; return ResponseEntity . ok ( response ) ; }
Post a shop
 @param orderDetailFirstRequest - Shop request model
 @return - Return response message
Post a shop @param orderDetailFirstRequest - Shop request model @return - Return response message
// System.out.println(date);