Преглед изворни кода

实时发送 超过一个月的不允许发

xgb пре 1 месец
родитељ
комит
9f6708a38f

+ 13 - 0
fs-company-app/src/main/java/com/fs/app/controller/FsUserCourseVideoController.java

@@ -399,6 +399,19 @@ public class FsUserCourseVideoController extends AppBaseController {
     @PostMapping("/batchSendCourse")
     public R batchSendCourse(@RequestBody BatchSendCourseDTO batchSendCourseDTO) throws JsonProcessingException {
 
+        // 发送前校验时间 最多一个月
+        if(batchSendCourseDTO.getSendTime()!=null){
+            if(batchSendCourseDTO.getSendTime().getTime()>System.currentTimeMillis()+30L*24*60*60*1000){
+                return R.error("发课时间请勿选择超过一个月的日期");
+            }
+        }
+
+        if(batchSendCourseDTO.getUrgeTime()!=null){
+            if(batchSendCourseDTO.getUrgeTime().getTime()>System.currentTimeMillis()+30L*24*60*60*1000){
+                return R.error("催课时间请勿选择超过一个月的日期");
+            }
+        }
+
         // 生成看课短链
         FsCourseLinkCreateParam fsCourseLinkCreateParam = new FsCourseLinkCreateParam();
         BeanUtils.copyProperties(batchSendCourseDTO, fsCourseLinkCreateParam);