wangwei 7 år sedan
förälder
incheckning
3c40ae898b

+ 15 - 0
core-api/src/main/java/cn/com/qmth/examcloud/service/core/api/CourseApi.java

@@ -38,6 +38,8 @@ import cn.com.qmth.examcloud.service.core.service.CourseService;
 import cn.com.qmth.examcloud.service.core.util.ExportUtils;
 import org.springframework.web.multipart.commons.CommonsMultipartFile;
 
+import com.google.common.collect.Lists;
+
 /**
  * 课程服务API
  * Created by songyue on 17/1/14.
@@ -118,6 +120,19 @@ public class CourseApi {
     public ResponseEntity getCourseByOrgId(@PathVariable Long orgId){
         return new ResponseEntity(courseRepo.findByOrgId(orgId),HttpStatus.OK);
     }
+    
+	@ApiOperation(value = "批量查询课程", notes = "批量查询课程")
+	@PostMapping("/batchGetCourses")
+	public ResponseEntity<List<Course>> batchGetCourses(@RequestBody String[] funcIds, HttpServletRequest request) {
+		List<Course> list = Lists.newArrayList();
+		for (String id : funcIds) {
+			Course one = courseRepo.findOne(Long.parseLong(id));
+			if (null != one) {
+				list.add(one);
+			}
+		}
+		return new ResponseEntity<List<Course>>(list, HttpStatus.OK);
+	}			
 
     @ApiOperation(value="新增课程",notes="新增")
     @PostMapping