视频查看量更新修改
This commit is contained in:
parent
2d740c3879
commit
3ac407d062
@ -32,6 +32,4 @@ public interface LearningResourcesMapper extends BaseMapperX<LearningResourcesDO
|
||||
@Update("update llm_learning_resources set down_count = down_count + 1 where id = #{id}")
|
||||
void updateDownCount(LearningResourcesDO learningResourcesDO);
|
||||
|
||||
@Update("update llm_learning_resources set down_count = down_count + 1 where id = #{id}")
|
||||
void videoViewsUpdate(@Param("id") Long id);
|
||||
}
|
||||
|
@ -104,6 +104,18 @@ public class LearningResourcesServiceImpl implements LearningResourcesService {
|
||||
*/
|
||||
@Override
|
||||
public void videoViewsUpdate(LearningResourcesSaveReqVO updateReqVO) {
|
||||
learningResourcesMapper.videoViewsUpdate(updateReqVO.getId());
|
||||
Long id = updateReqVO.getId();
|
||||
|
||||
if (id == null) {
|
||||
throw exception(LEARNING_RESOURCES_NOT_EXISTS);
|
||||
}
|
||||
|
||||
// 校验存在
|
||||
validateLearningResourcesExists(id);
|
||||
|
||||
// 更新
|
||||
learningResourcesMapper.update(new UpdateWrapper<LearningResourcesDO>()
|
||||
.setSql("down_count = down_count + 1")
|
||||
.eq("id", id));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user