feat: complete IM group governance actions

This commit is contained in:
richjohnrambo
2026-08-21 16:34:55 +08:00
parent 21a5b97ac8
commit 77b19a8157
12 changed files with 981 additions and 17 deletions
@@ -248,6 +248,59 @@ func (in *ImGroupUnmuteInp) Filter(ctx context.Context) (err error) {
return
}
type ImGroupJoinRequestResolveInp struct {
ImGroupTopicInp
RequestId string `json:"requestId" v:"required#申请ID不能为空" dc:"申请ID"`
RejectReason string `json:"rejectReason" dc:"拒绝原因"`
}
func (in *ImGroupJoinRequestResolveInp) Filter(ctx context.Context) (err error) {
if err = in.ImGroupTopicInp.Filter(ctx); err != nil {
return
}
if in.RequestId == "" {
return gerror.New("申请ID不能为空")
}
if len([]rune(in.RejectReason)) > 200 {
return gerror.New("拒绝原因不能超过200个字符")
}
return
}
type ImGroupRoleUpdateInp struct {
ImGroupTopicInp
UserId int64 `json:"userId" v:"required#用户ID不能为空" dc:"用户ID"`
Role string `json:"role" v:"required#角色不能为空" dc:"角色"`
}
func (in *ImGroupRoleUpdateInp) Filter(ctx context.Context) (err error) {
if err = in.ImGroupTopicInp.Filter(ctx); err != nil {
return
}
if in.UserId <= 0 {
return gerror.New("用户ID不能为空")
}
if in.Role == "" {
return gerror.New("角色不能为空")
}
return
}
type ImGroupOwnerTransferInp struct {
ImGroupTopicInp
UserId int64 `json:"userId" v:"required#新群主ID不能为空" dc:"新群主ID"`
}
func (in *ImGroupOwnerTransferInp) Filter(ctx context.Context) (err error) {
if err = in.ImGroupTopicInp.Filter(ctx); err != nil {
return
}
if in.UserId <= 0 {
return gerror.New("新群主ID不能为空")
}
return
}
type ImGroupJoinRequestListInp struct {
form.PageReq
ImGroupTopicInp
@@ -273,6 +326,49 @@ type ImGroupJoinRequestListModel struct {
UpdatedAt *gtime.Time `json:"updatedAt" dc:"修改时间"`
}
type ImGroupFileListInp struct {
form.PageReq
ImGroupTopicInp
Status string `json:"status" dc:"状态"`
FileType string `json:"fileType" dc:"文件类型"`
FileName string `json:"fileName" dc:"文件名"`
UploaderId int64 `json:"uploaderId" dc:"上传人ID"`
}
type ImGroupFileListModel struct {
Id int64 `json:"id" dc:"ID"`
GroupFileId string `json:"groupFileId" dc:"群文件ID"`
Topic string `json:"topic" dc:"Topic"`
FileId string `json:"fileId" dc:"文件ID"`
SourceTopic string `json:"sourceTopic" dc:"来源Topic"`
SourceSeq int `json:"sourceSeq" dc:"来源消息序号"`
UploaderId int64 `json:"uploaderId" dc:"上传人ID"`
FileName string `json:"fileName" dc:"文件名"`
MimeType string `json:"mimeType" dc:"MIME类型"`
FileType string `json:"fileType" dc:"文件类型"`
FileSize int64 `json:"fileSize" dc:"文件大小"`
Status string `json:"status" dc:"状态"`
DeletedBy int64 `json:"deletedBy" dc:"删除人"`
DeletedAt *gtime.Time `json:"deletedAt" dc:"删除时间"`
CreatedAt *gtime.Time `json:"createdAt" dc:"创建时间"`
UpdatedAt *gtime.Time `json:"updatedAt" dc:"修改时间"`
}
type ImGroupFileDeleteInp struct {
ImGroupTopicInp
GroupFileId string `json:"groupFileId" v:"required#群文件ID不能为空" dc:"群文件ID"`
}
func (in *ImGroupFileDeleteInp) Filter(ctx context.Context) (err error) {
if err = in.ImGroupTopicInp.Filter(ctx); err != nil {
return
}
if in.GroupFileId == "" {
return gerror.New("群文件ID不能为空")
}
return
}
type ImGroupInvitationListInp struct {
form.PageReq
ImGroupTopicInp