Helius
2021-06-11 fed58c8b88dc71ea5a5fa1cf1b5527f0b4555089
src/main/java/com/xcong/excoin/modules/coin/controller/OrderCoinController.java
@@ -5,13 +5,12 @@
import javax.annotation.Resource;
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 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;
@@ -37,6 +36,7 @@
@Api(value = "币币交易接口", tags = "币币交易接口")
@RestController
@RequestMapping(value = "/api/orderCoin")
@CrossOrigin("*")
public class OrderCoinController {
   
   @Resource
@@ -62,13 +62,15 @@
    */
   @ApiOperation(value = "提交买卖订单", notes = "提交买卖订单")
   @PostMapping(value="/submitSalesWalletCoinOrder")
    @SubmitRepeat
   public Result submitSalesWalletCoinOrder(@RequestBody @Valid SubmitSalesWalletCoinOrderDto submitSalesWalletCoinOrderDto) {
      log.debug("买卖单参数[{}]", JSONObject.toJSONString(submitSalesWalletCoinOrderDto));
      String symbol = submitSalesWalletCoinOrderDto.getSymbol();
      Integer type = submitSalesWalletCoinOrderDto.getType();
      Integer tradeType = submitSalesWalletCoinOrderDto.getTradeType();
      BigDecimal price = submitSalesWalletCoinOrderDto.getPrice();
      BigDecimal amount = submitSalesWalletCoinOrderDto.getAmount();
      if("NEKK".equals(symbol)){
      if(SymbolsConstats.EXCHANGE_SYMBOLS.contains(symbol)){
         return orderCoinService.submitSalesWalletCoinOrderWithMatch(symbol,type,tradeType,price,amount,submitSalesWalletCoinOrderDto.getEntrustAmount());
      }else{
@@ -97,8 +99,10 @@
    */
   @ApiOperation(value = "撤销委托订单", notes = "撤销委托订单")
   @PostMapping(value="/cancelEntrustWalletCoinOrder")
    @SubmitRepeat
   public Result cancelEntrustWalletCoinOrder(@RequestBody @Valid CancelEntrustWalletCoinOrderDto cancelEntrustWalletCoinOrderDto) {
      String orderId = cancelEntrustWalletCoinOrderDto.getOrderId();
      // 根据不同币种
      return orderCoinService.cancelEntrustWalletCoinOrder(orderId);
   }
   
@@ -173,5 +177,15 @@
   public Result  searchSymbolResultList() {
      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();
   }
}