为支付宝和微信支付服务添加条件属性注解,以支持按配置启用支付功能
This commit is contained in:
parent
b4cdbf119b
commit
7b8c68f565
@ -4,6 +4,7 @@ import java.util.HashMap;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.alipay.easysdk.factory.Factory;
|
import com.alipay.easysdk.factory.Factory;
|
||||||
@ -17,6 +18,7 @@ import jakarta.servlet.http.HttpServletRequest;
|
|||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
@Service("alipayPayService")
|
@Service("alipayPayService")
|
||||||
|
@ConditionalOnProperty(prefix = "pay.alipay", name = "enabled", havingValue = "true")
|
||||||
public class AliPayService implements IAliPayService {
|
public class AliPayService implements IAliPayService {
|
||||||
public void callback(Map<String, String> params) {
|
public void callback(Map<String, String> params) {
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ package com.ruoyi.pay.wx.service.Impl;
|
|||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.StreamUtils;
|
import org.springframework.util.StreamUtils;
|
||||||
|
|
||||||
@ -22,6 +23,7 @@ import jakarta.servlet.http.HttpServletRequest;
|
|||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
@Service("wechatPayService")
|
@Service("wechatPayService")
|
||||||
|
@ConditionalOnProperty(prefix = "pay.wechat", name = "enabled", havingValue = "true")
|
||||||
public class WxPayService implements IWxPayService {
|
public class WxPayService implements IWxPayService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
Loading…
Reference in New Issue
Block a user