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