| | |
| | | @ApiOperation(value = "我要购买") |
| | | @PostMapping(value = "/buy") |
| | | public Result buy(@RequestBody OtcOrderAddDto orderAddDto) { |
| | | otcOrderService.buyOrder(orderAddDto); |
| | | return Result.ok("购买成功"); |
| | | return otcOrderService.buyOrder(orderAddDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "我要出售") |
| | | @PostMapping(value = "/sale") |
| | | public Result sale(@RequestBody OtcOrderAddDto orderAddDto) { |
| | | otcOrderService.saleOrder(orderAddDto); |
| | | return Result.ok("出售成功"); |
| | | return otcOrderService.saleOrder(orderAddDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "用户订单列表") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = OrderListVo.class) |
| | | }) |
| | | @PostMapping(value = "/orderList") |
| | | public Result orderList(@RequestBody OrderListDto orderListDto) { |
| | | IPage<OrderListVo> page = otcOrderService.findOrderListInPage(orderListDto); |
| | |
| | | otcOrderService.finishOrder(id); |
| | | return Result.ok("操作成功"); |
| | | } |
| | | |
| | | @ApiOperation(value = "取消订单") |
| | | @PostMapping(value = "/cancelUserOrder/{id}") |
| | | public Result cancelUserOrder(@PathVariable("id") Long id) { |
| | | otcOrderService.cancelOrder(id); |
| | | return Result.ok("操作成功"); |
| | | } |
| | | } |