mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-09 19:06:49 +08:00
开启异步发送消息
This commit is contained in:
@@ -1,19 +1,20 @@
|
||||
package com.xboe;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.system.ApplicationPid;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
@Configuration
|
||||
@SpringBootApplication
|
||||
@EnableCaching
|
||||
@EnableAsync
|
||||
public class BoeServerAllApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
@@ -28,6 +28,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -174,7 +175,8 @@ public class CasesRecommendPushRecordServiceImpl implements ICasesRecommendPushR
|
||||
return casesRecommendDao.updateMultiFieldById(id, UpdateBuilder.create("pushProgress", pushProgress)) > 0;
|
||||
}
|
||||
|
||||
private void sendCasesRecommend(CasesRecommend casesRecommend) {
|
||||
@Async
|
||||
public void sendCasesRecommend(CasesRecommend casesRecommend) {
|
||||
List<Integer> pushStatusList = new ArrayList<>();
|
||||
pushStatusList.add(CasesPushStatusEnum.WAIT_PUSH.getStatus());
|
||||
pushStatusList.add(CasesPushStatusEnum.PUSH_REVOKE.getStatus());
|
||||
|
||||
Reference in New Issue
Block a user