refactor(terminology): rename user-facing tenant labels to workspace
Align product copy, API docs, Swagger descriptions, and i18n strings with workspace terminology while keeping internal tenant identifiers and headers unchanged for API compatibility.
This commit is contained in:
@@ -472,7 +472,7 @@ func (h *KnowledgeBaseHandler) validateAndGetKnowledgeBase(c *gin.Context) (*typ
|
||||
agent, err := h.agentShareService.GetSharedAgentForTenant(ctx, currentTenantID, callerTenantRole, agentID)
|
||||
if err == nil && agent != nil {
|
||||
if kb.TenantID != agent.TenantID {
|
||||
logger.Warnf(ctx, "Shared agent tenant mismatch, KB %s tenant: %d, agent tenant: %d", id, kb.TenantID, agent.TenantID)
|
||||
logger.Warnf(ctx, "Shared agent workspace mismatch, KB %s tenant: %d, agent tenant: %d", id, kb.TenantID, agent.TenantID)
|
||||
} else {
|
||||
mode := agent.Config.KBSelectionMode
|
||||
if mode == "none" {
|
||||
@@ -549,7 +549,7 @@ func (h *KnowledgeBaseHandler) GetKnowledgeBase(c *gin.Context) {
|
||||
|
||||
// ListKnowledgeBases godoc
|
||||
// @Summary 获取知识库列表
|
||||
// @Description 获取当前租户的所有知识库;或当传入 agent_id(共享智能体)时,校验权限后返回该智能体配置的知识库范围(用于 @ 提及)
|
||||
// @Description 获取当前空间的所有知识库;或当传入 agent_id(共享智能体)时,校验权限后返回该智能体配置的知识库范围(用于 @ 提及)
|
||||
// @Tags 知识库
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
@@ -572,7 +572,7 @@ func (h *KnowledgeBaseHandler) ListKnowledgeBases(c *gin.Context) {
|
||||
_ = userIDVal
|
||||
currentTenantID := c.GetUint64(types.TenantIDContextKey.String())
|
||||
if currentTenantID == 0 {
|
||||
c.Error(apperrors.NewUnauthorizedError("tenant ID not found"))
|
||||
c.Error(apperrors.NewUnauthorizedError("workspace ID not found"))
|
||||
return
|
||||
}
|
||||
callerTenantRole := types.TenantRoleFromContext(ctx)
|
||||
@@ -700,7 +700,7 @@ func (h *KnowledgeBaseHandler) ListKnowledgeBases(c *gin.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
// 批量回填 creator_name,让前端列表能区分「我创建」与「同租户其他成员创建」。
|
||||
// 批量回填 creator_name,让前端列表能区分「我创建」与「同空间其他成员创建」。
|
||||
// 仅在 list 接口里回填,详情 / 编辑场景不依赖这个字段;解析失败(用户已删除、
|
||||
// CreatorID 为空的老数据)就让字段为空,前端按 fallback 渲染。
|
||||
enrichKBCreatorNames(ctx, h.userService, kbs)
|
||||
|
||||
Reference in New Issue
Block a user