feat: Refactor tenant configuration management to use KV API

- Updated tenant web search and agent configuration endpoints to utilize a KV-style API for better flexibility.
- Enhanced the tenant handler to support generic key-value operations for retrieving and updating configurations.
- Improved frontend API calls to align with the new KV API structure, ensuring consistent data handling.
- Removed deprecated direct configuration endpoints for a cleaner and more maintainable codebase.
This commit is contained in:
wizardchen
2025-11-10 20:11:45 +08:00
parent 07a8c1de4c
commit ac8c8e9af2
8 changed files with 201 additions and 178 deletions
+3 -7
View File
@@ -222,14 +222,10 @@ func RegisterTenantRoutes(r *gin.RouterGroup, handler *handler.TenantHandler) {
tenantRoutes.DELETE("/:id", handler.DeleteTenant)
tenantRoutes.GET("", handler.ListTenants)
// Agent configuration management (tenant-level)
// Generic KV configuration management (tenant-level)
// Tenant ID is obtained from authentication context
tenantRoutes.GET("/agent-config", handler.GetTenantAgentConfig)
tenantRoutes.PUT("/agent-config", handler.UpdateTenantAgentConfig)
// Web search configuration management (tenant-level)
// Tenant ID is obtained from authentication context
tenantRoutes.GET("/web-search-config", handler.GetTenantWebSearchConfig)
tenantRoutes.PUT("/web-search-config", handler.UpdateTenantWebSearchConfig)
tenantRoutes.GET("/kv/:key", handler.GetTenantKV)
tenantRoutes.PUT("/kv/:key", handler.UpdateTenantKV)
}
}