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