feat: record and show systemlog, admin delete log

This commit is contained in:
2022-03-26 02:49:18 +08:00
parent 59714bfbef
commit ce3379c5ae
5 changed files with 84 additions and 9 deletions

View File

@@ -179,11 +179,9 @@ impl Post {
}
pub async fn get(db: &Db, rconn: &RdsConn, id: i32) -> QueryResult<Self> {
// 注意即使is_deleted也应该缓存和返回
let mut cacher = PostCache::init(&rconn);
if let Some(p) = cacher.get(&id).await {
if p.is_deleted {
return Err(diesel::result::Error::NotFound);
}
Ok(p)
} else {
let p = Self::_get(db, id).await?;