fix(config): 修复切换充值渠道报错及补齐 peace_enabled 字段声明
- 在 DouyuConfigOut 与 DouyuConfigUpdate 中补齐 peace_enabled 声明与序列化 - 在 update_config 中使用 getattr(req, field, None) 安全读取属性,避免 AttributeError 导致 500 - 在 _config_out 中加入 peace_enabled 输出映射 - 增加切换充值渠道与配置更新的单元测试
This commit is contained in:
@@ -783,6 +783,7 @@ class DouyuConfigOut(BaseModel):
|
||||
esports_chicken_skin_id: str = "0"
|
||||
esports_firework_gift_id: str = "24767"
|
||||
esports_firework_skin_id: str = "3850"
|
||||
peace_enabled: bool = False
|
||||
xpd_act_alias: str = "20260623KDQFH"
|
||||
xpd_act_id: str = "46195"
|
||||
xpd_rid: str = "9263298"
|
||||
@@ -811,6 +812,7 @@ class DouyuConfigOut(BaseModel):
|
||||
"esports_chicken_skin_id": self.esports_chicken_skin_id,
|
||||
"esports_firework_gift_id": self.esports_firework_gift_id,
|
||||
"esports_firework_skin_id": self.esports_firework_skin_id,
|
||||
"peace_enabled": self.peace_enabled,
|
||||
"xpd_act_alias": self.xpd_act_alias,
|
||||
"xpd_act_id": self.xpd_act_id,
|
||||
"xpd_rid": self.xpd_rid,
|
||||
@@ -839,6 +841,7 @@ class DouyuConfigUpdate(BaseModel):
|
||||
esports_chicken_skin_id: str | None = None
|
||||
esports_firework_gift_id: str | None = None
|
||||
esports_firework_skin_id: str | None = None
|
||||
peace_enabled: bool | None = None
|
||||
xpd_act_alias: str | None = None
|
||||
xpd_act_id: str | None = None
|
||||
xpd_rid: str | None = None
|
||||
|
||||
Reference in New Issue
Block a user