Helius
2020-06-01 4b844113469b203adc40f1e540de98612321f26e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
package com.xcong.excoin.modules.contract.controller;
 
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.*;
 
import javax.annotation.Resource;
 
/**
 * @author wzy
 * @date 2020-05-27
 **/
@Slf4j
@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;
    }
 
}