mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-02 12:05:54 +00:00
feat: 持久化和 web 接口基础架构
This commit is contained in:
0
pkg/api/http/controller/groups/__init__.py
Normal file
0
pkg/api/http/controller/groups/__init__.py
Normal file
21
pkg/api/http/controller/groups/log.py
Normal file
21
pkg/api/http/controller/groups/log.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import traceback
|
||||
|
||||
import quart
|
||||
|
||||
from .....core import app
|
||||
from .. import group
|
||||
|
||||
|
||||
@group.group_class('log', '/api/v1/log')
|
||||
class LogRouterGroup(group.RouterGroup):
|
||||
|
||||
async def initialize(self) -> None:
|
||||
@self.route('', methods=['GET'])
|
||||
async def _() -> str:
|
||||
return self.success(
|
||||
data={
|
||||
"logs": self.ap.log_cache.get_all_logs()
|
||||
}
|
||||
)
|
||||
Reference in New Issue
Block a user