-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from Toktik-Team/feat-comment-service
- Loading branch information
Showing
24 changed files
with
3,217 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package biz | ||
|
||
import httpStatus "github.com/cloudwego/hertz/pkg/protocol/consts" | ||
|
||
const ( | ||
InvalidCommentActionType = 400001 | ||
VideoNotFound = 400002 | ||
ActorIDNotMatch = 403001 | ||
UnableToCreateComment = 500001 | ||
UnableToDeleteComment = 500002 | ||
UnableToQueryVideo = 500003 | ||
UnableToQueryComment = 500004 | ||
UnableToQueryUser = 500005 | ||
) | ||
|
||
var ( | ||
UnauthorizedError = GWError{HTTPStatusCode: httpStatus.StatusUnauthorized, StatusCode: 400003, StatusMsg: "Unauthorized"} | ||
|
||
BadRequestError = GWError{HTTPStatusCode: httpStatus.StatusBadRequest, StatusCode: 400004, StatusMsg: "Bad request"} | ||
|
||
InternalServerError = GWError{HTTPStatusCode: httpStatus.StatusInternalServerError, StatusCode: 500006, StatusMsg: "Internal server error"} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
syntax = "proto3"; | ||
package douyin.comment; | ||
option go_package = "douyin/comment"; | ||
|
||
import "user.proto"; | ||
|
||
message Comment { | ||
uint32 id = 1; | ||
user.User user = 2; | ||
string content = 3; | ||
string create_date = 4; | ||
} | ||
|
||
enum ActionCommentType { | ||
ACTION_COMMENT_TYPE_UNSPECIFIED = 0; // Only for protobuf compatibility | ||
ACTION_COMMENT_TYPE_ADD = 1; | ||
ACTION_COMMENT_TYPE_DELETE = 2; | ||
} | ||
|
||
message ActionCommentRequest { | ||
uint32 actor_id = 1; | ||
uint32 video_id = 2; | ||
ActionCommentType action_type = 3; | ||
oneof action { | ||
string comment_text = 4; | ||
uint32 comment_id = 5; | ||
} | ||
} | ||
|
||
message ActionCommentResponse { | ||
uint32 status_code = 1; | ||
optional string status_msg = 2; | ||
optional Comment comment = 3; | ||
} | ||
|
||
|
||
message ListCommentRequest { | ||
uint32 actor_id = 1; | ||
uint32 video_id = 2; | ||
} | ||
|
||
message ListCommentResponse { | ||
uint32 status_code = 1; | ||
optional string status_msg = 2; | ||
repeated Comment comment_list = 3; | ||
} | ||
|
||
|
||
service CommentService { | ||
rpc ActionComment(ActionCommentRequest) returns (ActionCommentResponse); | ||
rpc ListComment(ListCommentRequest) returns (ListCommentResponse); | ||
} |
Oops, something went wrong.