浏览代码

add 对内评价接口

周箭河 5 年之前
父节点
当前提交
4ce5f5321c

+ 7 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/CourseReviewServiceImpl.java

@@ -180,7 +180,13 @@ public class CourseReviewServiceImpl extends BaseServiceImpl<Integer, CourseSche
 
     @Override
     public CourseScheduleReview updateReview(CourseScheduleReview courseScheduleReview) {
-        courseScheduleReview.setUpdateTime(new Date());
+        if (courseScheduleReview.getId() == null || courseScheduleReview.getId() <= 0) {
+            throw new BizException("评论id为空");
+        }
+        CourseScheduleReview review = courseScheduleReviewDao.get(courseScheduleReview.getId());
+        if(review == null){
+            throw new BizException("评论不存在");
+        }
         courseScheduleReviewDao.update(courseScheduleReview);
         return courseScheduleReview;
     }

+ 7 - 0
mec-web/src/main/java/com/ym/mec/web/controller/education/EduCourseReviewController.java

@@ -3,6 +3,7 @@ package com.ym.mec.web.controller.education;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.dao.EmployeeDao;
+import com.ym.mec.biz.dal.entity.CourseScheduleReview;
 import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.page.CourseReview4EduQueryInfo;
 import com.ym.mec.biz.dal.page.CourseReviewQueryInfo;
@@ -50,4 +51,10 @@ public class EduCourseReviewController extends BaseController {
         return succeed(courseReviewService.getReviewInfo(id));
     }
 
+    @ApiOperation(value = "教务评论")
+    @GetMapping("updateReviewInfo")
+    public HttpResponseResult updateReviewInfo(CourseScheduleReview courseScheduleReview) {
+        return succeed(courseReviewService.updateReview(courseScheduleReview));
+    }
+
 }