Commit f1956075 by Li Feifei

实现好友关系的http服务

parent a9c358f2
......@@ -22,12 +22,13 @@ func main() {
}
beeLogger.Log.Success("gRPC server is running on " + port + " port.")
// 启动http服务
go func() {
if err := gateway.ProvideHTTP(Address, initialize.RpcServer).ListenAndServe(); err != nil {
beeLogger.Log.Fatalf("failed to api serve: %v", err)
}
}()
// 启动grpc服务
if err := initialize.RpcServer.Serve(lis); err != nil {
beeLogger.Log.Fatalf("failed to serve: %v", err)
......
......@@ -63,13 +63,31 @@ message ListBlackAndMuteListReply {
}
service UserRelationshipService {
rpc Add(UserRelationshipAddRequest) returns (UserRelationshipAddReply) {}
rpc Delete(UserRelationshipDelRequest) returns (UserRelationshipAddReply) {}
rpc All(UserRelationshipListRequest) returns (UserRelationshipListReply) {}
rpc SetSpecialRelation(SetSpecialRelationReq) returns (UserRelationshipAddReply) {}
rpc Add(UserRelationshipAddRequest) returns (UserRelationshipAddReply) {
option(google.api.http) = {
post:"/nimserver/friend/add"
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) {
option (google.api.http) ={
get:"/api/v1/listBlackAndMuteList"
get:"/nimserver/user/listBlackAndMuteList"
};
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment