feat: separate workbench admin features
This commit is contained in:
@@ -8,6 +8,7 @@ package sys
|
||||
import (
|
||||
"context"
|
||||
"hotgo/internal/consts"
|
||||
"hotgo/internal/library/contexts"
|
||||
"hotgo/internal/model/entity"
|
||||
"hotgo/internal/model/input/sysin"
|
||||
"hotgo/internal/service"
|
||||
@@ -47,6 +48,9 @@ func (s *sSysImFile) List(ctx context.Context, in *sysin.ImFileListInp) (list []
|
||||
for _, item := range list {
|
||||
item.TenantId = tenant.Id
|
||||
item.TenantName = tenant.Name
|
||||
if !contexts.IsCompanyDept(ctx) {
|
||||
item.Location = ""
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -68,6 +72,9 @@ func (s *sSysImFile) View(ctx context.Context, in *sysin.ImFileViewInp) (res *sy
|
||||
}
|
||||
res.TenantId = tenant.Id
|
||||
res.TenantName = tenant.Name
|
||||
if !contexts.IsCompanyDept(ctx) {
|
||||
res.Location = ""
|
||||
}
|
||||
if err = db.Model("im_filemsglinks").Safe().Ctx(ctx).
|
||||
Fields("id", "createdat created_at", "fileid file_id", "COALESCE(msgid,0) msg_id", "COALESCE(topic,'') topic", "COALESCE(userid,0) user_id").
|
||||
Where("fileid", in.Id).
|
||||
@@ -139,6 +146,9 @@ func (s *sSysImFile) CleanupOrphan(ctx context.Context, in *sysin.ImFileCleanupO
|
||||
return nil, gerror.Wrap(err, "标记IM孤儿文件失败,请稍后重试!")
|
||||
}
|
||||
res.Count = len(ids)
|
||||
if !contexts.IsCompanyDept(ctx) {
|
||||
res.Locations = []string{}
|
||||
}
|
||||
_ = writeImAdminAudit(ctx, tenant.Id, "im_file_cleanup_orphan", "im_file", 0, "success", g.Map{
|
||||
"days": in.Days, "limit": in.Limit, "count": res.Count,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user