This commit is contained in:
withchao
2023-03-02 14:41:59 +08:00
parent 7050b64b19
commit 6150419842
15 changed files with 291 additions and 1167 deletions
+10 -10
View File
@@ -19,26 +19,26 @@ type Auth struct {
zk *openKeeper.ZkClient
}
func (a *Auth) getGroupClient() (auth.AuthClient, error) {
conn, err := a.zk.GetConn(config.Config.RpcRegisterName.OpenImGroupName)
func (o *Auth) client() (auth.AuthClient, error) {
conn, err := o.zk.GetConn(config.Config.RpcRegisterName.OpenImGroupName)
if err != nil {
return nil, err
}
return auth.NewAuthClient(conn), nil
}
func (a *Auth) UserRegister(c *gin.Context) {
a2r.Call(auth.AuthClient.UserRegister, a.getGroupClient, c)
func (o *Auth) UserRegister(c *gin.Context) {
a2r.Call(auth.AuthClient.UserRegister, o.client, c)
}
func (a *Auth) UserToken(c *gin.Context) {
a2r.Call(auth.AuthClient.UserToken, a.getGroupClient, c)
func (o *Auth) UserToken(c *gin.Context) {
a2r.Call(auth.AuthClient.UserToken, o.client, c)
}
func (a *Auth) ParseToken(c *gin.Context) {
a2r.Call(auth.AuthClient.ParseToken, a.getGroupClient, c)
func (o *Auth) ParseToken(c *gin.Context) {
a2r.Call(auth.AuthClient.ParseToken, o.client, c)
}
func (a *Auth) ForceLogout(c *gin.Context) {
a2r.Call(auth.AuthClient.ForceLogout, a.getGroupClient, c)
func (o *Auth) ForceLogout(c *gin.Context) {
a2r.Call(auth.AuthClient.ForceLogout, o.client, c)
}