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/user.go

58 lines
1.3 KiB

2 years ago
package api
3 years ago
import (
2 years ago
"OpenIM/internal/api/a2r"
2 years ago
"OpenIM/pkg/common/config"
2 years ago
"OpenIM/pkg/proto/user"
3 years ago
"context"
2 years ago
"github.com/OpenIMSDK/openKeeper"
2 years ago
"github.com/gin-gonic/gin"
3 years ago
)
2 years ago
var _ context.Context // 解决goland编辑器bug
3 years ago
2 years ago
func NewUser(zk *openKeeper.ZkClient) *User {
return &User{zk: zk}
3 years ago
}
2 years ago
type User struct {
zk *openKeeper.ZkClient
}
2 years ago
func (o *User) client() (user.UserClient, error) {
conn, err := o.zk.GetConn(config.Config.RpcRegisterName.OpenImGroupName)
3 years ago
if err != nil {
2 years ago
return nil, err
3 years ago
}
2 years ago
return user.NewUserClient(conn), nil
3 years ago
}
2 years ago
func (o *User) UserRegister(c *gin.Context) {
a2r.Call(user.UserClient.UserRegister, o.client, c)
}
2 years ago
func (o *User) UpdateUserInfo(c *gin.Context) {
a2r.Call(user.UserClient.UpdateUserInfo, o.client, c)
3 years ago
}
2 years ago
2 years ago
func (o *User) SetGlobalRecvMessageOpt(c *gin.Context) {
a2r.Call(user.UserClient.SetGlobalRecvMessageOpt, o.client, c)
}
3 years ago
2 years ago
func (o *User) GetUsersPublicInfo(c *gin.Context) {
a2r.Call(user.UserClient.GetDesignateUsers, o.client, c)
3 years ago
}
2 years ago
func (o *User) GetAllUsersID(c *gin.Context) {
a2r.Call(user.UserClient.GetDesignateUsers, o.client, c)
}
2 years ago
//
2 years ago
func (u *User) AccountCheck(c *gin.Context) {
a2r.Call(user.UserClient.AccountCheck, u.client, c)
}
2 years ago
2 years ago
func (o *User) GetUsers(c *gin.Context) {
a2r.Call(user.UserClient.GetPaginationUsers, o.client, c)
2 years ago
}