cleaner
This commit is contained in:
parent
72abef1092
commit
a603366427
@ -45,6 +45,12 @@ class LyricSearch(FastAPI):
|
|||||||
|
|
||||||
self.endpoint_name = "lyric_search"
|
self.endpoint_name = "lyric_search"
|
||||||
self.endpoint2_name = "lyric_cache_list"
|
self.endpoint2_name = "lyric_cache_list"
|
||||||
|
|
||||||
|
self.endpoints = {
|
||||||
|
"lyric_search": self.lyric_search_handler,
|
||||||
|
"lyric_cache_list": self.lyric_cache_list_handler,
|
||||||
|
}
|
||||||
|
|
||||||
self.acceptable_request_sources = [
|
self.acceptable_request_sources = [
|
||||||
"WEB",
|
"WEB",
|
||||||
"IRC-MS",
|
"IRC-MS",
|
||||||
@ -55,8 +61,8 @@ class LyricSearch(FastAPI):
|
|||||||
"LIMNORIA-SHARED"
|
"LIMNORIA-SHARED"
|
||||||
]
|
]
|
||||||
|
|
||||||
app.add_api_route(f"/{self.endpoint_name}/",self.lyric_search_handler, methods=["POST"])
|
for endpoint, handler in self.endpoints.items():
|
||||||
app.add_api_route(f"/{self.endpoint2_name}/",self.lyric_cache_list_handler, methods=["POST"]) # pylint: disable=trailing-whitespace
|
app.add_api_route(f"/{endpoint}/", handler, methods=["POST"])
|
||||||
|
|
||||||
async def lyric_cache_list_handler(self):
|
async def lyric_cache_list_handler(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user