作业导出修改名称

This commit is contained in:
lu
2024-09-03 11:21:37 +08:00
parent 5070be0620
commit 45fce7927d

View File

@@ -365,7 +365,7 @@ public class CoursePortalApi extends ApiBaseController{
}
//作业导出
@GetMapping("/export")
public JsonResponse<String> export(String courseId,String contentId,String name,Integer status) throws IOException {
public JsonResponse<String> export(String courseId,String courseName,String contentId,String name,Integer status) throws IOException {
Map<String, String>map=new HashMap<>();
List<String> userIds = studyCourseDao.findList(FieldFilters.eq("courseId", courseId)).stream().filter(Objects::nonNull).map(StudyCourse::getAid).collect(Collectors.toList());
if (userIds.isEmpty()){
@@ -430,8 +430,8 @@ public class CoursePortalApi extends ApiBaseController{
// 将临时文件移动到指定位置
Path source = tempZipFile.toPath();
//生成uuid
String uuid = UUID.randomUUID().toString();
Path destination = Paths.get("/home/www/elearning/upload/saveZip/" + uuid + ".zip");
// String uuid = UUID.randomUUID().toString();
Path destination = Paths.get("/home/www/elearning/upload/saveZip/" + courseName+"【作业】" + ".zip");
// 确保目标目录存在
Files.createDirectories(destination.getParent());