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);
|
}
|
}
|