mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-10 19:36:50 +08:00
修改
This commit is contained in:
@@ -555,7 +555,7 @@ public class StudyCourseApi extends ApiBaseController{
|
||||
*/
|
||||
@Deprecated
|
||||
@RequestMapping(value="/appendtime",method = {RequestMethod.GET,RequestMethod.POST})
|
||||
public JsonResponse<String> appendTime(StudyTime studyTime){
|
||||
public JsonResponse<String> appendTime(StudyTime studyTime, HttpServletRequest request){
|
||||
|
||||
if(StringUtils.isBlank(studyTime.getStudyId())){
|
||||
return error("参数错误");
|
||||
@@ -569,11 +569,17 @@ public class StudyCourseApi extends ApiBaseController{
|
||||
CurrentUser cuser=getCurrent();
|
||||
studyTime.setStudentId(cuser.getAccountId());
|
||||
studyTime.setStudentName(cuser.getName());
|
||||
String token = request.getHeader("Xboe-Access-Token");
|
||||
if (StringUtils.isEmpty(token)) {
|
||||
token = request.getHeader("token");
|
||||
}
|
||||
try {
|
||||
//此处需要优化处理,
|
||||
//不能直接记录追加学习时间。以后增加到队列中,后台服务定时从队列中读取, 更新到系统中
|
||||
//studyService.appendStudyDuration(studyTime);
|
||||
studyService.appendStudyDuration(studyTime.getStudyId(),null,studyTime.getContentId(),studyTime.getDuration());
|
||||
List<StudyCourse> allUserList = thirdApi.getStudyCourseList(studyTime.getStudyId() ,studyTime.getCourseId(), token);
|
||||
log.info("在线课学习记录"+allUserList);
|
||||
return success(studyTime.getId());
|
||||
}catch(Exception e) {
|
||||
log.error("记录学习时长错误",e);
|
||||
|
||||
Reference in New Issue
Block a user