feat: code by huntun

This commit is contained in:
Junyan Qin
2025-08-06 21:57:43 +08:00
parent ed869f7e81
commit c0d56aa905
17 changed files with 2205 additions and 4 deletions

View File

@@ -93,7 +93,10 @@ class RouterGroup(abc.ABC):
return self.http_status(500, -2, str(e))
new_f = handler_error
new_f.__name__ = (self.name + rule).replace('/', '__')
# 为不同的HTTP方法生成不同的端点名称
methods = options.get('methods', ['GET'])
method_suffix = '_'.join(methods)
new_f.__name__ = (self.name + rule + '_' + method_suffix).replace('/', '__')
new_f.__doc__ = f.__doc__
self.quart_app.route(rule, **options)(new_f)