获取当前签到状态。返回 {"type", "start_time"} 或 None。
()
| 34 | |
| 35 | @staticmethod |
| 36 | def get_state() -> Optional[dict]: |
| 37 | """获取当前签到状态。返回 {"type", "start_time"} 或 None。""" |
| 38 | if not STATE_FILE.exists(): |
| 39 | return None |
| 40 | |
| 41 | try: |
| 42 | with open(STATE_FILE, 'r', encoding='utf-8') as f: |
| 43 | state = json.load(f) |
| 44 | logger.debug(f"[库洛签到·签到状态] 读取状态文件: {state}") |
| 45 | return state |
| 46 | except Exception as e: |
| 47 | logger.error(f"[库洛签到·签到状态] 读取状态文件失败: {e}") |
| 48 | return None |
| 49 | |
| 50 | @staticmethod |
| 51 | def set_state(sign_type: SignType): |
no outgoing calls
no test coverage detected