Skip to content

很多的改进和优化

Compare
Choose a tag to compare
@ldqk ldqk released this 10 Jun 04:20
· 266 commits to master since this release
  1. 文章增加日期归档
  2. 移除加载模糊效果
  3. 优化广告匹配算法
  4. 移除码云图床
  5. rss增加全局开关
  6. 文章支持url直接跳转
  7. 新增访问记录导出功能
  8. 图片上传转码处理优化
  9. 文章分类支持三级分类
  10. 站内搜索优化
  11. 广告系统支持三级分类
  12. 文章标签选择优化
  13. 广告系统管理优化
  14. 模板变量支持嵌套和系统变量
  15. 支持取消屏蔽分类
  16. 留言评论分类菜单性能优化
  17. 数据库支持mysql/postgresql/mssql/sqlite自由切换
  18. 请求日志记录和性能计数器支持数据库/内存/文件的方式存储
  19. 一些bug修正
  20. 一些体验优化
  21. 一些性能优化

数据库期初脚本:

        [HttpGet("/Init"), MyAuthorize]
        public ActionResult Init([FromServices] DataContext db)
        {
            var comments = db.Comment.Where(c => c.ParentId == 0 || c.ParentId == null).ToList();
            comments.ForEach(c =>
            {
                c.ParentId = null;
                c.GroupTag = SnowFlake.NewId;
                c.Path = c.Id + "";
            });
            comments.Flatten().ForEach(c =>
            {
                c.GroupTag = c.Root().GroupTag;
                c.Path = c.Path(cc => cc.Id + "", ",");
            });

            var msgs = db.LeaveMessage.Where(c => c.ParentId == 0 || c.ParentId == null).ToList();
            msgs.ForEach(c =>
            {
                c.ParentId = null;
                c.GroupTag = SnowFlake.NewId;
                c.Path = c.Id + "";
            });
            msgs.Flatten().ForEach(c =>
            {
                c.GroupTag = c.Root().GroupTag;
                c.Path = c.Path(cc => cc.Id + "", ",");
            });

            var categories = db.Category.Where(c => c.ParentId == 0 || c.ParentId == null).ToList();
            categories.ForEach(c => c.Path = c.Id + "");
            categories.Flatten().ForEach(c => c.Path = c.Path(cc => cc.Id + "", ","));

            var menus = db.Menu.Where(c => c.ParentId == 0 || c.ParentId == null).ToList();
            menus.ForEach(c => c.Path = c.Id + "");
            menus.Flatten().ForEach(c => c.Path = c.Path(cc => cc.Id + "", ","));
            db.Comment.Where(c => c.GroupTag == null).DeleteFromQuery();
            db.LeaveMessage.Where(c => c.GroupTag == null).DeleteFromQuery();
            return Ok(db.SaveChanges());
        }