|
|
@ -76,9 +76,9 @@ public class StuConceptBlockController {
|
|
|
|
@PostMapping("/getLearningAssessment")
|
|
|
|
@PostMapping("/getLearningAssessment")
|
|
|
|
@AnonymousAccess
|
|
|
|
@AnonymousAccess
|
|
|
|
@ApiOperation("哈希函数学习测评查看")
|
|
|
|
@ApiOperation("哈希函数学习测评查看")
|
|
|
|
public ResultDataEntity<List<StuAssessmentQuestionDetailsDTO>> getLearningAssessment(@ApiParam("用户ID") String module,@ApiParam("用户ID") String userId) {
|
|
|
|
public ResultDataEntity<List<StuAssessmentQuestionDetailsDTO>> getLearningAssessment(@ApiParam("用户ID") String userId) {
|
|
|
|
|
|
|
|
|
|
|
|
List<StuAssessmentQuestionDetailsDTO> list = stuConceptBlockService.getLearningAssessment(module,userId);
|
|
|
|
List<StuAssessmentQuestionDetailsDTO> list = stuConceptBlockService.getLearningAssessment(userId);
|
|
|
|
return new ResultDataEntity<>(HttpStatus.OK, list);
|
|
|
|
return new ResultDataEntity<>(HttpStatus.OK, list);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@PostMapping("/hashLearningAssessmentScore")
|
|
|
|
@PostMapping("/hashLearningAssessmentScore")
|
|
|
@ -108,9 +108,9 @@ public class StuConceptBlockController {
|
|
|
|
@GetMapping("/getReport")
|
|
|
|
@GetMapping("/getReport")
|
|
|
|
@ApiOperation("获取实训报告详情")
|
|
|
|
@ApiOperation("获取实训报告详情")
|
|
|
|
@AnonymousAccess
|
|
|
|
@AnonymousAccess
|
|
|
|
public ResultDataEntity<StuPracticalTrainingReport> getReport(String userId, String module,String ascription) {
|
|
|
|
public ResultDataEntity<StuPracticalTrainingReport> getReport(String userId) {
|
|
|
|
|
|
|
|
|
|
|
|
StuPracticalTrainingReport report = stuConceptBlockService.getReport(userId,module,ascription);
|
|
|
|
StuPracticalTrainingReport report = stuConceptBlockService.getReport(userId);
|
|
|
|
return new ResultDataEntity<>(HttpStatus.OK, report);
|
|
|
|
return new ResultDataEntity<>(HttpStatus.OK, report);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -139,9 +139,9 @@ public class StuConceptBlockController {
|
|
|
|
@GetMapping("/download")
|
|
|
|
@GetMapping("/download")
|
|
|
|
@ApiOperation("下载实训报告")
|
|
|
|
@ApiOperation("下载实训报告")
|
|
|
|
@AnonymousAccess
|
|
|
|
@AnonymousAccess
|
|
|
|
public void download(@RequestParam String userId, String TOKEN, HttpServletResponse response, String module,String ascription) {
|
|
|
|
public void download(@RequestParam String userId, String TOKEN, HttpServletResponse response) {
|
|
|
|
TokenProvider.getJWTUser(TOKEN);
|
|
|
|
TokenProvider.getJWTUser(TOKEN);
|
|
|
|
stuConceptBlockService.download(userId, response, module,ascription);
|
|
|
|
stuConceptBlockService.download(userId, response);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/getResourceUrl")
|
|
|
|
@GetMapping("/getResourceUrl")
|
|
|
@ -155,50 +155,6 @@ public class StuConceptBlockController {
|
|
|
|
return new ResultEntity<>(HttpStatus.OK,"获取成功","report"+stuResources.get(0).getResourcesUrl());
|
|
|
|
return new ResultEntity<>(HttpStatus.OK,"获取成功","report"+stuResources.get(0).getResourcesUrl());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/getResource")
|
|
|
|
|
|
|
|
@ApiOperation("获取视频流")
|
|
|
|
|
|
|
|
@AnonymousAccess
|
|
|
|
|
|
|
|
public ResponseEntity<FileSystemResource> streamVideo(@RequestParam String module, @RequestParam String name, HttpServletResponse response) {
|
|
|
|
|
|
|
|
StuResourcesExample example = new StuResourcesExample();
|
|
|
|
|
|
|
|
example.createCriteria().andModuleEqualTo(module).andResourcesNameEqualTo(name);
|
|
|
|
|
|
|
|
List<StuResources> stuResources = stuResourcesMapper.selectByExample(example);
|
|
|
|
|
|
|
|
if (stuResources.size() > 0) {
|
|
|
|
|
|
|
|
StuResources stuResources1 = stuResources.get(0);
|
|
|
|
|
|
|
|
String url = stuResources1.getResourcesUrl();
|
|
|
|
|
|
|
|
String videoPath = filePath + url;
|
|
|
|
|
|
|
|
File videoFile = new File(videoPath);
|
|
|
|
|
|
|
|
if ("mp4".equals(stuResources1.getResourcesType())) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (videoFile.exists()) {
|
|
|
|
|
|
|
|
Path path = Paths.get(videoPath);
|
|
|
|
|
|
|
|
FileSystemResource fileSystemResource = new FileSystemResource(videoFile);
|
|
|
|
|
|
|
|
return ResponseEntity.ok()
|
|
|
|
|
|
|
|
.contentType(MediaType.parseMediaType("video/mp4"))
|
|
|
|
|
|
|
|
.body(fileSystemResource);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return ResponseEntity.notFound().build();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if ("pdf".equals(stuResources1.getResourcesType())) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// fileUtil.getPdf(response,name,url);
|
|
|
|
|
|
|
|
if (videoFile.exists()) {
|
|
|
|
|
|
|
|
Path path = Paths.get(videoPath);
|
|
|
|
|
|
|
|
FileSystemResource fileSystemResource = new FileSystemResource(videoFile);
|
|
|
|
|
|
|
|
return ResponseEntity.ok()
|
|
|
|
|
|
|
|
.contentType(MediaType.parseMediaType("application/pdf"))
|
|
|
|
|
|
|
|
.body(fileSystemResource);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return ResponseEntity.notFound().build();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return ResponseEntity.notFound().build();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|