Skip to content

Commit

Permalink
fix: 修复异常返回值不正确的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
flben233 committed Jun 23, 2024
1 parent 08e843d commit baecf35
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import org.apache.hc.client5.http.cookie.CookieStore;
import org.shirakawatyu.handixikebackend.api.CourseApi;
import org.shirakawatyu.handixikebackend.cache.RawCourseCache;
import org.shirakawatyu.handixikebackend.exception.NotLoginException;
import org.shirakawatyu.handixikebackend.pojo.Lesson;
import org.shirakawatyu.handixikebackend.utils.ArrayUtils;
import org.springframework.cache.annotation.CacheEvict;
Expand Down Expand Up @@ -34,14 +33,9 @@ public class RawCourseCacheImpl implements RawCourseCache {
@Override
public List<Lesson> getRawCourse(CookieStore cookieStore, String no) {
HashSet<Lesson> lessonsResultSet = new HashSet<>();
try {
for (CourseApi api : courseApis) {
lessonsResultSet.addAll(api.getCourse(cookieStore));
}
} catch (Exception e) {
throw new NotLoginException();
for (CourseApi api : courseApis) {
lessonsResultSet.addAll(api.getCourse(cookieStore));
}

if (!lessonsResultSet.isEmpty()) {
ArrayList<Lesson> lessonList = new ArrayList<>(lessonsResultSet);
ArrayUtils.nullObjChk(lessonList);
Expand Down

0 comments on commit baecf35

Please sign in to comment.