package com.xcong.excoin.modules.coin.controller;
|
|
import java.math.BigDecimal;
|
|
import javax.annotation.Resource;
|
import javax.validation.Valid;
|
|
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 com.xcong.excoin.common.response.Result;
|
import com.xcong.excoin.modules.coin.parameter.dto.SubmitSalesWalletCoinOrderDto;
|
import com.xcong.excoin.modules.coin.parameter.dto.TransferOfBalanceDto;
|
import com.xcong.excoin.modules.coin.service.OrderCoinService;
|
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiParam;
|
import lombok.extern.slf4j.Slf4j;
|
|
@Slf4j
|
@Api(value = "币币交易接口", tags = "币币交易接口")
|
@RestController
|
@RequestMapping(value = "/api/orderCoin")
|
public class OrderCoinController {
|
|
@Resource
|
OrderCoinService orderCoinService;
|
|
/**
|
* 进入交易页面
|
* @return
|
*/
|
@ApiOperation(value = "进入交易页面", notes = "进入交易页面")
|
@GetMapping(value = "/enterTransactionPageOfWalletCoin")
|
public Result enterTransactionPageOfWalletCoin( @ApiParam(name="symbol",value="币种",required=true)String symbol,
|
@ApiParam(name="type",value="买入卖出类型",required=true)String type) {
|
return orderCoinService.enterTransactionPageOfWalletCoin(symbol,type);
|
}
|
|
/**
|
* 提交买卖订单
|
* @param buySymbolTradeVo
|
* @param token
|
* @return
|
*/
|
@ApiOperation(value = "提交买卖订单", notes = "提交买卖订单")
|
@PostMapping(value="/submitSalesWalletCoinOrder")
|
public Result submitSalesWalletCoinOrder(@RequestBody @Valid SubmitSalesWalletCoinOrderDto submitSalesWalletCoinOrderDto) {
|
String symbol = submitSalesWalletCoinOrderDto.getSymbol();
|
Integer type = submitSalesWalletCoinOrderDto.getType();
|
Integer tradeType = submitSalesWalletCoinOrderDto.getTradeType();
|
BigDecimal price = submitSalesWalletCoinOrderDto.getPrice();
|
BigDecimal amount = submitSalesWalletCoinOrderDto.getAmount();
|
return orderCoinService.submitSalesWalletCoinOrder(symbol,type,tradeType,price,amount);
|
}
|
|
}
|