From 9a968ba186af5280fcc29cc3eb04412eff204ba7 Mon Sep 17 00:00:00 2001 From: Helius <wangdoubleone@gmail.com> Date: Thu, 27 May 2021 16:37:33 +0800 Subject: [PATCH] modify --- src/main/java/com/xcong/excoin/modules/otc/controller/OtcOrderController.java | 30 +++++++++++++++++++++++------- 1 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/xcong/excoin/modules/otc/controller/OtcOrderController.java b/src/main/java/com/xcong/excoin/modules/otc/controller/OtcOrderController.java index ef94ab0..3065e30 100644 --- a/src/main/java/com/xcong/excoin/modules/otc/controller/OtcOrderController.java +++ b/src/main/java/com/xcong/excoin/modules/otc/controller/OtcOrderController.java @@ -4,12 +4,14 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.xcong.excoin.common.response.Result; import com.xcong.excoin.modules.otc.dto.HasPayDto; -import com.xcong.excoin.modules.otc.dto.OrderAddDto; +import com.xcong.excoin.modules.otc.dto.OrderApealDto; import com.xcong.excoin.modules.otc.dto.OrderListDto; +import com.xcong.excoin.modules.otc.dto.OtcOrderAddDto; import com.xcong.excoin.modules.otc.service.OtcOrderService; import com.xcong.excoin.modules.otc.vo.BuyOrderDetailVo; import com.xcong.excoin.modules.otc.vo.OrderListVo; import com.xcong.excoin.modules.otc.vo.SaleOrderDetailVo; +import com.xcong.excoin.utils.RedisUtils; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiResponse; @@ -32,19 +34,20 @@ @ApiOperation(value = "我要购买") @PostMapping(value = "/buy") - public Result buy(@RequestBody OrderAddDto orderAddDto) { - otcOrderService.buyOrder(orderAddDto); - return Result.ok("购买成功"); + public Result buy(@RequestBody OtcOrderAddDto orderAddDto) { + return otcOrderService.buyOrder(orderAddDto); } @ApiOperation(value = "我要出售") @PostMapping(value = "/sale") - public Result sale(@RequestBody OrderAddDto orderAddDto) { - otcOrderService.saleOrder(orderAddDto); - return Result.ok("出售成功"); + public Result sale(@RequestBody OtcOrderAddDto orderAddDto) { + 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); @@ -82,4 +85,17 @@ 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("操作成功"); + } + + @ApiOperation(value = "申诉") + @PostMapping(value = "/orderApeal") + public Result orderApeal(@RequestBody OrderApealDto orderApealDto) { + return otcOrderService.orderApeal(orderApealDto); + } } -- Gitblit v1.9.1