81 lines
3.2 KiB
Go
81 lines
3.2 KiB
Go
// Package sysin
|
|
// @Link https://github.com/bufanyun/hotgo
|
|
// @Copyright Copyright (c) 2026 HotGo
|
|
// @Author Ms <133814250@qq.com>
|
|
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
|
package sysin
|
|
|
|
import (
|
|
"context"
|
|
"hotgo/internal/model/input/form"
|
|
|
|
"github.com/gogf/gf/v2/errors/gerror"
|
|
"github.com/gogf/gf/v2/os/gtime"
|
|
)
|
|
|
|
// ImUserListInp 获取IM用户列表
|
|
type ImUserListInp struct {
|
|
form.PageReq
|
|
TenantId int64 `json:"tenantId" dc:"租户ID"`
|
|
UserId int64 `json:"userId" dc:"用户ID"`
|
|
Nickname string `json:"nickname" dc:"昵称"`
|
|
AuthName string `json:"authName" dc:"登录标识"`
|
|
State *int `json:"state" dc:"账号状态"`
|
|
CreatedAt []*gtime.Time `json:"createdAt" dc:"创建时间"`
|
|
LastSeen []*gtime.Time `json:"lastSeen" dc:"最后在线时间"`
|
|
}
|
|
|
|
func (in *ImUserListInp) Filter(ctx context.Context) (err error) {
|
|
if in.TenantId <= 0 {
|
|
return gerror.New("请选择租户")
|
|
}
|
|
return
|
|
}
|
|
|
|
type ImUserListModel struct {
|
|
TenantId int64 `json:"tenantId" dc:"租户ID"`
|
|
TenantName string `json:"tenantName" dc:"租户名称"`
|
|
UserId int64 `json:"userId" dc:"用户ID"`
|
|
Nickname string `json:"nickname" dc:"昵称"`
|
|
PublicAccount string `json:"publicAccount" dc:"公开账号"`
|
|
Gender string `json:"gender" dc:"性别"`
|
|
Region string `json:"region" dc:"地区"`
|
|
State int `json:"state" dc:"账号状态"`
|
|
AuthVersion int `json:"authVersion" dc:"认证版本"`
|
|
PasswordUpdatedAt *gtime.Time `json:"passwordUpdatedAt" dc:"密码更新时间"`
|
|
AuthNames string `json:"authNames" dc:"登录标识"`
|
|
Credentials string `json:"credentials" dc:"凭证"`
|
|
LastSeen *gtime.Time `json:"lastSeen" dc:"最后在线时间"`
|
|
UserAgent string `json:"userAgent" dc:"客户端"`
|
|
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
|
UpdatedAt *gtime.Time `json:"updatedAt" dc:"修改时间"`
|
|
}
|
|
|
|
// ImUserViewInp 获取指定IM用户信息
|
|
type ImUserViewInp struct {
|
|
TenantId int64 `json:"tenantId" v:"required#租户ID不能为空" dc:"租户ID"`
|
|
UserId int64 `json:"userId" v:"required#用户ID不能为空" dc:"用户ID"`
|
|
}
|
|
|
|
func (in *ImUserViewInp) Filter(ctx context.Context) (err error) {
|
|
if in.TenantId <= 0 {
|
|
return gerror.New("请选择租户")
|
|
}
|
|
if in.UserId <= 0 {
|
|
return gerror.New("用户ID不能为空")
|
|
}
|
|
return
|
|
}
|
|
|
|
type ImUserViewModel struct {
|
|
ImUserListModel
|
|
Signature string `json:"signature" dc:"个性签名"`
|
|
AvatarFileId string `json:"avatarFileId" dc:"头像文件ID"`
|
|
BirthDate string `json:"birthDate" dc:"出生日期"`
|
|
ProfileJson string `json:"profileJson" dc:"Tinode Public资料"`
|
|
TrustedJson string `json:"trustedJson" dc:"Tinode Trusted资料"`
|
|
TagsJson string `json:"tagsJson" dc:"Tinode标签"`
|
|
AccessJson string `json:"accessJson" dc:"访问权限"`
|
|
ProfileVersion int `json:"profileVersion" dc:"资料版本"`
|
|
}
|