From ac17367da4f1877024b2cd943cd60f4fe3a62118 Mon Sep 17 00:00:00 2001 From: touale <136764239@qq.com> Date: Fri, 27 Feb 2026 09:49:15 +0800 Subject: [PATCH 1/2] chore: remove renovate.json --- renovate.json | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 renovate.json diff --git a/renovate.json b/renovate.json deleted file mode 100644 index c7a01cb..0000000 --- a/renovate.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": [ - "config:recommended", - ":enablePreCommit" - ] -} From 0de764a8cf0c617667c8b6f2b62805293aba7ab5 Mon Sep 17 00:00:00 2001 From: touale <136764239@qq.com> Date: Fri, 6 Mar 2026 16:21:36 +0800 Subject: [PATCH 2/2] feat: add api_prefix option to on_request --- src/framex/plugin/on.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/framex/plugin/on.py b/src/framex/plugin/on.py index b5dbfc6..361ee67 100644 --- a/src/framex/plugin/on.py +++ b/src/framex/plugin/on.py @@ -30,10 +30,11 @@ def decorator(cls: type) -> type: if getattr(func, "_on_request", False): call_type = func.__expose__call_type path = func.__expose_path__ + api_prefix = func.__api_prefix if not path: call_type = ApiType.FUNC - elif not path.startswith(API_STR): + elif api_prefix and not path.startswith(API_STR): path = f"{API_STR}{path}" if path.startswith("/") else f"{API_STR}/{path}" params = extract_method_params(func) @@ -64,7 +65,11 @@ def decorator(cls: type) -> type: def on_request( - path: str | None = None, methods: list[str] | None = None, call_type: ApiType = ApiType.HTTP, stream: bool = False + path: str | None = None, + methods: list[str] | None = None, + call_type: ApiType = ApiType.HTTP, + stream: bool = False, + api_prefix: bool = True, ) -> Callable: if methods is None: methods = ["GET"] @@ -96,6 +101,7 @@ def wrapper(func: Callable) -> Callable: func.__expose_methods_ = methods # type: ignore [attr-defined] func.__expose__call_type = call_type # type: ignore [attr-defined] func.__expose_stream = stream # type: ignore [attr-defined] + func.__api_prefix = api_prefix # type: ignore [attr-defined] return func return wrapper