rebuild(migration): validate local legacy cutover
This commit is contained in:
@@ -210,16 +210,16 @@ class AccountService:
|
||||
return None
|
||||
try:
|
||||
payload = json.loads(self._cipher.decrypt(str(row["encrypted_payload"])))
|
||||
return BirthProfile(
|
||||
birth_date=str(payload["birth_date"]),
|
||||
birth_time=str(payload["birth_time"]),
|
||||
gender=str(payload["gender"]),
|
||||
updated_at=datetime.fromisoformat(str(row["updated_at"])),
|
||||
)
|
||||
except (ValueError, json.JSONDecodeError, KeyError) as exc:
|
||||
raise BusinessError(
|
||||
"profile_unavailable", "个人资料暂时无法读取,请联系管理员。"
|
||||
) from exc
|
||||
return BirthProfile(
|
||||
birth_date=str(payload["birth_date"]),
|
||||
birth_time=str(payload["birth_time"]),
|
||||
gender=str(payload["gender"]),
|
||||
updated_at=datetime.fromisoformat(str(row["updated_at"])),
|
||||
)
|
||||
|
||||
def save_profile(
|
||||
self, user_id: int, birth_date: date, birth_time: str, gender: str
|
||||
|
||||
@@ -68,7 +68,6 @@ class MarketSnapshotService:
|
||||
history = [json.loads(str(row["payload_json"])) for row in rows]
|
||||
sentiment = calculate_sentiment(snapshot, history)
|
||||
snapshot["sentiment"] = sentiment
|
||||
snapshot.update(snapshot["overview"])
|
||||
snapshot["temperature"] = sentiment["score"]
|
||||
observed_at = datetime.combine(
|
||||
date.fromisoformat(trade_date), time(15), tzinfo=SHANGHAI
|
||||
@@ -144,7 +143,6 @@ class MarketSnapshotService:
|
||||
history = [json.loads(str(row["payload_json"])) for row in rows]
|
||||
sentiment = calculate_sentiment(snapshot, history)
|
||||
snapshot["sentiment"] = sentiment
|
||||
snapshot.update(snapshot["overview"])
|
||||
snapshot["temperature"] = sentiment["score"]
|
||||
observed_at = clock.isoformat(timespec="seconds")
|
||||
with self._database.transaction() as connection:
|
||||
|
||||
Reference in New Issue
Block a user