马府强
2 years ago
32 changed files with 1419 additions and 0 deletions
@ -0,0 +1,27 @@ |
|||||
|
# Created by .ignore support plugin (hsz.mobi) |
||||
|
### Java template |
||||
|
# Compiled class file |
||||
|
*.class |
||||
|
|
||||
|
# Log file |
||||
|
*.log |
||||
|
|
||||
|
# BlueJ files |
||||
|
*.ctxt |
||||
|
|
||||
|
# Mobile Tools for Java (J2ME) |
||||
|
.mtj.tmp/ |
||||
|
|
||||
|
# Package Files # |
||||
|
*.jar |
||||
|
*.war |
||||
|
*.nar |
||||
|
*.ear |
||||
|
*.zip |
||||
|
*.tar.gz |
||||
|
*.rar |
||||
|
|
||||
|
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml |
||||
|
hs_err_pid* |
||||
|
/.idea/ |
||||
|
/target/ |
@ -0,0 +1,123 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> |
||||
|
<modelVersion>4.0.0</modelVersion> |
||||
|
<parent> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-starter-parent</artifactId> |
||||
|
<version>2.3.9.RELEASE</version> |
||||
|
<relativePath/> <!-- lookup parent from repository --> |
||||
|
</parent> |
||||
|
|
||||
|
<groupId>com.ayi</groupId> |
||||
|
<artifactId>woniu-web</artifactId> |
||||
|
<version>0.0.1-SNAPSHOT</version> |
||||
|
<name>woniu-web</name> |
||||
|
<description>create by woniu</description> |
||||
|
|
||||
|
<packaging>jar</packaging> |
||||
|
|
||||
|
<properties> |
||||
|
<java.version>1.8</java.version> |
||||
|
</properties> |
||||
|
|
||||
|
<dependencies> |
||||
|
<dependency> |
||||
|
<groupId>com.google.guava</groupId> |
||||
|
<artifactId>guava</artifactId> |
||||
|
<version>29.0-jre</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<dependency> |
||||
|
<groupId>org.lionsoul</groupId> |
||||
|
<artifactId>ip2region</artifactId> |
||||
|
<version>2.7.0</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-starter-aop</artifactId> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>cn.hutool</groupId> |
||||
|
<artifactId>hutool-all</artifactId> |
||||
|
<version>5.3.3</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-starter</artifactId> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-starter-web</artifactId> |
||||
|
</dependency> |
||||
|
|
||||
|
|
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-starter-test</artifactId> |
||||
|
<scope>test</scope> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>org.projectlombok</groupId> |
||||
|
<artifactId>lombok</artifactId> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-starter-cache</artifactId> |
||||
|
</dependency> |
||||
|
|
||||
|
<!--mybatis-plus--> |
||||
|
|
||||
|
<dependency> |
||||
|
<groupId>com.baomidou</groupId> |
||||
|
<artifactId>mybatis-plus-boot-starter</artifactId> |
||||
|
<version>3.4.1</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java --> |
||||
|
<dependency> |
||||
|
<groupId>mysql</groupId> |
||||
|
<artifactId>mysql-connector-java</artifactId> |
||||
|
<version>8.0.29</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<dependency> |
||||
|
<groupId>com.alipay.sofa</groupId> |
||||
|
<artifactId>runtime-sofa-boot-starter</artifactId> |
||||
|
<version>3.18.0</version> |
||||
|
</dependency> |
||||
|
|
||||
|
<dependency> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-starter-validation</artifactId> |
||||
|
</dependency> |
||||
|
|
||||
|
|
||||
|
<dependency> |
||||
|
<groupId>com.alibaba</groupId> |
||||
|
<artifactId>fastjson</artifactId> |
||||
|
<version>1.2.76</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>com.alibaba</groupId> |
||||
|
<artifactId>easyexcel</artifactId> |
||||
|
<version>3.0.5</version> |
||||
|
</dependency> |
||||
|
<dependency> |
||||
|
<groupId>org.testng</groupId> |
||||
|
<artifactId>testng</artifactId> |
||||
|
<version>RELEASE</version> |
||||
|
<scope>compile</scope> |
||||
|
</dependency> |
||||
|
</dependencies> |
||||
|
<build> |
||||
|
<plugins> |
||||
|
<plugin> |
||||
|
<groupId>org.springframework.boot</groupId> |
||||
|
<artifactId>spring-boot-maven-plugin</artifactId> |
||||
|
</plugin> |
||||
|
</plugins> |
||||
|
</build> |
||||
|
|
||||
|
</project> |
@ -0,0 +1,20 @@ |
|||||
|
package com.woniu; |
||||
|
|
||||
|
import org.springframework.boot.SpringApplication; |
||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication; |
||||
|
import org.springframework.cache.annotation.EnableCaching; |
||||
|
import org.springframework.scheduling.annotation.EnableAsync; |
||||
|
import org.springframework.transaction.annotation.EnableTransactionManagement; |
||||
|
|
||||
|
@SpringBootApplication |
||||
|
@EnableTransactionManagement |
||||
|
@EnableAsync |
||||
|
public class WoNiuApplication { |
||||
|
|
||||
|
public static void main(String[] args) { |
||||
|
SpringApplication.run(WoNiuApplication.class, args); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,17 @@ |
|||||
|
package com.woniu.anno; |
||||
|
|
||||
|
import java.lang.annotation.ElementType; |
||||
|
import java.lang.annotation.Retention; |
||||
|
import java.lang.annotation.RetentionPolicy; |
||||
|
import java.lang.annotation.Target; |
||||
|
|
||||
|
/** |
||||
|
* @className: MainTransaction |
||||
|
* @author: woniu |
||||
|
* @date: 2023/6/27 |
||||
|
**/ |
||||
|
@Target({ElementType.METHOD}) |
||||
|
@Retention(RetentionPolicy.RUNTIME) |
||||
|
public @interface MainTransaction { |
||||
|
int value();//子线程数量
|
||||
|
} |
@ -0,0 +1,18 @@ |
|||||
|
package com.woniu.anno; |
||||
|
|
||||
|
import java.lang.annotation.ElementType; |
||||
|
import java.lang.annotation.Retention; |
||||
|
import java.lang.annotation.RetentionPolicy; |
||||
|
import java.lang.annotation.Target; |
||||
|
|
||||
|
/** |
||||
|
* 多线程事务注解: 子事务 |
||||
|
* |
||||
|
* @author zlj |
||||
|
* @since 2022/11/3 |
||||
|
*/ |
||||
|
@Target({ElementType.METHOD}) |
||||
|
@Retention(RetentionPolicy.RUNTIME) |
||||
|
public @interface SonTransaction { |
||||
|
String value() default ""; |
||||
|
} |
@ -0,0 +1,125 @@ |
|||||
|
package com.woniu.aop; |
||||
|
|
||||
|
import com.woniu.anno.MainTransaction; |
||||
|
import org.apache.commons.collections4.CollectionUtils; |
||||
|
import org.aspectj.lang.ProceedingJoinPoint; |
||||
|
import org.aspectj.lang.annotation.Around; |
||||
|
import org.aspectj.lang.annotation.Aspect; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
import org.springframework.transaction.PlatformTransactionManager; |
||||
|
import org.springframework.transaction.TransactionDefinition; |
||||
|
import org.springframework.transaction.TransactionStatus; |
||||
|
import org.springframework.transaction.support.DefaultTransactionDefinition; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.util.HashMap; |
||||
|
import java.util.Map; |
||||
|
import java.util.Vector; |
||||
|
import java.util.concurrent.CountDownLatch; |
||||
|
import java.util.concurrent.atomic.AtomicBoolean; |
||||
|
|
||||
|
/** |
||||
|
* SpringBoot 中的多线程事务处理太繁琐?一个自定义注解直接搞定! |
||||
|
*/ |
||||
|
@Aspect |
||||
|
@Component |
||||
|
public class TransactionAop { |
||||
|
|
||||
|
//用来存储各线程计数器数据(每次执行后会从map中删除)
|
||||
|
private static final Map<String, Object> map = new HashMap<>(); |
||||
|
|
||||
|
@Resource |
||||
|
private PlatformTransactionManager transactionManager; |
||||
|
|
||||
|
@Around("@annotation(mainTransaction)") |
||||
|
public void mainIntercept(ProceedingJoinPoint joinPoint, MainTransaction mainTransaction) throws Throwable { |
||||
|
//当前线程名称
|
||||
|
Thread thread = Thread.currentThread(); |
||||
|
String threadName = thread.getName(); |
||||
|
//初始化计数器
|
||||
|
CountDownLatch mainDownLatch = new CountDownLatch(1); |
||||
|
CountDownLatch sonDownLatch = new CountDownLatch(mainTransaction.value());//@MainTransaction注解中的参数, 为子线程的数量
|
||||
|
// 用来记录子线程的运行状态,只要有一个失败就变为true
|
||||
|
AtomicBoolean rollBackFlag = new AtomicBoolean(false); |
||||
|
// 用来存每个子线程的异常,把每个线程的自定义异常向vector的首位置插入,其余异常向末位置插入,避免线程不安全,所以使用vector代替list
|
||||
|
Vector<Throwable> exceptionVector = new Vector<>(); |
||||
|
|
||||
|
map.put(threadName + "mainDownLatch", mainDownLatch); |
||||
|
map.put(threadName + "sonDownLatch", sonDownLatch); |
||||
|
map.put(threadName + "rollBackFlag", rollBackFlag); |
||||
|
map.put(threadName + "exceptionVector", exceptionVector); |
||||
|
|
||||
|
try { |
||||
|
joinPoint.proceed();//执行方法
|
||||
|
} catch (Throwable e) { |
||||
|
exceptionVector.add(0, e); |
||||
|
rollBackFlag.set(true);//子线程回滚
|
||||
|
mainDownLatch.countDown();//放行所有子线程
|
||||
|
} |
||||
|
|
||||
|
if (!rollBackFlag.get()) { |
||||
|
try { |
||||
|
// sonDownLatch等待,直到所有子线程执行完插入操作,但此时还没有提交事务
|
||||
|
sonDownLatch.await(); |
||||
|
mainDownLatch.countDown();// 根据rollBackFlag状态放行子线程的await处,告知是回滚还是提交
|
||||
|
} catch (Exception e) { |
||||
|
rollBackFlag.set(true); |
||||
|
exceptionVector.add(0, e); |
||||
|
} |
||||
|
} |
||||
|
if (CollectionUtils.isNotEmpty(exceptionVector)) { |
||||
|
map.remove(threadName + "mainDownLatch"); |
||||
|
map.remove(threadName + "sonDownLatch"); |
||||
|
map.remove(threadName + "rollBackFlag"); |
||||
|
map.remove(threadName + "exceptionVector"); |
||||
|
throw exceptionVector.get(0); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
@Around("@annotation(com.woniu.anno.SonTransaction)") |
||||
|
public void sonIntercept(ProceedingJoinPoint joinPoint) throws Throwable { |
||||
|
Object[] args = joinPoint.getArgs(); |
||||
|
Thread thread = (Thread) args[args.length - 1]; |
||||
|
String threadName = thread.getName(); |
||||
|
CountDownLatch mainDownLatch = (CountDownLatch) map.get(threadName + "mainDownLatch"); |
||||
|
if (mainDownLatch == null) { |
||||
|
//主事务未加注解时, 直接执行子事务
|
||||
|
joinPoint.proceed(); |
||||
|
return; |
||||
|
} |
||||
|
CountDownLatch sonDownLatch = (CountDownLatch) map.get(threadName + "sonDownLatch"); |
||||
|
AtomicBoolean rollBackFlag = (AtomicBoolean) map.get(threadName + "rollBackFlag"); |
||||
|
Vector<Throwable> exceptionVector = (Vector<Throwable>) map.get(threadName + "exceptionVector"); |
||||
|
|
||||
|
//如果这时有一个子线程已经出错,那当前线程不需要执行
|
||||
|
if (rollBackFlag.get()) { |
||||
|
sonDownLatch.countDown(); |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
DefaultTransactionDefinition def = new DefaultTransactionDefinition();// 开启事务
|
||||
|
def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);// 设置事务隔离级别
|
||||
|
TransactionStatus status = transactionManager.getTransaction(def); |
||||
|
|
||||
|
try { |
||||
|
joinPoint.proceed();//执行方法
|
||||
|
|
||||
|
sonDownLatch.countDown();// 对sonDownLatch-1
|
||||
|
mainDownLatch.await();// 如果mainDownLatch不是0,线程会在此阻塞,直到mainDownLatch变为0
|
||||
|
// 如果能执行到这一步说明所有子线程都已经执行完毕判断如果atomicBoolean是true就回滚false就提交
|
||||
|
if (rollBackFlag.get()) { |
||||
|
transactionManager.rollback(status); |
||||
|
} else { |
||||
|
transactionManager.commit(status); |
||||
|
} |
||||
|
} catch (Throwable e) { |
||||
|
exceptionVector.add(0, e); |
||||
|
// 回滚
|
||||
|
transactionManager.rollback(status); |
||||
|
// 并把状态设置为true
|
||||
|
rollBackFlag.set(true); |
||||
|
mainDownLatch.countDown(); |
||||
|
sonDownLatch.countDown(); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,30 @@ |
|||||
|
package com.woniu.config; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.DbType; |
||||
|
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor; |
||||
|
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor; |
||||
|
import org.mybatis.spring.annotation.MapperScan; |
||||
|
import org.springframework.context.annotation.Bean; |
||||
|
import org.springframework.context.annotation.Configuration; |
||||
|
import org.springframework.transaction.annotation.EnableTransactionManagement; |
||||
|
|
||||
|
|
||||
|
@Configuration |
||||
|
@MapperScan("com.woniu") |
||||
|
@EnableTransactionManagement |
||||
|
public class MybatisPlusConfig { |
||||
|
|
||||
|
/** |
||||
|
* 新的分页插件,一缓和二缓遵循mybatis的规则, |
||||
|
* 需要设置 MybatisConfiguration#useDeprecatedExecutor = false |
||||
|
* 避免缓存出现问题(该属性会在旧插件移除后一同移除) |
||||
|
*/ |
||||
|
@Bean |
||||
|
public MybatisPlusInterceptor mybatisPlusInterceptor() { |
||||
|
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); |
||||
|
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); |
||||
|
return interceptor; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,57 @@ |
|||||
|
package com.woniu.config; |
||||
|
|
||||
|
|
||||
|
import org.springframework.context.annotation.Bean; |
||||
|
import org.springframework.context.annotation.Configuration; |
||||
|
import org.springframework.scheduling.annotation.EnableAsync; |
||||
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; |
||||
|
|
||||
|
import java.util.concurrent.ThreadPoolExecutor; |
||||
|
|
||||
|
@Configuration |
||||
|
@EnableAsync |
||||
|
public class ThreadPoolTaskConfig { |
||||
|
|
||||
|
@Bean("threadPoolTaskExecutor")//自定义线程池名称
|
||||
|
public ThreadPoolTaskExecutor threadPoolTaskExecutor() { |
||||
|
|
||||
|
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); |
||||
|
|
||||
|
//线程池创建的核心线程数,线程池维护线程的最少数量,即使没有任务需要执行,也会一直存活
|
||||
|
executor.setCorePoolSize(16); |
||||
|
|
||||
|
//如果设置allowCoreThreadTimeout=true(默认false)时,核心线程会超时关闭
|
||||
|
//executor.setAllowCoreThreadTimeOut(true);
|
||||
|
|
||||
|
//阻塞队列 当核心线程数达到最大时,新任务会放在队列中排队等待执行
|
||||
|
executor.setQueueCapacity(124); |
||||
|
|
||||
|
//最大线程池数量,当线程数>=corePoolSize,且任务队列已满时。线程池会创建新线程来处理任务
|
||||
|
//任务队列已满时, 且当线程数=maxPoolSize,,线程池会拒绝处理任务而抛出异常
|
||||
|
executor.setMaxPoolSize(64); |
||||
|
|
||||
|
//当线程空闲时间达到keepAliveTime时,线程会退出,直到线程数量=corePoolSize
|
||||
|
//允许线程空闲时间30秒,当maxPoolSize的线程在空闲时间到达的时候销毁
|
||||
|
//如果allowCoreThreadTimeout=true,则会直到线程数量=0
|
||||
|
executor.setKeepAliveSeconds(30); |
||||
|
|
||||
|
//spring 提供的 ThreadPoolTaskExecutor 线程池,是有setThreadNamePrefix() 方法的。
|
||||
|
//jdk 提供的ThreadPoolExecutor 线程池是没有 setThreadNamePrefix() 方法的
|
||||
|
executor.setThreadNamePrefix("自定义线程池-"); |
||||
|
|
||||
|
// rejection-policy:拒绝策略:当线程数已经达到maxSize的时候,如何处理新任务
|
||||
|
// CallerRunsPolicy():交由调用方线程运行,比如 main 线程;如果添加到线程池失败,那么主线程会自己去执行该任务,不会等待线程池中的线程去执行, (个人推荐)
|
||||
|
// AbortPolicy():该策略是线程池的默认策略,如果线程池队列满了丢掉这个任务并且抛出RejectedExecutionException异常。
|
||||
|
// DiscardPolicy():如果线程池队列满了,会直接丢掉这个任务并且不会有任何异常
|
||||
|
// DiscardOldestPolicy():丢弃队列中最老的任务,队列满了,会将最早进入队列的任务删掉腾出空间,再尝试加入队列
|
||||
|
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy()); |
||||
|
|
||||
|
//设置线程池关闭的时候等待所有任务都完成再继续销毁其他的Bean,这样这些异步任务的销毁就会先于Redis线程池的销毁
|
||||
|
executor.setWaitForTasksToCompleteOnShutdown(true); |
||||
|
//设置线程池中任务的等待时间,如果超过这个时候还没有销毁就强制销毁,以确保应用最后能够被关闭,而不是阻塞住。
|
||||
|
executor.setAwaitTerminationSeconds(60); |
||||
|
|
||||
|
executor.initialize(); |
||||
|
return executor; |
||||
|
} |
||||
|
} |
@ -0,0 +1,8 @@ |
|||||
|
package com.woniu.constant; |
||||
|
|
||||
|
|
||||
|
public class Constants { |
||||
|
|
||||
|
public static String ADDRESS = ""; |
||||
|
|
||||
|
} |
@ -0,0 +1,32 @@ |
|||||
|
package com.woniu.controller; |
||||
|
|
||||
|
import com.woniu.service.MainService; |
||||
|
import com.woniu.vo.ApiResponse; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* IP 归属地获取,一个依赖轻松搞定 |
||||
|
*/ |
||||
|
@RequestMapping("/api") |
||||
|
@RestController |
||||
|
@Slf4j |
||||
|
public class AddressController { |
||||
|
|
||||
|
|
||||
|
@Autowired |
||||
|
MainService mainService; |
||||
|
|
||||
|
|
||||
|
@GetMapping("/get2") |
||||
|
public ApiResponse get() { |
||||
|
mainService.test1(); |
||||
|
return ApiResponse.ok(null); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,24 @@ |
|||||
|
package com.woniu.enumd; |
||||
|
|
||||
|
public enum AnimalEnum implements Eat { |
||||
|
Dog(){ |
||||
|
@Override |
||||
|
public void eat() { |
||||
|
System.out.println("吃骨头"); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
Cat() { |
||||
|
@Override |
||||
|
public void eat() { |
||||
|
System.out.println("吃鱼干"); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
Sheep() { |
||||
|
@Override |
||||
|
public void eat() { |
||||
|
System.out.println("吃草"); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,6 @@ |
|||||
|
package com.woniu.enumd; |
||||
|
|
||||
|
|
||||
|
public interface Eat { |
||||
|
void eat(); |
||||
|
} |
@ -0,0 +1,32 @@ |
|||||
|
package com.woniu.enumd; |
||||
|
|
||||
|
/** |
||||
|
* @Author: woniu |
||||
|
* @Description: 枚举 线程安全 |
||||
|
*/ |
||||
|
public class SingletonExample { |
||||
|
|
||||
|
/** |
||||
|
* 构造函数私有化,避免外部创建实例 |
||||
|
*/ |
||||
|
private SingletonExample() { |
||||
|
} |
||||
|
|
||||
|
public static SingletonExample getInstance() { |
||||
|
return Singleton.INSTANCE.getInstance(); |
||||
|
} |
||||
|
|
||||
|
private enum Singleton { |
||||
|
INSTANCE; |
||||
|
private SingletonExample instance; |
||||
|
|
||||
|
// JVM 保证这个方法绝对只调用一次
|
||||
|
Singleton() { |
||||
|
instance = new SingletonExample(); |
||||
|
} |
||||
|
|
||||
|
public SingletonExample getInstance() { |
||||
|
return instance; |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,142 @@ |
|||||
|
package com.woniu.enumd; |
||||
|
|
||||
|
import com.google.common.collect.ImmutableList; |
||||
|
import com.google.common.collect.Lists; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.util.*; |
||||
|
import java.util.stream.Collectors; |
||||
|
import java.util.stream.Stream; |
||||
|
|
||||
|
//提升Java代码简洁度的小技巧
|
||||
|
public class TestMain { |
||||
|
/** |
||||
|
* 先引入guava依赖 |
||||
|
* <dependency> |
||||
|
* <groupId>com.google.guava</groupId> |
||||
|
* <artifactId>guava</artifactId> |
||||
|
* <version>29.0-jre</version> |
||||
|
* </dependency> |
||||
|
* |
||||
|
* @param args |
||||
|
*/ |
||||
|
public static void main(String[] args) { |
||||
|
//创建一个list集合并赋值
|
||||
|
List<String> stringList = new ArrayList<>(); |
||||
|
stringList.add("jack"); |
||||
|
stringList.add("pony"); |
||||
|
stringList.add("ekko"); |
||||
|
|
||||
|
//简单改造:
|
||||
|
List<String> stringList2 = new ArrayList<String>(4) {{ |
||||
|
add("jack"); |
||||
|
add("pony"); |
||||
|
add("ekko"); |
||||
|
}}; |
||||
|
|
||||
|
|
||||
|
List<String> stringList3 = ImmutableList.of("jack", "pony", "ekko"); |
||||
|
// 类似于 Arrays.asList("jack", "pony", "ekko");
|
||||
|
stringList3.add("maomao"); |
||||
|
System.out.println(stringList3); |
||||
|
|
||||
|
// 终极改造:
|
||||
|
List<String> stringList4 = Lists.newArrayList("jack", "pony", "ekko"); |
||||
|
stringList4.add("hahah"); |
||||
|
System.out.println(stringList4); |
||||
|
|
||||
|
|
||||
|
//去除list中的空值
|
||||
|
List<String> nameList = new ArrayList<>(); |
||||
|
List<String> noNullList = new ArrayList<>(); |
||||
|
nameList.add("jack"); |
||||
|
nameList.add("pony"); |
||||
|
nameList.add("ekko"); |
||||
|
nameList.add(null); |
||||
|
for (String o : nameList) { |
||||
|
if (o != null) { |
||||
|
noNullList.add(o); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
//使用lamda简化后的写法
|
||||
|
List<String> noNullListFun = nameList |
||||
|
.stream() |
||||
|
.filter(Objects::nonNull) |
||||
|
.collect(Collectors.toList()); |
||||
|
|
||||
|
|
||||
|
//list中的值求和
|
||||
|
List<BigDecimal> numList = ImmutableList.of(BigDecimal.valueOf(111L) |
||||
|
, BigDecimal.valueOf(8888.22), BigDecimal.valueOf(333.22) |
||||
|
, BigDecimal.valueOf(857857.22), BigDecimal.valueOf(5331.22)); |
||||
|
|
||||
|
BigDecimal total = BigDecimal.ZERO; |
||||
|
for (BigDecimal num : numList) { |
||||
|
total = total.add(num); |
||||
|
} |
||||
|
System.out.println(total); |
||||
|
|
||||
|
|
||||
|
// 简化一下:
|
||||
|
List<BigDecimal> numListSimple = ImmutableList.of(BigDecimal.valueOf(111L) |
||||
|
, BigDecimal.valueOf(8888.22), BigDecimal.valueOf(333.22) |
||||
|
, BigDecimal.valueOf(857857.22), BigDecimal.valueOf(5331.22)); |
||||
|
|
||||
|
BigDecimal reduce = numListSimple.stream().reduce(BigDecimal.ZERO, BigDecimal::add); |
||||
|
System.out.println(reduce); |
||||
|
|
||||
|
|
||||
|
|
||||
|
/* |
||||
|
* 从多个集合中取匹配的值 |
||||
|
* 匹配到姓马的并去重然后放入一个新的集合中 |
||||
|
*/ |
||||
|
List<String> nameListA = ImmutableList.of("素云云", "马云云", "腾花花", "阿娇娇", "马飞飞", "廖妹妹"); |
||||
|
List<String> nameListB = ImmutableList.of("素云涛", "唐三三", "小五五", "马中山", "马僻静", "马肥羊"); |
||||
|
List<String> nameListC = ImmutableList.of("张三", "李四", "王二", "麻子", "上官玩儿", "马可菠萝"); |
||||
|
Set<String> nameSet = new HashSet<>(); |
||||
|
nameListA.forEach(n -> { |
||||
|
if (n.startsWith("马")) { |
||||
|
nameSet.add(n); |
||||
|
} |
||||
|
}); |
||||
|
nameListB.forEach(n -> { |
||||
|
if (n.startsWith("马")) { |
||||
|
nameSet.add(n); |
||||
|
} |
||||
|
}); |
||||
|
nameListC.forEach(n -> { |
||||
|
if (n.startsWith("马")) { |
||||
|
nameSet.add(n); |
||||
|
} |
||||
|
}); |
||||
|
System.out.println(nameSet.toString()); |
||||
|
|
||||
|
//改造后的代码:
|
||||
|
Set<String> set = Stream.of(nameListA, nameListB, nameListC) |
||||
|
.flatMap(list -> list.stream().filter(name -> name.startsWith("马"))) |
||||
|
.collect(Collectors.toSet()); |
||||
|
|
||||
|
System.out.println(set); |
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
private static void eatWhat(String animalType) { |
||||
|
// if ("Dog".equals(animalType)) {
|
||||
|
// System.out.println("吃骨头");
|
||||
|
// } else if ("Cat".equals(animalType)) {
|
||||
|
// System.out.println("我想吃鱼了");
|
||||
|
// } else if ("Sheep".equals(animalType)) {
|
||||
|
// System.out.println("吃草");
|
||||
|
// } else {
|
||||
|
// System.out.println("不知道吃啥");
|
||||
|
// }
|
||||
|
|
||||
|
|
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,12 @@ |
|||||
|
package com.woniu.enumdemo; |
||||
|
|
||||
|
public class Test { |
||||
|
public static void main(String[] args) { |
||||
|
// Week w = Week.TUESDAY;
|
||||
|
// w.getWeekNum();
|
||||
|
for (Week w : Week.values()) { |
||||
|
System.out.println(w); |
||||
|
} |
||||
|
System.out.println("星期天:" + Week.valueOf("SUNDAY")); |
||||
|
} |
||||
|
} |
@ -0,0 +1,61 @@ |
|||||
|
package com.woniu.enumdemo; |
||||
|
|
||||
|
public enum Week { |
||||
|
// SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY;
|
||||
|
//
|
||||
|
// Week(){
|
||||
|
// System.out.println("hello");
|
||||
|
// }
|
||||
|
|
||||
|
// SUNDAY(7), MONDAY(1), TUESDAY(2), WEDNESDAY(3), THURSDAY(4), FRIDAY(5), SATURDAY(6);
|
||||
|
//
|
||||
|
// Week(int weekNum){
|
||||
|
// System.out.println(weekNum);
|
||||
|
// }
|
||||
|
|
||||
|
|
||||
|
// SUNDAY(7), MONDAY(1), TUESDAY(2), WEDNESDAY(3), THURSDAY(4), FRIDAY(5), SATURDAY(6);
|
||||
|
//
|
||||
|
// private int weekNum;
|
||||
|
//
|
||||
|
// Week(int weekNum){
|
||||
|
// this.weekNum = weekNum;
|
||||
|
// }
|
||||
|
//
|
||||
|
// public int getWeekNum() {
|
||||
|
// return weekNum;
|
||||
|
// }
|
||||
|
|
||||
|
|
||||
|
SUNDAY(){ |
||||
|
@Override |
||||
|
public void getWeekNum() { |
||||
|
System.out.println(7); |
||||
|
} |
||||
|
}, |
||||
|
MONDAY() { |
||||
|
@Override |
||||
|
public void getWeekNum() { |
||||
|
System.out.println("星期一"); |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
TUESDAY(){ |
||||
|
@Override |
||||
|
public void getWeekNum() { |
||||
|
System.out.println("礼拜二"); |
||||
|
} |
||||
|
}, |
||||
|
WEDNESDAY(){ |
||||
|
@Override |
||||
|
public void getWeekNum() { |
||||
|
System.out.println("周三"); |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
public abstract void getWeekNum(); |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,45 @@ |
|||||
|
package com.woniu.interceptor; |
||||
|
|
||||
|
import com.woniu.ip.AddressUtils; |
||||
|
import com.woniu.ip.IPUtil; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.context.annotation.Configuration; |
||||
|
import org.springframework.web.servlet.HandlerInterceptor; |
||||
|
import org.springframework.web.servlet.ModelAndView; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletRequest; |
||||
|
import javax.servlet.http.HttpServletResponse; |
||||
|
|
||||
|
/** |
||||
|
* IP 归属地获取,一个依赖轻松搞定 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Configuration |
||||
|
public class IpUrlLimitInterceptor implements HandlerInterceptor { |
||||
|
|
||||
|
|
||||
|
@Override |
||||
|
public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o) { |
||||
|
//通过本地获取
|
||||
|
// 获得ip
|
||||
|
String ip = IPUtil.getIpAddr(httpServletRequest); |
||||
|
// 解析具体地址
|
||||
|
String addr = IPUtil.getAddr("2.58.179.255"); |
||||
|
|
||||
|
//通过在线库获取
|
||||
|
String ip2 = IPUtil.getIpAddr(httpServletRequest); |
||||
|
String ipaddr2 = AddressUtils.getRealAddressByIP(ip2); |
||||
|
log.info("IP >> {},Address >> {}", ip2, 2); |
||||
|
return true; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void postHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, ModelAndView modelAndView) { |
||||
|
|
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void afterCompletion(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, Exception e) { |
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,21 @@ |
|||||
|
package com.woniu.interceptor; |
||||
|
|
||||
|
|
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.context.annotation.Configuration; |
||||
|
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; |
||||
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; |
||||
|
|
||||
|
@Configuration |
||||
|
public class WebConfig implements WebMvcConfigurer { |
||||
|
@Autowired |
||||
|
IpUrlLimitInterceptor ipUrlLimitInterceptor; |
||||
|
|
||||
|
//执行ip拦截器
|
||||
|
@Override |
||||
|
public void addInterceptors(InterceptorRegistry registry) { |
||||
|
registry.addInterceptor(ipUrlLimitInterceptor) |
||||
|
// 拦截所有请求
|
||||
|
.addPathPatterns("/**"); |
||||
|
} |
||||
|
} |
@ -0,0 +1,89 @@ |
|||||
|
package com.woniu.ip; |
||||
|
|
||||
|
import cn.hutool.core.util.StrUtil; |
||||
|
import com.alibaba.fastjson.JSONObject; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
|
||||
|
import java.io.BufferedReader; |
||||
|
import java.io.IOException; |
||||
|
import java.io.InputStreamReader; |
||||
|
import java.net.ConnectException; |
||||
|
import java.net.SocketTimeoutException; |
||||
|
import java.net.URL; |
||||
|
import java.net.URLConnection; |
||||
|
|
||||
|
@Slf4j |
||||
|
public class AddressUtils { |
||||
|
// IP地址查询
|
||||
|
public static final String IP_URL = "http://whois.pconline.com.cn/ipJson.jsp"; |
||||
|
|
||||
|
// 未知地址
|
||||
|
public static final String UNKNOWN = "XX XX"; |
||||
|
|
||||
|
/** |
||||
|
* 离线IP库总会出现更新不及时的问题, |
||||
|
* 如果想要获取更加全面的ip 地址信息, |
||||
|
* 可使用在线数据库,这里提供的是 whois.pconline.com的IP解析, |
||||
|
* 该IP解析在我的使用过程中表现非常流畅,而且只有少数的ip 存在无法解析的情况。 |
||||
|
* @param ip |
||||
|
* @return |
||||
|
*/ |
||||
|
public static String getRealAddressByIP(String ip) { |
||||
|
String address = UNKNOWN; |
||||
|
if (true) { |
||||
|
try { |
||||
|
String rspStr = sendGet(IP_URL, "ip=" + ip + "&json=true", "GBK"); |
||||
|
if (StrUtil.isEmpty(rspStr)) { |
||||
|
log.error("获取地理位置异常 {}", ip); |
||||
|
return UNKNOWN; |
||||
|
} |
||||
|
JSONObject obj = JSONObject.parseObject(rspStr); |
||||
|
String region = obj.getString("pro"); |
||||
|
String city = obj.getString("city"); |
||||
|
String addr = obj.getString("addr"); |
||||
|
return String.format("%s %s %s", region, city, addr); |
||||
|
} catch (Exception e) { |
||||
|
log.error("获取地理位置异常 {}", ip); |
||||
|
} |
||||
|
} |
||||
|
return address; |
||||
|
} |
||||
|
|
||||
|
public static String sendGet(String url, String param, String contentType) { |
||||
|
StringBuilder result = new StringBuilder(); |
||||
|
BufferedReader in = null; |
||||
|
try { |
||||
|
String urlNameString = url + "?" + param; |
||||
|
log.info("sendGet - {}", urlNameString); |
||||
|
URL realUrl = new URL(urlNameString); |
||||
|
URLConnection connection = realUrl.openConnection(); |
||||
|
connection.setRequestProperty("accept", "*/*"); |
||||
|
connection.setRequestProperty("connection", "Keep-Alive"); |
||||
|
connection.setRequestProperty("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)"); |
||||
|
connection.connect(); |
||||
|
in = new BufferedReader(new InputStreamReader(connection.getInputStream(), contentType)); |
||||
|
String line; |
||||
|
while ((line = in.readLine()) != null) { |
||||
|
result.append(line); |
||||
|
} |
||||
|
log.info("recv - {}", result); |
||||
|
} catch (ConnectException e) { |
||||
|
log.error("调用HttpUtils.sendGet ConnectException, url=" + url + ",param=" + param, e); |
||||
|
} catch (SocketTimeoutException e) { |
||||
|
log.error("调用HttpUtils.sendGet SocketTimeoutException, url=" + url + ",param=" + param, e); |
||||
|
} catch (IOException e) { |
||||
|
log.error("调用HttpUtils.sendGet IOException, url=" + url + ",param=" + param, e); |
||||
|
} catch (Exception e) { |
||||
|
log.error("调用HttpsUtil.sendGet Exception, url=" + url + ",param=" + param, e); |
||||
|
} finally { |
||||
|
try { |
||||
|
if (in != null) { |
||||
|
in.close(); |
||||
|
} |
||||
|
} catch (Exception ex) { |
||||
|
log.error("调用in.close Exception, url=" + url + ",param=" + param, ex); |
||||
|
} |
||||
|
} |
||||
|
return result.toString(); |
||||
|
} |
||||
|
} |
@ -0,0 +1,65 @@ |
|||||
|
package com.woniu.ip; |
||||
|
|
||||
|
|
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.lionsoul.ip2region.xdb.Searcher; |
||||
|
|
||||
|
import javax.servlet.http.HttpServletRequest; |
||||
|
|
||||
|
@Slf4j |
||||
|
public class IPUtil { |
||||
|
|
||||
|
private static final String UNKNOWN = "unknown"; |
||||
|
|
||||
|
protected IPUtil() { |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取 IP地址 |
||||
|
* 使用 Nginx等反向代理软件, 则不能通过 request.getRemoteAddr()获取 IP地址 |
||||
|
* 如果使用了多级反向代理的话,X-Forwarded-For的值并不止一个,而是一串IP地址, |
||||
|
* X-Forwarded-For中第一个非 unknown的有效IP字符串,则为真实IP地址 |
||||
|
*/ |
||||
|
public static String getIpAddr(HttpServletRequest request) { |
||||
|
String ip = request.getHeader("x-forwarded-for"); |
||||
|
if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) { |
||||
|
ip = request.getHeader("Proxy-Client-IP"); |
||||
|
} |
||||
|
if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) { |
||||
|
ip = request.getHeader("WL-Proxy-Client-IP"); |
||||
|
} |
||||
|
if (ip == null || ip.length() == 0 || UNKNOWN.equalsIgnoreCase(ip)) { |
||||
|
ip = request.getRemoteAddr(); |
||||
|
} |
||||
|
return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : ip; |
||||
|
} |
||||
|
|
||||
|
public static String getAddr(String ip) { |
||||
|
String dbPath = "D:\\java project\\fanfu-web-master\\woniu-web-master\\src\\main\\resources\\ip2region\\ip2region.xdb"; |
||||
|
// 1、从 dbPath 加载整个 xdb 到内存。
|
||||
|
byte[] cBuff; |
||||
|
try { |
||||
|
cBuff = Searcher.loadContentFromFile(dbPath); |
||||
|
} catch (Exception e) { |
||||
|
log.info("failed to load content from `%s`: %s\n", dbPath, e); |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
// 2、使用上述的 cBuff 创建一个完全基于内存的查询对象。
|
||||
|
Searcher searcher; |
||||
|
try { |
||||
|
searcher = Searcher.newWithBuffer(cBuff); |
||||
|
} catch (Exception e) { |
||||
|
log.info("failed to create content cached searcher: %s\n", e); |
||||
|
return null; |
||||
|
} |
||||
|
// 3、查询
|
||||
|
try { |
||||
|
String region = searcher.search(ip); |
||||
|
return region; |
||||
|
} catch (Exception e) { |
||||
|
log.info("failed to search(%s): %s\n", ip, e); |
||||
|
} |
||||
|
return null; |
||||
|
} |
||||
|
} |
@ -0,0 +1,27 @@ |
|||||
|
package com.woniu.service; |
||||
|
|
||||
|
|
||||
|
import com.woniu.anno.MainTransaction; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
|
||||
|
|
||||
|
@Service |
||||
|
public class MainService { |
||||
|
|
||||
|
@Resource |
||||
|
private SonService sonService; |
||||
|
|
||||
|
@MainTransaction(3) //调用的方法中sonMethod1/sonMethod2/sonMethod3使用@Async开启了线程, 所以参数为: 3
|
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void test1() { |
||||
|
sonService.sonMethod1("蜗牛", Thread.currentThread()); |
||||
|
sonService.sonMethod2("乾隆", "山治", Thread.currentThread()); |
||||
|
sonService.sonMethod3("小宝", Thread.currentThread()); |
||||
|
sonService.sonMethod4("罗宾"); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,49 @@ |
|||||
|
package com.woniu.service; |
||||
|
|
||||
|
import com.woniu.anno.SonTransaction; |
||||
|
import org.springframework.scheduling.annotation.Async; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
/** |
||||
|
* @author woniu |
||||
|
* @since 2023/06/28 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class SonService { |
||||
|
|
||||
|
/** |
||||
|
* 参数说明: 以下4个方法参数和此相同 |
||||
|
* |
||||
|
* @param args 业务中需要传递的参数 |
||||
|
* @param thread 调用者的线程, 用于aop获取参数, 不建议以方法重写的方式简略此参数, |
||||
|
* 在调用者方法中可以以此参数为标识计算子线程的个数作为注解参数,避免线程参数计算错误导致锁表 |
||||
|
* 传参时参数固定为: Thread.currentThread() |
||||
|
*/ |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
@Async("threadPoolTaskExecutor") |
||||
|
@SonTransaction |
||||
|
public void sonMethod1(String args, Thread thread) { |
||||
|
System.out.println(args + "开启了线程"); |
||||
|
} |
||||
|
|
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
@Async("threadPoolTaskExecutor") |
||||
|
@SonTransaction |
||||
|
public void sonMethod2(String args1, String args2, Thread thread) { |
||||
|
System.out.println(args1 + "和" + args2 + "开启了线程"); |
||||
|
} |
||||
|
|
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
@Async("threadPoolTaskExecutor") |
||||
|
@SonTransaction |
||||
|
public void sonMethod3(String args, Thread thread) { |
||||
|
System.out.println(args + "开启了线程"); |
||||
|
} |
||||
|
|
||||
|
//sonMethod4方法没有使用线程池
|
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void sonMethod4(String args) { |
||||
|
System.out.println(args + "没有开启线程"); |
||||
|
} |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
package com.woniu.thread; |
||||
|
|
||||
|
import com.alibaba.fastjson.JSON; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 加了一行log日志,结果引发了线上事故 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
public class FastJonTest { |
||||
|
|
||||
|
public static void main(String[] args) { |
||||
|
StudentDTO studentDTO = new StudentDTO(); |
||||
|
String str = JSON.toJSONString(studentDTO); |
||||
|
log.info(str); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,21 @@ |
|||||
|
package com.woniu.thread; |
||||
|
|
||||
|
|
||||
|
import com.alibaba.fastjson.annotation.JSONField; |
||||
|
|
||||
|
public class StudentDTO { |
||||
|
private String studentName; |
||||
|
|
||||
|
public String getStudentName() { |
||||
|
return studentName; |
||||
|
} |
||||
|
|
||||
|
public void setStudentName(String studentName) { |
||||
|
this.studentName = studentName; |
||||
|
} |
||||
|
@JSONField(serialize = false) |
||||
|
public Boolean isChinaName() { |
||||
|
return this.studentName.equals("孔子"); |
||||
|
} |
||||
|
} |
||||
|
|
@ -0,0 +1,26 @@ |
|||||
|
package com.woniu.vo; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
@Data |
||||
|
public class ApiResponse<T> { |
||||
|
|
||||
|
private T data; |
||||
|
private String message; |
||||
|
private String code; |
||||
|
|
||||
|
public ApiResponse(T data, String message, String code) { |
||||
|
this.data = data; |
||||
|
this.message = message; |
||||
|
this.code = code; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
public static<T> ApiResponse<T> fail(T data, MessageEnum messageEnum) { |
||||
|
return new ApiResponse(data, messageEnum.getMessage(), messageEnum.getCode()); |
||||
|
} |
||||
|
|
||||
|
public static<T> ApiResponse<T> ok(T data) { |
||||
|
return new ApiResponse(data, "响应正常", "200"); |
||||
|
} |
||||
|
} |
@ -0,0 +1,28 @@ |
|||||
|
package com.woniu.vo; |
||||
|
|
||||
|
/** |
||||
|
* @className: MessageEnum |
||||
|
* @author: woniu |
||||
|
* @date: 2023/6/25 |
||||
|
**/ |
||||
|
|
||||
|
|
||||
|
public enum MessageEnum { |
||||
|
ParamException("400","参数错误!"); |
||||
|
|
||||
|
private String code; |
||||
|
private String message; |
||||
|
|
||||
|
MessageEnum(String code, String message) { |
||||
|
this.code = code; |
||||
|
this.message = message; |
||||
|
} |
||||
|
|
||||
|
public String getCode() { |
||||
|
return code; |
||||
|
} |
||||
|
|
||||
|
public String getMessage() { |
||||
|
return message; |
||||
|
} |
||||
|
} |
@ -0,0 +1,67 @@ |
|||||
|
package com.woniu.write; |
||||
|
|
||||
|
|
||||
|
import java.io.File; |
||||
|
import java.io.FileWriter; |
||||
|
import java.io.IOException; |
||||
|
import java.util.concurrent.locks.Lock; |
||||
|
import java.util.concurrent.locks.ReentrantLock; |
||||
|
|
||||
|
public class MultiThreadFileWriter { |
||||
|
|
||||
|
private File file; |
||||
|
private FileWriter fileWriter; |
||||
|
private Lock lock; |
||||
|
|
||||
|
public MultiThreadFileWriter(String filePath) throws IOException { |
||||
|
this.file = new File(filePath); |
||||
|
if (!file.exists()) { |
||||
|
file.createNewFile(); |
||||
|
} |
||||
|
this.fileWriter = new FileWriter(file, true); // 追加写入
|
||||
|
this.lock = new ReentrantLock(); |
||||
|
} |
||||
|
|
||||
|
public void write(String content) { |
||||
|
lock.lock(); |
||||
|
try { |
||||
|
fileWriter.write(content); |
||||
|
fileWriter.flush(); |
||||
|
} catch (IOException e) { |
||||
|
e.printStackTrace(); |
||||
|
} finally { |
||||
|
lock.unlock(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public void close() { |
||||
|
try { |
||||
|
fileWriter.close(); |
||||
|
} catch (IOException e) { |
||||
|
e.printStackTrace(); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public static void main(String[] args) throws IOException { |
||||
|
MultiThreadFileWriter writer = new MultiThreadFileWriter("test.txt"); |
||||
|
Thread thread1 = new Thread(() -> { |
||||
|
for (int i = 0; i < 100; i++) { |
||||
|
writer.write("Thread 1: " + i + "\n"); |
||||
|
} |
||||
|
}); |
||||
|
Thread thread2 = new Thread(() -> { |
||||
|
for (int i = 0; i < 100; i++) { |
||||
|
writer.write("Thread 2: " + i + "\n"); |
||||
|
} |
||||
|
}); |
||||
|
thread1.start(); |
||||
|
thread2.start(); |
||||
|
try { |
||||
|
thread1.join(); |
||||
|
thread2.join(); |
||||
|
} catch (InterruptedException e) { |
||||
|
e.printStackTrace(); |
||||
|
} |
||||
|
writer.close(); |
||||
|
} |
||||
|
} |
@ -0,0 +1,12 @@ |
|||||
|
spring.datasource.username=root |
||||
|
spring.datasource.password=123456 |
||||
|
spring.datasource.url=jdbc:mysql://localhost:3306/test?serverTimezone=UTC |
||||
|
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver |
||||
|
|
||||
|
mybatis.mapper-locations=classpath:/mapper/*.xml |
||||
|
|
||||
|
spring.cache.type=simple |
||||
|
spring.application.name=yyyy |
||||
|
#spring.jackson.date-format=yyyy-MM-dd HH:mm:ss |
||||
|
#spring.jackson.time-zone=GMT+8 |
||||
|
|
Binary file not shown.
@ -0,0 +1,26 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<configuration> |
||||
|
<!-- 控制台日志格式 --> |
||||
|
<property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %X{requestId} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/> |
||||
|
<!-- 控制台日志格式 依赖的渲染类 --> |
||||
|
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" /> |
||||
|
<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" /> |
||||
|
<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" /> |
||||
|
<!-- 输出到控制台 --> |
||||
|
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> |
||||
|
<encoder> |
||||
|
<!-- 配置日志输出格式 --> |
||||
|
<pattern>${CONSOLE_LOG_PATTERN}</pattern> |
||||
|
<!-- 使用的字符集 --> |
||||
|
<charset>UTF-8</charset> |
||||
|
</encoder> |
||||
|
</appender> |
||||
|
|
||||
|
|
||||
|
<!-- 开启上面的appender --> |
||||
|
<root level="info"> |
||||
|
<appender-ref ref="CONSOLE" /> |
||||
|
</root> |
||||
|
|
||||
|
|
||||
|
</configuration> |
@ -0,0 +1,35 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||
|
<!DOCTYPE configuration |
||||
|
PUBLIC "-//mybatis.org//DTD Config 3.0//EN" |
||||
|
"http://mybatis.org/dtd/mybatis-3-config.dtd"> |
||||
|
<configuration> |
||||
|
<settings> |
||||
|
<!-- 打印sql日志 --> |
||||
|
<setting name="logImpl" value="org.apache.ibatis.logging.stdout.StdOutImpl"/> |
||||
|
</settings> |
||||
|
<plugins> |
||||
|
<plugin interceptor="com.github.pagehelper.PageHelper"> |
||||
|
<property name="dialect" value="mysql"/> |
||||
|
<property name="offsetAsPageNum" value="false"/> |
||||
|
<property name="rowBoundsWithCount" value="false"/> |
||||
|
<property name="pageSizeZero" value="true"/> |
||||
|
<property name="reasonable" value="false"/> |
||||
|
<property name="supportMethodsArguments" value="false"/> |
||||
|
<property name="returnPageInfo" value="none"/> |
||||
|
</plugin> |
||||
|
</plugins> |
||||
|
<!--<environments default="development">--> |
||||
|
<!--<environment id="development">--> |
||||
|
<!--<transactionManager type="JDBC"/>--> |
||||
|
<!--<dataSource type="POOLED">--> |
||||
|
<!--<property name="driver" value="com.mysql.jdbc.Driver"/>--> |
||||
|
<!--<property name="url" value="jdbc:mysql://localhost:3307/happy_home?serverTimezone=UTC"/>--> |
||||
|
<!--<property name="username" value="root"/>--> |
||||
|
<!--<property name="password" value="root"/>--> |
||||
|
<!--</dataSource>--> |
||||
|
<!--</environment>--> |
||||
|
<!--</environments>--> |
||||
|
<!--<mappers>--> |
||||
|
<!--<mapper resource="mapper/EmployeeMapper.xml" />--> |
||||
|
<!--</mappers>--> |
||||
|
</configuration> |
@ -0,0 +1,154 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> |
||||
|
<component name="FacetManager"> |
||||
|
<facet type="Spring" name="Spring"> |
||||
|
<configuration /> |
||||
|
</facet> |
||||
|
<facet type="web" name="Web"> |
||||
|
<configuration> |
||||
|
<webroots /> |
||||
|
<sourceRoots> |
||||
|
<root url="file://$MODULE_DIR$/src/main/java" /> |
||||
|
<root url="file://$MODULE_DIR$/src/main/resources" /> |
||||
|
</sourceRoots> |
||||
|
</configuration> |
||||
|
</facet> |
||||
|
</component> |
||||
|
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8"> |
||||
|
<output url="file://$MODULE_DIR$/target/classes" /> |
||||
|
<output-test url="file://$MODULE_DIR$/target/test-classes" /> |
||||
|
<content url="file://$MODULE_DIR$"> |
||||
|
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> |
||||
|
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> |
||||
|
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> |
||||
|
<excludeFolder url="file://$MODULE_DIR$/target" /> |
||||
|
</content> |
||||
|
<orderEntry type="inheritedJdk" /> |
||||
|
<orderEntry type="sourceFolder" forTests="false" /> |
||||
|
<orderEntry type="library" name="Maven: com.google.guava:guava:29.0-jre" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: com.google.guava:failureaccess:1.0.1" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: com.google.code.findbugs:jsr305:3.0.2" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.checkerframework:checker-qual:2.11.1" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: com.google.errorprone:error_prone_annotations:2.3.4" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: com.google.j2objc:j2objc-annotations:1.3" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.lionsoul:ip2region:2.7.0" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-aop:2.3.9.RELEASE" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-aop:5.2.13.RELEASE" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-beans:5.2.13.RELEASE" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.aspectj:aspectjweaver:1.9.6" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: cn.hutool:hutool-all:5.3.3" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter:2.3.9.RELEASE" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot:2.3.9.RELEASE" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-context:5.2.13.RELEASE" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-autoconfigure:2.3.9.RELEASE" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-logging:2.3.9.RELEASE" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: ch.qos.logback:logback-classic:1.2.3" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: ch.qos.logback:logback-core:1.2.3" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-to-slf4j:2.13.3" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.13.3" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.slf4j:jul-to-slf4j:1.7.30" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: jakarta.annotation:jakarta.annotation-api:1.3.5" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-core:5.2.13.RELEASE" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-jcl:5.2.13.RELEASE" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.26" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-web:2.3.9.RELEASE" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-json:2.3.9.RELEASE" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.11.4" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.11.4" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.11.4" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.11.4" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.4" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: com.fasterxml.jackson.module:jackson-module-parameter-names:2.11.4" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-tomcat:2.3.9.RELEASE" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-core:9.0.43" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.apache.tomcat.embed:tomcat-embed-websocket:9.0.43" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-web:5.2.13.RELEASE" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-webmvc:5.2.13.RELEASE" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-expression:5.2.13.RELEASE" level="project" /> |
||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-starter-test:2.3.9.RELEASE" level="project" /> |
||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test:2.3.9.RELEASE" level="project" /> |
||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.springframework.boot:spring-boot-test-autoconfigure:2.3.9.RELEASE" level="project" /> |
||||
|
<orderEntry type="library" scope="TEST" name="Maven: com.jayway.jsonpath:json-path:2.4.0" level="project" /> |
||||
|
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:json-smart:2.3" level="project" /> |
||||
|
<orderEntry type="library" scope="TEST" name="Maven: net.minidev:accessors-smart:1.2" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: jakarta.xml.bind:jakarta.xml.bind-api:2.3.3" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: jakarta.activation:jakarta.activation-api:1.2.2" level="project" /> |
||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.assertj:assertj-core:3.16.1" level="project" /> |
||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest:2.2" level="project" /> |
||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter:5.6.3" level="project" /> |
||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-api:5.6.3" level="project" /> |
||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.opentest4j:opentest4j:1.2.0" level="project" /> |
||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-commons:1.6.3" level="project" /> |
||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-params:5.6.3" level="project" /> |
||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-engine:5.6.3" level="project" /> |
||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.junit.vintage:junit-vintage-engine:5.6.3" level="project" /> |
||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.apiguardian:apiguardian-api:1.1.0" level="project" /> |
||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-engine:1.6.3" level="project" /> |
||||
|
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.13.2" level="project" /> |
||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-core:3.3.3" level="project" /> |
||||
|
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy:1.10.20" level="project" /> |
||||
|
<orderEntry type="library" scope="TEST" name="Maven: net.bytebuddy:byte-buddy-agent:1.10.20" level="project" /> |
||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:2.6" level="project" /> |
||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-junit-jupiter:3.3.3" level="project" /> |
||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.skyscreamer:jsonassert:1.5.0" level="project" /> |
||||
|
<orderEntry type="library" scope="TEST" name="Maven: com.vaadin.external.google:android-json:0.0.20131108.vaadin1" level="project" /> |
||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.springframework:spring-test:5.2.13.RELEASE" level="project" /> |
||||
|
<orderEntry type="library" scope="TEST" name="Maven: org.xmlunit:xmlunit-core:2.7.0" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.projectlombok:lombok:1.18.18" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-cache:2.3.9.RELEASE" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-context-support:5.2.13.RELEASE" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-boot-starter:3.4.1" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus:3.4.1" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-extension:3.4.1" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-core:3.4.1" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: com.baomidou:mybatis-plus-annotation:3.4.1" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: com.github.jsqlparser:jsqlparser:3.2" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.mybatis:mybatis:3.5.6" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.mybatis:mybatis-spring:2.0.5" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-jdbc:2.3.9.RELEASE" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: com.zaxxer:HikariCP:3.4.5" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-jdbc:5.2.13.RELEASE" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.springframework:spring-tx:5.2.13.RELEASE" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: mysql:mysql-connector-java:8.0.29" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: com.alipay.sofa:runtime-sofa-boot-starter:3.18.0" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: com.alipay.sofa:runtime-sofa-boot:3.18.0" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: com.alipay.sofa:sofa-boot:3.18.0" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: com.alipay.sofa:log-sofa-boot-starter:3.18.0" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: com.alipay.sofa:log-sofa-boot:3.18.0" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: com.alipay.sofa.common:sofa-common-tools:1.3.6" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: com.alipay.sofa:sofa-ark-spi:1.1.5" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: com.alipay.sofa:sofa-ark-exception:1.1.5" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: com.alipay.sofa:sofa-boot-autoconfigure:3.18.0" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.springframework.boot:spring-boot-starter-validation:2.3.9.RELEASE" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.glassfish:jakarta.el:3.0.3" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.hibernate.validator:hibernate-validator:6.1.7.Final" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: jakarta.validation:jakarta.validation-api:2.0.2" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.jboss.logging:jboss-logging:3.4.1.Final" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: com.fasterxml:classmate:1.5.1" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: com.alibaba:fastjson:1.2.76" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: com.alibaba:easyexcel:3.0.5" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.apache.poi:poi:4.1.2" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.14" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.apache.commons:commons-collections4:4.4" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.apache.commons:commons-math3:3.6.1" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: com.zaxxer:SparseBitSet:1.2" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml:4.1.2" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.apache.commons:commons-compress:1.19" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: com.github.virtuald:curvesapi:1.06" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.apache.poi:poi-ooxml-schemas:4.1.2" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.apache.xmlbeans:xmlbeans:3.1.0" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.apache.commons:commons-csv:1.8" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: cglib:cglib:3.3.0" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.ow2.asm:asm:7.1" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.30" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.ehcache:ehcache:3.8.1" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.glassfish.jaxb:jaxb-runtime:2.3.3" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.glassfish.jaxb:txw2:2.3.3" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: com.sun.istack:istack-commons-runtime:3.0.11" level="project" /> |
||||
|
<orderEntry type="library" scope="RUNTIME" name="Maven: com.sun.activation:jakarta.activation:1.2.2" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: org.testng:testng:7.8.0" level="project" /> |
||||
|
<orderEntry type="library" name="Maven: com.beust:jcommander:1.82" level="project" /> |
||||
|
<orderEntry type="library" scope="RUNTIME" name="Maven: org.webjars:jquery:3.6.1" level="project" /> |
||||
|
</component> |
||||
|
</module> |
Loading…
Reference in new issue