MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / get_accounts

Function get_accounts

src/database/crud.py:92–118  ·  view source on GitHub ↗

获取账户列表(支持分页、筛选)

(
    db: Session,
    skip: int = 0,
    limit: int = 100,
    email_service: Optional[str] = None,
    status: Optional[str] = None,
    search: Optional[str] = None
)

Source from the content-addressed store, hash-verified

90
91
92def get_accounts(
93 db: Session,
94 skip: int = 0,
95 limit: int = 100,
96 email_service: Optional[str] = None,
97 status: Optional[str] = None,
98 search: Optional[str] = None
99) -> List[Account]:
100 """获取账户列表(支持分页、筛选)"""
101 query = db.query(Account)
102
103 if email_service:
104 query = query.filter(Account.email_service == email_service)
105
106 if status:
107 query = query.filter(Account.status == status)
108
109 if search:
110 search_filter = or_(
111 Account.email.ilike(f"%{search}%"),
112 Account.account_id.ilike(f"%{search}%"),
113 Account.workspace_id.ilike(f"%{search}%")
114 )
115 query = query.filter(search_filter)
116
117 query = query.order_by(desc(Account.created_at)).offset(skip).limit(limit)
118 return query.all()
119
120
121def update_account(

Callers

nothing calls this directly

Calls 3

allMethod · 0.80
queryMethod · 0.45
filterMethod · 0.45

Tested by

no test coverage detected