public ActionResult BlogDelete(Guid id) { Blog blog = BlogDataSvc.GetByID(id); if (blog.OwnerID != CurrentUser.ID) { return(Json(new { msg = "小伙子你想干嘛" })); } BlogDataSvc.DeleteByID(id); return(Json(new { msg = "done" })); }
public ActionResult BlogDelete(Guid id) { Blog blog = BlogDataSvc.GetByID(id); BlogDataSvc.DeleteByID(id); SysMsg msg = new SysMsg(); msg.Date = DateTime.Now; msg.Title = "你的" + Enum.GetName(typeof(EnumObjectType), 1) + "被删除"; msg.Msg = blog.Title.MaxByteLength(30); string key = MyRedisKeys.Pre_SysMsg + blog.OwnerID; MyRedisDB.SetAdd(key, msg); return(Json(new { msg = "done" })); }