xiaoyong931011
2021-11-24 d0748bb35a57c3e2fa901559a954a9541ba51fcc
20211124  fish
3 files modified
1 files added
51 ■■■■■ changed files
src/main/java/com/xcong/excoin/modules/fish/controller/MemberCannonController.java 11 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/fish/service/MemberCannonService.java 2 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/fish/service/impl/MemberCannonServiceImpl.java 15 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/fish/vo/AccountAvaBanlaceVo.java 23 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/fish/controller/MemberCannonController.java
@@ -5,6 +5,7 @@
import com.xcong.excoin.modules.coin.parameter.vo.OrderWalletCoinDealVo;
import com.xcong.excoin.modules.fish.dto.*;
import com.xcong.excoin.modules.fish.service.MemberCannonService;
import com.xcong.excoin.modules.fish.vo.AccountAvaBanlaceVo;
import com.xcong.excoin.modules.fish.vo.CannonSettingVo;
import com.xcong.excoin.modules.fish.vo.GoldAccountVo;
import com.xcong.excoin.modules.fish.vo.OwnCannonVo;
@@ -27,6 +28,16 @@
    private MemberCannonService memberCannonService;
    /**
     * 获取账户金币,代币,USDT可用余额
     */
    @ApiOperation(value="获取账户金币,代币,USDT可用余额", notes="获取账户金币,代币,USDT可用余额")
    @ApiResponses({@ApiResponse( code = 200, message = "success", response = AccountAvaBanlaceVo.class)})
    @GetMapping(value="/getAccountAvaBanlace")
    public Result getAccountAvaBanlace() {
        return memberCannonService.getAccountAvaBanlace();
    }
    /**
     * 获取金币账户
     */
    @ApiOperation(value="获取金币账户", notes="获取金币账户")
src/main/java/com/xcong/excoin/modules/fish/service/MemberCannonService.java
@@ -25,4 +25,6 @@
    Result getOwnCannon();
    Result fishing(FishingDto fishingDto);
    Result getAccountAvaBanlace();
}
src/main/java/com/xcong/excoin/modules/fish/service/impl/MemberCannonServiceImpl.java
@@ -14,6 +14,7 @@
import com.xcong.excoin.modules.fish.dto.*;
import com.xcong.excoin.modules.fish.entity.*;
import com.xcong.excoin.modules.fish.service.MemberCannonService;
import com.xcong.excoin.modules.fish.vo.AccountAvaBanlaceVo;
import com.xcong.excoin.modules.fish.vo.CannonSettingVo;
import com.xcong.excoin.modules.fish.vo.GoldAccountVo;
import com.xcong.excoin.modules.fish.vo.OwnCannonVo;
@@ -264,6 +265,20 @@
        return Result.ok("success");
    }
    @Override
    public Result getAccountAvaBanlace() {
        Long memberId = LoginUserUtils.getAppLoginUser().getId();
        MemberAccountGold memberAccountGold = memberAccountGoldDao.selectAccountGoldByMemberId(memberId);
        MemberWalletCoinEntity memberWalletCoinEntityXCT = memberWalletCoinDao.selectWalletCoinBymIdAndCode(memberId, CoinTypeEnum.XCT.name());
        MemberWalletCoinEntity memberWalletCoinEntityUSDT = memberWalletCoinDao.selectWalletCoinBymIdAndCode(memberId, CoinTypeEnum.USDT.name());
        AccountAvaBanlaceVo accountAvaBanlaceVo = new AccountAvaBanlaceVo();
        accountAvaBanlaceVo.setMemberId(memberId);
        accountAvaBanlaceVo.setGoldAvailableBalance(memberAccountGold.getAvailableBalance() == null?BigDecimal.ZERO:memberAccountGold.getAvailableBalance());
        accountAvaBanlaceVo.setCoinAvailableBalance(memberWalletCoinEntityXCT.getAvailableBalance() == null?BigDecimal.ZERO:memberWalletCoinEntityXCT.getAvailableBalance());
        accountAvaBanlaceVo.setUsdtAvailableBalance(memberWalletCoinEntityUSDT.getAvailableBalance() == null?BigDecimal.ZERO:memberWalletCoinEntityUSDT.getAvailableBalance());
        return Result.ok(accountAvaBanlaceVo);
    }
    public static void main(String[] args) {
        System.out.println(UUID.randomUUID().toString());
    }
src/main/java/com/xcong/excoin/modules/fish/vo/AccountAvaBanlaceVo.java
New file
@@ -0,0 +1,23 @@
package com.xcong.excoin.modules.fish.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
@Data
@ApiModel(value = "AccountAvaBanlaceVo", description = "")
public class AccountAvaBanlaceVo {
    private Long memberId;
    @ApiModelProperty(value = "金币可用余额")
    private BigDecimal goldAvailableBalance;
    @ApiModelProperty(value = "代币可用余额")
    private BigDecimal coinAvailableBalance;
    @ApiModelProperty(value = "usdt可用余额")
    private BigDecimal usdtAvailableBalance;
}