feat: expand IM admin controls
This commit is contained in:
@@ -29,9 +29,6 @@ type ImAuditLogListInp struct {
|
||||
}
|
||||
|
||||
func (in *ImAuditLogListInp) Filter(ctx context.Context) (err error) {
|
||||
if in.TenantId <= 0 {
|
||||
return gerror.New("请选择租户")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@@ -61,9 +58,6 @@ type ImAuditLogViewInp struct {
|
||||
}
|
||||
|
||||
func (in *ImAuditLogViewInp) Filter(ctx context.Context) (err error) {
|
||||
if in.TenantId <= 0 {
|
||||
return gerror.New("请选择租户")
|
||||
}
|
||||
if in.Id <= 0 {
|
||||
return gerror.New("ID不能为空")
|
||||
}
|
||||
@@ -73,3 +67,18 @@ func (in *ImAuditLogViewInp) Filter(ctx context.Context) (err error) {
|
||||
type ImAuditLogViewModel struct {
|
||||
ImAuditLogListModel
|
||||
}
|
||||
|
||||
type ImAuditLogExportModel struct {
|
||||
Id int64 `json:"id" dc:"ID"`
|
||||
TenantName string `json:"tenantName" dc:"租户名称"`
|
||||
ActorUid int64 `json:"actorUid" dc:"操作人UID"`
|
||||
ActorRole string `json:"actorRole" dc:"操作角色"`
|
||||
Action string `json:"action" dc:"操作类型"`
|
||||
TargetType string `json:"targetType" dc:"目标类型"`
|
||||
TargetId string `json:"targetId" dc:"目标ID"`
|
||||
Reason string `json:"reason" dc:"操作原因"`
|
||||
RequestId string `json:"requestId" dc:"请求ID"`
|
||||
Ip string `json:"ip" dc:"IP"`
|
||||
UserAgent string `json:"userAgent" dc:"客户端"`
|
||||
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
|
||||
}
|
||||
|
||||
@@ -155,3 +155,67 @@ func (in *ImTenantStatusInp) Filter(ctx context.Context) (err error) {
|
||||
}
|
||||
|
||||
type ImTenantStatusModel struct{}
|
||||
|
||||
type ImTenantUsageInp struct {
|
||||
Id int64 `json:"id" v:"required#ID不能为空" dc:"ID"`
|
||||
}
|
||||
|
||||
func (in *ImTenantUsageInp) Filter(ctx context.Context) (err error) {
|
||||
if in.Id <= 0 {
|
||||
return gerror.New("ID不能为空")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
type ImTenantUsageModel struct {
|
||||
Id int64 `json:"id" dc:"租户ID"`
|
||||
Code string `json:"code" dc:"租户编码"`
|
||||
Name string `json:"name" dc:"租户名称"`
|
||||
DbName string `json:"dbName" dc:"业务库名"`
|
||||
DbDsnConfigured bool `json:"dbDsnConfigured" dc:"是否配置独立连接串"`
|
||||
DbReachable bool `json:"dbReachable" dc:"业务库是否可达"`
|
||||
DbCheckError string `json:"dbCheckError" dc:"业务库检查错误"`
|
||||
SchemaVersion string `json:"schemaVersion" dc:"Schema版本"`
|
||||
UserCount int64 `json:"userCount" dc:"用户数"`
|
||||
ActiveUserCount int64 `json:"activeUserCount" dc:"正常用户数"`
|
||||
GroupCount int64 `json:"groupCount" dc:"群数"`
|
||||
DeviceCount int64 `json:"deviceCount" dc:"设备数"`
|
||||
PushTokenCount int64 `json:"pushTokenCount" dc:"Push Token数"`
|
||||
InviteUseCount int64 `json:"inviteUseCount" dc:"邀请码使用次数"`
|
||||
OutboxPendingCount int64 `json:"outboxPendingCount" dc:"待处理Outbox数"`
|
||||
Warnings []string `json:"warnings" dc:"警告信息"`
|
||||
}
|
||||
|
||||
type ImTenantDeletionCheckInp struct {
|
||||
Id int64 `json:"id" v:"required#ID不能为空" dc:"ID"`
|
||||
}
|
||||
|
||||
func (in *ImTenantDeletionCheckInp) Filter(ctx context.Context) (err error) {
|
||||
if in.Id <= 0 {
|
||||
return gerror.New("ID不能为空")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
type ImTenantDeletionCheckModel struct {
|
||||
Id int64 `json:"id" dc:"租户ID"`
|
||||
Code string `json:"code" dc:"租户编码"`
|
||||
Name string `json:"name" dc:"租户名称"`
|
||||
CanEnterDeleting bool `json:"canEnterDeleting" dc:"是否可进入删除流程"`
|
||||
Blockers []string `json:"blockers" dc:"阻断原因"`
|
||||
Warnings []string `json:"warnings" dc:"警告信息"`
|
||||
UserCount int64 `json:"userCount" dc:"用户数"`
|
||||
GroupCount int64 `json:"groupCount" dc:"群数"`
|
||||
PendingOutbox int64 `json:"pendingOutbox" dc:"待处理Outbox"`
|
||||
}
|
||||
|
||||
type ImTenantLifecycleInp struct {
|
||||
Id int64 `json:"id" v:"required#ID不能为空" dc:"ID"`
|
||||
}
|
||||
|
||||
func (in *ImTenantLifecycleInp) Filter(ctx context.Context) (err error) {
|
||||
if in.Id <= 0 {
|
||||
return gerror.New("ID不能为空")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@@ -87,6 +87,31 @@ func (in *ImUserPasswordResetInp) Filter(ctx context.Context) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
type ImUserRevokeSessionsInp struct {
|
||||
TenantId int64 `json:"tenantId" dc:"租户ID"`
|
||||
UserId string `json:"userId" v:"required#用户ID不能为空" dc:"用户ID"`
|
||||
}
|
||||
|
||||
func (in *ImUserRevokeSessionsInp) Filter(ctx context.Context) error {
|
||||
if _, err := ParseOptionalInt64(in.UserId); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ImUserStatusInp struct {
|
||||
TenantId int64 `json:"tenantId" dc:"租户ID"`
|
||||
UserId string `json:"userId" v:"required#用户ID不能为空" dc:"用户ID"`
|
||||
State int `json:"state" dc:"账号状态"`
|
||||
}
|
||||
|
||||
func (in *ImUserStatusInp) Filter(ctx context.Context) error {
|
||||
if _, err := ParseOptionalInt64(in.UserId); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ImUserViewModel struct {
|
||||
ImUserListModel
|
||||
Signature string `json:"signature" dc:"个性签名"`
|
||||
@@ -97,3 +122,31 @@ type ImUserViewModel struct {
|
||||
AccessJson string `json:"accessJson" dc:"访问权限"`
|
||||
ProfileVersion int `json:"profileVersion" dc:"资料版本"`
|
||||
}
|
||||
|
||||
type ImUserDeviceListInp struct {
|
||||
form.PageReq
|
||||
TenantId int64 `json:"tenantId" dc:"租户ID"`
|
||||
UserId string `json:"userId" v:"required#用户ID不能为空" dc:"用户ID"`
|
||||
}
|
||||
|
||||
func (in *ImUserDeviceListInp) Filter(ctx context.Context) (err error) {
|
||||
if _, err = ParseOptionalInt64(in.UserId); err != nil {
|
||||
return gerror.New("用户ID不能为空")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
type ImUserDeviceListModel struct {
|
||||
TenantId int64 `json:"tenantId" dc:"租户ID"`
|
||||
TenantName string `json:"tenantName" dc:"租户名称"`
|
||||
UserId string `json:"userId" dc:"用户ID"`
|
||||
DeviceId string `json:"deviceId" dc:"设备ID"`
|
||||
Platform string `json:"platform" dc:"平台"`
|
||||
Lang string `json:"lang" dc:"语言"`
|
||||
LastSeen *gtime.Time `json:"lastSeen" dc:"最后活跃时间"`
|
||||
PushProvider string `json:"pushProvider" dc:"Push服务商"`
|
||||
PushPlatform string `json:"pushPlatform" dc:"Push平台"`
|
||||
PushAppVersion string `json:"pushAppVersion" dc:"App版本"`
|
||||
PushTokenConfigured bool `json:"pushTokenConfigured" dc:"是否配置Push Token"`
|
||||
PushUpdatedAt *gtime.Time `json:"pushUpdatedAt" dc:"Push更新时间"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user