| | |
| | | import com.yami.trading.admin.model.LoginModel; |
| | | import com.yami.trading.admin.model.UpdateAddressModel; |
| | | import com.yami.trading.bean.model.ChannelBlockchain; |
| | | import com.yami.trading.common.constants.RedisKeys; |
| | | import com.yami.trading.common.domain.Result; |
| | | import com.yami.trading.common.exception.YamiShopBindException; |
| | | import com.yami.trading.common.util.GoogleAuthenticator; |
| | |
| | | import com.yami.trading.sys.model.SysUser; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | |
| | | * @description: 充值地址 |
| | | * @create: 2025-08-07 14:44 |
| | | **/ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("address") |
| | | @Api(tags = "充值地址") |
| | | public class AddressController { |
| | | |
| | | @Autowired |
| | | RedisTemplate redisTemplate; |
| | | |
| | | /** |
| | | * 地址列表 |
| | |
| | | return Result.succeed(); |
| | | } |
| | | |
| | | /** |
| | | * u盾地址列表 |
| | | * @return |
| | | */ |
| | | @GetMapping("/getUDList") |
| | | public Result<?> getUDList(String partyId) { |
| | | if (partyId == null || partyId.isEmpty()) { |
| | | return Result.failed("请选择用户"); |
| | | } |
| | | List<CryptoCurrencyEnum> currencyEnums = CryptoCurrencyEnum.getAll(); |
| | | List<ChannelBlockchain> data = new ArrayList<>(); |
| | | currencyEnums.forEach(currencyEnum->{ |
| | | try { |
| | | String address = (String)redisTemplate.opsForValue().get(RedisKeys.BLOCKCHAIN_ADDRESS + partyId + currencyEnum.getName()); |
| | | ChannelBlockchain blockchain = new ChannelBlockchain(); |
| | | blockchain.setBlockchain_name(currencyEnum.getChain()); |
| | | blockchain.setAddress(address); |
| | | blockchain.setCoin(currencyEnum.getCoin()); |
| | | blockchain.setAuto(false); |
| | | blockchain.setImg(null); |
| | | data.add(blockchain); |
| | | } catch (Exception e) { |
| | | log.error(e.getMessage()); |
| | | } |
| | | }); |
| | | return Result.succeed(data); |
| | | } |
| | | |
| | | } |