From 1410c2c53a44f66a3dd06b5fc3d9e8152a1d4bf1 Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Tue, 15 Jun 2021 16:32:41 +0800
Subject: [PATCH] modify

---
 src/main/java/com/xcong/excoin/modules/coin/controller/OrderCoinController.java |   32 +++++++++++++++++++++++++-------
 1 files changed, 25 insertions(+), 7 deletions(-)

diff --git a/src/main/java/com/xcong/excoin/modules/coin/controller/OrderCoinController.java b/src/main/java/com/xcong/excoin/modules/coin/controller/OrderCoinController.java
index bea2599..95c1c68 100644
--- a/src/main/java/com/xcong/excoin/modules/coin/controller/OrderCoinController.java
+++ b/src/main/java/com/xcong/excoin/modules/coin/controller/OrderCoinController.java
@@ -6,14 +6,13 @@
 import javax.validation.Valid;
 
 import com.alibaba.fastjson.JSONObject;
+import com.xcong.excoin.common.annotations.SubmitRepeat;
 import com.xcong.excoin.modules.coin.entity.OrderCoinsEntity;
 import com.xcong.excoin.modules.symbols.constants.SymbolsConstats;
+import com.xcong.excoin.utils.RedisUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import com.xcong.excoin.common.response.Result;
 import com.xcong.excoin.modules.coin.parameter.dto.CancelEntrustWalletCoinOrderDto;
@@ -39,11 +38,14 @@
 @Api(value = "币币交易接口", tags = "币币交易接口")
 @RestController
 @RequestMapping(value = "/api/orderCoin")
+@CrossOrigin("*")
 public class OrderCoinController {
 	
 	@Resource
 	OrderCoinService orderCoinService;
-	
+
+	@Autowired
+	private RedisUtils redisUtils;
 	/**
 	 * 进入交易页面
 	 * @return
@@ -64,8 +66,13 @@
 	 */
 	@ApiOperation(value = "提交买卖订单", notes = "提交买卖订单")
 	@PostMapping(value="/submitSalesWalletCoinOrder")
+    @SubmitRepeat
 	public Result submitSalesWalletCoinOrder(@RequestBody @Valid SubmitSalesWalletCoinOrderDto submitSalesWalletCoinOrderDto) {
-		log.info("买卖单参数[{}]", JSONObject.toJSONString(submitSalesWalletCoinOrderDto));
+		log.debug("买卖单参数[{}]", JSONObject.toJSONString(submitSalesWalletCoinOrderDto));
+		String status = redisUtils.getString("bzz_order_status");
+//		if (!"1".equals(status)) {
+//			return Result.fail("暂未开放");
+//		}
 		String symbol = submitSalesWalletCoinOrderDto.getSymbol();
 		Integer type = submitSalesWalletCoinOrderDto.getType();
 		Integer tradeType = submitSalesWalletCoinOrderDto.getTradeType();
@@ -100,6 +107,7 @@
 	 */
 	@ApiOperation(value = "撤销委托订单", notes = "撤销委托订单")
 	@PostMapping(value="/cancelEntrustWalletCoinOrder")
+    @SubmitRepeat
 	public Result cancelEntrustWalletCoinOrder(@RequestBody @Valid CancelEntrustWalletCoinOrderDto cancelEntrustWalletCoinOrderDto) {
 		String orderId = cancelEntrustWalletCoinOrderDto.getOrderId();
 		// 根据不同币种
@@ -178,4 +186,14 @@
 		return orderCoinService.searchSymbolResultList();
 	}
 
+	/**
+	 * 获取币币交易历史订单信息
+	 * @return
+	 */
+	@ApiOperation(value = "获取币币交易历史订单信息", notes = "获取币币交易历史订单信息")
+	@ApiResponses({@ApiResponse( code = 200, message = "success", response = OrderWalletCoinDealVo.class)})
+	@GetMapping(value="/deal/list")
+	public Result  findAllWalletCoinOrder() {
+		return orderCoinService.findAllWalletCoinOrder();
+	}
 }

--
Gitblit v1.9.1