提交 808ca2c5 作者: xiaowang

接口放行

上级 f6c36e71
......@@ -3,12 +3,14 @@ package com.mmc.iuav.user;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.client.RestTemplate;
/**
* @author:zhenjie
* @Date:2023/5/15 15:35
*/
@EnableScheduling
@SpringBootApplication
public class UserApplication {
public static void main(String[] args) {
......@@ -16,7 +18,7 @@ public class UserApplication {
}
@Bean
public RestTemplate restTemplate(){
public RestTemplate restTemplate() {
return new RestTemplate();
}
}
......@@ -2,6 +2,7 @@ package com.mmc.iuav.user.schedule;
import com.mmc.iuav.user.model.vo.data.ActiveUserCountVO;
import com.mmc.iuav.user.service.data.UserReportService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
......@@ -14,6 +15,7 @@ import java.util.Calendar;
*/
@Component
@ConditionalOnProperty(prefix = "scheduling", name = "enabled", havingValue = "true")
@Slf4j
public class ManagerLogSchedule {
@Resource
UserReportService userReportService;
......@@ -21,10 +23,10 @@ public class ManagerLogSchedule {
/**
* 统计日活量
*/
@Scheduled(cron = "0 0 10 * * ?")
@Scheduled(cron = "0 0 20 * * ?")
public void calculateActiveUserCount() {
log.info("统计日活量");
Integer userActiveCount = userReportService.getUserActiveCount();
Calendar calendar = Calendar.getInstance();
calendar.add(Calendar.DAY_OF_MONTH, -1);
//记录到数据库
......
......@@ -96,4 +96,6 @@ iuav:
pay:
uri: http://payment-svc:8088
pms:
uri: http://pms-svc:8099
\ No newline at end of file
uri: http://pms-svc:8099
scheduling:
enabled: true
\ No newline at end of file
......@@ -88,4 +88,6 @@ iuav:
pay:
uri: http://payment-svc:8088
pms:
uri: http://pms-svc:8099
\ No newline at end of file
uri: http://pms-svc:8099
scheduling:
enabled: true
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论