refactor: 统一使用秒级时间戳,优化代码格式

This commit is contained in:
Hvemi_han 2024-12-20 15:52:26 +08:00
parent d1aafdae85
commit 2ac66ed9eb
2 changed files with 67 additions and 67 deletions

View File

@ -157,8 +157,8 @@
"avatar": null,
"creatorId": 1,
"status": 1,
"createdAt": 1734498503690,
"updatedAt": 1734498503690,
"createdAt": 1734578081,
"updatedAt": 1734578081,
"enabled": true,
"authorities": [
{
@ -194,8 +194,8 @@
"avatar": null,
"creatorId": 1,
"status": 1,
"createdAt": 1734491549,
"updatedAt": 1734491549
"createdAt": 1734578081,
"updatedAt": 1734578081
}
],
"total": 12,
@ -245,14 +245,14 @@
"microLessonName": "Test Lesson",
"userId": 12,
"progressStatus": 1,
"scriptUploadTime": 1734498510000,
"scriptConfirmTime": 1734498510000,
"videoCaptureTime": 1734498510000,
"videoConfirmTime": 1734498510000,
"finishTime": 1734498510000,
"scriptUploadTime": 1734578081,
"scriptConfirmTime": 1734578081,
"videoCaptureTime": 1734578081,
"videoConfirmTime": 1734578081,
"finishTime": 1734578081,
"advise": "Test advice",
"createdAt": 1734498546322,
"updatedAt": 1734498546322
"createdAt": 1734578081,
"updatedAt": 1734578081
}
],
"totalElements": 4,
@ -284,14 +284,14 @@
"microLessonName": "Test Lesson",
"userId": 12,
"progressStatus": 1,
"scriptUploadTime": 1734498510000,
"scriptConfirmTime": 1734498510000,
"videoCaptureTime": 1734498510000,
"videoConfirmTime": 1734498510000,
"finishTime": 1734498510000,
"scriptUploadTime": 1734578081,
"scriptConfirmTime": 1734578081,
"videoCaptureTime": 1734578081,
"videoConfirmTime": 1734578081,
"finishTime": 1734578081,
"advise": "Test advice",
"createdAt": 1734498546322,
"updatedAt": 1734498546322
"createdAt": 1734578081,
"updatedAt": 1734578081
}
}
```
@ -327,8 +327,8 @@
"videoConfirmTime": ,
"finishTime": ,
"advise": "请注意讲解速度",
"createdAt": 1734498546322,
"updatedAt": 1734498546322
"createdAt": 1734578081,
"updatedAt": 1734578081
}
}
```
@ -347,11 +347,11 @@
"microLessonName": "Updated Lesson", // 微课名称
"userId": 12, // 用户ID
"progressStatus": 2, // 进度状态
"scriptUploadTime": 1734498510000, // 脚本上传时间
"scriptConfirmTime": 1734498510000, // 脚本确认时间
"videoCaptureTime": 1734498510000, // 视频录制时间
"videoConfirmTime": 1734498510000, // 视频确认时间
"finishTime": 1734498510000, // 完成时间
"scriptUploadTime": 1734578081, // 脚本上传时间
"scriptConfirmTime": 1734578081, // 脚本确认时间
"videoCaptureTime": 1734578081, // 视频录制时间
"videoConfirmTime": 1734578081, // 视频确认时间
"finishTime": 1734578081, // 完成时间
"advise": "Updated advice" // 建议
}
```
@ -366,14 +366,14 @@
"microLessonName": "Updated Lesson",
"userId": 12,
"progressStatus": 2,
"scriptUploadTime": 1734498510000,
"scriptConfirmTime": 1734498510000,
"videoCaptureTime": 1734498510000,
"videoConfirmTime": 1734498510000,
"finishTime": 1734498510000,
"scriptUploadTime": 1734578081,
"scriptConfirmTime": 1734578081,
"videoCaptureTime": 1734578081,
"videoConfirmTime": 1734578081,
"finishTime": 1734578081,
"advise": "Updated advice",
"createdAt": 1734498546322,
"updatedAt": 1734498586574
"createdAt": 1734578081,
"updatedAt": 1734578081
}
}
```
@ -418,14 +418,14 @@
"userId": 1,
"username": "教师账号1", // 新增:用户名字段
"progressStatus": 4,
"scriptUploadTime": 1734498510000,
"scriptConfirmTime": 1734498510000,
"videoCaptureTime": 1734498510000,
"videoConfirmTime": 1734498510000,
"finishTime": 1734498510000,
"scriptUploadTime": 1734498510,
"scriptConfirmTime": 1734498510,
"videoCaptureTime": 1734498510,
"videoConfirmTime": 1734498510,
"finishTime": 1734498510,
"advise": null,
"createdAt": 1734578081000,
"updatedAt": 1734580393000
"createdAt": 1734578081,
"updatedAt": 1734580393
}
],
"totalElements": 10,
@ -473,13 +473,13 @@
"userId": 1,
"progressStatus": 2,
"scriptUploadTime": null,
"scriptConfirmTime": 1734663755667,
"scriptConfirmTime": 1734663755,
"videoCaptureTime": null,
"videoConfirmTime": null,
"finishTime": null,
"advise": "{\"method\":\"wechat\",\"uploaded\":true}",
"createdAt": 1734602440561,
"updatedAt": 1734663755000
"createdAt": 1734602440,
"updatedAt": 1734663755
}
}
```
@ -487,7 +487,7 @@
## 注意事项
1. 所有需要认证的接口必须在请求头中携带有效的 JWT 令牌
2. 所有时间戳字段均为秒级时间戳
2. 所有时间戳字段均为秒级时间戳
3. 分页接口的页码从 1 开始
4. 用户密码在传输和存储时都会进行加密处理
5. 课程任务的 progressStatus 字段状态码说明:

View File

@ -74,7 +74,7 @@ public class LessonTaskService {
if (request.getProgressStatus() != null) {
task.setProgressStatus(request.getProgressStatus());
// 根据进度状态更新时间戳
long currentTime = System.currentTimeMillis();
long currentTime = System.currentTimeMillis() / 1000;
switch (request.getProgressStatus()) {
case 1: // 脚本上传
task.setScriptUploadTime(currentTime);
@ -106,7 +106,7 @@ public class LessonTaskService {
task.setUserId(request.getUserId());
}
task.setUpdatedAt(System.currentTimeMillis());
task.setUpdatedAt(System.currentTimeMillis() / 1000);
LessonTask updatedTask = lessonTaskRepository.save(task);
logger.info("更新课程任务成功 - 任务ID: {}", updatedTask.getId());
return updatedTask;