mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-11 11:56:50 +08:00
Compare commits
1 Commits
master-202
...
smartDoc-2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d7f714562 |
@@ -240,6 +240,18 @@
|
|||||||
<version>2.3.0</version> <!-- 请根据实际需求选择版本 -->
|
<version>2.3.0</version> <!-- 请根据实际需求选择版本 -->
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- https://mvnrepository.com/artifact/com.github.shalousun/smart-doc -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.shalousun</groupId>
|
||||||
|
<artifactId>smart-doc</artifactId>
|
||||||
|
<version>2.7.7</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>javax.enterprise</groupId>
|
||||||
|
<artifactId>cdi-api</artifactId>
|
||||||
|
<version>2.0</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
@@ -265,6 +277,28 @@
|
|||||||
<includeSystemScope>true</includeSystemScope>
|
<includeSystemScope>true</includeSystemScope>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>com.github.shalousun</groupId>
|
||||||
|
<artifactId>smart-doc-maven-plugin</artifactId>
|
||||||
|
<version>2.7.7</version>
|
||||||
|
<configuration>
|
||||||
|
<!--指定生成文档的使用的配置文件,配置文件放在自己的项目中-->
|
||||||
|
<configFile>./src/main/resources/smart-doc.json</configFile>
|
||||||
|
<!--指定项目名称,推荐使用动态参数,例如${project.description}-->
|
||||||
|
<!--如果smart-doc.json中和此处都未设置projectName,2.3.4开始,插件自动采用pom中的projectName作为设置-->
|
||||||
|
<projectName>${project.description}</projectName>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<!--如果不需要在执行编译时启动smart-doc,则将phase注释掉-->
|
||||||
|
<phase>compile</phase>
|
||||||
|
<goals>
|
||||||
|
<!--smart-doc提供了html、openapi、markdown等goal,可按需配置-->
|
||||||
|
<goal>html</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
<profiles>
|
<profiles>
|
||||||
|
|||||||
@@ -8,11 +8,9 @@ import cn.hutool.json.JSONUtil;
|
|||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.boe.feign.api.courseweb.entity.ExamTestDto;
|
import com.boe.feign.api.courseweb.entity.ExamTestDto;
|
||||||
import com.boe.feign.api.courseweb.entity.ProjectStudyDto;
|
import com.boe.feign.api.courseweb.entity.ProjectStudyDto;
|
||||||
import com.boe.feign.api.courseweb.remote.ExternalRemoteClient;
|
|
||||||
import com.boe.feign.api.courseweb.remote.OffCourseRemoteClient;
|
import com.boe.feign.api.courseweb.remote.OffCourseRemoteClient;
|
||||||
import com.boe.feign.api.courseweb.remote.ProjectAdminRemoteClient;
|
import com.boe.feign.api.courseweb.remote.ProjectAdminRemoteClient;
|
||||||
import com.boe.feign.api.courseweb.remote.ProjectRemoteClient;
|
import com.boe.feign.api.courseweb.remote.ProjectRemoteClient;
|
||||||
import com.boe.feign.api.courseweb.reps.ExamStudyRecordParam;
|
|
||||||
import com.boe.feign.api.infrastructure.entity.CommonSearchVo;
|
import com.boe.feign.api.infrastructure.entity.CommonSearchVo;
|
||||||
import com.boe.feign.api.infrastructure.entity.Dict;
|
import com.boe.feign.api.infrastructure.entity.Dict;
|
||||||
import com.boe.feign.api.infrastructure.remote.DictRemoteClient;
|
import com.boe.feign.api.infrastructure.remote.DictRemoteClient;
|
||||||
@@ -75,8 +73,6 @@ public class ThirdApi {
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private ProjectRemoteClient projectRemoteClient;
|
private ProjectRemoteClient projectRemoteClient;
|
||||||
@Resource
|
|
||||||
ExternalRemoteClient externalRemoteClient;
|
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private DictRemoteClient dictRemoteClient;
|
private DictRemoteClient dictRemoteClient;
|
||||||
@@ -266,19 +262,11 @@ public class ThirdApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<StudyCourse> getStudyCourseList(String studyId, String courseId, String token) {
|
public List<StudyCourse> getStudyCourseList(String studyId, String courseId, String token) {
|
||||||
log.info(" 1 studyId = "+ studyId + " ,courseId = " + courseId );
|
|
||||||
if ( studyId == null || courseId == null ){
|
|
||||||
log.error(" 在线课学习记录 参数不能为空 ");
|
|
||||||
return new ArrayList<>();
|
|
||||||
}
|
|
||||||
StudyCourseVo studyCourseVo = new StudyCourseVo();
|
StudyCourseVo studyCourseVo = new StudyCourseVo();
|
||||||
studyCourseVo.setStudyId(studyId);
|
studyCourseVo.setStudyId(studyId);
|
||||||
studyCourseVo.setCourseId(courseId);
|
studyCourseVo.setCourseId(courseId);
|
||||||
ProjectStudyDto projectStudyDto = new ProjectStudyDto();
|
ProjectStudyDto projectStudyDto = new ProjectStudyDto();
|
||||||
// BeanUtil.copyProperties(studyCourseVo, studyCourseVo);
|
BeanUtil.copyProperties(studyCourseVo, studyCourseVo);
|
||||||
projectStudyDto.setStudyId(Long.parseLong(studyId));
|
|
||||||
projectStudyDto.setCourseId(Long.parseLong(courseId));
|
|
||||||
log.info(" 12 在线课学习记录 studyId = "+ projectStudyDto.getStudyId() + " ,courseId = " + projectStudyDto.getCourseId() );
|
|
||||||
projectRemoteClient.updateStudyStatus(projectStudyDto);
|
projectRemoteClient.updateStudyStatus(projectStudyDto);
|
||||||
return new ArrayList<>();
|
return new ArrayList<>();
|
||||||
}
|
}
|
||||||
@@ -394,8 +382,4 @@ public class ThirdApi {
|
|||||||
.body()).orElseThrow(() -> new RuntimeException("token校验失败"));
|
.body()).orElseThrow(() -> new RuntimeException("token校验失败"));
|
||||||
log.info("updateOrSaveCourse = " + resp);
|
log.info("updateOrSaveCourse = " + resp);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void syncExamStudyRecord(ExamStudyRecordParam param) {
|
|
||||||
externalRemoteClient.syncExamStudyRecord(param);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,19 +122,12 @@ public class OutSideDataServiceImpl implements IOutSideDataService {
|
|||||||
//这里应该是单独的线程去处理
|
//这里应该是单独的线程去处理
|
||||||
user.setId(getNodeText(result.get("userId")));//最新接口变化,id改成userId
|
user.setId(getNodeText(result.get("userId")));//最新接口变化,id改成userId
|
||||||
String band=getNodeText(result.get("bandCode"));
|
String band=getNodeText(result.get("bandCode"));
|
||||||
try {
|
if(StringUtils.isNotBlank(band) && band.length()>4) {
|
||||||
if(StringUtils.isNotBlank(band) && band.length()>4 && band.contains("band")) {
|
|
||||||
String bandNum=band.substring(4);
|
String bandNum=band.substring(4);
|
||||||
user.setBandLevel(Integer.valueOf(bandNum));
|
user.setBandLevel(Integer.valueOf(bandNum));
|
||||||
}else if (StringUtils.isNotBlank(band) && band.length()>4 && band.contains("Level")) {
|
|
||||||
String bandNum=band.substring(5);
|
|
||||||
user.setBandLevel(Integer.valueOf(bandNum));
|
|
||||||
}else {
|
}else {
|
||||||
user.setBandLevel(0);
|
user.setBandLevel(0);
|
||||||
}
|
}
|
||||||
} catch (NumberFormatException e) {
|
|
||||||
user.setBandLevel(0);
|
|
||||||
}
|
|
||||||
user.setAvatar(getNodeText(result.get("avatar")));
|
user.setAvatar(getNodeText(result.get("avatar")));
|
||||||
user.setCode(getNodeText(result.get("userNo")));
|
user.setCode(getNodeText(result.get("userNo")));
|
||||||
|
|
||||||
|
|||||||
@@ -140,9 +140,6 @@ public class CasesApi extends ApiBaseController {
|
|||||||
List<Cases> cases = views.getList();
|
List<Cases> cases = views.getList();
|
||||||
if (CollUtil.isNotEmpty(cases)) {
|
if (CollUtil.isNotEmpty(cases)) {
|
||||||
for (Cases c : cases) {
|
for (Cases c : cases) {
|
||||||
if ("null".equals(c.getSummary())) {
|
|
||||||
c.setSummary(null);
|
|
||||||
}
|
|
||||||
StringBuffer stringBuffer = new StringBuffer();
|
StringBuffer stringBuffer = new StringBuffer();
|
||||||
List<CasesMajorType> caseId = casesMajorTypeDao.findList(FieldFilters.eq("caseId", c.getId()));
|
List<CasesMajorType> caseId = casesMajorTypeDao.findList(FieldFilters.eq("caseId", c.getId()));
|
||||||
if (caseId != null && !caseId.isEmpty()) {
|
if (caseId != null && !caseId.isEmpty()) {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ public interface ICasesRecommendPushRecordService {
|
|||||||
/**
|
/**
|
||||||
* 案例推送
|
* 案例推送
|
||||||
*
|
*
|
||||||
* @param
|
* @param boeParam
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
boolean launchPush(CasesRecommendLaunchVo casesRecommendLaunch, CurrentUser currentUser, String token);
|
boolean launchPush(CasesRecommendLaunchVo casesRecommendLaunch, CurrentUser currentUser, String token);
|
||||||
|
|||||||
@@ -49,12 +49,4 @@ public class CourseTeacher extends IdBaseEntity {
|
|||||||
@Transient
|
@Transient
|
||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
/**供应商*/
|
|
||||||
@Transient
|
|
||||||
private String supplier;
|
|
||||||
|
|
||||||
/**讲师类型 1 内部讲师 2外部讲师*/
|
|
||||||
@Transient
|
|
||||||
private Integer teacherType;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,8 +8,6 @@ import java.util.Map;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
import com.boe.feign.api.courseweb.reps.ExamStudyRecordParam;
|
|
||||||
import com.xboe.api.ThirdApi;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
@@ -39,9 +37,6 @@ public class AloneExamServiceImpl implements IAloneExamService{
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
AloneExamDao aeDao;
|
AloneExamDao aeDao;
|
||||||
@Resource
|
|
||||||
private ThirdApi thirdApi;
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
@@ -106,17 +101,6 @@ public class AloneExamServiceImpl implements IAloneExamService{
|
|||||||
// //这种情况汶是不存在的
|
// //这种情况汶是不存在的
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
ExamStudyRecordParam param = new ExamStudyRecordParam();
|
|
||||||
param.setTestId(aea.getTestId());
|
|
||||||
param.setAid(aea.getAid());
|
|
||||||
thirdApi.syncExamStudyRecord(param);
|
|
||||||
} catch (Exception e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ public interface ICommentsService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询案例@的评论
|
* 查询案例@的评论
|
||||||
* @param
|
* @param boeParam
|
||||||
* */
|
* */
|
||||||
|
|
||||||
PageList<CommentsDto> findCasesTome(int pageIndex,int pageSize,Integer objType,String toaid,String uname,Boolean isread);
|
PageList<CommentsDto> findCasesTome(int pageIndex,int pageSize,Integer objType,String toaid,String uname,Boolean isread);
|
||||||
|
|||||||
@@ -204,8 +204,6 @@ public class StudyCourseApi extends ApiBaseController{
|
|||||||
Teacher t = teacherService.get(ct.getTeacherId());
|
Teacher t = teacherService.get(ct.getTeacherId());
|
||||||
if(t!=null) {
|
if(t!=null) {
|
||||||
ct.setRemark(t.getDescription());
|
ct.setRemark(t.getDescription());
|
||||||
ct.setSupplier(t.getSupplier());
|
|
||||||
ct.setTeacherType(t.getTeacherType());
|
|
||||||
}
|
}
|
||||||
if(redisTemplate.opsForValue().get(ct.getTeacherId())==null){
|
if(redisTemplate.opsForValue().get(ct.getTeacherId())==null){
|
||||||
List<String>list=new ArrayList<>();
|
List<String>list=new ArrayList<>();
|
||||||
@@ -214,11 +212,11 @@ public class StudyCourseApi extends ApiBaseController{
|
|||||||
redisTemplate.opsForValue().set(teacherVo.get(0).getTeacherId(), teacherVo.get(0).getStatus());
|
redisTemplate.opsForValue().set(teacherVo.get(0).getTeacherId(), teacherVo.get(0).getStatus());
|
||||||
//设置过期时间为1天
|
//设置过期时间为1天
|
||||||
redisTemplate.expire(teacherVo.get(0).getTeacherId(), 24 * 60 * 60, TimeUnit.SECONDS);
|
redisTemplate.expire(teacherVo.get(0).getTeacherId(), 24 * 60 * 60, TimeUnit.SECONDS);
|
||||||
if (Objects.equals(redisTemplate.opsForValue().get(ct.getTeacherId()), "1") && t.getTeacherType() == 1 ){
|
if (Objects.equals(redisTemplate.opsForValue().get(ct.getTeacherId()), "1")){
|
||||||
ct.setTeacherName("BOE教师");
|
ct.setTeacherName("BOE教师");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Objects.equals(redisTemplate.opsForValue().get(ct.getTeacherId()), "1") && t.getTeacherType() == 1 ){
|
if (Objects.equals(redisTemplate.opsForValue().get(ct.getTeacherId()), "1")){
|
||||||
ct.setTeacherName("BOE教师");
|
ct.setTeacherName("BOE教师");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -290,7 +288,7 @@ public class StudyCourseApi extends ApiBaseController{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 记录学习信息,在学习每个资源时都要记录.前端用户打开课程资源按规则调用带着课程及学习信息调用此接口。
|
* 记录学习信息,在学习每个资源时都要记录.前端用户打开课程资源按规则调用带着课程及学习信息调用此接口。
|
||||||
* @param
|
* @param boeParam
|
||||||
* @return 返回学习条目的id
|
* @return 返回学习条目的id
|
||||||
*/
|
*/
|
||||||
@PostMapping("/study")
|
@PostMapping("/study")
|
||||||
@@ -345,8 +343,6 @@ public class StudyCourseApi extends ApiBaseController{
|
|||||||
}
|
}
|
||||||
//追加学习时长
|
//追加学习时长
|
||||||
studyService.appendStudyDuration(sci.getStudyId(),item.getId(),sci.getContentId(),sci.getDuration());
|
studyService.appendStudyDuration(sci.getStudyId(),item.getId(),sci.getContentId(),sci.getDuration());
|
||||||
|
|
||||||
log.info(" 1 在线课学习记录 sci.getStudyId() = "+ sci.getStudyId() + " , sci.getCourseId() = " + sci.getCourseId() );
|
|
||||||
List<StudyCourse> allUserList = thirdApi.getStudyCourseList(sci.getStudyId() ,sci.getCourseId(), token);
|
List<StudyCourse> allUserList = thirdApi.getStudyCourseList(sci.getStudyId() ,sci.getCourseId(), token);
|
||||||
log.info("在线课学习记录"+allUserList);
|
log.info("在线课学习记录"+allUserList);
|
||||||
return success(item.getId());
|
return success(item.getId());
|
||||||
@@ -454,8 +450,8 @@ public class StudyCourseApi extends ApiBaseController{
|
|||||||
* 音视频学习保存,初始化保存学习记录.
|
* 音视频学习保存,初始化保存学习记录.
|
||||||
* 如果已经保存,就不要再保存第二次了,前端注意控制
|
* 如果已经保存,就不要再保存第二次了,前端注意控制
|
||||||
* {studyId,contentId,courseId,progress,contentType,studyDuration}
|
* {studyId,contentId,courseId,progress,contentType,studyDuration}
|
||||||
* @param
|
* @param boeParam
|
||||||
* @param
|
* @param boeParam
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/study-video-save")
|
@PostMapping("/study-video-save")
|
||||||
@@ -510,8 +506,8 @@ public class StudyCourseApi extends ApiBaseController{
|
|||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 视频学习完
|
* 视频学习完
|
||||||
* @param
|
* @param boeParam
|
||||||
* @param
|
* @param boeParam
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/study-video-finish")
|
@PostMapping("/study-video-finish")
|
||||||
@@ -543,7 +539,7 @@ public class StudyCourseApi extends ApiBaseController{
|
|||||||
/**
|
/**
|
||||||
* 记录视频的学习时间点,前端可以每10秒记录一次,时长是秒
|
* 记录视频的学习时间点,前端可以每10秒记录一次,时长是秒
|
||||||
* @param itemId 学习内容条目id
|
* @param itemId 学习内容条目id
|
||||||
* @param
|
* @param boeParam
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping("/study-video-time")
|
@PostMapping("/study-video-time")
|
||||||
|
|||||||
@@ -1,108 +0,0 @@
|
|||||||
package com.xboe.school.study.api;
|
|
||||||
|
|
||||||
import com.xboe.school.study.service.IStudyService;
|
|
||||||
import com.xxl.job.core.handler.annotation.XxlJob;
|
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.data.redis.connection.RedisConnection;
|
|
||||||
import org.springframework.data.redis.core.Cursor;
|
|
||||||
import org.springframework.data.redis.core.ScanOptions;
|
|
||||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.format.DateTimeFormatter;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author by lyc
|
|
||||||
* @date 2025/3/3
|
|
||||||
*/
|
|
||||||
@Component
|
|
||||||
@Slf4j
|
|
||||||
@RequiredArgsConstructor
|
|
||||||
public class StudyCourseTask {
|
|
||||||
|
|
||||||
private final IStudyService studyService;
|
|
||||||
private final StringRedisTemplate redisTemplate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 定时任务
|
|
||||||
* 获取redis 中学习结束的数据更新入库
|
|
||||||
* */
|
|
||||||
@XxlJob("saveStudyCourseItemLastTime")
|
|
||||||
public void saveStudyCourseItemLastTime() {
|
|
||||||
log.info("------定时任务-获取redis 中学习结束的数据更新入库------" );
|
|
||||||
// 1. 定义匹配模式(匹配所有目标key)
|
|
||||||
final String KEY_PATTERN = "studyContentId:*:last_active";
|
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss");
|
|
||||||
// 2. 使用SCAN安全遍历(避免阻塞)
|
|
||||||
ScanOptions options = ScanOptions.scanOptions()
|
|
||||||
.match(KEY_PATTERN)
|
|
||||||
.count(100) // 分页大小
|
|
||||||
.build();
|
|
||||||
|
|
||||||
try (RedisConnection connection = Objects.requireNonNull(redisTemplate.getConnectionFactory()).getConnection()) {
|
|
||||||
Cursor<byte[]> cursor = connection.scan(options);
|
|
||||||
// 3. 遍历处理符合条件的key
|
|
||||||
while (cursor.hasNext()) {
|
|
||||||
String redisKey = new String(cursor.next());
|
|
||||||
log.info("------定时任务-获取redis 中学习结束的数据更新入库------redisKey = " + redisKey );
|
|
||||||
// 4. 获取剩余TTL(秒)
|
|
||||||
Long ttl = redisTemplate.getExpire(redisKey, TimeUnit.SECONDS);
|
|
||||||
log.info("------定时任务-获取redis 中学习结束的数据更新入库------ttl = " + ttl );
|
|
||||||
// 5. 过滤条件:剩余时间 >= 29天23小时30分钟(转换为秒)
|
|
||||||
// 总需时间 = (30天 - 30分钟) = 29天23小时30分钟 = 2590200秒
|
|
||||||
// 5分钟 300秒 || 2592000 - 300 = 2591700
|
|
||||||
if (ttl <= 2590200) {
|
|
||||||
try {
|
|
||||||
// 6. 提取studyContentId
|
|
||||||
String[] parts = redisKey.split(":");
|
|
||||||
if (parts.length < 2) continue;
|
|
||||||
String studyContentId = parts[1];
|
|
||||||
|
|
||||||
// 7. 获取存储的时间点(示例逻辑)
|
|
||||||
String redisValue = redisTemplate.opsForValue().get(redisKey);
|
|
||||||
if (redisValue == null) continue;
|
|
||||||
String[] partValues = redisValue.split("&");
|
|
||||||
int lastStudyTime = Integer.parseInt(partValues[0]);
|
|
||||||
LocalDateTime timestamp = null;
|
|
||||||
if (partValues.length >= 2){
|
|
||||||
timestamp = LocalDateTime.parse(partValues[1], formatter);
|
|
||||||
}
|
|
||||||
log.info("-定时任务-获取redis 中学习结束的数据更新入库---studyContentId = " + studyContentId + ",lastStudyTime = " + lastStudyTime + ", timestamp = " + timestamp);
|
|
||||||
// 8. 更新数据库(调用已有服务方法)
|
|
||||||
studyService.updateStudyCourseItemLastTime(studyContentId, lastStudyTime, timestamp);
|
|
||||||
|
|
||||||
// 9. 删除Redis键(原子操作)
|
|
||||||
redisTemplate.delete(redisKey);
|
|
||||||
|
|
||||||
log.info("处理成功 key: {}, lastStudyTime: {}", redisKey, lastStudyTime);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("处理失败 key: {}", redisKey, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
cursor.close();
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("定时任务执行异常", e);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* // 新增日志逻辑
|
|
||||||
if (ttl <= 172800) {
|
|
||||||
studyService.saveCourseExpireLog(
|
|
||||||
studyContentId,
|
|
||||||
lastStudyTime,
|
|
||||||
redisKey,
|
|
||||||
ttl,
|
|
||||||
"system_job"
|
|
||||||
);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.xboe.school.study.service;
|
package com.xboe.school.study.service;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -100,5 +99,4 @@ public interface IStudyService {
|
|||||||
|
|
||||||
List<StudyCourseItem> getList(String courseId, String contentId, String name, Integer status);
|
List<StudyCourseItem> getList(String courseId, String contentId, String name, Integer status);
|
||||||
|
|
||||||
void updateStudyCourseItemLastTime(String studyContentId, int lastStudyTime, LocalDateTime timestamp);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.xboe.school.study.service.impl;
|
package com.xboe.school.study.service.impl;
|
||||||
|
|
||||||
import java.time.Duration;
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -16,7 +15,6 @@ import com.xboe.school.study.entity.StudyCourse;
|
|||||||
import com.xboe.system.user.entity.User;
|
import com.xboe.system.user.entity.User;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import com.xboe.common.OrderCondition;
|
import com.xboe.common.OrderCondition;
|
||||||
@@ -53,9 +51,6 @@ public class StudyServiceImpl implements IStudyService{
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
UserDao userDao;
|
UserDao userDao;
|
||||||
@Autowired
|
|
||||||
StringRedisTemplate redisTemplate;
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public StudyCourseItem checkHas(String studyId,String contentId) {
|
public StudyCourseItem checkHas(String studyId,String contentId) {
|
||||||
@@ -328,27 +323,9 @@ public class StudyServiceImpl implements IStudyService{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 更新 前端传输已学习时长
|
// 更新 前端传输已学习时长
|
||||||
@Override
|
|
||||||
public void updateLastTime(String studyContentId, int lastStudyTime,String aid) {
|
|
||||||
LocalDateTime now = LocalDateTime.now();
|
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss");
|
|
||||||
String value = lastStudyTime + "&" + now.format(formatter); // 使用ISO8601时间格式
|
|
||||||
log.info("-study-video-time-----value = " + value);
|
|
||||||
// 20250303 优化 多次更新改一次更新
|
|
||||||
// 更新Redis中的最后活跃时间(带30秒过期)
|
|
||||||
redisTemplate.opsForValue().set(
|
|
||||||
"studyContentId:" + studyContentId + ":last_active",
|
|
||||||
value,
|
|
||||||
Duration.ofSeconds(2592000)
|
|
||||||
);
|
|
||||||
log.info("-study-video-time-redis保存---value = " + value);
|
|
||||||
// Duration.ofDays(30) 也就是 2592000秒
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void updateStudyCourseItemLastTime(String studyContentId, int lastStudyTime,LocalDateTime timestamp) {
|
public void updateLastTime(String studyContentId, int lastStudyTime,String aid) {
|
||||||
log.info("-study-video-time-定时---studyContentId = " + studyContentId + ",lastStudyTime = " + lastStudyTime + ", timestamp = " + timestamp);
|
|
||||||
// 更新最后的学习时间点
|
// 更新最后的学习时间点
|
||||||
LocalDateTime now=LocalDateTime.now();
|
LocalDateTime now=LocalDateTime.now();
|
||||||
UpdateBuilder update=UpdateBuilder.from(StudyCourseItem.class);
|
UpdateBuilder update=UpdateBuilder.from(StudyCourseItem.class);
|
||||||
@@ -356,9 +333,9 @@ public class StudyServiceImpl implements IStudyService{
|
|||||||
//只记录时间长的时候的处理
|
//只记录时间长的时候的处理
|
||||||
update.addFilter(FieldFilters.lt("lastStudyTime", lastStudyTime));
|
update.addFilter(FieldFilters.lt("lastStudyTime", lastStudyTime));
|
||||||
update.addUpdateField("lastStudyTime", lastStudyTime);
|
update.addUpdateField("lastStudyTime", lastStudyTime);
|
||||||
update.addUpdateField("lastTime", timestamp==null ? now : timestamp);
|
update.addUpdateField("lastTime", now);
|
||||||
scItemDao.update(update.builder());
|
scItemDao.update(update.builder());
|
||||||
log.info("-study-video-time-mysql保存---studyContentId = " + studyContentId);
|
//增加用户的学习时长,在api中调用
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -76,9 +76,9 @@ xboe:
|
|||||||
iv-generator-classname: org.jasypt.iv.NoIvGenerator
|
iv-generator-classname: org.jasypt.iv.NoIvGenerator
|
||||||
xxl:
|
xxl:
|
||||||
job:
|
job:
|
||||||
accessToken: 65ddc683-22f5-83b4-de3a-3c97a0a29af0
|
|
||||||
admin:
|
admin:
|
||||||
addresses: http://u.boe.com/jobAdmin
|
addresses: http://u.boe.com/jobAdmin
|
||||||
|
accessToken: 65ddc683-22f5-83b4-de3a-3c97a0a29af0
|
||||||
executor:
|
executor:
|
||||||
appname: java-servers-job-api
|
appname: java-servers-job-api
|
||||||
port: 9995
|
port: 9995
|
||||||
|
|||||||
@@ -1,183 +0,0 @@
|
|||||||
spring:
|
|
||||||
# application.yml
|
|
||||||
servlet:
|
|
||||||
multipart:
|
|
||||||
max-file-size: 1000MB
|
|
||||||
max-request-size: 1000MB
|
|
||||||
cloud:
|
|
||||||
nacos:
|
|
||||||
discovery:
|
|
||||||
server-addr: 10.251.186.27:8848
|
|
||||||
config:
|
|
||||||
server-addr: 10.251.186.27:8848
|
|
||||||
redis:
|
|
||||||
database: 1
|
|
||||||
host: 10.251.160.38
|
|
||||||
password: qwert!W577
|
|
||||||
port: 6379
|
|
||||||
lettuce:
|
|
||||||
pool:
|
|
||||||
max-active: 8
|
|
||||||
min-idle: 0
|
|
||||||
max-idle: 30
|
|
||||||
max-wait: 10000ms
|
|
||||||
shutdown-timeout: 100ms
|
|
||||||
jpa:
|
|
||||||
database: MYSQL
|
|
||||||
properties:
|
|
||||||
hibernate:
|
|
||||||
naming_strategy: org.hibernate.cfg.EJB3NamingStrategy
|
|
||||||
dialect: org.hibernate.dialect.MySQL5InnoDBDialect
|
|
||||||
current_session_context_class: org.springframework.orm.hibernate5.SpringSessionContext
|
|
||||||
show-sql: true
|
|
||||||
hibernate:
|
|
||||||
ddl-auto: update
|
|
||||||
datasource:
|
|
||||||
driverClassName: com.mysql.cj.jdbc.Driver
|
|
||||||
url: jdbc:mysql://10.251.160.40:3306/boe_base?useSSL=false&useUnicode=true&characterEncoding=UTF8&zeroDateTimeBehavior=convertToNull
|
|
||||||
username: admin
|
|
||||||
password: boeRds01
|
|
||||||
web:
|
|
||||||
resources:
|
|
||||||
static-locations: file:E:/Projects/BOE/10/static
|
|
||||||
server:
|
|
||||||
port: 9090
|
|
||||||
tomcat:
|
|
||||||
uri-encoding: UTF-8
|
|
||||||
servlet:
|
|
||||||
multipart:
|
|
||||||
maxFileSize: 1024MB
|
|
||||||
maxRequestSize: 1024MB
|
|
||||||
mvc:
|
|
||||||
static-path-pattern: /cdn/**
|
|
||||||
|
|
||||||
#logging.level.org.hibernate.SQL=DEBUG
|
|
||||||
#logging.level.org.hibernate.type.descriptor.sql.BasicBinder=TRACE
|
|
||||||
#logging.config=classpath:log/logback-@profileActive@.xml
|
|
||||||
|
|
||||||
# logging:
|
|
||||||
# config: classpath:log/logback-${spring.profiles.active}.xml
|
|
||||||
# level:
|
|
||||||
# org:
|
|
||||||
# hibernate:
|
|
||||||
# SQL: DEBUG
|
|
||||||
# type:
|
|
||||||
# descriptor:
|
|
||||||
# sql:
|
|
||||||
# BasicBinder: TRACE
|
|
||||||
|
|
||||||
xcaching:
|
|
||||||
specs:
|
|
||||||
favorites:
|
|
||||||
timeout: 10s
|
|
||||||
praises:
|
|
||||||
timeout: 10s
|
|
||||||
shares:
|
|
||||||
timeout: 10s
|
|
||||||
|
|
||||||
xboe:
|
|
||||||
api:
|
|
||||||
cross_filter: true
|
|
||||||
local:
|
|
||||||
dev: true
|
|
||||||
upload:
|
|
||||||
file:
|
|
||||||
temp_path: /tmp
|
|
||||||
save_path: /home/www/elearning/upload
|
|
||||||
http_path: http://10.251.186.27/upload
|
|
||||||
externalinterface:
|
|
||||||
url:
|
|
||||||
system: http://localhost:9091
|
|
||||||
old:
|
|
||||||
base:
|
|
||||||
url: http://10.251.186.27
|
|
||||||
server:
|
|
||||||
userbasic:
|
|
||||||
url: http://10.251.186.27/userbasic
|
|
||||||
stat:
|
|
||||||
base:
|
|
||||||
url: http://10.251.186.27:9080
|
|
||||||
elasticsearch:
|
|
||||||
server:
|
|
||||||
ip: 10.251.129.25
|
|
||||||
port: 9200
|
|
||||||
user: elastic
|
|
||||||
password: Boe@es123
|
|
||||||
email:
|
|
||||||
url: http://10.251.186.27/api/b1/email/send
|
|
||||||
from: boeu_learning@boe.com.cn
|
|
||||||
user:
|
|
||||||
security:
|
|
||||||
|
|
||||||
jasypt:
|
|
||||||
encryptor:
|
|
||||||
algorithm: PBEWithMD5AndDES
|
|
||||||
iv-generator-classname: org.jasypt.iv.NoIvGenerator
|
|
||||||
|
|
||||||
boe:
|
|
||||||
domain: http://10.251.186.27
|
|
||||||
|
|
||||||
ok:
|
|
||||||
http:
|
|
||||||
connect-timeout: 30
|
|
||||||
read-timeout: 30
|
|
||||||
write-timeout: 30
|
|
||||||
max-idle-connections: 200
|
|
||||||
keep-alive-duration: 300
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
orgTree:
|
|
||||||
orgTreeList: ${boe.domain}/userbasic/org/list
|
|
||||||
orgChildTreeList: ${boe.domain}/userbasic/org/childOrgs
|
|
||||||
|
|
||||||
userBasic:
|
|
||||||
searchUserList: ${boe.domain}/userbasic/user/list
|
|
||||||
getUserBasicInfo: ${boe.domain}/userbasic/user/getUserBasicInfo
|
|
||||||
getTeacherIds: ${boe.domain}/userbasic/user/getTeacherInfo
|
|
||||||
|
|
||||||
audience:
|
|
||||||
usersByAudienceList: ${boe.domain}/userbasic/audience/memberList
|
|
||||||
getOrgUsers: ${boe.domain}/userbasic/user/getOrgUsers
|
|
||||||
|
|
||||||
statApi:
|
|
||||||
userdynamicList: ${boe.domain}/statApi/xboe/m/stat/userdynamic/list
|
|
||||||
|
|
||||||
infrasApi:
|
|
||||||
dict: ${boe.domain}/infrasApi/dict/list
|
|
||||||
|
|
||||||
manageApi:
|
|
||||||
stu:
|
|
||||||
offcourse: ${boe.domain}/manageApi/stu/offcourse/getOffCourseId
|
|
||||||
editExam: ${boe.domain}/manageApi/admin/project/editExam
|
|
||||||
getStudyStatus: ${boe.domain}/manageApi/stu/project/completeStatus
|
|
||||||
coursesuilt:
|
|
||||||
getStudyStatus: ${boe.domain}/manageApi/stu/project/completeStatus
|
|
||||||
|
|
||||||
xxl:
|
|
||||||
job:
|
|
||||||
admin:
|
|
||||||
addresses: http://10.251.186.27/jobAdmin
|
|
||||||
accessToken: 65ddc683-22f5-83b4-de3a-3c97a0a29af0
|
|
||||||
executor:
|
|
||||||
appname: java-servers-job-api
|
|
||||||
port: 9995
|
|
||||||
address:
|
|
||||||
ip:
|
|
||||||
logpath: /var/log/xxl-job/system/
|
|
||||||
logretentiondays: 30
|
|
||||||
|
|
||||||
aop-log-record:
|
|
||||||
#是否开启日志记录
|
|
||||||
enabled: true
|
|
||||||
#不进行拦截的包或者类
|
|
||||||
excludeClassNames:
|
|
||||||
activemq:
|
|
||||||
broker-url: tcp://10.251.129.25:61616
|
|
||||||
user: admin
|
|
||||||
password: admin
|
|
||||||
elasticsearch:
|
|
||||||
host: 10.251.129.25
|
|
||||||
port: 9200
|
|
||||||
user: elastic
|
|
||||||
password: Boe@es123
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<configuration debug="false" scan="false">
|
|
||||||
<springProperty scop="context" name="spring.application.name" source="spring.application.name" defaultValue=""/>
|
|
||||||
<property name="log.path" value="/home/logs/${spring.application.name}"/>
|
|
||||||
<!-- 彩色日志格式 -->
|
|
||||||
<property name="CONSOLE_LOG_PATTERN"
|
|
||||||
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %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"/>
|
|
||||||
<!-- Console log output -->
|
|
||||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
|
||||||
<encoder>
|
|
||||||
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
|
|
||||||
</encoder>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- Log file debug output -->
|
|
||||||
<appender name="info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
||||||
<file>${log.path}/debug.log</file>
|
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
|
||||||
<fileNamePattern>${log.path}/%d{yyyy-MM, aux}/debug.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
|
||||||
<maxFileSize>50MB</maxFileSize>
|
|
||||||
<maxHistory>30</maxHistory>
|
|
||||||
</rollingPolicy>
|
|
||||||
<encoder>
|
|
||||||
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
|
|
||||||
</encoder>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- Log file error output -->
|
|
||||||
<appender name="error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
||||||
<file>${log.path}/error.log</file>
|
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
|
||||||
<fileNamePattern>${log.path}/%d{yyyy-MM}/error.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
|
||||||
<maxFileSize>50MB</maxFileSize>
|
|
||||||
<maxHistory>30</maxHistory>
|
|
||||||
</rollingPolicy>
|
|
||||||
<encoder>
|
|
||||||
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
|
|
||||||
</encoder>
|
|
||||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
|
||||||
<level>ERROR</level>
|
|
||||||
</filter>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 -->
|
|
||||||
<root level="INFO">
|
|
||||||
<appender-ref ref="info"/>
|
|
||||||
<!-- <appender-ref ref="console"/>-->
|
|
||||||
<!-- <appender-ref ref="error"/> -->
|
|
||||||
</root>
|
|
||||||
</configuration>
|
|
||||||
@@ -51,6 +51,5 @@
|
|||||||
<root level="INFO">
|
<root level="INFO">
|
||||||
<appender-ref ref="debug"/>
|
<appender-ref ref="debug"/>
|
||||||
<appender-ref ref="error"/>
|
<appender-ref ref="error"/>
|
||||||
<appender-ref ref="console"/>
|
|
||||||
</root>
|
</root>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|||||||
7
servers/boe-server-all/src/main/resources/smart-doc.json
Normal file
7
servers/boe-server-all/src/main/resources/smart-doc.json
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"outPath": "src/main/resources/apidoc",
|
||||||
|
"isStrict": false,
|
||||||
|
"ignoreEmptyTag": true,
|
||||||
|
"createDebugPage": true,
|
||||||
|
"allInOne": true
|
||||||
|
}
|
||||||
@@ -98,7 +98,7 @@
|
|||||||
<filtering>true</filtering>
|
<filtering>true</filtering>
|
||||||
<directory>src/main/resources</directory>
|
<directory>src/main/resources</directory>
|
||||||
<includes>
|
<includes>
|
||||||
<include>application-*.yml</include>
|
<include>application-${profileActive}.yml</include>
|
||||||
<include>application.yml</include>
|
<include>application.yml</include>
|
||||||
</includes>
|
</includes>
|
||||||
</resource>
|
</resource>
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
# application-pro.yml
|
# application-pro.yml
|
||||||
spring:
|
spring:
|
||||||
|
profiles:
|
||||||
|
active: pro
|
||||||
redis:
|
redis:
|
||||||
database: 1
|
database: 3
|
||||||
host: 10.251.88.213
|
host: 10.251.88.213
|
||||||
password: qwert!W588
|
password: qwert!W588
|
||||||
port: 6379
|
port: 6379
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# application.yml
|
# application.yml
|
||||||
spring:
|
spring:
|
||||||
profiles:
|
profiles:
|
||||||
active: dev
|
active: @profileActive@
|
||||||
application:
|
application:
|
||||||
name: boe-server-basic
|
name: boe-server-basic
|
||||||
jackson:
|
jackson:
|
||||||
@@ -62,4 +62,4 @@ ok:
|
|||||||
|
|
||||||
# 设置logback.xml位置
|
# 设置logback.xml位置
|
||||||
logging:
|
logging:
|
||||||
config: classpath:log/logback-${spring.profiles.active}.xml
|
config: classpath:log/logback-@profileActive@.xml
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<configuration debug="false" scan="false">
|
|
||||||
<springProperty scop="context" name="spring.application.name" source="spring.application.name" defaultValue=""/>
|
|
||||||
<property name="log.path" value="/home/logs/${spring.application.name}"/>
|
|
||||||
<!-- 彩色日志格式 -->
|
|
||||||
<property name="CONSOLE_LOG_PATTERN"
|
|
||||||
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %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"/>
|
|
||||||
<!-- Console log output -->
|
|
||||||
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
|
||||||
<encoder>
|
|
||||||
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
|
|
||||||
</encoder>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- Log file debug output -->
|
|
||||||
<appender name="debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
||||||
<file>${log.path}/debug.log</file>
|
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
|
||||||
<fileNamePattern>${log.path}/%d{yyyy-MM, aux}/debug.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
|
||||||
<maxFileSize>50MB</maxFileSize>
|
|
||||||
<maxHistory>30</maxHistory>
|
|
||||||
</rollingPolicy>
|
|
||||||
<encoder>
|
|
||||||
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
|
|
||||||
</encoder>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- Log file error output -->
|
|
||||||
<appender name="error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|
||||||
<file>${log.path}/error.log</file>
|
|
||||||
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
|
|
||||||
<fileNamePattern>${log.path}/%d{yyyy-MM}/error.%d{yyyy-MM-dd}.%i.log.gz</fileNamePattern>
|
|
||||||
<maxFileSize>50MB</maxFileSize>
|
|
||||||
<maxHistory>30</maxHistory>
|
|
||||||
</rollingPolicy>
|
|
||||||
<encoder>
|
|
||||||
<pattern>%date [%thread] %-5level [%logger{50}] %file:%line - %msg%n</pattern>
|
|
||||||
</encoder>
|
|
||||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
|
||||||
<level>ERROR</level>
|
|
||||||
</filter>
|
|
||||||
</appender>
|
|
||||||
|
|
||||||
<!-- Level: FATAL 0 ERROR 3 WARN 4 INFO 6 DEBUG 7 -->
|
|
||||||
<root level="WARN">
|
|
||||||
<appender-ref ref="debug"/>
|
|
||||||
<appender-ref ref="error"/>
|
|
||||||
</root>
|
|
||||||
</configuration>
|
|
||||||
Reference in New Issue
Block a user