mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-06 09:26:48 +08:00
104-master代碼回退
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
@@ -16,38 +16,38 @@
|
||||
<properties>
|
||||
<java.version>1.8</java.version>
|
||||
<spring-cloud.version>2021.0.5</spring-cloud.version>
|
||||
<spring-cloud-alibaba.version>2021.0.5.0</spring-cloud-alibaba.version>
|
||||
<nacos-client.version>2.2.0</nacos-client.version>
|
||||
<spring-cloud-alibaba.version>2021.0.5.0</spring-cloud-alibaba.version>
|
||||
<nacos-client.version>2.2.0</nacos-client.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<!-- 引入Cloud -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
<version>${spring-cloud-alibaba.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.alibaba.nacos</groupId>
|
||||
<artifactId>nacos-client</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.nacos</groupId>
|
||||
<artifactId>nacos-client</artifactId>
|
||||
<version>${nacos-client.version}</version>
|
||||
</dependency>
|
||||
<!-- end -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
<version>${spring-cloud-alibaba.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.alibaba.nacos</groupId>
|
||||
<artifactId>nacos-client</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba.nacos</groupId>
|
||||
<artifactId>nacos-client</artifactId>
|
||||
<version>${nacos-client.version}</version>
|
||||
</dependency>
|
||||
<!-- end -->
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml</artifactId>
|
||||
<version>4.0.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.8.16</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.8.16</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.xboe</groupId>
|
||||
<artifactId>xboe-api</artifactId>
|
||||
@@ -93,9 +93,9 @@
|
||||
<systemPath>${project.basedir}/src/main/resources/libs/jave-1.0.2.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.auth0</groupId>
|
||||
<artifactId>java-jwt</artifactId>
|
||||
<version>3.18.3</version>
|
||||
<groupId>com.auth0</groupId>
|
||||
<artifactId>java-jwt</artifactId>
|
||||
<version>3.18.3</version>
|
||||
</dependency>
|
||||
<!--
|
||||
<dependency>
|
||||
@@ -110,8 +110,8 @@
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@@ -125,17 +125,15 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<version>2.7.18</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.session</groupId>
|
||||
<artifactId>spring-session-data-redis</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-aop</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-aop</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
@@ -187,13 +185,13 @@
|
||||
</dependency>
|
||||
|
||||
<!-- aspose -->
|
||||
<dependency>
|
||||
<groupId>com.aspose</groupId>
|
||||
<artifactId>slides</artifactId>
|
||||
<version>15.9.0</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/src/main/resources/aspose/aspose.slides-15.9.0.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aspose</groupId>
|
||||
<artifactId>slides</artifactId>
|
||||
<version>15.9.0</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/src/main/resources/aspose/aspose.slides-15.9.0.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.aspose</groupId>
|
||||
<artifactId>words</artifactId>
|
||||
@@ -216,79 +214,54 @@
|
||||
<version>3.0.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.elasticsearch.client</groupId>
|
||||
<artifactId>elasticsearch-rest-high-level-client</artifactId>
|
||||
<version>7.9.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.elasticsearch</groupId>
|
||||
<artifactId>elasticsearch</artifactId>
|
||||
<version>7.9.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.elasticsearch.client</groupId>
|
||||
<artifactId>elasticsearch-rest-client</artifactId>
|
||||
<version>7.9.0</version>
|
||||
</dependency>
|
||||
<groupId>org.elasticsearch.client</groupId>
|
||||
<artifactId>elasticsearch-rest-high-level-client</artifactId>
|
||||
<version>7.9.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.elasticsearch</groupId>
|
||||
<artifactId>elasticsearch</artifactId>
|
||||
<version>7.9.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.elasticsearch.client</groupId>
|
||||
<artifactId>elasticsearch-rest-client</artifactId>
|
||||
<version>7.9.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.retry</groupId>
|
||||
<artifactId>spring-retry</artifactId>
|
||||
<version>1.3.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-webmvc</artifactId>
|
||||
<version>5.3.26</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.yaml</groupId>
|
||||
<artifactId>snakeyaml</artifactId>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-text</artifactId>
|
||||
<version>1.10.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.tomcat.embed</groupId>
|
||||
<artifactId>tomcat-embed-core</artifactId>
|
||||
<version>9.0.83</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<filtering>true</filtering>
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>application-${profileActive}.properties</include>
|
||||
<include>application.properties</include>
|
||||
</includes>
|
||||
</resource>
|
||||
<resource>
|
||||
<filtering>false</filtering>
|
||||
<directory>src/main/resources</directory>
|
||||
<excludes>
|
||||
<exclude>*.properties</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
</resources>
|
||||
<resource>
|
||||
<filtering>true</filtering>
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>application-${profileActive}.properties</include>
|
||||
<include>application.properties</include>
|
||||
</includes>
|
||||
</resource>
|
||||
<resource>
|
||||
<filtering>false</filtering>
|
||||
<directory>src/main/resources</directory>
|
||||
<excludes>
|
||||
<exclude>*.properties</exclude>
|
||||
</excludes>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<!-- <version>3.8.0</version> -->
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<!-- <version>3.8.0</version> -->
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
@@ -299,8 +272,8 @@
|
||||
<artifactId>lombok</artifactId>
|
||||
</exclude>
|
||||
</excludes>
|
||||
<includeSystemScope>true</includeSystemScope>
|
||||
</configuration>
|
||||
<includeSystemScope>true</includeSystemScope>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
@@ -323,12 +296,12 @@
|
||||
<profileActive>test</profileActive>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>test135</id>
|
||||
<properties>
|
||||
<profileActive>test135</profileActive>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>test135</id>
|
||||
<properties>
|
||||
<profileActive>test135</profileActive>
|
||||
</properties>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>dev</id>
|
||||
<properties>
|
||||
|
||||
@@ -74,19 +74,19 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
|
||||
@Resource
|
||||
private ICourseService courseService;
|
||||
|
||||
|
||||
@Resource
|
||||
private ITeacherService teacherService;
|
||||
|
||||
|
||||
@Resource
|
||||
private ICourseContentService contentService;
|
||||
|
||||
|
||||
@Resource
|
||||
private ICourseSectionService sectionService;
|
||||
|
||||
@Resource
|
||||
private ICourseTeacherService courseTeacherService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private IUserGroupService userGroupService;
|
||||
|
||||
@@ -124,9 +124,9 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
Map<String,Object> list=courseService.findImages(cids);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 人气榜
|
||||
* 人气榜
|
||||
* */
|
||||
@PostMapping("/ranking")
|
||||
public JsonResponse<List<RankingDto>> Ranking(Integer type,Integer time){
|
||||
@@ -152,7 +152,7 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
return success(rankingDtos);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询列表,数量,类型,最新,最热
|
||||
* @param num
|
||||
@@ -178,7 +178,7 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
}
|
||||
dto.setDevice(device);
|
||||
try {
|
||||
|
||||
|
||||
List<Course> list=courseService.findList(num, dto);
|
||||
return success(list);
|
||||
}catch(Exception e) {
|
||||
@@ -186,10 +186,10 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
return error("查询课程列表失败",e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/pagelist-new")
|
||||
public JsonResponse<PageList<Course>> findNewPage(Pagination pager,CourseQueryDto dto){
|
||||
|
||||
|
||||
//只是查询已发布的
|
||||
|
||||
dto.setPublish(true);
|
||||
@@ -211,9 +211,9 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return success(coursePageList);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -224,7 +224,7 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
*/
|
||||
@PostMapping("/pagelist")
|
||||
public JsonResponse<PageList<Course>> findPage(Pagination pager,CourseQueryDto dto){
|
||||
|
||||
|
||||
//只是查询已发布的
|
||||
|
||||
dto.setPublish(true);
|
||||
@@ -245,11 +245,11 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return success(coursePageList);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取详细信息
|
||||
* @param id
|
||||
@@ -260,19 +260,19 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
if(StringUtils.isBlank(id)) {
|
||||
return badRequest("参数错误,未指定课程");
|
||||
}
|
||||
|
||||
|
||||
//当前对于课程不增加浏览量,课程的意义并不是看过
|
||||
// if(addView==null) {
|
||||
// addView=false;
|
||||
// }
|
||||
|
||||
|
||||
Map<String,Object> rs=new HashMap<String,Object>();
|
||||
Course course=courseService.getAddView(id);
|
||||
if(course==null || course.getDeleted()){
|
||||
return badRequest("课程不存在或已被删除");
|
||||
}
|
||||
rs.put("course",course);
|
||||
|
||||
|
||||
List<CourseCrowd> courseCrowdList = courseService.findCrowdByCourseId(id);
|
||||
if(crowd!=null && crowd) {
|
||||
rs.put("crowds",courseCrowdList);
|
||||
@@ -315,7 +315,7 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
List<CourseContent> cclist=contentService.getByCourseId(id);
|
||||
List<CourseSection> sectionlist=sectionService.getByCourseId(id);
|
||||
List<CourseTeacher> teachers=courseService.findTeachersByCourseId(id);
|
||||
|
||||
|
||||
|
||||
//获取教师的介绍信息,因为一门课程 的教师不会太多,所以这里简单直接遍历查询,后续再优化
|
||||
for(CourseTeacher ct : teachers) {
|
||||
@@ -335,7 +335,7 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
rs.put("isCrowd",pass);
|
||||
@@ -344,7 +344,7 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
rs.put("teachers",teachers);
|
||||
//查询课程
|
||||
return success(rs);
|
||||
|
||||
|
||||
}
|
||||
private void getTeacherInfo(String token, List<String> teacherIds) {
|
||||
List<TeacherVo> teacherInfo = thirdApi.getTeacherInfo(teacherIds, token);
|
||||
@@ -363,9 +363,9 @@ 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 courseName,String courseId,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()){
|
||||
@@ -404,6 +404,20 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
if (totalFileSize > 2L * 1024 * 1024 * 1024) {
|
||||
return success("您要下载的作业过大,请分批下载或联系管理员!");
|
||||
}
|
||||
|
||||
// String encodedFilename = URLEncoder.encode(courseName+"【作业】.zip")
|
||||
// .replace("+", "%20") // 空格替换为"%20"
|
||||
// .replace("%2F", "/"); // 解决斜杠问题
|
||||
// StringBuilder contentDispositionValue = new StringBuilder();
|
||||
// contentDispositionValue.append("attachment; filename=\"")
|
||||
// .append(encodedFilename)
|
||||
// .append("\"")
|
||||
// .append("; filename*=utf-8''")
|
||||
// .append(encodedFilename);
|
||||
//
|
||||
// // 设置响应类型和Content-Disposition头
|
||||
// response.setContentType("application/zip");
|
||||
|
||||
// 创建一个临时文件用于存储ZIP文件
|
||||
File tempZipFile = new File("/home/www/elearning/upload/temp.zip");
|
||||
|
||||
@@ -429,13 +443,10 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
}
|
||||
// 将临时文件移动到指定位置
|
||||
Path source = tempZipFile.toPath();
|
||||
//生成uuid
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
//生成uuid
|
||||
String uuid = UUID.randomUUID().toString();
|
||||
Path destination = Paths.get("/home/www/elearning/upload/saveZip/" + uuid + ".zip");
|
||||
|
||||
// 确保目标目录存在
|
||||
Files.createDirectories(destination.getParent());
|
||||
|
||||
// 删除目标文件如果已存在
|
||||
if (Files.exists(destination)) {
|
||||
Files.delete(destination);
|
||||
@@ -492,7 +503,7 @@ public class CoursePortalApi extends ApiBaseController{
|
||||
cv.setStatus(9);
|
||||
}
|
||||
}
|
||||
//音视频
|
||||
//音视频
|
||||
}else{
|
||||
cv.setStatus(study.getStatus());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user