src/main/java/com/xcong/excoin/modules/coin/controller/CoinController.java
@@ -6,6 +6,7 @@ import javax.validation.Valid; import com.xcong.excoin.modules.coin.parameter.vo.AllWalletCoinVo; import com.xcong.excoin.modules.coin.parameter.vo.ContractSymbolListVo; import com.xcong.excoin.modules.coin.parameter.vo.MemberAccountMoneyChangeInfoVo; import com.xcong.excoin.modules.coin.parameter.vo.MemberAgentIntoInfoVo; import com.xcong.excoin.modules.coin.parameter.vo.MemberWalletAgentInfoVo; @@ -235,5 +236,16 @@ return coinService.agentTransferToWalletCoins(balance,transfertype,symbol); } /** * 合约账户列表 * @return */ @ApiOperation(value="合约账户列表", notes="合约账户列表") @ApiResponses({@ApiResponse( code = 200, message = "success", response = ContractSymbolListVo.class)}) @GetMapping(value="/getContractSymbolList") public Result getContractSymbolList() { return coinService.getContractSymbolList(); } } src/main/java/com/xcong/excoin/modules/coin/parameter/vo/ContractSymbolListVo.java
New file @@ -0,0 +1,14 @@ package com.xcong.excoin.modules.coin.parameter.vo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data @ApiModel(value = "ContractSymbolListVo", description = "信息返回") public class ContractSymbolListVo { @ApiModelProperty(value = "账户类型") private String walletCode; } src/main/java/com/xcong/excoin/modules/coin/service/CoinService.java
@@ -45,4 +45,6 @@ public Result agentTransferToWalletCoins(BigDecimal balance, Integer transfertype, String symbol); public Result getContractSymbolList(); } src/main/java/com/xcong/excoin/modules/coin/service/impl/CoinServiceImpl.java
@@ -22,6 +22,7 @@ import com.xcong.excoin.modules.coin.mapper.MemberAccountMoneyChangeMapper; import com.xcong.excoin.modules.coin.parameter.dto.RecordsPageDto; import com.xcong.excoin.modules.coin.parameter.vo.AllWalletCoinVo; import com.xcong.excoin.modules.coin.parameter.vo.ContractSymbolListVo; import com.xcong.excoin.modules.coin.parameter.vo.MemberAccountMoneyChangeInfoVo; import com.xcong.excoin.modules.coin.parameter.vo.MemberWalletAgentInfoVo; import com.xcong.excoin.modules.coin.parameter.vo.MemberWalletCoinInfoVo; @@ -797,4 +798,19 @@ return Result.ok(allWalletCoinVo); } @Override public Result getContractSymbolList() { //获取用户ID Long memberId = LoginUserUtils.getAppLoginUser().getId(); List<ContractSymbolListVo> list = memberWalletContractDao.findContractSymbolListBymemberId(memberId); if(CollUtil.isNotEmpty(list)) { for(ContractSymbolListVo contractSymbolListVo : list) { String walletCode = contractSymbolListVo.getWalletCode(); walletCode = walletCode+"/USDT"; contractSymbolListVo.setWalletCode(walletCode); } } return Result.ok(list); } } src/main/java/com/xcong/excoin/modules/member/dao/MemberWalletContractDao.java
@@ -3,9 +3,11 @@ import org.apache.ibatis.annotations.Param; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.xcong.excoin.modules.coin.parameter.vo.ContractSymbolListVo; import com.xcong.excoin.modules.member.entity.MemberWalletContractEntity; import java.math.BigDecimal; import java.util.List; public interface MemberWalletContractDao extends BaseMapper<MemberWalletContractEntity> { @@ -19,4 +21,6 @@ * @param id */ void increaseWalletContractBalanceById(@Param("availableBalance") BigDecimal availableBalance,@Param("totalBalance") BigDecimal totalBalance,@Param("frozenBalance") BigDecimal frozenBalance,@Param("id") Long id); List<ContractSymbolListVo> findContractSymbolListBymemberId(@Param("memberId")Long memberId); } src/main/resources/mapper/member/MemberWalletContractDao.xml
@@ -9,6 +9,12 @@ and wallet_code = #{symbol} </if> </select> <select id="findContractSymbolListBymemberId" resultType="com.xcong.excoin.modules.coin.parameter.vo.ContractSymbolListVo"> select wallet_code from member_wallet_contract where member_id = #{memberId} </select> <update id="increaseWalletContractBalanceById" parameterType="map" > update member_wallet_contract