-
Notifications
You must be signed in to change notification settings - Fork 367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat/seasearch: add wiki search api #6606
base: master
Are you sure you want to change the base?
Conversation
7cf89c8
to
16066c4
Compare
16066c4
to
cc03cd1
Compare
seahub/api2/utils.py
Outdated
@@ -313,6 +313,24 @@ def get_search_repos(username, org_id): | |||
|
|||
return repos | |||
|
|||
def get_search_wiki_ids(username, org_id): | |||
owned_wikis, shared_wikis, group_wikis, public_wikis = get_user_repos(username, org_id=org_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
变量名不对,现在查出来的是资料库,还不是wiki, 下面最好也别用wiki_id,因为实际上并不是wiki_id 而是repo_id
seahub/api2/endpoints/wiki2.py
Outdated
error_msg = 'search_wiki invalid.' | ||
return api_error(status.HTTP_400_BAD_REQUEST, error_msg) | ||
|
||
if search_wiki == 'all': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这部分可以去掉了
89d6463
to
99538fa
Compare
seahub/api2/endpoints/wiki2.py
Outdated
@@ -21,25 +21,29 @@ | |||
from seaserv import seafile_api, edit_repo | |||
from pysearpc import SearpcError | |||
from django.utils.translation import gettext as _ | |||
from django.core.cache import cache |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个没用到了吧,下面还有其他没用到的也删一下
seahub/api2/utils.py
Outdated
@@ -313,6 +313,24 @@ def get_search_repos(username, org_id): | |||
|
|||
return repos | |||
|
|||
def get_search_wiki_ids(username, org_id): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
去掉
seahub/wiki2/utils.py
Outdated
@@ -22,6 +22,10 @@ | |||
WIKI_CONFIG_PATH = '_Internal/Wiki' | |||
WIKI_CONFIG_FILE_NAME = 'index.json' | |||
|
|||
SEARCH_WIKIS_LIMIT = 200 | |||
RELATED_WIKIS_PREFIX = 'RELATED_WIKIS_' | |||
RELATED_WIKIS_CACHE_TIMEOUT = 2 * 60 * 60 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
去掉
950a347
to
405aa9c
Compare
No description provided.