代码片段管理工具: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"]
|
||||
4
CodeSnippetRofi/entity/result.py
Normal file
4
CodeSnippetRofi/entity/result.py
Normal file
@@ -0,0 +1,4 @@
|
||||
class ActionResult:
|
||||
def __init__(self, ok: bool, message: str):
|
||||
self.ok = ok
|
||||
self.message = message
|
||||
Reference in New Issue
Block a user