代码片段管理工具:rofi前端+Java守护进程
This commit is contained in:
19
CodeSnippetRofi/entity/response.py
Normal file
19
CodeSnippetRofi/entity/response.py
Normal file
@@ -0,0 +1,19 @@
|
||||
import json
|
||||
|
||||
|
||||
class SearchResponse:
|
||||
def __init__(self, response: dict):
|
||||
self.status = response["status"]
|
||||
self.data = [SearchResponse.SearchData(dict(r)) for r in json.loads(response["data"])]
|
||||
|
||||
class SearchData:
|
||||
def __init__(self, data: dict):
|
||||
self.id = data["id"]
|
||||
self.name = data["name"]
|
||||
self.path = data["path"]
|
||||
self.score = data["score"]
|
||||
|
||||
class NormalResponse:
|
||||
def __init__(self, response: dict):
|
||||
self.status = response["status"]
|
||||
self.data = response["data"]
|
||||
Reference in New Issue
Block a user