cbx
zmyYYDS 2024-01-15 22:22:30 +08:00
parent ca889c252e
commit 13779a763d
5 changed files with 32 additions and 0 deletions

View File

@ -40,4 +40,14 @@ public class VideoController {
List<VideoCommentVo> videoCommentVoList = videoService.findVideoCommentList(videoId);
return HealthR.ok(videoCommentVoList);
}
@PostMapping("/verify/v1/addVideoComment")
public HealthR<VideoCommentVo> addVideoComment(@RequestHeader Integer userId,
@RequestHeader String sessionId,
@RequestParam Integer videoId,
@RequestParam String content) {
videoService.addVideoComment(userId,sessionId,videoId,content);
return HealthR.ok();
}
}

View File

@ -33,6 +33,8 @@ public interface VideoMapper {
List<VideoCommentEntity> findVideoCommentList(@Param("videoId") Integer videoId);
void addVideoComment(@Param("userId") Integer userId, @Param("sessionId") String sessionId, @Param("videoId") Integer videoId, @Param("content") String content);
// UserWalletEntity FindById(@Param("userId") Integer userId);
}

View File

@ -20,4 +20,6 @@ public interface VideoService {
List<VideoCommentVo> findVideoCommentList(Integer videoId);
void addVideoComment(Integer userId, String sessionId, Integer videoId, String content);
}

View File

@ -62,5 +62,10 @@ public class VideoServiceImpl implements VideoService {
return videoCommentVoList;
}
@Override
public void addVideoComment(Integer userId, String sessionId, Integer videoId, String content) {
videoMapper.addVideoComment(userId, sessionId, videoId, content);
}
}

View File

@ -13,6 +13,19 @@
#{videoId},
now());
</insert>
<insert id="addVideoComment">
INSERT INTO video_comment (
video_id,
user_id,
content,
create_time
)VALUES(
#{videoId},
#{userId},
#{content},
now()
)
</insert>
<update id="updateVideoCount">
update video_count
set collection_num=collection_num + 1