观看记录问题

This commit is contained in:
wangw 2025-01-07 16:23:52 +08:00
parent b4c7ee22db
commit 61301104b1
1 changed files with 8 additions and 3 deletions

View File

@ -51,9 +51,13 @@ public class CourseCollectServiceImpl extends ServiceImpl<CourseCollectDao, Cour
@Override
@CacheEvict(value = "app:courseCollect", key = "#courseCollect.userId")
public Result insertCourseCollect(CourseCollect courseCollect) {
reentrantReadWriteLock.writeLock().lock();
// reentrantReadWriteLock.writeLock().lock();
try {
if (courseCollect.getClassify() == 3) {
if (courseCollect.getCourseId() == null || courseCollect.getCourseDetailsId() == null) {
return Result.success("操作成功!");
}
QueryWrapper<CourseCollect> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("user_id", courseCollect.getUserId())
.eq("classify", 3)
@ -103,9 +107,10 @@ public class CourseCollectServiceImpl extends ServiceImpl<CourseCollectDao, Cour
} catch (Exception e) {
e.printStackTrace();
log.error("收藏短剧出错了!" + e.getMessage());
} finally {
reentrantReadWriteLock.writeLock().unlock();
}
// finally {
// reentrantReadWriteLock.writeLock().unlock();
// }
return Result.error("系统繁忙,请稍后再试!");
}