mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-07 01:46:47 +08:00
作业导出修改名称
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user