From bef3b23ca8918a355f6ff9751b46f4c35970f19e Mon Sep 17 00:00:00 2001
From: zainali5120 <512061637@qq.com>
Date: Sun, 25 Oct 2020 14:09:43 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/whole' into whole

---
 src/main/java/com/xcong/excoin/modules/contract/controller/ContractOrderController.java |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/xcong/excoin/modules/contract/controller/ContractOrderController.java b/src/main/java/com/xcong/excoin/modules/contract/controller/ContractOrderController.java
index 89614aa..59eed54 100644
--- a/src/main/java/com/xcong/excoin/modules/contract/controller/ContractOrderController.java
+++ b/src/main/java/com/xcong/excoin/modules/contract/controller/ContractOrderController.java
@@ -1,5 +1,6 @@
 package com.xcong.excoin.modules.contract.controller;
 
+import com.xcong.excoin.common.LoginUserUtils;
 import com.xcong.excoin.common.response.Result;
 import com.xcong.excoin.modules.contract.parameter.dto.*;
 import com.xcong.excoin.modules.contract.parameter.vo.ContractMoneyInfoVo;
@@ -7,6 +8,7 @@
 import com.xcong.excoin.modules.contract.parameter.vo.OrderListVo;
 import com.xcong.excoin.modules.contract.service.ContractHoldOrderService;
 import com.xcong.excoin.modules.contract.service.ContractOrderService;
+import com.xcong.excoin.modules.member.entity.MemberEntity;
 import com.xcong.excoin.rabbit.producer.OrderProducer;
 import io.swagger.annotations.*;
 import lombok.extern.slf4j.Slf4j;
@@ -118,13 +120,22 @@
     @ApiOperation(value = "全仓模式 - 平仓")
     @PostMapping(value = "/closingOrder")
     public Result closingOrder(@RequestBody @Validated WholeCloseOrderDto wholeCloseOrderDto) {
-        return Result.ok("平仓成功");
+        return contractHoldOrderService.cancelHoldOrder(wholeCloseOrderDto);
     }
 
     @ApiOperation(value = "全仓模式 - 变更仓位类型")
     @GetMapping(value = "/changePositionType")
     public Result changePositionType() {
-        return contractHoldOrderService.changePositionType();
+        return Result.fail("无法切换");
+//        return contractHoldOrderService.changePositionType();
+    }
+
+    @GetMapping(value = "/findPositionType")
+    @ApiModelProperty(value = "全仓模式 -- 获取仓位状态")
+    public Result findPositionType() {
+        MemberEntity memberEntity = LoginUserUtils.getAppLoginUser();
+
+        return Result.ok("获取成功", memberEntity.getContractPositionType());
     }
 
 }

--
Gitblit v1.9.1