修改无忧支付配置

This commit is contained in:
GYJ
2024-12-05 17:01:32 +08:00
parent 2d9a74158a
commit 2c07d98be9
5 changed files with 45 additions and 7 deletions

View File

@@ -1,15 +1,37 @@
package com.sqx;
import com.sqx.modules.pay.wuyou.WuyouPay;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.scheduling.annotation.EnableScheduling;
import java.util.Map;
/**
* @author GYJ
*/
@EnableScheduling
@SpringBootApplication
public class SqxApplication {
public static void main(String[] args) {
SpringApplication.run(SqxApplication.class, args);
ConfigurableApplicationContext context = SpringApplication.run(SqxApplication.class, args);
context.getEnvironment().getPropertySources().forEach(source -> {
if (source.getName().contains("application-dev.yml") || source.getName().contains("application-prod.yml")) {
if (source.getSource() instanceof Map) {
((Map<String, Object>) source.getSource()).forEach((key, value) -> {
System.out.println(key + ": " + value);
if ("pay.orderNotifyUrl".equals(key)) {
WuyouPay.setNotifyUrl(value.toString());
}
if ("pay.extractNotifyUrl".equals(key)) {
WuyouPay.setExtractNotifyUrl(value.toString());
}
});
}
}
});
System.out.println("(♥◠‿◠)ノ゙ 短剧系统启动成功 ლ(´ڡ`ლ)゙ \n"+
" _ \n" +
" | | \n" +
@@ -20,4 +42,4 @@ public class SqxApplication {
}
}
}