Function get_auth_snapshot_cached
Source pub async fn get_auth_snapshot_cached(
state: &AppState,
member_id: i32,
) -> Result<Member, AppError>
Expand description
获取鉴权快照
先从缓存查询,未命中时查数据库并回填缓存。
state: 应用状态(持有缓存实例和数据库连接池)
member_id: 组员 ID
§返回值
返回组员快照(含岗位 ID 列表)。
§Errors
AppError::business("组员不存在喵") — ID 不存在
AppError::Database — 查询失败