mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-11 23:47:32 +08:00
32 lines
666 B
Go
32 lines
666 B
Go
package api
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
"github.com/openimsdk/protocol/auth"
|
|
"github.com/openimsdk/tools/a2r"
|
|
)
|
|
|
|
type AuthApi struct {
|
|
Client auth.AuthClient
|
|
}
|
|
|
|
func NewAuthApi(client auth.AuthClient) AuthApi {
|
|
return AuthApi{client}
|
|
}
|
|
|
|
func (o *AuthApi) GetAdminToken(c *gin.Context) {
|
|
a2r.Call(c, auth.AuthClient.GetAdminToken, o.Client)
|
|
}
|
|
|
|
func (o *AuthApi) GetUserToken(c *gin.Context) {
|
|
a2r.Call(c, auth.AuthClient.GetUserToken, o.Client)
|
|
}
|
|
|
|
func (o *AuthApi) ParseToken(c *gin.Context) {
|
|
a2r.Call(c, auth.AuthClient.ParseToken, o.Client)
|
|
}
|
|
|
|
func (o *AuthApi) ForceLogout(c *gin.Context) {
|
|
a2r.Call(c, auth.AuthClient.ForceLogout, o.Client)
|
|
}
|