package com.ruoyi;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.util.unit.DataSize;
import javax.servlet.MultipartConfigElement;
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
@MapperScan("com.ruoyi.file2.web.dao,com.ruoyi.file3.dao,com.ruoyi.file3.log.dao,com.ruoyi.file3.storage.local.LocalStorageProcessor")
@EnableAsync
public class RuoYiApplication
{
public static void main(String[] args)
{
SpringApplication.run(RuoYiApplication.class, args);
System.out.println("(♥◠‿◠)ノ゙ VR项目启动成功 ლ(´ڡ`ლ)゙ \n" +
" .-------. ____ __ \n" +
" | _ _ \\ \\ \\ / / \n" +
" | ( ' ) | \\ _. / ' \n" +
" |(_ o _) / _( )_ .' \n" +
" | (_,_).' __ ___(_ o _)' \n" +
" | |\\ \\ | || |(_,_)' \n" +
" | | \\ `' /| `-' / \n" +
" | | \\ / \\ / \n" +
" ''-' `'-' `-..-' ");
}
@Bean
public MultipartConfigElement multipartConfigElement() {
MultipartConfigFactory factory = new MultipartConfigFactory();
factory.setMaxFileSize(DataSize.parse("1000MB"));
factory.setMaxRequestSize(DataSize.parse("1000MB"));
return factory.createMultipartConfig();
}
}
@RestController
@RequestMapping("/videoInfoRecords/videoInfoRecords")
@EnableScheduling
public class VideoInfoRecordsController extends BaseController {
@Autowired
private IVideoInfoRecordsService videoInfoRecordsService;
@Scheduled(cron = "*/1 * * * * ?")
public void updateWatchVideoStatus() {
VideoInfoRecords videoInfoRecords = new VideoInfoRecords();
videoInfoRecords.setStatus("未退出");
List<VideoInfoRecords> list = videoInfoRecordsService.selectVideoInfoRecordsList(videoInfoRecords);
for (VideoInfoRecords infoRecords : list) {
Date updateTime = infoRecords.getUpdateTime();
long diffTime = System.currentTimeMillis() - updateTime.getTime();
if(diffTime>30000){
infoRecords.getId();
infoRecords.setStatus("已退出");
videoInfoRecordsService.updateVideoInfoRecords(infoRecords);
}
}
}
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80