add 站点管理命令

This commit is contained in:
jxxghp
2023-06-14 16:48:55 +08:00
parent 0b6a52f788
commit c726864412
6 changed files with 90 additions and 5 deletions

View File

@ -25,6 +25,12 @@ class Sites:
return True, "新增站点成功"
return False, "站点已存在"
def get(self, sid: int):
"""
查询单个站点
"""
return Site.get(self._db, sid)
def list(self) -> List[Site]:
"""
获取站点列表
@ -37,6 +43,12 @@ class Sites:
"""
return Site.get_actives(self._db)
def delete(self, sid: int):
"""
删除站点
"""
return Site.delete(self._db, sid)
def get_by_domain(self, domain: str) -> Site:
"""
按域名获取站点