Skip to content

Commit

Permalink
测试rpc连接
Browse files Browse the repository at this point in the history
  • Loading branch information
Rapha-29 committed Aug 24, 2023
1 parent f759797 commit e72c4e5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
14 changes: 7 additions & 7 deletions pkg/pb/video_interaction.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions server/video-center/Web/controller/CommentController.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ func CommentAction(c *gin.Context) {
})
}
c.JSON(http.StatusOK, response)
return
}
if param.ActionType == "2" {
videoId, err := strconv.ParseInt(param.VideoID, 10, 64)
Expand All @@ -85,6 +86,7 @@ func CommentAction(c *gin.Context) {
return
}
c.JSON(http.StatusOK, response)
return
}
c.JSON(http.StatusOK, CommentActionResponse{
Response: Response{StatusCode: errno.ParamErrCode, StatusMsg: errno.ParamErr.ErrMsg},
Expand Down
5 changes: 3 additions & 2 deletions server/video-center/Web/controller/FavoriteController.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ func ListFav(context *gin.Context) {
return
}
request := pb.DouyinFavoriteListRequest{}
response, err := rpc.GetFavoriteList(context, &request)
if err != nil {
response, err2 := rpc.GetFavoriteList(context, &request)
if err2 != nil {
println("调用rpc失败")
context.JSON(http.StatusOK, FavListResponse{
Response: Response{StatusCode: errno.FailedToCallRpcCode, StatusMsg: errno.FailedToCallRpcErr.ErrMsg},
FavList: []*pb.Video{},
Expand Down
1 change: 0 additions & 1 deletion server/video-center/handler/videoInteractionHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ func (v VideoInteractionServer) ActionComment(ctx context.Context, request *pb.D

func (v VideoInteractionServer) ListComment(ctx context.Context, request *pb.DouyinCommentListRequest) (*pb.DouyinCommentListResponse, error) {
videoId := request.GetVideoId()
// TODO service调用
comments, err := service.NewCommentService(ctx).ListComment(videoId)
if err != nil {
return &pb.DouyinCommentListResponse{
Expand Down

0 comments on commit e72c4e5

Please sign in to comment.