数据库新增原神画片开关字段 (KimigaiiWuyi/GenshinUID#563)

This commit is contained in:
Wuyi无疑 2023-06-30 00:33:18 +08:00
parent 9905c787c5
commit 81d015f3d8
3 changed files with 19 additions and 12 deletions

View File

@ -761,20 +761,24 @@ class RoleCalendar(TypedDict):
is_subscribe: bool
class RoleCalendarList(TypedDict):
calendar_role: List[RoleCalendar]
MonthlyRoleCalendar = TypedDict(
'MonthlyRoleCalendar',
{
'1': List[RoleCalendar],
'2': List[RoleCalendar],
'3': List[RoleCalendar],
'4': List[RoleCalendar],
'5': List[RoleCalendar],
'6': List[RoleCalendar],
'7': List[RoleCalendar],
'8': List[RoleCalendar],
'9': List[RoleCalendar],
'10': List[RoleCalendar],
'11': List[RoleCalendar],
'12': List[RoleCalendar],
'1': RoleCalendarList,
'2': RoleCalendarList,
'3': RoleCalendarList,
'4': RoleCalendarList,
'5': RoleCalendarList,
'6': RoleCalendarList,
'7': RoleCalendarList,
'8': RoleCalendarList,
'9': RoleCalendarList,
'10': RoleCalendarList,
'11': RoleCalendarList,
'12': RoleCalendarList,
},
)

View File

@ -46,6 +46,7 @@ class SQLA:
'ALTER TABLE GsUser ADD COLUMN device_id TEXT',
'ALTER TABLE GsUser ADD COLUMN sr_sign_switch TEXT DEFAULT "off"',
'ALTER TABLE GsUser ADD COLUMN sr_push_switch TEXT DEFAULT "off"',
'ALTER TABLE GsUser ADD COLUMN draw_switch TEXT DEFAULT "off"',
'ALTER TABLE GsCache ADD COLUMN sr_uid TEXT',
]
async with self.async_session() as session:
@ -334,6 +335,7 @@ class SQLA:
sign_switch='off',
push_switch='off',
bbs_switch='off',
draw_switch='off',
region=SERVER.get(uid[0], 'cn_gf01') if uid else None,
sr_region=SR_SERVER.get(sr_uid[0], None)
if sr_uid

View File

@ -28,6 +28,7 @@ class GsUser(SQLModel, table=True):
push_switch: str = Field(title='全局推送开关')
sign_switch: str = Field(title='自动签到')
bbs_switch: str = Field(title='自动米游币')
draw_switch: str = Field(title='自动留影叙佳期')
sr_push_switch: str = Field(title='星铁全局推送开关')
sr_sign_switch: str = Field(title='星铁自动签到')
status: Optional[str] = Field(default=None, title='状态')