xiaoyong931011
2020-05-25 ee5c6327f939b3df45f701266ce1e93bbef2c0f1
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
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);
    }
 
}