fix plugin api

This commit is contained in:
jxxghp
2023-07-23 09:42:30 +08:00
parent 629f8036ab
commit c21aed693f
6 changed files with 262 additions and 6 deletions

View File

@ -1,6 +1,6 @@
from abc import ABCMeta, abstractmethod
from pathlib import Path
from typing import Any, List, Dict
from typing import Any, List, Dict, Tuple
from app.chain import ChainBase
from app.core.config import settings
@ -74,6 +74,20 @@ class _PluginBase(metaclass=ABCMeta):
"""
pass
@abstractmethod
def get_form(self) -> Tuple[List[dict], Dict[str, Any]]:
"""
拼装插件配置页面需要返回两块数据1、页面配置2、数据结构
"""
pass
@abstractmethod
def get_page(self) -> List[dict]:
"""
拼装插件详情页面,需要返回页面配置,同时附带数据
"""
pass
@abstractmethod
def stop_service(self):
"""