zmy06
parent
ca889c252e
commit
13779a763d
|
@ -40,4 +40,14 @@ public class VideoController {
|
||||||
List<VideoCommentVo> videoCommentVoList = videoService.findVideoCommentList(videoId);
|
List<VideoCommentVo> videoCommentVoList = videoService.findVideoCommentList(videoId);
|
||||||
return HealthR.ok(videoCommentVoList);
|
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();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,8 @@ public interface VideoMapper {
|
||||||
|
|
||||||
List<VideoCommentEntity> findVideoCommentList(@Param("videoId") Integer videoId);
|
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);
|
// UserWalletEntity FindById(@Param("userId") Integer userId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,4 +20,6 @@ public interface VideoService {
|
||||||
|
|
||||||
|
|
||||||
List<VideoCommentVo> findVideoCommentList(Integer videoId);
|
List<VideoCommentVo> findVideoCommentList(Integer videoId);
|
||||||
|
|
||||||
|
void addVideoComment(Integer userId, String sessionId, Integer videoId, String content);
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,5 +62,10 @@ public class VideoServiceImpl implements VideoService {
|
||||||
return videoCommentVoList;
|
return videoCommentVoList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addVideoComment(Integer userId, String sessionId, Integer videoId, String content) {
|
||||||
|
videoMapper.addVideoComment(userId, sessionId, videoId, content);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,19 @@
|
||||||
#{videoId},
|
#{videoId},
|
||||||
now());
|
now());
|
||||||
</insert>
|
</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 id="updateVideoCount">
|
||||||
update video_count
|
update video_count
|
||||||
set collection_num=collection_num + 1
|
set collection_num=collection_num + 1
|
||||||
|
|
Loading…
Reference in New Issue