Helius
2021-05-13 1b44a9a25a51324dba8e8640cb405440f2cf7d48
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
package com.xcong.excoin.modules.yunding.controller;
 
import com.xcong.excoin.common.response.Result;
import com.xcong.excoin.modules.yunding.dto.InsureChangeUsdtDto;
import com.xcong.excoin.modules.yunding.dto.PayProductDto;
import com.xcong.excoin.modules.yunding.dto.YdOrderListDto;
import com.xcong.excoin.modules.yunding.dto.YdProductListDto;
import com.xcong.excoin.modules.yunding.service.YunDingService;
import com.xcong.excoin.modules.yunding.vo.*;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
 
@RestController
@RequestMapping(value = "api/yd")
@Slf4j
@Api(value = "YunDingController", tags = "云顶算力")
public class YunDingController {
 
    @Resource
    YunDingService yunDingService;
 
    /**
     * 全网数据
     */
    @ApiOperation(value = "全网数据")
    @ApiResponses({
            @ApiResponse(code = 0, message = "success", response = YdBasicSettingVo.class)
    })
    @GetMapping(value = "/findAllInfo")
    public Result findAllInfo() {
        return yunDingService.findAllInfo();
    }
 
    /**
     * 算力产品列表
     */
    @ApiOperation(value = "产品列表")
    @ApiResponses({
            @ApiResponse(code = 0, message = "success", response = YdProductVo.class)
    })
    @PostMapping(value = "/getProductList")
    public Result getProductList(@RequestBody @Validated YdProductListDto ydProductListDto) {
        return yunDingService.getProductList(ydProductListDto);
    }
 
    /**
     * 获取算力产品详情
     */
    @ApiOperation(value = "获取产品详情")
    @GetMapping(value = "/findProductInfo")
    public Result findProductInfoById(@ApiParam(name = "id", value = "产品ID", required = true, example = "1")
                                      @RequestParam(value = "id") Long id) {
        return yunDingService.findProductInfoById(id);
    }
 
    /**
     * 获取USDT余额
     */
    @ApiOperation(value = "获取USDT余额")
    @GetMapping(value = "/getBalance")
    public Result getBalance() {
        return yunDingService.getBalance();
    }
 
    /**
     * 支付
     */
    @ApiOperation(value = "购买,点击支付")
    @PostMapping(value = "/payProduct")
    public Result payProduct(@RequestBody @Validated PayProductDto payProductDto) {
        return yunDingService.payProduct(payProductDto);
    }
 
    /**
     * 订单列表
     */
    @ApiOperation(value = "订单列表")
    @ApiResponses({
            @ApiResponse(code = 0, message = "success", response = YdOrderVo.class)
    })
    @PostMapping(value = "/getOrderList")
    public Result getOrderList(@RequestBody @Validated YdOrderListDto ydOrderListDto) {
        return yunDingService.getOrderList(ydOrderListDto);
    }
 
    /**
     * 订单详情
     */
    @ApiOperation(value = "订单详情")
    @ApiResponses({
            @ApiResponse(code = 0, message = "success", response = YdOrderVo.class)
    })
    @GetMapping(value = "/getOrderInfo")
    public Result getOrderInfo(@ApiParam(name = "id", value = "订单ID", required = true, example = "1")
                                      @RequestParam(value = "id") Long id) {
        return yunDingService.getOrderInfo(id);
    }
 
    /**
     *订单头部数据
     */
    @ApiOperation(value = "订单头部数据")
    @ApiResponses({
            @ApiResponse(code = 0, message = "success", response = OrderAllInfoVo.class)
    })
    @GetMapping(value = "/findOrderAllInfo")
    public Result findOrderAllInfo() {
        return yunDingService.findOrderAllInfo();
    }
 
    /**
     * 转换成USDT
     */
    @ApiOperation(value = "获取转换成USDT信息")
    @ApiResponses({
            @ApiResponse(code = 0, message = "success", response = ChangeVo.class)
    })
    @GetMapping(value = "/changeUsdt")
    public Result changeUsdt() {
        return yunDingService.changeUsdt();
    }
 
    /**
     * 确认转换成USDT
     */
    @ApiOperation(value = "确认转换成USDT")
    @PostMapping(value = "/insureChangeUsdt")
    public Result insureChangeUsdt(@RequestBody @Validated InsureChangeUsdtDto insureChangeUsdtdto){
        return yunDingService.insureChangeUsdt(insureChangeUsdtdto);
    }
 
 
}