xiaoyong931011
2022-03-01 ee64a79830f6bad4107301c31f1fed3d8ab190c4
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
package com.xcong.excoin.modules.coin.controller;
 
import com.xcong.excoin.common.annotations.SubmitRepeat;
import com.xcong.excoin.common.response.Result;
import com.xcong.excoin.modules.coin.parameter.dto.*;
import com.xcong.excoin.modules.coin.parameter.vo.MemberGusdInfoVo;
import com.xcong.excoin.modules.coin.parameter.vo.UsdtToGusdVo;
import com.xcong.excoin.modules.coin.parameter.vo.ZhiyaInfoVo;
import com.xcong.excoin.modules.coin.parameter.vo.ZhiyaRewardVo;
import com.xcong.excoin.modules.coin.service.CoinService;
import com.xcong.excoin.modules.coin.service.ZhiyaService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
 
import javax.annotation.Resource;
import javax.validation.Valid;
import java.math.BigDecimal;
 
@Slf4j
@Api(value = "质押接口", tags = "质押接口")
@RestController
@RequestMapping(value = "/api/zhiya")
public class ZhiyaController {
 
    @Resource
    private ZhiyaService zhiyaService;
 
    /**
     * 获取GUSD账户信息
     */
    @ApiOperation(value="获取GUSD账户信息", notes="获取GUSD账户信息")
    @ApiResponses({@ApiResponse( code = 200, message = "success", response = MemberGusdInfoVo.class)})
    @GetMapping(value="/findMemberGusdInfo")
    public Result findMemberGusdInfo() {
        return zhiyaService.findMemberGusdInfo();
    }
 
    /**
     * USDT兌換成GUSD
     * @return
     */
    @ApiOperation(value="USDT兌換成GUSD", notes="USDT兌換成GUSD")
    @PostMapping(value="/usdtToGusd")
    @SubmitRepeat
    public Result  usdtToGusd(@RequestBody @Valid UsdtToGusdDto usdtToGusdDto) {
        BigDecimal balance = usdtToGusdDto.getBalance();
        Integer type = usdtToGusdDto.getType();
        return zhiyaService.usdtToGusd(balance,type);
    }
 
    /**
     *  获取兌換GUSD记录
     * @return
     */
    @ApiOperation(value="获取兌換GUSD记录", notes="获取兌換GUSD记录")
    @ApiResponses({@ApiResponse( code = 200, message = "success", response = UsdtToGusdVo.class)})
    @PostMapping(value="/getusdtToGusdRecords")
    public Result getusdtToGusdRecords(@RequestBody @Valid RecordsPageDto recordsPageDto) {
        return zhiyaService.getusdtToGusdRecords(recordsPageDto);
    }
 
    /**
     * 质押GUSD
     */
    @ApiOperation(value="质押GUSD", notes="质押GUSD")
    @PostMapping(value="/zhiYaGusd")
    @SubmitRepeat
    public Result  zhiYaGusd(@RequestBody @Valid ZhiYaGusdDto zhiYaGusdDto) {
        BigDecimal balance = zhiYaGusdDto.getBalance();
        return zhiyaService.zhiYaGusd(balance);
    }
 
    /**
     *  获取质押GUSD记录
     * @return
     */
    @ApiOperation(value="获取质押GUSD记录", notes="获取质押GUSD记录")
    @ApiResponses({@ApiResponse( code = 200, message = "success", response = ZhiyaInfoVo.class)})
    @PostMapping(value="/getZhiyaRecords")
    public Result  getZhiyaRecords(@RequestBody @Valid RecordsPageDto recordsPageDto) {
        return zhiyaService.getZhiyaRecords(recordsPageDto);
    }
 
    /**
     * 赎回GUSD
     */
    @ApiOperation(value="赎回GUSD", notes="赎回GUSD")
    @PostMapping(value="/shuhuiGusd")
    @SubmitRepeat
    public Result  shuhuiGusd(@RequestBody @Valid ShuhuiGusdDto shuhuiGusdDto) {
        BigDecimal balance = shuhuiGusdDto.getBalance();
        Long id = shuhuiGusdDto.getId();
        return zhiyaService.shuhuiGusd(balance,id);
    }
 
    /**
     *  获取质押GUSD奖励记录
     * @return
     */
    @ApiOperation(value="获取质押GUSD奖励记录", notes="获取质押GUSD奖励记录")
    @ApiResponses({@ApiResponse( code = 200, message = "success", response = ZhiyaRewardVo.class)})
    @PostMapping(value="/getZhiyaReward")
    public Result  getZhiyaReward(@RequestBody @Valid ZhiyaRewardRecordsPageDto recordsPageDto) {
        return zhiyaService.getZhiyaReward(recordsPageDto);
    }
 
    /**
     *  获取质押GUSD奖励返佣记录
     * @return
     */
    @ApiOperation(value="获取质押GUSD奖励返佣记录", notes="获取质押GUSD奖励返佣记录")
    @ApiResponses({@ApiResponse( code = 200, message = "success", response = ZhiyaRewardVo.class)})
    @PostMapping(value="/getZhiyaRewardTypeTo")
    public Result  getZhiyaRewardTypeTo(@RequestBody @Valid ZhiyaRewardRecordsTypePageDto recordsPageDto) {
        return zhiyaService.getZhiyaRewardTypeTo(recordsPageDto);
    }
}