RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
Unified user_service.py (#4606)
Zhichang Yu240e7d7c22b5
diff --git a/api/db/services/user_service.py b/api/db/services/user_service.pyindex 44cafb87ac..04789fd165 100644--- a/api/db/services/user_service.py+++ b/api/db/services/user_service.py@@ -13,6 +13,7 @@# See the License for the specific language governing permissions and# limitations under the License.#+import hashlibfrom datetime import datetimeimport peewee@@ -24,6 +25,7 @@ from api.db.db_models import User, Tenantfrom api.db.services.common_service import CommonServicefrom api.utils import get_uuid, current_timestamp, datetime_formatfrom api.db import StatusEnum+from rag.settings import MINIOclass UserService(CommonService):@@ -48,6 +50,12 @@ class UserService(CommonService):else:return None+ @classmethod+ @DB.connection_context()+ def user_gateway(cls, tenant_id):+ hashobj = hashlib.sha256(tenant_id.encode("utf-8"))+ return int(hashobj.hexdigest(), 16)%len(MINIO)+@classmethod@DB.connection_context()def save(cls, **kwargs):