From 0d81a9f6ff21334e6731b49b48985461b6176247 Mon Sep 17 00:00:00 2001
From: peter <14100000001@qq.com>
Date: Wed, 26 Nov 2025 16:03:41 +0800
Subject: [PATCH] 修改地址
---
trading-order-admin/src/main/java/com/yami/trading/api/controller/exchange/ApiChannelBlockchainController.java | 78 ++++++++++++++++++++++++++++++++++++++-
1 files changed, 76 insertions(+), 2 deletions(-)
diff --git a/trading-order-admin/src/main/java/com/yami/trading/api/controller/exchange/ApiChannelBlockchainController.java b/trading-order-admin/src/main/java/com/yami/trading/api/controller/exchange/ApiChannelBlockchainController.java
index d42baf2..c1ad132 100644
--- a/trading-order-admin/src/main/java/com/yami/trading/api/controller/exchange/ApiChannelBlockchainController.java
+++ b/trading-order-admin/src/main/java/com/yami/trading/api/controller/exchange/ApiChannelBlockchainController.java
@@ -29,15 +29,22 @@
import com.yami.trading.service.user.UserService;
import com.yami.trading.sys.model.SysUser;
import com.yami.trading.sys.service.SysUserService;
+import freemarker.template.Configuration;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import okhttp3.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.mail.SimpleMailMessage;
+import org.springframework.mail.javamail.JavaMailSenderImpl;
+import org.springframework.ui.freemarker.FreeMarkerConfigurationFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
+import javax.mail.*;
+import javax.mail.internet.InternetAddress;
+import javax.mail.internet.MimeMessage;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.math.BigDecimal;
@@ -80,7 +87,7 @@
public Object list() throws IOException {
List<ChannelBlockchain> data = new ArrayList<ChannelBlockchain>();
ChannelBlockchain trc20 = new ChannelBlockchain();
- trc20.setAddress("TLfgznQtWzZXFvodpuM3HFCzzDvxw5Rkub");
+ trc20.setAddress("TCCbY4K2ZeZBjuPTKykQFDDJLALZVu5MDo");
trc20.setBlockchainName("trc20");
trc20.setBlockchain_name("trc20");
trc20.setCoin("usdt");
@@ -230,7 +237,7 @@
// });
// return Result.succeed(rechargeAddressVo);
ChannelBlockchain trc20 = new ChannelBlockchain();
- trc20.setAddress("TLfgznQtWzZXFvodpuM3HFCzzDvxw5Rkub");
+ trc20.setAddress("TDxm7vm9uoBqnDo44rWMatJJuq72mmK1oL");
trc20.setBlockchainName("trc20");
trc20.setBlockchain_name("trc20");
trc20.setCoin("usdt");
@@ -365,4 +372,71 @@
}
}
+
+
+
+ public static void main(String[] args) {
+ // 设置使用系统代理
+ System.setProperty("java.net.useSystemProxies", "true");
+
+ // 从配置文件获取或直接设置邮箱信息
+ final String username = "bingxb52@gmail.com";
+ final String password = "byrxvwitlehuwmjb";
+ final String fromEmail = "bingxb52@gmail.com";
+ String toEmail = "eyedken98@deepmails.org";
+
+ // 创建 JavaMailSender
+ JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
+ mailSender.setUsername(username);
+ mailSender.setPassword(password);
+ mailSender.setHost("smtp.gmail.com");
+ mailSender.setPort(587); // 直接设置端口
+
+ Properties javaMailProperties = new Properties();
+ javaMailProperties.setProperty("mail.smtp.auth", "true");
+ javaMailProperties.setProperty("mail.smtp.starttls.enable", "true");
+ javaMailProperties.setProperty("mail.smtp.starttls.required", "true");
+ javaMailProperties.setProperty("mail.debug", "true");
+
+ // 添加超时设置
+ javaMailProperties.setProperty("mail.smtp.timeout", "30000");
+ javaMailProperties.setProperty("mail.smtp.connectiontimeout", "30000");
+ javaMailProperties.setProperty("mail.smtp.writetimeout", "30000");
+
+ mailSender.setJavaMailProperties(javaMailProperties);
+
+ // 创建邮件消息
+ SimpleMailMessage mailMessage = new SimpleMailMessage();
+ mailMessage.setFrom(fromEmail);
+
+ // 配置 FreeMarker(如果需要发送模板邮件)
+ FreeMarkerConfigurationFactory freeMarkerConfigurer = new FreeMarkerConfigurationFactory();
+ freeMarkerConfigurer.setTemplateLoaderPath("classpath:email/ftl");
+ Properties settings = new Properties();
+ settings.setProperty("template_update_delay", "1800");
+ settings.setProperty("default_encoding", "UTF-8");
+ settings.setProperty("locale", "zh_CN");
+ freeMarkerConfigurer.setFreemarkerSettings(settings);
+
+ try {
+ Configuration freeMarkerConfig = freeMarkerConfigurer.createConfiguration();
+ System.out.println("FreeMarker 配置完成");
+ } catch (Exception e) {
+ System.out.println("FreeMarker 配置失败: " + e.getMessage());
+ }
+
+ // 发送测试邮件
+ try {
+ mailMessage.setTo(toEmail);
+ mailMessage.setSubject("测试邮件主题");
+ mailMessage.setText("这是一封通过Java程序发送的测试邮件。");
+
+ mailSender.send(mailMessage);
+ System.out.println("邮件发送成功!");
+
+ } catch (Exception e) {
+ System.out.println("邮件发送失败:");
+ e.printStackTrace();
+ }
+ }
}
--
Gitblit v1.9.3