54 lines
1.5 KiB
Python
54 lines
1.5 KiB
Python
|
|
#
|
||
|
|
# Copyright 2025 The InfiniFlow Authors. All Rights Reserved.
|
||
|
|
#
|
||
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||
|
|
# you may not use this file except in compliance with the License.
|
||
|
|
# You may obtain a copy of the License at
|
||
|
|
#
|
||
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||
|
|
#
|
||
|
|
# Unless required by applicable law or agreed to in writing, software
|
||
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
|
# See the License for the specific language governing permissions and
|
||
|
|
# limitations under the License.
|
||
|
|
#
|
||
|
|
|
||
|
|
from typing import Optional, List, Dict, Any
|
||
|
|
from pydantic import BaseModel, Field
|
||
|
|
|
||
|
|
|
||
|
|
class CreateSearchRequest(BaseModel):
|
||
|
|
"""创建搜索应用请求"""
|
||
|
|
name: str
|
||
|
|
description: Optional[str] = ""
|
||
|
|
|
||
|
|
|
||
|
|
class UpdateSearchRequest(BaseModel):
|
||
|
|
"""更新搜索应用请求"""
|
||
|
|
search_id: str
|
||
|
|
name: str
|
||
|
|
search_config: Dict[str, Any]
|
||
|
|
tenant_id: str
|
||
|
|
description: Optional[str] = None
|
||
|
|
|
||
|
|
|
||
|
|
class DeleteSearchRequest(BaseModel):
|
||
|
|
"""删除搜索应用请求"""
|
||
|
|
search_id: str
|
||
|
|
|
||
|
|
|
||
|
|
class ListSearchAppsQuery(BaseModel):
|
||
|
|
"""列出搜索应用查询参数"""
|
||
|
|
keywords: Optional[str] = ""
|
||
|
|
page: Optional[int] = 0
|
||
|
|
page_size: Optional[int] = 0
|
||
|
|
orderby: Optional[str] = "create_time"
|
||
|
|
desc: Optional[str] = "true"
|
||
|
|
|
||
|
|
|
||
|
|
class ListSearchAppsBody(BaseModel):
|
||
|
|
"""列出搜索应用请求体"""
|
||
|
|
owner_ids: Optional[List[str]] = []
|
||
|
|
|