更新 providers

This commit is contained in:
2025-11-02 03:15:18 +08:00
parent f689e08a1d
commit 723046a876
20 changed files with 160 additions and 249 deletions

View File

@@ -4,6 +4,7 @@ __all__ = [
'SM2Algorithm',
]
registry = {
algorithms = {
"SM-2": SM2Algorithm,
"supermemo2": SM2Algorithm,
}

View File

@@ -0,0 +1,33 @@
import heurams.services.timer as timer
from typing import TypedDict
class BaseAlgorithm:
algo_name = "BaseAlgorithm"
class AlgodataDict(TypedDict):
efactor: float
real_rept: int
rept: int
interval: int
last_date: int
next_date: int
is_activated: int
last_modify: float
defaults = {
'real_rept': 0,
'rept': 0,
'interval': 0,
'last_date': 0,
'next_date': 0,
'is_activated': 0,
'last_modify': timer.get_timestamp()
}
@classmethod
def revisor(cls, algodata: dict, feedback: int = 5, is_new_activation: bool = False):
pass
@classmethod
def is_due(cls, algodata):
return 1

View File

@@ -1,7 +1,8 @@
from .base import BaseAlgorithm
import heurams.services.timer as timer
from typing import TypedDict
class SM2Algorithm:
class SM2Algorithm(BaseAlgorithm):
algo_name = "SM-2"
class AlgodataDict(TypedDict):