feat: separate workbench admin features

This commit is contained in:
richjohnrambo
2026-09-10 01:02:35 +08:00
parent 27a368b386
commit 047df08f84
10 changed files with 173 additions and 30 deletions
+10
View File
@@ -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,
})