|
@@ -0,0 +1,49 @@
|
|
|
+/*
|
|
|
+ * *************************************************
|
|
|
+ * Copyright (c) 2018 QMTH. All Rights Reserved.
|
|
|
+ * Created by Deason on 2018-11-15 10:08:45.
|
|
|
+ * *************************************************
|
|
|
+ */
|
|
|
+
|
|
|
+package cn.com.qmth.examcloud.core.print.api.provider;
|
|
|
+
|
|
|
+import cn.com.qmth.examcloud.commons.web.support.ControllerSupport;
|
|
|
+import cn.com.qmth.examcloud.core.print.api.CoursePaperCloudService;
|
|
|
+import cn.com.qmth.examcloud.core.print.api.request.SyncCoursePaperReq;
|
|
|
+import cn.com.qmth.examcloud.core.print.api.response.SyncCoursePaperResp;
|
|
|
+import cn.com.qmth.examcloud.core.print.common.utils.Check;
|
|
|
+import cn.com.qmth.examcloud.core.print.entity.CoursePaper;
|
|
|
+import cn.com.qmth.examcloud.core.print.service.CoursePaperService;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 课程试卷相关接口
|
|
|
+ *
|
|
|
+ * @author: fengdesheng
|
|
|
+ * @since: 2018/11/15
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("${$rmp.cloud.print}/course/paper")
|
|
|
+public class CoursePaperCloudServiceProvider extends ControllerSupport implements CoursePaperCloudService {
|
|
|
+ @Autowired
|
|
|
+ private CoursePaperService coursePaperService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 同步考试课程的试卷
|
|
|
+ */
|
|
|
+ @PostMapping("/save")
|
|
|
+ public SyncCoursePaperResp syncCoursePaper(@RequestBody SyncCoursePaperReq req) {
|
|
|
+ Check.isNull(req, "请求不能为空!");
|
|
|
+ Check.isNull(req.getBean(), "试卷信息不能为空!");
|
|
|
+ CoursePaper coursePaper = new CoursePaper();
|
|
|
+ BeanUtils.copyProperties(req.getBean(), coursePaper);
|
|
|
+ coursePaperService.saveCoursePaper(coursePaper);
|
|
|
+ return new SyncCoursePaperResp();
|
|
|
+ }
|
|
|
+
|
|
|
+}
|