package com.xcong.excoin.modules.otc.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.xcong.excoin.common.response.Result; import com.xcong.excoin.modules.otc.dto.OrderAddDto; import com.xcong.excoin.modules.otc.dto.OrderListDto; import com.xcong.excoin.modules.otc.service.OtcOrderService; import com.xcong.excoin.modules.otc.vo.OrderListVo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.ibatis.annotations.Param; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @Slf4j @Validated @RestController @RequestMapping(value = "/api/otcOrder") @RequiredArgsConstructor @Api(value = "OtcOrderController", tags = "otc用户订单接口类") public class OtcOrderController { private final OtcOrderService otcOrderService; @ApiOperation(value = "我要购买") @PostMapping(value = "/buy") public Result buy(@RequestBody OrderAddDto orderAddDto) { otcOrderService.buyOrder(orderAddDto); return Result.ok("购买成功"); } @ApiOperation(value = "我要出售") @PostMapping(value = "/sale") public Result sale(@RequestBody OrderAddDto orderAddDto) { otcOrderService.saleOrder(orderAddDto); return Result.ok("出售成功"); } @ApiOperation(value = "用户订单列表") @PostMapping(value = "/orderList") public Result orderList(@RequestBody OrderListDto orderListDto) { IPage page = otcOrderService.findOrderListInPage(orderListDto); return Result.ok(page.getRecords()); } @ApiOperation(value = "已付款,请放币") @PostMapping(value = "/hasPay/{id}") public Result hasPay(@PathVariable("id") Long id) { otcOrderService.hasPay(id); return Result.ok("操作成功"); } @ApiOperation(value = "确认收款") @PostMapping(value = "/finishOrder/{id}") public Result finishOrder(@PathVariable("id") Long id) { return null; } }