Skip to content

Commit

Permalink
feat: 支付(6)
Browse files Browse the repository at this point in the history
  • Loading branch information
phy19870227 committed May 23, 2021
1 parent d020e5a commit bb07d4d
Show file tree
Hide file tree
Showing 10 changed files with 69 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public class AlipayConfig implements ApplicationContextAware {
private final StarTigerPayProperties starTigerPayProperties;

public AlipayConfig(StarTigerPayProperties starTigerPayProperties) {
logger.info("实例化配置类:" + this.getClass().getName());
this.starTigerPayProperties = starTigerPayProperties;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.snake19870227.stiger.pay.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
Expand All @@ -12,9 +14,14 @@
@Configuration
@EnableConfigurationProperties(StarTigerPayProperties.class)
@Import({
StarTigerPaySampleConfig.class,
AlipayConfig.class,
WxpayConfig.class
})
public class StarTigerPayAutoConfig {

private static final Logger logger = LoggerFactory.getLogger(StarTigerPayAutoConfig.class);

public StarTigerPayAutoConfig() {
logger.info("实例化配置类:" + this.getClass().getName());
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class WxpayConfig implements ApplicationContextAware {
private final StarTigerPayProperties starTigerPayProperties;

public WxpayConfig(StarTigerPayProperties starTigerPayProperties) {
logger.info("实例化配置类:" + this.getClass().getName());
this.starTigerPayProperties = starTigerPayProperties;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.snake19870227.stiger.pay.server.config;

import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand All @@ -13,10 +15,18 @@
* 2021/2/14
*/
@Configuration
@AutoConfigureAfter(MybatisPlusAutoConfiguration.class)
@MapperScan(basePackages = "com.snake19870227.stiger.pay.dao")
@MapperScan(basePackages = {
"com.snake19870227.stiger.admin.dao",
"com.snake19870227.stiger.pay.dao"
})
public class StarTigerPayDatabaseConfig {

private static final Logger logger = LoggerFactory.getLogger(StarTigerPayDatabaseConfig.class);

public StarTigerPayDatabaseConfig() {
logger.info("实例化配置类:" + this.getClass().getName());
}

@Bean
public PaginationInterceptor paginationInterceptor() {
PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package com.snake19870227.stiger.pay.server.config;

import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import com.snake19870227.stiger.admin.dao.base.SysCfgMapper;
import com.snake19870227.stiger.pay.channel.IPayStorage;
import com.snake19870227.stiger.pay.channel.PayChannelHandler;
import com.snake19870227.stiger.pay.channel.alipay.AlipayChannelHandler;
import com.snake19870227.stiger.pay.config.StarTigerPaySampleConfig;
import com.snake19870227.stiger.pay.channel.wxpay.WxpayChannelHandler;
import com.snake19870227.stiger.pay.dao.base.PayNotifyMapper;
import com.snake19870227.stiger.pay.dao.base.PayRefundMapper;
import com.snake19870227.stiger.pay.dao.base.PayTradeMapper;
Expand All @@ -24,13 +24,18 @@
* 2021/2/17
*/
@Configuration
@AutoConfigureBefore(StarTigerPaySampleConfig.class)
@Import({
StarTigerPayDatabaseConfig.class,
StarTigerPayServiceConfig.class
})
public class StarTigerPayServerAutoConfig {

private static final Logger logger = LoggerFactory.getLogger(StarTigerPayServerAutoConfig.class);

public StarTigerPayServerAutoConfig() {
logger.info("实例化配置类:" + this.getClass().getName());
}

@Bean
@ConditionalOnBean(StarTigerPayServerMarkerConfig.Marker.class)
@ConditionalOnMissingBean(IPayStorage.class)
Expand All @@ -47,6 +52,12 @@ public AlipayChannelHandler alipayChannelHandler(IPayStorage payStorage,
return new AlipayChannelHandler(starTigerPayProperties, payStorage);
}

@Bean
public WxpayChannelHandler wxpayChannelHandler(IPayStorage payStorage,
StarTigerPayProperties starTigerPayProperties) {
return new WxpayChannelHandler(starTigerPayProperties, payStorage);
}

@Bean
public PayController payController(IPayStorage payStorage) {
return new PayController(payStorage);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.snake19870227.stiger.pay.server.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

Expand All @@ -10,6 +12,12 @@
@Configuration(proxyBeanMethods = false)
public class StarTigerPayServerMarkerConfig {

private static final Logger logger = LoggerFactory.getLogger(StarTigerPayServerMarkerConfig.class);

public StarTigerPayServerMarkerConfig() {
logger.info("实例化配置类:" + this.getClass().getName());
}

@Bean
public Marker payServerMarker() {
return new Marker();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.snake19870227.stiger.pay.server.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
Expand All @@ -19,6 +21,12 @@
@AutoConfigureAfter(StarTigerPayDatabaseConfig.class)
public class StarTigerPayServiceConfig {

private static final Logger logger = LoggerFactory.getLogger(StarTigerPayServiceConfig.class);

public StarTigerPayServiceConfig() {
logger.info("实例化配置类:" + this.getClass().getName());
}

@Bean
@ConditionalOnMissingBean
public IPayTradeService payTradeService() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ spring:
mybatis-plus:
global-config:
banner: false
# db-config:
# logic-delete-field: record_status
# logic-delete-value: N
# logic-not-delete-value: Y
db-config:
logic-delete-field: record_status
logic-delete-value: N
logic-not-delete-value: Y
configuration:
lazy-loading-enabled: false
aggressive-lazy-loading: false
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<include resource="com/snake19870227/stiger/core/log/StarTigerLogBase.xml"/>
<root level="info">
<appender-ref ref="CONSOLE"/>
</root>
<logger name="com.snake19870227.stiger" level="debug"/>

</configuration>

0 comments on commit bb07d4d

Please sign in to comment.