Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Friend #5

Merged
merged 9 commits into from
Jul 11, 2024
1 change: 1 addition & 0 deletions migrations/2406280107_add_is_accepted..down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE friend_invite DROP is_accepted;
1 change: 1 addition & 0 deletions migrations/2406280107_add_is_accepted..up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE friend_invite ADD is_accepted BOOLEAN NOT NULL DEFAULT FALSE;
20 changes: 6 additions & 14 deletions protobuf/friend.proto
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,18 @@ service FriendService{
};
}

// Add the record on the table(friend)
rpc AcceptInvitation_post_(AcceptInvitation_post_Request) returns (FriendEmpty){
rpc AcceptInvitation(AcceptInvitationRequest) returns (FriendEmpty){
option (google.api.http) = {
post: "/v1/friend"
};
}

// Delete the record from the table(friend invite)
rpc AcceptInvitation_delete_(AcceptInvitation_delete_Request) returns (FriendEmpty){
option (google.api.http) = {
delete: "/v1/friend/accept_invitation/{invite_id}"
};
}

rpc RejectInvitation(RejectInvitationRequest) returns (FriendEmpty){
option (google.api.http) = {
delete: "/v1/friend/reject_invitation/{invite_id}"
};
}

}

message DeleteFriendRequest{
Expand All @@ -64,6 +57,7 @@ message ListFriendResponse{
message Friend{
string friend_id = 1;
string name = 2;
string relation_id = 3;
}

message InviteFriendRequest{
Expand All @@ -81,15 +75,13 @@ message ListFriendInvitationResponse{
message Invitation{
string sender_nickId = 1;
string sender_name = 2;
string invite_id = 3;
}

message AcceptInvitation_post_Request{
message AcceptInvitationRequest{
string user1_id = 1;
string user2_id = 2;
}

message AcceptInvitation_delete_Request{
string invite_id = 1;
string invite_id = 3;
}

message RejectInvitationRequest{
Expand Down
318 changes: 136 additions & 182 deletions protobuf/gen/go/friend.pb.go

Large diffs are not rendered by default.

141 changes: 19 additions & 122 deletions protobuf/gen/go/friend.pb.gw.go

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

Loading
Loading