Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
im-microservice
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Li Feifei
im-microservice
Commits
f1956075
Commit
f1956075
authored
Jul 13, 2020
by
Li Feifei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
实现好友关系的http服务
parent
a9c358f2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
6 deletions
+26
-6
main.go
main.go
+2
-1
im_user_relationship.pb.gw.go
pb/im_user_relationship.pb.gw.go
+0
-0
im_user_relationship.proto
u-proto/im_user_relationship.proto
+24
-5
No files found.
main.go
View file @
f1956075
...
@@ -22,12 +22,13 @@ func main() {
...
@@ -22,12 +22,13 @@ func main() {
}
}
beeLogger
.
Log
.
Success
(
"gRPC server is running on "
+
port
+
" port."
)
beeLogger
.
Log
.
Success
(
"gRPC server is running on "
+
port
+
" port."
)
// 启动http服务
go
func
()
{
go
func
()
{
if
err
:=
gateway
.
ProvideHTTP
(
Address
,
initialize
.
RpcServer
)
.
ListenAndServe
();
err
!=
nil
{
if
err
:=
gateway
.
ProvideHTTP
(
Address
,
initialize
.
RpcServer
)
.
ListenAndServe
();
err
!=
nil
{
beeLogger
.
Log
.
Fatalf
(
"failed to api serve: %v"
,
err
)
beeLogger
.
Log
.
Fatalf
(
"failed to api serve: %v"
,
err
)
}
}
}()
}()
// 启动grpc服务
if
err
:=
initialize
.
RpcServer
.
Serve
(
lis
);
err
!=
nil
{
if
err
:=
initialize
.
RpcServer
.
Serve
(
lis
);
err
!=
nil
{
beeLogger
.
Log
.
Fatalf
(
"failed to serve: %v"
,
err
)
beeLogger
.
Log
.
Fatalf
(
"failed to serve: %v"
,
err
)
...
...
pb/im_user_relationship.pb.gw.go
View file @
f1956075
This diff is collapsed.
Click to expand it.
u-proto/im_user_relationship.proto
View file @
f1956075
...
@@ -63,13 +63,31 @@ message ListBlackAndMuteListReply {
...
@@ -63,13 +63,31 @@ message ListBlackAndMuteListReply {
}
}
service
UserRelationshipService
{
service
UserRelationshipService
{
rpc
Add
(
UserRelationshipAddRequest
)
returns
(
UserRelationshipAddReply
)
{}
rpc
Add
(
UserRelationshipAddRequest
)
returns
(
UserRelationshipAddReply
)
{
rpc
Delete
(
UserRelationshipDelRequest
)
returns
(
UserRelationshipAddReply
)
{}
option
(
google.api.http
)
=
{
rpc
All
(
UserRelationshipListRequest
)
returns
(
UserRelationshipListReply
)
{}
post
:
"/nimserver/friend/add"
rpc
SetSpecialRelation
(
SetSpecialRelationReq
)
returns
(
UserRelationshipAddReply
)
{}
body
:
"*"
};
}
rpc
Delete
(
UserRelationshipDelRequest
)
returns
(
UserRelationshipAddReply
)
{
option
(
google.api.http
)
=
{
delete
:
"/nimserver/friend/delete"
};
}
rpc
All
(
UserRelationshipListRequest
)
returns
(
UserRelationshipListReply
)
{
option
(
google.api.http
)
=
{
get
:
"/nimserver/friend/get"
};
}
rpc
SetSpecialRelation
(
SetSpecialRelationReq
)
returns
(
UserRelationshipAddReply
)
{
option
(
google.api.http
)
=
{
put
:
"/nimserver/user/setSpecialRelation"
body
:
"*"
};
}
rpc
ListBlackAndMuteList
(
ListBlackAndMuteListReq
)
returns
(
ListBlackAndMuteListReply
)
{
rpc
ListBlackAndMuteList
(
ListBlackAndMuteListReq
)
returns
(
ListBlackAndMuteListReply
)
{
option
(
google.api.http
)
=
{
option
(
google.api.http
)
=
{
get
:
"/
api/v1
/listBlackAndMuteList"
get
:
"/
nimserver/user
/listBlackAndMuteList"
};
};
}
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment