config.py 915 B

123456789101112131415161718192021222324252627282930
  1. # This Python file uses the following encoding: utf-8
  2. # @author runhey
  3. # github https://github.com/runhey
  4. from enum import Enum
  5. from pydantic import BaseModel, Field
  6. from tasks.Component.config_base import ConfigBase, Time
  7. from tasks.Component.config_scheduler import Scheduler
  8. class Strategy(str, Enum):
  9. Majority = 'frog_majority'
  10. Minority = 'frog_minority'
  11. Bilibili = 'frog_bilibili'
  12. Dashen = 'frog_dashen'
  13. Oas = 'frog_oas'
  14. AlwaysRed = 'frog_always_red'
  15. AlwaysBlue = 'frog_always_blue'
  16. class FrogBossConfig(ConfigBase):
  17. before_end_frog: Time = Field(default=Time(0, 15, 0), description='before_end_frog_help')
  18. strategy_frog: Strategy = Field(default=Strategy.Majority, description='strategy_frog_help')
  19. class FrogBoss(ConfigBase):
  20. scheduler: Scheduler = Field(default_factory=Scheduler)
  21. frog_boss_config: FrogBossConfig = Field(default_factory=FrogBossConfig)