You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Open-IM-Server/internal/api/auth.go

32 lines
666 B

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)
}