master
parent
b70ca2faa5
commit
ee029cdc52
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
|
@ -58,32 +58,5 @@
|
|||
<artifactId>pagehelper-spring-boot-starter</artifactId>
|
||||
<version>1.4.1</version>
|
||||
</dependency>
|
||||
<!-- test -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mybatis</groupId>
|
||||
<artifactId>mybatis-spring</artifactId>
|
||||
<version>2.1.1</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.bwie</groupId>
|
||||
<artifactId>bwie-common</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-test</artifactId>
|
||||
<version>2.7.18</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-api</artifactId>
|
||||
<version>5.8.2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -3,6 +3,7 @@ import org.mybatis.spring.annotation.MapperScan;
|
|||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
package com.bwie.alipay.controller;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/alipay")
|
||||
public class AlipayController {
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
package com.bwie.alipay.demo;
|
||||
|
||||
public interface ListenerPer {
|
||||
|
||||
|
||||
public void test03(String message);
|
||||
}
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
package com.bwie.alipay.demo;
|
||||
|
||||
public interface MonitorPer {
|
||||
|
||||
void test01(ListenerPer listenerPer);
|
||||
void test02(ListenerPer listenerPer);
|
||||
|
||||
void test04(String message);
|
||||
}
|
||||
|
|
|
@ -1,18 +1,15 @@
|
|||
package com.bwie.alipay.demo;
|
||||
|
||||
public interface Newspaper {
|
||||
/**
|
||||
* 添加订阅者
|
||||
* @param subscriber
|
||||
*/
|
||||
void addSubscriber(Subscriber subscriber);
|
||||
|
||||
/**
|
||||
* 移除订阅者
|
||||
* @param subscriber
|
||||
*/
|
||||
void removeSubscriber(Subscriber subscriber);
|
||||
|
||||
/**
|
||||
* 通知订阅者
|
||||
* @param message
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
package com.bwie.alipay.demo;
|
||||
|
||||
public interface Subscriber {
|
||||
|
||||
public void update(String message);
|
||||
}
|
||||
|
|
|
@ -6,41 +6,40 @@ import com.bwie.alipay.demo.service.ListenerImpl;
|
|||
import com.bwie.alipay.demo.service.MonitorImpl;
|
||||
import com.bwie.alipay.demo.service.NewspaperImpl;
|
||||
import com.bwie.alipay.demo.service.SubscriberImpl;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
//import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
|
||||
@SpringBootTest
|
||||
public class TestObserver {
|
||||
@Test
|
||||
void testObserver() {
|
||||
Newspaper newspaper = new NewspaperImpl();
|
||||
|
||||
Subscriber li = new SubscriberImpl("李老头");
|
||||
Subscriber wang = new SubscriberImpl("王奶奶");
|
||||
//李老头和王奶奶订阅了报纸
|
||||
newspaper.addSubscriber(li);
|
||||
|
||||
newspaper.addSubscriber(wang);
|
||||
//报纸到了,通知订阅者
|
||||
newspaper.notifySubscribers("今天的报纸到了!!!");
|
||||
//李老头取消订阅了,移除
|
||||
newspaper.removeSubscriber(li);
|
||||
|
||||
newspaper.notifySubscribers("明天的报纸还是这个点到!!!");
|
||||
}
|
||||
|
||||
@Test
|
||||
void test04(){
|
||||
MonitorPer monitor = new MonitorImpl();
|
||||
|
||||
ListenerImpl listener = new ListenerImpl("佩奇佩奇");
|
||||
ListenerImpl listener1 = new ListenerImpl("狗嘉狗嘉");
|
||||
monitor.test01(listener);
|
||||
monitor.test04("我爱你,爱你爱你");
|
||||
monitor.test02(listener);
|
||||
monitor.test01(listener1);
|
||||
monitor.test04("我想拉拉手,拉拉手,拉拉手");
|
||||
}
|
||||
// @Test
|
||||
// void testObserver() {
|
||||
// Newspaper newspaper = new NewspaperImpl();
|
||||
//
|
||||
// Subscriber li = new SubscriberImpl("李老头");
|
||||
// Subscriber wang = new SubscriberImpl("王奶奶");
|
||||
// //李老头和王奶奶订阅了报纸
|
||||
// newspaper.addSubscriber(li);
|
||||
//
|
||||
// newspaper.addSubscriber(wang);
|
||||
// //报纸到了,通知订阅者
|
||||
// newspaper.notifySubscribers("今天的报纸到了!!!");
|
||||
// //李老头取消订阅了,移除
|
||||
// newspaper.removeSubscriber(li);
|
||||
//
|
||||
// newspaper.notifySubscribers("明天的报纸还是这个点到!!!");
|
||||
// }
|
||||
//
|
||||
// @Test
|
||||
// void test04(){
|
||||
// MonitorPer monitor = new MonitorImpl();
|
||||
//
|
||||
// ListenerImpl listener = new ListenerImpl("佩奇佩奇");
|
||||
// ListenerImpl listener1 = new ListenerImpl("狗嘉狗嘉");
|
||||
// monitor.test01(listener);
|
||||
// monitor.test04("我爱你,爱你爱你");
|
||||
// monitor.test02(listener);
|
||||
// monitor.test01(listener1);
|
||||
// monitor.test04("我想拉拉手,拉拉手,拉拉手");
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1,21 +1,18 @@
|
|||
package com.bwie.alipay.demo.service;
|
||||
|
||||
import com.bwie.alipay.demo.Newspaper;
|
||||
import com.bwie.alipay.demo.Subscriber;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class NewspaperImpl implements Newspaper {
|
||||
public class NewspaperImpl implements Newspaper{
|
||||
List<Subscriber> subscribers = new ArrayList<>();
|
||||
//添加订阅者
|
||||
@Override
|
||||
public void addSubscriber(Subscriber subscriber) {
|
||||
public void addSubscriber(Subscriber subscriber){
|
||||
subscribers.add(subscriber);
|
||||
}
|
||||
//移除订阅者
|
||||
@Override
|
||||
public void removeSubscriber(Subscriber subscriber) {
|
||||
public void removeSubscriber(Subscriber subscriber){
|
||||
subscribers.remove(subscriber);
|
||||
}
|
||||
//通知订阅者
|
||||
|
|
|
@ -1,17 +1,13 @@
|
|||
package com.bwie.alipay.demo.service;
|
||||
|
||||
import com.bwie.alipay.demo.Subscriber;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class SubscriberImpl implements Subscriber {
|
||||
public class SubscriberImpl implements Subscriber{
|
||||
private String name;
|
||||
|
||||
@Override
|
||||
public void update(String message) {
|
||||
System.out.println(name + "---接到消息: " + message);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,12 +1,20 @@
|
|||
package com.bwie.alipay.time;
|
||||
|
||||
import com.alipay.api.AlipayApiException;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.bwie.alipay.service.AlimentPayService;
|
||||
import com.bwie.alipay.service.AlipayWayService;
|
||||
import com.bwie.alipay.utils.service.AlipayWay;
|
||||
import com.bwie.alipay.vo.OrderSnRequest;
|
||||
import com.bwie.common.domain.BuyOrder;
|
||||
import com.bwie.common.domain.PaymentEntity;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Log4j2
|
||||
@Component
|
||||
public class CreateTime {
|
||||
|
@ -22,31 +30,31 @@ public class CreateTime {
|
|||
// public void findOrderSn(){
|
||||
// List<BuyOrder> buyOrderList = alipayWayService.list(
|
||||
// new LambdaQueryWrapper<BuyOrder>()
|
||||
// .eq(BuyOrder::getBuyOrderZt, 3)
|
||||
// .eq(BuyOrder::getOrderState, 3)
|
||||
//
|
||||
// );
|
||||
// buyOrderList.forEach(c->{
|
||||
// try {
|
||||
// OrderSnRequest buyOrderDh = alipayWay.findBuyOrderDh(c.getBuyOrderDh());
|
||||
// OrderSnRequest buyOrderDh = alipayWay.findBuyOrderDh(c.getOrderNumber());
|
||||
// OrderSnRequest.AlipayTradeQueryResponseBean queryResponse = buyOrderDh.getAlipay_trade_query_response();
|
||||
// String tradeStatus = queryResponse.getTrade_status();
|
||||
// if(tradeStatus.equals("TRADE_SUCCESS")){
|
||||
// alipayWayService.updateById(
|
||||
// BuyOrder.builder()
|
||||
// .buyOrderId(c.getBuyOrderId())
|
||||
// .buyOrderZt(c.getBuyOrderZt())
|
||||
// .orderId(c.getOrderId())
|
||||
// .orderState(c.getOrderState())
|
||||
// .build()
|
||||
// );
|
||||
// }
|
||||
// alimentPayService.list(
|
||||
// new LambdaQueryWrapper<PaymentEntity>()
|
||||
// .eq(PaymentEntity::getPaymentDh,c.getBuyOrderDh())
|
||||
// .eq(PaymentEntity::getOrdersNumber,c.getOrderNumber())
|
||||
// ).forEach(s->{
|
||||
// if(s.getPaymentState().equals(2)){
|
||||
// if(s.getTradeStatus().equals(2)){
|
||||
// alimentPayService.updateById(
|
||||
// PaymentEntity.builder()
|
||||
// .paymentId(s.getPaymentId())
|
||||
// .paymentState(3)
|
||||
// .tradeId(s.getTradeId())
|
||||
// .thirdStatus(3)
|
||||
// .build()
|
||||
// );
|
||||
// }
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
package com.bwie.alipay.utils;
|
||||
|
||||
|
||||
import com.alipay.api.AlipayApiException;
|
||||
import com.bwie.common.domain.BuyOrder;
|
||||
|
||||
public interface PayServive{
|
||||
|
||||
public String alipay(BuyOrder buyOrder) throws AlipayApiException;
|
||||
public interface PayServive {
|
||||
String alipay(BuyOrder buyOrder) throws AlipayApiException;
|
||||
}
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
package com.bwie.alipay.utils.service;
|
||||
|
||||
import com.bwie.common.domain.BuyOrder;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component("UnionPay")
|
||||
public class UnionWay {
|
||||
|
||||
public String alipay(BuyOrder buyOrder){
|
||||
return "你好消费者,这是银联支付奥,支付金额是: "+buyOrder.getOrderPrice()+"元,支付的名称是: "+buyOrder.getOrderName()+",支付的单号是: "+buyOrder.getOrderNumber();
|
||||
}
|
||||
|
|
|
@ -1,13 +1,9 @@
|
|||
package com.bwie.alipay.utils.service;
|
||||
|
||||
import com.bwie.alipay.utils.PayServive;
|
||||
import com.bwie.common.domain.BuyOrder;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component("Wechpay")
|
||||
public class Wechpay implements PayServive {
|
||||
|
||||
|
||||
public String alipay(BuyOrder buyOrder){
|
||||
return "你好消费者,这是微信支付奥,支付金额是: "+buyOrder.getOrderPrice()+"元,支付的名称是: "+buyOrder.getOrderName()+",支付的单号是: "+buyOrder.getOrderNumber();
|
||||
}
|
||||
|
|
|
@ -1,16 +1,12 @@
|
|||
package com.bwie.alipay.vo;
|
||||
|
||||
import com.alipay.api.AlipayClient;
|
||||
import com.alipay.api.AlipayConstants;
|
||||
import com.alipay.api.DefaultAlipayClient;
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "zhipay")
|
||||
@Data
|
||||
|
@ -31,5 +27,4 @@ public class Alipay {
|
|||
AlipayConstants.FORMAT_JSON, AlipayConstants.CHARSET_UTF8,
|
||||
alipayPublicKey, AlipayConstants.SIGN_TYPE_RSA2);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -2,9 +2,6 @@ package com.bwie.alipay.vo;
|
|||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import java.util.List;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ToString
|
||||
@Data
|
||||
public class OrderSnRequest {
|
||||
|
|
|
@ -7,8 +7,8 @@ import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
|||
|
||||
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
|
||||
@EnableDiscoveryClient
|
||||
public class AuthenApp {
|
||||
public class AuthenticationApp {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(AuthenApp.class);
|
||||
SpringApplication.run(AuthenticationApp.class);
|
||||
}
|
||||
}
|
|
@ -13,9 +13,9 @@ import java.util.Map;
|
|||
@Configuration
|
||||
public class AliveUtil {
|
||||
@Value("${alive.appcode}")
|
||||
private String appcode;
|
||||
private String appcode;//配置文件appcode
|
||||
@Value("${alive.host}")
|
||||
private String host;
|
||||
private String host;//配置文件
|
||||
|
||||
public AliveRes alive(AliveReq aliveReq){
|
||||
Map stringStringMap = new HashMap<>();
|
||||
|
|
|
@ -15,11 +15,11 @@ import java.util.Map;
|
|||
@Configuration
|
||||
public class IdCheckUtil {
|
||||
@Value("${idcheck.appcode}")
|
||||
private String appcode;
|
||||
private String appcode;//配置文件appcode
|
||||
@Value("${idcheck.host}")
|
||||
private String host;
|
||||
private String host;//配置文件
|
||||
@Value("${idcheck.path}")
|
||||
private String path;
|
||||
private String path;//
|
||||
|
||||
|
||||
public IdCheckResponse idcheck(IdCheckReq idCheckReq){
|
||||
|
|
|
@ -18,7 +18,6 @@ public class OSSupload {
|
|||
@Value("${aliyun.end-point}")
|
||||
private String endPoint;
|
||||
|
||||
|
||||
@Value("${aliyun.access-key-id}")
|
||||
private String accessKeyId;
|
||||
|
||||
|
@ -27,13 +26,9 @@ public class OSSupload {
|
|||
|
||||
// @Value("${aliyun.access-pre}")
|
||||
// private String accessPre;
|
||||
|
||||
@Value("${aliyun.bucket-name}")
|
||||
private String bucketName;
|
||||
|
||||
public String upload(MultipartFile multipartFile) throws IOException {
|
||||
|
||||
|
||||
OSSClient ossClient = new OSSClient(endPoint, accessKeyId, accesskeySecret);
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
|
||||
// 获取文件名
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
package com.bwie.authentication.util;
|
||||
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
@ -8,7 +7,6 @@ import org.springframework.context.annotation.Configuration;
|
|||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@Configuration
|
||||
@Log4j2
|
||||
public class ThreadPoolExecutorConfig {
|
||||
|
@ -16,13 +14,8 @@ public class ThreadPoolExecutorConfig {
|
|||
private Integer coreSize;
|
||||
@Value("${authen.coreMax}")
|
||||
private Integer coreMax;
|
||||
|
||||
|
||||
|
||||
@Bean
|
||||
public ThreadPoolExecutor threadPoolExecutor(){
|
||||
// int coreSize = 3 * Runtime.getRuntime().availableProcessors();
|
||||
// int coreMax = coreSize + 30;
|
||||
ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(coreSize, coreMax, 5, TimeUnit.SECONDS,
|
||||
new LinkedBlockingQueue<>(100));
|
||||
return threadPoolExecutor;
|
||||
|
|
Loading…
Reference in New Issue