| | |
| | | package com.xcong.excoin.modules.contract.controller; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import com.xcong.excoin.common.response.Result; |
| | | import com.xcong.excoin.modules.contract.parameter.dto.HoldOrderListDto; |
| | | import com.xcong.excoin.modules.contract.parameter.dto.SubmitOrderDto; |
| | | import com.xcong.excoin.modules.contract.service.ContractHoldOrderService; |
| | | import com.xcong.excoin.modules.contract.service.ContractOrderService; |
| | | import com.xcong.excoin.rabbit.producer.OrderProducer; |
| | | import io.swagger.annotations.*; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * @author wzy |
| | | * @date 2020-05-27 |
| | | **/ |
| | | @Slf4j |
| | | @Api(value = "ContractOrderController", tags = "合约订单历史接口类") |
| | | @Api(value = "ContractOrderController", tags = "合约订单接口类") |
| | | @RestController |
| | | @RequestMapping(value = "/api/contractOrder") |
| | | public class ContractOrderController { |
| | | |
| | | @Resource |
| | | private ContractHoldOrderService contractHoldOrderService; |
| | | |
| | | @Resource |
| | | private ContractOrderService contractOrderService; |
| | | |
| | | @ApiOperation(value = "市价提交合约订单") |
| | | @PostMapping(value = "/submitOrder") |
| | | public Result submitOrder(@RequestBody SubmitOrderDto submitOrderDto) { |
| | | return contractHoldOrderService.submitOrder(submitOrderDto); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询当前持仓订单列表 -- 轮询") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 0, message = "success", response = HoldOrderListDto.class) |
| | | }) |
| | | @GetMapping(value = "/findHoldOrderList") |
| | | public Result findHoldOrderList() { |
| | | return contractHoldOrderService.findHoldOrderList(); |
| | | } |
| | | |
| | | @ApiOperation(value = "未完成--根据Id查询订单详情") |
| | | @GetMapping(value = "/findHoldOrderDetail") |
| | | public Result findHoldOrderDetail(@ApiParam(name = "id", value = "持仓ID", required = true, example = "1") @RequestParam(value = "id") Long id) { |
| | | return null; |
| | | } |
| | | |
| | | @ApiOperation(value = "根据Id平仓") |
| | | @GetMapping(value = "/closingOrder") |
| | | public Result closingOrder(@ApiParam(name = "id", value = "持仓ID", required = true, example = "1") @RequestParam(value = "id") Long id) { |
| | | return contractHoldOrderService.cancelHoldOrder(id); |
| | | } |
| | | |
| | | @ApiOperation(value = "一键平仓") |
| | | @GetMapping(value = "/oneKeyClosing") |
| | | public Result oneKeyClosing() { |
| | | return contractHoldOrderService.cancelHoldOrderBatch(); |
| | | } |
| | | |
| | | @ApiOperation(value = "未完成--设置止盈止损") |
| | | @PostMapping(value = "/setTargetProfitOrLoss") |
| | | public Result setTargetProfitOrLoss() { |
| | | return null; |
| | | } |
| | | |
| | | @ApiOperation(value = "未完成--调整保证金") |
| | | @PostMapping(value = "/tuneUpBond") |
| | | public Result tuneUpBond() { |
| | | return null; |
| | | } |
| | | |
| | | @ApiOperation(value = "未完成--分页查询历史订单列表") |
| | | @GetMapping(value = "/findHistoryOrderList") |
| | | public Result findHistoryOrderList() { |
| | | return null; |
| | | } |
| | | |
| | | } |