Przeglądaj źródła

fix: 修复课程的始末时间错误保存的bug

mjh 4 lat temu
rodzic
commit
2e18855327

+ 2 - 2
seecoder-portal-server/src/main/java/cn/seecoder/seecoderportalserver/domain/Course.java

@@ -43,11 +43,11 @@ public class Course {
     private String description;
     private String description;
 
 
     @Column
     @Column
-    @CreationTimestamp
+    @NotNull
     private OffsetDateTime startTime;
     private OffsetDateTime startTime;
 
 
     @Column
     @Column
-    @CreationTimestamp
+    @NotNull
     private OffsetDateTime endTime;
     private OffsetDateTime endTime;
 
 
     @Column
     @Column

+ 1 - 1
seecoder-portal-server/src/main/java/cn/seecoder/seecoderportalserver/service/CourseService.java

@@ -77,7 +77,7 @@ public class CourseService {
 //        }
 //        }
         Course course = courseMapper.courseVOToCourse(courseVO);
         Course course = courseMapper.courseVOToCourse(courseVO);
         course.setState(ObjectState.NORMAL);
         course.setState(ObjectState.NORMAL);
-        Course result = courseRepository.save(course);
+        Course result = courseRepository.saveAndFlush(course);
         return courseMapper.courseToCourseVO(result);
         return courseMapper.courseToCourseVO(result);
     }
     }
 
 

+ 0 - 1
seecoder-portal-server/src/main/java/cn/seecoder/seecoderportalserver/service/Impl/EvalService.java

@@ -50,7 +50,6 @@ public class EvalService implements SubsystemService {
         String uri = "https://eval-server.seec.seecoder.cn/api/exam/student/exams";
         String uri = "https://eval-server.seec.seecoder.cn/api/exam/student/exams";
         String token = httpService.getToken();
         String token = httpService.getToken();
         List<NameValuePair> params = new ArrayList<>();
         List<NameValuePair> params = new ArrayList<>();
-        System.out.println(pageSize);
         params.add(new BasicNameValuePair("pageSize", String.valueOf(pageSize)));
         params.add(new BasicNameValuePair("pageSize", String.valueOf(pageSize)));
         params.add(new BasicNameValuePair("pageNum", String.valueOf(pageNum)));
         params.add(new BasicNameValuePair("pageNum", String.valueOf(pageNum)));
         params.add(new BasicNameValuePair("state", String.valueOf(state)));
         params.add(new BasicNameValuePair("state", String.valueOf(state)));

+ 6 - 6
seecoder-portal-server/src/main/resources/data.sql

@@ -2,12 +2,12 @@
 INSERT INTO public.portal_user (id, created_time, email, is_valid, name, password, phone, photo, role, signature, username) VALUES (3117, '2022-02-21 13:21:26.171000', 'm15256072859@163.com', true, 'PortalTestTeacher', '$2a$10$y1kkNo3r2W3PKp4i.n64TeJz2Uj38r5ShahFh/3wRugFm27wz9eBe', '13382405535', null, 'TEACHER', '无', 'PortalTestTeacher');
 INSERT INTO public.portal_user (id, created_time, email, is_valid, name, password, phone, photo, role, signature, username) VALUES (3117, '2022-02-21 13:21:26.171000', 'm15256072859@163.com', true, 'PortalTestTeacher', '$2a$10$y1kkNo3r2W3PKp4i.n64TeJz2Uj38r5ShahFh/3wRugFm27wz9eBe', '13382405535', null, 'TEACHER', '无', 'PortalTestTeacher');
 
 
 -- course
 -- course
-INSERT INTO public.course (id, coder_id, state, created_time, description, end_time, eval_id, helper_id, image_url, invitation_code, mooc_url, name, semester, start_time, teacher_id, price) VALUES (1, null, 'EXAMPLE', '2022-02-20 11:54:34.084000', '精选课程简介1', '2022-02-28 11:08:07.608000', null, null, null, 'EXAMPLE-1', null, '精选课程1', '2022春', '2022-02-28 11:08:07.608000', 3117, 0);
-INSERT INTO public.course (id, coder_id, state, created_time, description, end_time, eval_id, helper_id, image_url, invitation_code, mooc_url, name, semester, start_time, teacher_id, price) VALUES (2, null, 'EXAMPLE', '2022-02-28 16:52:06.235000', '精选课程简介2', '2022-02-28 16:52:27.670000', null, null, null, 'EXAMPLE-2', null, '精选课程2', '2023春', '2022-02-28 16:52:27.670000', 3117, 0);
-INSERT INTO public.course (id, coder_id, state, created_time, description, end_time, eval_id, helper_id, image_url, invitation_code, mooc_url, name, semester, start_time, teacher_id, price) VALUES (3, null, 'EXAMPLE', '2022-02-28 21:46:24.008000', '精选课程简介3', '2022-02-28 21:46:24.307000', null, null, null, 'EXAMPLE-3', null, '精选课程3', '2022春', '2022-02-28 21:46:24.307000', 3117, 0);
-INSERT INTO public.course (id, coder_id, state, created_time, description, end_time, eval_id, helper_id, image_url, invitation_code, mooc_url, name, semester, start_time, teacher_id, price) VALUES (4, null, 'EXAMPLE', '2022-02-20 12:54:34.084000', '精选课程简介4', '2022-02-24 10:24:18.129000', null, null, null, 'EXAMPLE-4', null, '精选课程4', '2022春', '2022-02-24 10:24:18.129000', 3117, 0);
-INSERT INTO public.course (id, coder_id, state, created_time, description, end_time, eval_id, helper_id, image_url, invitation_code, mooc_url, name, semester, start_time, teacher_id, price) VALUES (5, null, 'EXAMPLE', '2022-02-20 13:54:34.084000', '精选课程简介5', '2022-02-24 10:24:18.129000', null, null, null, 'EXAMPLE-5', null, '精选课程5', '2022春', '2022-02-24 10:24:18.129000', 3117, 0);
-INSERT INTO public.course (id, coder_id, state, created_time, description, end_time, eval_id, helper_id, image_url, invitation_code, mooc_url, name, semester, start_time, teacher_id, price) VALUES (6, null, 'EXAMPLE', '2022-02-20 14:54:34.084000', '精选课程简介6', '2022-02-24 10:24:18.129000', null, null, null, 'EXAMPLE-6', null, '精选课程6', '2022春', '2022-02-24 10:24:18.129000', 3117, 0);
+INSERT INTO public.course (id, coder_id, state, created_time, description, end_time, eval_id, helper_id, image_url, invitation_code, mooc_url, name, semester, start_time, teacher_id, price) VALUES (1, null, 'EXAMPLE', '2022-02-20 11:54:34.084000', '精选课程简介1', '2022-03-28 11:08:07.608000', null, null, 'https://mjh1.oss-cn-hangzhou.aliyuncs.com/hci/no-image.png', 'EXAMPLE-1', null, '精选课程1', '2022春', '2022-02-28 11:08:07.608000', 3117, 0);
+INSERT INTO public.course (id, coder_id, state, created_time, description, end_time, eval_id, helper_id, image_url, invitation_code, mooc_url, name, semester, start_time, teacher_id, price) VALUES (2, null, 'EXAMPLE', '2022-02-28 16:52:06.235000', '精选课程简介2', '2022-03-28 16:52:27.670000', null, null, 'https://mjh1.oss-cn-hangzhou.aliyuncs.com/hci/no-image.png', 'EXAMPLE-2', null, '精选课程2', '2023春', '2022-02-28 16:52:27.670000', 3117, 0);
+INSERT INTO public.course (id, coder_id, state, created_time, description, end_time, eval_id, helper_id, image_url, invitation_code, mooc_url, name, semester, start_time, teacher_id, price) VALUES (3, null, 'EXAMPLE', '2022-02-28 21:46:24.008000', '精选课程简介3', '2022-03-28 21:46:24.307000', null, null, 'https://mjh1.oss-cn-hangzhou.aliyuncs.com/hci/no-image.png', 'EXAMPLE-3', null, '精选课程3', '2022春', '2022-02-28 21:46:24.307000', 3117, 0);
+INSERT INTO public.course (id, coder_id, state, created_time, description, end_time, eval_id, helper_id, image_url, invitation_code, mooc_url, name, semester, start_time, teacher_id, price) VALUES (4, null, 'EXAMPLE', '2022-02-20 12:54:34.084000', '精选课程简介4', '2022-03-24 10:24:18.129000', null, null, 'https://mjh1.oss-cn-hangzhou.aliyuncs.com/hci/no-image.png', 'EXAMPLE-4', null, '精选课程4', '2022春', '2022-02-24 10:24:18.129000', 3117, 0);
+INSERT INTO public.course (id, coder_id, state, created_time, description, end_time, eval_id, helper_id, image_url, invitation_code, mooc_url, name, semester, start_time, teacher_id, price) VALUES (5, null, 'EXAMPLE', '2022-02-20 13:54:34.084000', '精选课程简介5', '2022-03-24 10:24:18.129000', null, null, 'https://mjh1.oss-cn-hangzhou.aliyuncs.com/hci/no-image.png', 'EXAMPLE-5', null, '精选课程5', '2022春', '2022-02-24 10:24:18.129000', 3117, 0);
+INSERT INTO public.course (id, coder_id, state, created_time, description, end_time, eval_id, helper_id, image_url, invitation_code, mooc_url, name, semester, start_time, teacher_id, price) VALUES (6, null, 'EXAMPLE', '2022-02-20 14:54:34.084000', '精选课程简介6', '2022-03-24 10:24:18.129000', null, null, 'https://mjh1.oss-cn-hangzhou.aliyuncs.com/hci/no-image.png', 'EXAMPLE-6', null, '精选课程6', '2022春', '2022-02-24 10:24:18.129000', 3117, 0);
 
 
 -- course_generation
 -- course_generation
 UPDATE public.course_generation SET pk_course_id_value = 7 WHERE pk_course_id_name = 'COURSE_PK';
 UPDATE public.course_generation SET pk_course_id_value = 7 WHERE pk_course_id_name = 'COURSE_PK';