Skip to content

Commit

Permalink
feat: 简书用户数据添加状态字段
Browse files Browse the repository at this point in the history
  • Loading branch information
FHU-yezi committed Mar 6, 2024
1 parent b88fb15 commit 67b1908
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions models/jianshu_user.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from datetime import datetime
from enum import Enum
from typing import Any, Dict, List, Optional

from jkit._constraints import PositiveInt, UserName, UserSlug, UserUploadedUrl
Expand All @@ -10,8 +11,14 @@
COLLECTION = DB.jianshu_users


class JianshuUserStatus(Enum):
NORMAL = "NORMAL"
INACCESSABLE = "INACCESSIBLE"


class JianshuUser(Documemt):
slug: UserSlug
status: JianshuUserStatus
updated_at: datetime
id: Optional[PositiveInt]
name: Optional[UserName]
Expand Down Expand Up @@ -47,6 +54,7 @@ async def insert_or_update_one(
await COLLECTION.insert_one(
JianshuUser(
slug=slug,
status=JianshuUserStatus.NORMAL,
updated_at=updated_at,
id=id,
name=name,
Expand Down

0 comments on commit 67b1908

Please sign in to comment.