1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- from abc import ABC, abstractmethod
- from models.process_data import ProcessData
- class IDataStore(ABC):
- """
- 定义数据保存接口
- """
- @abstractmethod
- def insert_collect_data(self,
- url: str,
- keyword: str,
- content: str,
- is_batch=True) -> None:
- raise NotImplementedError("insert 应由子类重写。")
- @abstractmethod
- def save_collect_data(self, is_force=False):
- raise NotImplementedError("save 应由子类重写。")
- @abstractmethod
- def query_urls_to_process(self):
- raise NotImplementedError("query_to_process 应由子类重写。")
- @abstractmethod
- def query_one_collect_by_url(self, url):
- raise NotImplementedError("query_one_collect_by_url 应由子类重写。")
- @abstractmethod
- def query_one_process_by_no(self, no):
- raise NotImplementedError("query_one_process_by_no 应由子类重写。")
- @abstractmethod
- def insert_process_data(self, data: ProcessData):
- raise NotImplementedError("insert_process_data 应由子类重写。")
- @abstractmethod
- def save_process_data(self, is_force=False):
- raise NotImplementedError("save_process_data 应由子类重写。")
- @abstractmethod
- def set_process_other_urls(self, url, other_urls: str):
- raise NotImplementedError("save_process_data 应由子类重写。")
- @abstractmethod
- def query_to_send(self):
- raise NotImplementedError("query_to_send 应由子类重写。")
- @abstractmethod
- def set_send(self, no: str):
- raise NotImplementedError("set_send 应由子类重写。")
- @abstractmethod
- def get_email_by_area(self, area: str):
- raise NotImplementedError("get_email_by_area 应由子类重写。")
|