Skip to content

Commit

Permalink
Merge pull request #65 from luhaoling/main
Browse files Browse the repository at this point in the history
feat: add getUserToken api and add ex field in getSortedConversationListResp
  • Loading branch information
FGadvancer authored Feb 4, 2024
2 parents 8e26a62 + 148eedd commit 09cafc0
Show file tree
Hide file tree
Showing 7 changed files with 285 additions and 50 deletions.
11 changes: 11 additions & 0 deletions auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,14 @@ func (x *ParseTokenReq) Check() error {
}
return nil
}

func (x *GetUserTokenReq) Check() error {
if x.UserID == "" {
errors.New("userID is empty")
}

if x.PlatformID == 0 {
errors.New("platformID is empty")
}
return nil
}
263 changes: 227 additions & 36 deletions auth/auth.pb.go

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

12 changes: 12 additions & 0 deletions auth/auth.proto
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,21 @@ message parseTokenResp{
int64 expireTimeSeconds = 4;
}

message getUserTokenReq{
int32 platformID = 1;
string userID = 2;
}

message getUserTokenResp{
string token = 1;
int64 expireTimeSeconds = 2;
}

service Auth {
//生成token
rpc userToken(userTokenReq) returns(userTokenResp);
// 管理员获取用户 token
rpc getUserToken(getUserTokenReq)returns(getUserTokenResp);
//强制退出登录
rpc forceLogout(forceLogoutReq) returns(forceLogoutResp);
//解析token
Expand Down
Loading

0 comments on commit 09cafc0

Please sign in to comment.