Skip to content

Commit fbda130

Browse files
committed
feat: add keyword search for uncategorized apps
1 parent 5716ba2 commit fbda130

2 files changed

Lines changed: 26 additions & 5 deletions

File tree

src/backend/bisheng/api/services/workflow.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,13 @@ def add_frequently_used_flows(cls, user: UserPayload, user_link_type: str, type_
410410
return is_new
411411

412412
@classmethod
413-
def get_uncategorized_flows(cls, user: UserPayload, page: int = 1, page_size: int = 8) -> tuple[list, int]:
413+
def get_uncategorized_flows(
414+
cls,
415+
user: UserPayload,
416+
page: int = 1,
417+
page_size: int = 8,
418+
keyword: Optional[str] = None,
419+
) -> tuple[list, int]:
414420
"""
415421
Get a list of unsorted skills
416422
"""
@@ -427,7 +433,17 @@ def get_uncategorized_flows(cls, user: UserPayload, page: int = 1, page_size: in
427433

428434
# Get a list of skills visible to the user
429435
if user.is_admin():
430-
data, _ = FlowDao.get_all_apps(None, FlowStatus.ONLINE.value, None, None, None, None, flow_ids_not_in, 0, 0)
436+
data, _ = FlowDao.get_all_apps(
437+
keyword,
438+
FlowStatus.ONLINE.value,
439+
None,
440+
None,
441+
None,
442+
None,
443+
flow_ids_not_in,
444+
0,
445+
0,
446+
)
431447
else:
432448
user_role = UserRoleDao.get_user_roles(user.user_id)
433449
role_ids = [role.role_id for role in user_role]
@@ -436,7 +452,7 @@ def get_uncategorized_flows(cls, user: UserPayload, page: int = 1, page_size: in
436452
flow_id_extra = []
437453
if role_access:
438454
flow_id_extra = [access.third_id for access in role_access]
439-
data, _ = FlowDao.get_all_apps(None, FlowStatus.ONLINE.value, None, None, user.user_id, flow_id_extra,
455+
data, _ = FlowDao.get_all_apps(keyword, FlowStatus.ONLINE.value, None, None, user.user_id, flow_id_extra,
440456
flow_ids_not_in, 0, 0)
441457
data = cls.filter_supported_apps(data)
442458
total = len(data)

src/backend/bisheng/workstation/api/endpoints/apps.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,13 @@ def delete_frequently_used_chat(
4949

5050

5151
@router.get('/app/uncategorized')
52-
def get_uncategorized_chat(login_user=LoginUserDep, page: Optional[int] = 1, limit: Optional[int] = 8):
53-
data, _ = WorkFlowService.get_uncategorized_flows(login_user, page, limit)
52+
def get_uncategorized_chat(
53+
login_user=LoginUserDep,
54+
page: Optional[int] = 1,
55+
limit: Optional[int] = 8,
56+
keyword: Optional[str] = None,
57+
):
58+
data, _ = WorkFlowService.get_uncategorized_flows(login_user, page, limit, keyword)
5459
return resp_200(data=data)
5560

5661

0 commit comments

Comments
 (0)