为支付宝和微信支付服务添加条件属性注解,以支持按配置启用支付功能

This commit is contained in:
Dftre 2025-03-10 00:13:54 +08:00
parent b4cdbf119b
commit 7b8c68f565
2 changed files with 4 additions and 0 deletions

View File

@ -4,6 +4,7 @@ import java.util.HashMap;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Service;
import com.alipay.easysdk.factory.Factory;
@ -17,6 +18,7 @@ import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
@Service("alipayPayService")
@ConditionalOnProperty(prefix = "pay.alipay", name = "enabled", havingValue = "true")
public class AliPayService implements IAliPayService {
public void callback(Map<String, String> params) {
}

View File

@ -3,6 +3,7 @@ package com.ruoyi.pay.wx.service.Impl;
import java.nio.charset.StandardCharsets;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Service;
import org.springframework.util.StreamUtils;
@ -22,6 +23,7 @@ import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
@Service("wechatPayService")
@ConditionalOnProperty(prefix = "pay.wechat", name = "enabled", havingValue = "true")
public class WxPayService implements IWxPayService {
@Autowired