上传用户会话接口

This commit is contained in:
liwei1dao 2022-06-07 11:57:32 +08:00
parent 10b415789c
commit ea9b9a394c
3 changed files with 6 additions and 1 deletions

View File

@ -41,6 +41,7 @@ type IUserSession interface {
GetUserId() string GetUserId() string
GetIP() string GetIP() string
GetGatewayServiceId() string GetGatewayServiceId() string
IsLogin() bool
Build(uid string) (err error) Build(uid string) (err error)
UnBuild(ServiceMethod string, msg proto.Message) (err error) UnBuild(ServiceMethod string, msg proto.Message) (err error)
SendMsg(mainType, subType string, code pb.ErrorCode, msg proto.Message) (err error) SendMsg(mainType, subType string, code pb.ErrorCode, msg proto.Message) (err error)

View File

@ -42,6 +42,10 @@ func (this *UserSession) GetGatewayServiceId() string {
return this.GatewayServiceId return this.GatewayServiceId
} }
func (this *UserSession) IsLogin() bool {
return this.UserId != ""
}
func (this *UserSession) Build(uid string) (err error) { func (this *UserSession) Build(uid string) (err error) {
reply := &pb.RPCMessageReply{} reply := &pb.RPCMessageReply{}
if err := this.service.RpcCallById(this.GatewayServiceId, string(Rpc_GatewayAgentBuild), context.Background(), &pb.AgentBuildReq{ if err := this.service.RpcCallById(this.GatewayServiceId, string(Rpc_GatewayAgentBuild), context.Background(), &pb.AgentBuildReq{

View File

@ -9,7 +9,7 @@ message Cache_UserData {
message DB_UserData { message DB_UserData {
string UserId = 1; //tags:{bson:"_id"}Id string UserId = 1; //tags:{bson:"_id"}Id
string account = 2; string Account = 2;
string NiceName = 3; string NiceName = 3;
string Email = 4; string Email = 4;
string Password = 5; string Password = 5;