Merge remote-tracking branch '121/dev0525' into dev0525

This commit is contained in:
nisen
2024-08-15 19:32:45 +08:00
6 changed files with 26 additions and 16 deletions

View File

@@ -14,14 +14,13 @@ import com.xboe.module.exam.entity.AloneExam;
import com.xboe.module.exam.entity.ExamTest;
import com.xboe.school.study.entity.StudyCourse;
import com.xboe.system.user.dao.UserDao;
import com.xboe.system.user.entity.User;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Service;
import java.util.Collection;
import java.util.List;
import java.util.Optional;
import java.time.LocalDateTime;
import java.util.*;
import java.util.concurrent.ForkJoinPool;

View File

@@ -9,12 +9,7 @@ import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.xboe.common.PageList;
import com.xboe.common.Pagination;
@@ -1164,5 +1159,11 @@ public class CourseManageApi extends ApiBaseController{
return success(courses);
}
@GetMapping("/getCourseCoverUrl")
public JsonResponse<Map<String, String>> getCourseCoverUrl(@RequestParam String courseIds){
Map<String, String> courseUrlMap = courseService.getCourseCoverUrl(courseIds);
return success(courseUrlMap);
}
}

View File

@@ -340,9 +340,8 @@ public interface ICourseService {
* */
List<Course> mobiledelList(Integer num,CourseQueryDto courseQueryDto);
/**
* 获取课程封面
* */
Map<String, String> getCourseCoverUrl(String courseIds);
}

View File

@@ -1979,5 +1979,16 @@ public class CourseServiceImpl implements ICourseService {
return courseDao.findListByHql("Select new Course(id,studys,score) from Course where id in(?1)", ids);
}
@Override
public Map<String, String> getCourseCoverUrl(String courseIds) {
List<String> courseIdList = Arrays.asList(courseIds.split(","));
List<Course> courseList = courseDao.findList(FieldFilters.in("id", courseIdList));
Map<String, String> coverUrlMap = courseList.stream()
.filter(course -> StringUtils.isNotBlank(course.getCoverImg()))
.collect(Collectors.toMap(Course::getId, Course::getCoverImg));
return coverUrlMap;
}
}

View File

@@ -6,8 +6,9 @@ import javax.servlet.http.HttpServletRequest;
import cn.hutool.core.collection.CollectionUtil;
import com.xboe.api.ThirdApi;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.exception.ConstraintViolationException;
import org.springframework.web.bind.annotation.*;
import org.hibernate.exception.ConstraintViolationException;
import com.xboe.common.PageList;
import com.xboe.common.Pagination;

View File

@@ -188,5 +188,4 @@ public class ExamTest extends BaseEntity {
@Column(name = "ref_status")
private Integer refStatus;
}