dtp-移除hippop4j依赖

This commit is contained in:
2025-08-27 13:44:35 +08:00
parent 75d3bca541
commit 99922e8630
15 changed files with 49 additions and 75 deletions

View File

@@ -1,6 +1,5 @@
package com.accompany.admin.service.lucky;
import cn.hippo4j.common.toolkit.CollectionUtil;
import com.accompany.admin.service.system.SysConfAdminService;
import com.accompany.admin.vo.BravoConfigAdminVo;
import com.accompany.admin.vo.luckybag.BravoPersonalStatVo;
@@ -83,7 +82,7 @@ public class BravoPoolAdminService {
Date now = new Date();
List<BravoPool> poList = listPoolByType(type);
Map<Integer, BravoPool> poMap = !CollectionUtil.isEmpty(poList)?
Map<Integer, BravoPool> poMap = !CollectionUtils.isEmpty(poList)?
poList.stream().collect(Collectors.toMap(BravoPool::getId, po->po)):
new HashMap<>();

View File

@@ -1,6 +1,5 @@
package com.accompany.admin.service.lucky;
import cn.hippo4j.common.toolkit.CollectionUtil;
import com.accompany.admin.service.system.SysConfAdminService;
import com.accompany.admin.vo.Lucky24ConfigAdminVo;
import com.accompany.business.dto.lucky.Lucky24GiftConfig;
@@ -57,7 +56,7 @@ public class Lucky24PoolAdminService {
Date now = new Date();
List<Lucky24Pool> poList = listPoolByType(type);
Map<Integer, Lucky24Pool> poMap = !CollectionUtil.isEmpty(poList)?
Map<Integer, Lucky24Pool> poMap = !CollectionUtils.isEmpty(poList)?
poList.stream().collect(Collectors.toMap(Lucky24Pool::getId, po->po)):
new HashMap<>();

View File

@@ -1,6 +1,6 @@
package com.accompany.admin.service.lucky;
import cn.hippo4j.common.toolkit.CollectionUtil;
import org.springframework.util.CollectionUtils;
import com.accompany.admin.service.system.SysConfAdminService;
import com.accompany.admin.vo.Lucky25ConfigAdminVo;
import com.accompany.business.dto.lucky.Lucky25GiftConfig;
@@ -58,7 +58,7 @@ public class Lucky25PoolAdminService {
Date now = new Date();
List<Lucky25Pool> poList = listPoolByType(type);
Map<Integer, Lucky25Pool> poMap = !CollectionUtil.isEmpty(poList)?
Map<Integer, Lucky25Pool> poMap = !CollectionUtils.isEmpty(poList)?
poList.stream().collect(Collectors.toMap(Lucky25Pool::getId, po->po)):
new HashMap<>();

View File

@@ -1,6 +1,5 @@
package com.accompany.admin;
import cn.hippo4j.core.enable.EnableDynamicThreadPool;
import io.micrometer.core.instrument.MeterRegistry;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
@@ -17,7 +16,6 @@ import org.springframework.scheduling.annotation.EnableScheduling;
* admin
*
*/
@EnableDynamicThreadPool
@SpringBootApplication
@ComponentScan({"com.accompany","com.xuanyin"})
@EnableScheduling

View File

@@ -1,6 +1,5 @@
package com.accompany.flowteam.admin;
import cn.hippo4j.core.enable.EnableDynamicThreadPool;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringBootConfiguration;
@@ -14,7 +13,6 @@ import org.springframework.scheduling.annotation.EnableScheduling;
* admin
*
*/
@EnableDynamicThreadPool
@SpringBootApplication
@ComponentScan({"com.accompany","com.xuanyin"})
@EnableScheduling

View File

@@ -84,18 +84,6 @@
<artifactId>spring-boot-starter-freemarker</artifactId>
</dependency>
<dependency>
<groupId>cn.hippo4j</groupId>
<artifactId>hippo4j-config-spring-boot-starter</artifactId>
<version>${hippo4j-config-spring-boot-starter.version}</version>
</dependency>
<dependency>
<groupId>cn.hippo4j</groupId>
<artifactId>hippo4j-spring-boot-starter-monitor-micrometer</artifactId>
<version>${hippo4j-config-spring-boot-starter.version}</version>
</dependency>
<dependency>
<groupId>org.apache.rocketmq</groupId>
<artifactId>rocketmq-spring-boot-starter</artifactId>

View File

@@ -63,11 +63,6 @@
<artifactId>accompany-mq-service</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>cn.hippo4j</groupId>
<artifactId>hippo4j-core</artifactId>
<version>${hippo4j-core.version}</version>
</dependency>
<dependency>
<groupId>com.vaadin.external.google</groupId>
<artifactId>android-json</artifactId>

View File

@@ -1,8 +1,5 @@
package com.accompany.business.config;
import cn.hippo4j.core.executor.DynamicThreadPool;
import cn.hippo4j.core.executor.support.ThreadPoolBuilder;
import cn.hippo4j.core.toolkit.ExecutorTraceContextUtil;
import com.accompany.common.aop.ApiRequestLogAspect;
import com.accompany.core.base.SpringContextHolder;
import com.alibaba.fastjson.JSON;
@@ -16,6 +13,7 @@ import org.springframework.context.annotation.Primary;
import org.springframework.core.task.TaskDecorator;
import org.springframework.scheduling.annotation.AsyncConfigurer;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import javax.validation.constraints.NotNull;
import java.util.UUID;
@@ -29,27 +27,47 @@ public class ExecutorConfig implements AsyncConfigurer {
@Bean
@Primary
@DynamicThreadPool
public ThreadPoolExecutor bizExecutor() {
String threadPoolId = "biz-executor";
return ThreadPoolBuilder.builder()
.threadFactory(threadPoolId)
.threadPoolId(threadPoolId)
.taskDecorator(new MDCDecorator())
.dynamicPool()
.build();
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
// 核心线程数
executor.setCorePoolSize(5);
// 最大线程数
executor.setMaxPoolSize(10);
// 队列容量
executor.setQueueCapacity(100);
// 线程空闲时间(秒)
executor.setKeepAliveSeconds(60);
// 线程名称前缀
executor.setThreadNamePrefix(threadPoolId);
executor.setTaskDecorator(new MDCDecorator());
// 设置拒绝策略
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
// 初始化
executor.initialize();
return executor.getThreadPoolExecutor();
}
@Bean("async-executor")
@DynamicThreadPool
public ThreadPoolExecutor asyncExecutor() {
String threadPoolId = "async-executor";
return ThreadPoolBuilder.builder()
.threadFactory(threadPoolId)
.threadPoolId(threadPoolId)
.taskDecorator(new MDCDecorator())
.dynamicPool()
.build();
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
// 核心线程数
executor.setCorePoolSize(5);
// 最大线程数
executor.setMaxPoolSize(10);
// 队列容量
executor.setQueueCapacity(100);
// 线程空闲时间(秒)
executor.setKeepAliveSeconds(60);
// 线程名称前缀
executor.setThreadNamePrefix(threadPoolId);
executor.setTaskDecorator(new MDCDecorator());
// 设置拒绝策略
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
// 初始化
executor.initialize();
return executor.getThreadPoolExecutor();
}
public static class MDCDecorator implements TaskDecorator {
@@ -67,7 +85,6 @@ public class ExecutorConfig implements AsyncConfigurer {
// Right now: @Async thread context !
// Restore the Web thread context's MDC data
MDC.put(ApiRequestLogAspect.TRACE_UUID, traceId);
ExecutorTraceContextUtil.putTimeoutTrace(traceId);
runnable.run();
} finally {
MDC.remove(ApiRequestLogAspect.TRACE_UUID);

View File

@@ -1,6 +1,5 @@
package com.accompany.business.service.lucky.rank;
import cn.hippo4j.common.toolkit.CollectionUtil;
import com.accompany.business.common.constant.RewardTypeEnum;
import com.accompany.business.common.dto.RewardDto;
import com.accompany.business.common.vo.RewardVo;
@@ -12,7 +11,7 @@ import com.accompany.common.constant.Constant;
import com.accompany.common.redis.RedisKey;
import com.accompany.common.status.BusiStatus;
import com.accompany.common.utils.DateTimeUtil;
import com.accompany.common.utils.NumberUtils;
import com.accompany.core.enumeration.I18nAlertEnum;
import com.accompany.core.exception.ServiceException;
import com.accompany.core.service.SysConfService;
import com.accompany.core.util.I18NMessageSourceUtil;
@@ -30,9 +29,6 @@ import org.springframework.util.CollectionUtils;
import java.time.Instant;
import java.util.*;
import static com.accompany.core.enumeration.I18nAlertEnum.LUCKY_24_SEND_WEEK_RANK_REWARD_TIP;
import static com.accompany.core.enumeration.I18nAlertEnum.ROOM_BOSS_MIC_UP_MSG_I18N;
@Slf4j
@Service
public class Lucky24SendWeekRankRewardService {
@@ -62,7 +58,7 @@ public class Lucky24SendWeekRankRewardService {
long rankSize = settlementSizes.stream().mapToLong(Integer::intValue).max().getAsLong();
List<Lucky24WeekRankItemVo> list = rankService.listRankItem(lastWeek, rankSize, partitionId);
if (CollectionUtil.isEmpty(list)){
if (CollectionUtils.isEmpty(list)){
return;
}
@@ -117,7 +113,7 @@ public class Lucky24SendWeekRankRewardService {
}
if (rankIndex <= 3){
String tip = I18NMessageSourceUtil.getMessage(LUCKY_24_SEND_WEEK_RANK_REWARD_TIP, new Object[]{ranking}, partitionId);
String tip = I18NMessageSourceUtil.getMessage(I18nAlertEnum.LUCKY_24_SEND_WEEK_RANK_REWARD_TIP, new Object[]{ranking}, partitionId);
sendSysMsgService.sendPersonTextMsg(uid, tip);
}

View File

@@ -1,6 +1,5 @@
package com.accompany.business.service.lucky.rank;
import cn.hippo4j.common.toolkit.CollectionUtil;
import com.accompany.business.model.Gift;
import com.accompany.business.service.gift.GiftService;
import com.accompany.business.service.level.LevelService;
@@ -22,6 +21,7 @@ import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.time.DayOfWeek;
@@ -92,7 +92,7 @@ public class Lucky24SendWeekRankService extends AbstractRankService implements I
}
private Lucky24WeekRankItemVo getUserRankItem(Date now, Users me, List<Lucky24WeekRankItemVo> rankItemList) {
if (CollectionUtil.isEmpty(rankItemList)){
if (CollectionUtils.isEmpty(rankItemList)){
UserLevelVo meLevelVo = levelService.getUserLevelVo(me.getUid());
return new Lucky24WeekRankItemVo(me, meLevelVo, 0, 0d);
}
@@ -109,7 +109,7 @@ public class Lucky24SendWeekRankService extends AbstractRankService implements I
RList<Lucky24Record> rList = getRecordList(partitionId);
int size = Math.min(20, rList.size());
List<Lucky24Record> recordList = rList.subList(0, size);
if (CollectionUtil.isEmpty(recordList)){
if (CollectionUtils.isEmpty(recordList)){
return Collections.emptyList();
}
@@ -158,7 +158,7 @@ public class Lucky24SendWeekRankService extends AbstractRankService implements I
public List<Lucky24WeekRankItemVo> listRankItem(Date date, Long size, Integer partitionId){
Set<Map<String, Object>> rankSet = getRank(date, null, 0L, size - 1, partitionId);
if (CollectionUtil.isEmpty(rankSet)){
if (CollectionUtils.isEmpty(rankSet)){
return Collections.emptyList();
}

View File

@@ -1,6 +1,5 @@
package com.accompany.business;
import cn.hippo4j.core.enable.EnableDynamicThreadPool;
import io.micrometer.core.instrument.MeterRegistry;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
@@ -17,7 +16,6 @@ import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.boot.actuate.autoconfigure.metrics.MeterRegistryCustomizer;
@EnableDynamicThreadPool
@SpringBootApplication
@EnableTransactionManagement
@EnableAspectJAutoProxy(proxyTargetClass = true)

View File

@@ -1,6 +1,5 @@
package com.accompany.business.controller.activity;
import cn.hippo4j.common.toolkit.CollectionUtil;
import com.accompany.business.service.activity.LuckyNumberActService;
import com.accompany.business.vo.activity.*;
import com.accompany.common.annotation.Authorization;
@@ -14,6 +13,7 @@ import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
@@ -79,7 +79,7 @@ public class LuckyNumberActController {
@Authorization
@PostMapping(value = "/batchInput")
public BusiResult<Void> batchInput(@RequestBody List<Integer> numbers){
if (CollectionUtil.isEmpty(numbers)){
if (CollectionUtils.isEmpty(numbers)){
throw new ServiceException(BusiStatus.PARAMERROR);
}

View File

@@ -68,7 +68,6 @@
<ip2region.version>2.7.0</ip2region.version>
<opencc4j.version>1.7.2</opencc4j.version>
<hutool.version>5.8.38</hutool.version>
<hippo4j-config-spring-boot-starter.version>1.5.0</hippo4j-config-spring-boot-starter.version>
<google-api-services-androidpublisher.version>v3-rev20231115-2.0.0</google-api-services-androidpublisher.version>
<payermax-server.version>1.0.12</payermax-server.version>
<sharding-jdbc.version>5.5.2</sharding-jdbc.version>
@@ -78,7 +77,6 @@
<tencentcloud-cos-sts-sdk-java.version>3.1.1</tencentcloud-cos-sts-sdk-java.version>
<rocketmq-spring-boot.version>2.3.4</rocketmq-spring-boot.version>
<kaptcha.version>2.3.2</kaptcha.version>
<hippo4j-core.version>1.5.0</hippo4j-core.version>
<android-json.version>0.0.20131108.vaadin1</android-json.version>
<bcprov-jdk15on.version>1.64</bcprov-jdk15on.version>
<zxing.version>3.5.3</zxing.version>
@@ -137,12 +135,6 @@
<version>${rocketmq-spring-boot.version}</version>
</dependency>
<dependency>
<groupId>cn.hippo4j</groupId>
<artifactId>hippo4j-config-spring-boot-starter</artifactId>
<version>${hippo4j-config-spring-boot-starter.version}</version>
</dependency>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
@@ -717,7 +709,7 @@
<repositories>
<repository>
<id>peko-public</id>
<url>http://nexus.molistar.xyz/repository/maven-public/</url>
<url>https://nexus.molistar.xyz/repository/maven-public/</url>
<releases>
<enabled>true</enabled>
</releases>

View File

@@ -1,6 +1,5 @@
package com.accompany.oauth2;
import cn.hippo4j.core.enable.EnableDynamicThreadPool;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringBootConfiguration;
@@ -10,9 +9,6 @@ import org.springframework.context.annotation.ComponentScan;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
;
@EnableDynamicThreadPool
@SpringBootApplication
@ComponentScan("com.accompany")
@ServletComponentScan(value = {"com.accompany", "com.xuanyin"})

View File

@@ -1,6 +1,5 @@
package com.accompany.scheduler;
import cn.hippo4j.core.enable.EnableDynamicThreadPool;
import io.micrometer.core.instrument.MeterRegistry;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
@@ -16,7 +15,6 @@ import org.springframework.scheduling.annotation.EnableScheduling;
* @author PaperCut
* @date 2018/6/11
*/
@EnableDynamicThreadPool
@SpringBootApplication
@ComponentScan({"com.accompany","com.xuanyin"})
@EnableScheduling