Compare commits
2 Commits
e81ec8cca7
...
ea141bb640
| Author | SHA1 | Date | |
|---|---|---|---|
| ea141bb640 | |||
| 5adb63f612 |
@@ -43,11 +43,45 @@
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-webflux</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-commons</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.projectreactor</groupId>
|
||||
<artifactId>reactor-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.8.25</version>
|
||||
</dependency>
|
||||
<!-- 阿里云号码认证服务(新版SDK) -->
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>dypnsapi20170525</artifactId>
|
||||
<version>1.0.6</version>
|
||||
</dependency>
|
||||
<!-- 阿里云一键登录服务(旧版SDK,保留兼容) -->
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>aliyun-java-sdk-dypnsapi</artifactId>
|
||||
<version>1.2.12</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aliyun</groupId>
|
||||
<artifactId>aliyun-java-sdk-core</artifactId>
|
||||
|
||||
+25
@@ -2,11 +2,36 @@ package cn.novalon.gym.manage.auth.service;
|
||||
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
/**
|
||||
* 短信服务接口
|
||||
*
|
||||
* @author auto-generated
|
||||
* @date 2026-06-20
|
||||
*/
|
||||
public interface SmsService {
|
||||
|
||||
/**
|
||||
* 发送短信验证码
|
||||
*
|
||||
* @param phone 手机号
|
||||
* @return 发送结果
|
||||
*/
|
||||
Mono<Boolean> sendVerificationCode(String phone);
|
||||
|
||||
/**
|
||||
* 验证短信验证码
|
||||
*
|
||||
* @param phone 手机号
|
||||
* @param code 验证码
|
||||
* @return 验证结果
|
||||
*/
|
||||
Mono<Boolean> verifyCode(String phone, String code);
|
||||
|
||||
/**
|
||||
* 获取验证码(用于测试或特殊场景)
|
||||
*
|
||||
* @param phone 手机号
|
||||
* @return 验证码
|
||||
*/
|
||||
Mono<String> getVerificationCode(String phone);
|
||||
}
|
||||
+4
-4
@@ -76,13 +76,13 @@ public class SmsServiceImpl implements SmsService {
|
||||
log.info("阿里云号码认证原始响应: {}", responseData);
|
||||
|
||||
JsonNode jsonNode = objectMapper.readTree(responseData);
|
||||
|
||||
|
||||
JsonNode codeNode = jsonNode.get("Code");
|
||||
if (codeNode == null) {
|
||||
log.error("阿里云响应中找不到Code字段, 原始响应: {}", responseData);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
String code = codeNode.asText();
|
||||
|
||||
if ("OK".equals(code)) {
|
||||
@@ -146,13 +146,13 @@ public class SmsServiceImpl implements SmsService {
|
||||
log.info("阿里云号码认证核验原始响应: {}", responseData);
|
||||
|
||||
JsonNode jsonNode = objectMapper.readTree(responseData);
|
||||
|
||||
|
||||
JsonNode codeNode = jsonNode.get("Code");
|
||||
if (codeNode == null) {
|
||||
log.error("阿里云核验响应中找不到Code字段, 原始响应: {}", responseData);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
String responseCode = codeNode.asText();
|
||||
JsonNode modelNode = jsonNode.get("Model");
|
||||
JsonNode verifyResultNode = modelNode != null ? modelNode.get("VerifyResult") : null;
|
||||
|
||||
@@ -118,6 +118,11 @@
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.8.25</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.zxing</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
|
||||
+1
-16
@@ -18,7 +18,6 @@ import cn.novalon.gym.manage.member.handler.MemberHandler;
|
||||
import cn.novalon.gym.manage.member.handler.WechatAuthHandler;
|
||||
import cn.novalon.gym.manage.notify.handler.SysNoticeHandler;
|
||||
import cn.novalon.gym.manage.notify.handler.SysUserMessageHandler;
|
||||
import cn.novalon.gym.manage.payment.handler.PaymentHandler;
|
||||
import cn.novalon.gym.manage.sys.handler.auth.PasswordDiagnosticHandler;
|
||||
import cn.novalon.gym.manage.sys.handler.auth.SysAuthHandler;
|
||||
import cn.novalon.gym.manage.sys.handler.config.SysConfigHandler;
|
||||
@@ -80,8 +79,7 @@ public class SystemRouter {
|
||||
CourseLabelHandler courseLabelHandler,
|
||||
CheckInHandler checkInHandler,
|
||||
DataStatisticsHandler dataStatisticsHandler,
|
||||
PhoneAuthHandler phoneAuthHandler,
|
||||
PaymentHandler paymentHandler) {
|
||||
PhoneAuthHandler phoneAuthHandler) {
|
||||
|
||||
return route()
|
||||
// ========== 诊断路由 ==========
|
||||
@@ -363,19 +361,6 @@ public class SystemRouter {
|
||||
.GET("/api/datacount/history", dataStatisticsHandler::queryHistoricalStatistics)
|
||||
.GET("/api/datacount/export", dataStatisticsHandler::exportStatistics)
|
||||
|
||||
// ========================================
|
||||
// ========== 支付模块路由 =================
|
||||
// ========================================
|
||||
|
||||
// ===== 支付宝App支付 =====
|
||||
.POST("/api/payment/create", paymentHandler::createPayment)
|
||||
.GET("/api/payment/{orderId}", paymentHandler::getPaymentStatus)
|
||||
.POST("/api/payment/{orderId}/refund", paymentHandler::refundPayment)
|
||||
.POST("/api/payment/notify", paymentHandler::alipayNotify)
|
||||
|
||||
// ===== 支付宝扫码支付 =====
|
||||
.POST("/api/payment/qrcode/create", paymentHandler::createQrCodePayment)
|
||||
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@ spring:
|
||||
cache:
|
||||
type: none
|
||||
r2dbc:
|
||||
url: r2dbc:postgresql://localhost:55432/manage_system
|
||||
username: novalon
|
||||
password: novalon123
|
||||
url: r2dbc:postgresql://localhost:5432/manage_system
|
||||
username: postgres
|
||||
password: 123456
|
||||
pool:
|
||||
initial-size: 5
|
||||
max-size: 20
|
||||
@@ -12,10 +12,10 @@ spring:
|
||||
max-life-time: 30m
|
||||
acquire-timeout: 3s
|
||||
flyway:
|
||||
url: jdbc:postgresql://localhost:55432/manage_system
|
||||
user: novalon
|
||||
password: novalon123
|
||||
enabled: true
|
||||
url: jdbc:postgresql://localhost:5432/manage_system
|
||||
user: postgres
|
||||
password: 123456
|
||||
enabled: false
|
||||
locations: classpath:db/migration
|
||||
baseline-on-migrate: true
|
||||
validate-on-migrate: false
|
||||
|
||||
@@ -19,7 +19,7 @@ spring:
|
||||
password: 123456
|
||||
driver-class-name: org.postgresql.Driver
|
||||
flyway:
|
||||
enabled: true
|
||||
enabled: false
|
||||
locations: classpath:db/migration
|
||||
baseline-on-migrate: true
|
||||
baseline-version: 0
|
||||
|
||||
@@ -4,7 +4,7 @@ spring:
|
||||
username: ${DB_USERNAME}
|
||||
password: ${DB_PASSWORD}
|
||||
flyway:
|
||||
enabled: true
|
||||
enabled: false
|
||||
|
||||
logging:
|
||||
level:
|
||||
|
||||
@@ -15,9 +15,9 @@ spring:
|
||||
exclude:
|
||||
- org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration
|
||||
r2dbc:
|
||||
url: r2dbc:postgresql://${DB_HOST:localhost}:${DB_PORT:55432}/${DB_NAME:manage_system}
|
||||
username: ${DB_USERNAME:novalon}
|
||||
password: ${DB_PASSWORD:novalon123}
|
||||
url: r2dbc:postgresql://${DB_HOST:localhost}:${DB_PORT:5432}/${DB_NAME:manage_system}
|
||||
username: ${DB_USERNAME:postgres}
|
||||
password: ${DB_PASSWORD:123456}
|
||||
pool:
|
||||
initial-size: 10
|
||||
max-size: 50
|
||||
@@ -25,12 +25,12 @@ spring:
|
||||
max-life-time: 1h
|
||||
acquire-timeout: 5s
|
||||
datasource:
|
||||
url: jdbc:postgresql://${DB_HOST:localhost}:${DB_PORT:55432}/${DB_NAME:manage_system}
|
||||
username: ${DB_USERNAME:novalon}
|
||||
password: ${DB_PASSWORD:novalon123}
|
||||
url: jdbc:postgresql://${DB_HOST:localhost}:${DB_PORT:5432}/${DB_NAME:manage_system}
|
||||
username: ${DB_USERNAME:postgres}
|
||||
password: ${DB_PASSWORD:123456}
|
||||
driver-class-name: org.postgresql.Driver
|
||||
flyway:
|
||||
enabled: true
|
||||
enabled: false
|
||||
locations: classpath:db/migration
|
||||
baseline-on-migrate: true
|
||||
baseline-version: 0
|
||||
@@ -98,9 +98,9 @@ springdoc:
|
||||
alibaba:
|
||||
cloud:
|
||||
sms:
|
||||
access-key-id: ${ALIBABA_ACCESS_KEY_ID:}
|
||||
access-key-secret: ${ALIBABA_ACCESS_KEY_SECRET:}
|
||||
sign-name: ${ALIBABA_SMS_SIGN_NAME:}
|
||||
template-code: ${ALIBABA_SMS_TEMPLATE_CODE:}
|
||||
access-key-id: LTAI5t8GhorWLu5WkEx8MDZz
|
||||
access-key-secret: jNDwb9IHvTIESUezLYHZRT5c5NEaCz
|
||||
sign-name: 云渚科技验证平台
|
||||
template-code: 100001
|
||||
code-length: 6
|
||||
code-expire-seconds: 300
|
||||
|
||||
Reference in New Issue
Block a user