Browse Source

精简数据库

懒得勤快 6 years ago
parent
commit
9e58fbce44

+ 0 - 22
src/Masuit.MyBlogs.Core/Controllers/PostController.cs

@@ -552,18 +552,6 @@ namespace Masuit.MyBlogs.Core.Controllers
                 return ResultData(null, false, "文章已经被删除!");
             }
 
-            if (post.IsWordDocument)
-            {
-                try
-                {
-                    System.IO.File.Delete(Path.Combine(HostEnvironment.WebRootPath + "/upload", post.ResourceName));
-                    Directory.Delete(Path.Combine(HostEnvironment.WebRootPath + "/upload", Path.GetFileNameWithoutExtension(post.ResourceName)), true);
-                }
-                catch (IOException)
-                {
-                }
-            }
-
             var srcs = post.Content.MatchImgSrcs();
             foreach (var path in srcs)
             {
@@ -695,11 +683,6 @@ namespace Masuit.MyBlogs.Core.Controllers
                 post.Label = post.Label.Replace(",", ",");
             }
 
-            if (!post.IsWordDocument)
-            {
-                post.ResourceName = null;
-            }
-
             if (string.IsNullOrEmpty(post.ProtectContent) || post.ProtectContent.Equals("null", StringComparison.InvariantCultureIgnoreCase))
             {
                 post.ProtectContent = null;
@@ -803,11 +786,6 @@ namespace Masuit.MyBlogs.Core.Controllers
                 post.Label = post.Label.Replace(",", ",");
             }
 
-            if (!post.IsWordDocument)
-            {
-                post.ResourceName = null;
-            }
-
             if (string.IsNullOrEmpty(post.ProtectContent) || post.ProtectContent.Equals("null", StringComparison.InvariantCultureIgnoreCase))
             {
                 post.ProtectContent = null;

+ 0 - 60
src/Masuit.MyBlogs.Core/Masuit.MyBlogs.Core.xml

@@ -5492,16 +5492,6 @@
             分类id
             </summary>
         </member>
-        <member name="P:Masuit.MyBlogs.Core.Models.DTO.PostInputDto.ResourceName">
-            <summary>
-            资源名
-            </summary>
-        </member>
-        <member name="P:Masuit.MyBlogs.Core.Models.DTO.PostInputDto.IsWordDocument">
-            <summary>
-            是否是Word文档
-            </summary>
-        </member>
         <member name="P:Masuit.MyBlogs.Core.Models.DTO.PostInputDto.Email">
             <summary>
             作者邮箱
@@ -5662,16 +5652,6 @@
             是否置顶
             </summary>
         </member>
-        <member name="P:Masuit.MyBlogs.Core.Models.DTO.PostOutputDto.ResourceName">
-            <summary>
-            资源名
-            </summary>
-        </member>
-        <member name="P:Masuit.MyBlogs.Core.Models.DTO.PostOutputDto.IsWordDocument">
-            <summary>
-            是否是Word文档
-            </summary>
-        </member>
         <member name="P:Masuit.MyBlogs.Core.Models.DTO.PostOutputDto.Email">
             <summary>
             作者邮箱
@@ -6407,16 +6387,6 @@
             分类id
             </summary>
         </member>
-        <member name="P:Masuit.MyBlogs.Core.Models.Entity.Post.ResourceName">
-            <summary>
-            资源名
-            </summary>
-        </member>
-        <member name="P:Masuit.MyBlogs.Core.Models.Entity.Post.IsWordDocument">
-            <summary>
-            是否是Word文档
-            </summary>
-        </member>
         <member name="P:Masuit.MyBlogs.Core.Models.Entity.Post.Email">
             <summary>
             作者邮箱
@@ -6537,16 +6507,6 @@
             文章id
             </summary>
         </member>
-        <member name="P:Masuit.MyBlogs.Core.Models.Entity.PostHistoryVersion.ResourceName">
-            <summary>
-            资源名
-            </summary>
-        </member>
-        <member name="P:Masuit.MyBlogs.Core.Models.Entity.PostHistoryVersion.IsWordDocument">
-            <summary>
-            是否是Word文档
-            </summary>
-        </member>
         <member name="P:Masuit.MyBlogs.Core.Models.Entity.PostHistoryVersion.Email">
             <summary>
             作者邮箱
@@ -7367,16 +7327,6 @@
             是否置顶
             </summary>
         </member>
-        <member name="P:Masuit.MyBlogs.Core.Models.ViewModel.PostDataModel.ResourceName">
-            <summary>
-            资源名
-            </summary>
-        </member>
-        <member name="P:Masuit.MyBlogs.Core.Models.ViewModel.PostDataModel.IsWordDocument">
-            <summary>
-            是否是Word文档
-            </summary>
-        </member>
         <member name="P:Masuit.MyBlogs.Core.Models.ViewModel.PostDataModel.Email">
             <summary>
             作者邮箱
@@ -7462,16 +7412,6 @@
             是否置顶
             </summary>
         </member>
-        <member name="P:Masuit.MyBlogs.Core.Models.ViewModel.PostViewModel.ResourceName">
-            <summary>
-            资源名
-            </summary>
-        </member>
-        <member name="P:Masuit.MyBlogs.Core.Models.ViewModel.PostViewModel.IsWordDocument">
-            <summary>
-            是否是Word文档
-            </summary>
-        </member>
         <member name="P:Masuit.MyBlogs.Core.Models.ViewModel.PostViewModel.Email">
             <summary>
             作者邮箱

+ 0 - 673
src/Masuit.MyBlogs.Core/Migrations/20190321050816_Init.Designer.cs

@@ -1,673 +0,0 @@
-// <auto-generated />
-using Masuit.MyBlogs.Core.Infrastructure;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Migrations;
-using System;
-
-namespace Masuit.MyBlogs.Core.Migrations
-{
-    [DbContext(typeof(DataContext))]
-    [Migration("20190321050816_Init")]
-    partial class Init
-    {
-        protected override void BuildTargetModel(ModelBuilder modelBuilder)
-        {
-#pragma warning disable 612, 618
-            modelBuilder
-                .HasAnnotation("ProductVersion", "2.2.3-servicing-35854")
-                .HasAnnotation("Relational:MaxIdentifierLength", 64);
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.Banner", b =>
-                {
-                    b.Property<int>("Id")
-                        .ValueGeneratedOnAdd();
-
-                    b.Property<string>("Description")
-                        .IsRequired()
-                        .HasMaxLength(255);
-
-                    b.Property<string>("ImageUrl")
-                        .IsRequired()
-                        .HasMaxLength(255);
-
-                    b.Property<int>("Status");
-
-                    b.Property<string>("Title")
-                        .IsRequired();
-
-                    b.Property<string>("Url")
-                        .IsRequired()
-                        .HasMaxLength(255);
-
-                    b.HasKey("Id");
-
-                    b.ToTable("Banner");
-                });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.Broadcast", b =>
-                {
-                    b.Property<int>("Id")
-                        .ValueGeneratedOnAdd();
-
-                    b.Property<string>("Email");
-
-                    b.Property<int>("Status");
-
-                    b.Property<int>("SubscribeType");
-
-                    b.Property<DateTime>("UpdateTime");
-
-                    b.Property<string>("ValidateCode");
-
-                    b.HasKey("Id");
-
-                    b.ToTable("Broadcast");
-                });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.Category", b =>
-                {
-                    b.Property<int>("Id")
-                        .ValueGeneratedOnAdd();
-
-                    b.Property<string>("Description");
-
-                    b.Property<string>("Name")
-                        .IsRequired()
-                        .HasMaxLength(64);
-
-                    b.Property<int>("Status");
-
-                    b.HasKey("Id");
-
-                    b.ToTable("Category");
-                });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.Comment", b =>
-                {
-                    b.Property<int>("Id")
-                        .ValueGeneratedOnAdd();
-
-                    b.Property<int>("AgainstCount");
-
-                    b.Property<string>("Browser")
-                        .HasMaxLength(255);
-
-                    b.Property<DateTime>("CommentDate");
-
-                    b.Property<string>("Content")
-                        .IsRequired();
-
-                    b.Property<string>("Email");
-
-                    b.Property<string>("IP");
-
-                    b.Property<bool>("IsMaster");
-
-                    b.Property<string>("NickName")
-                        .IsRequired()
-                        .HasMaxLength(24);
-
-                    b.Property<string>("OperatingSystem")
-                        .HasMaxLength(255);
-
-                    b.Property<int>("ParentId");
-
-                    b.Property<int>("PostId");
-
-                    b.Property<string>("QQorWechat");
-
-                    b.Property<int>("Status");
-
-                    b.Property<int>("VoteCount");
-
-                    b.HasKey("Id");
-
-                    b.HasIndex("PostId");
-
-                    b.ToTable("Comment");
-                });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.Donate", b =>
-                {
-                    b.Property<int>("Id")
-                        .ValueGeneratedOnAdd();
-
-                    b.Property<string>("Amount");
-
-                    b.Property<DateTime>("DonateTime");
-
-                    b.Property<string>("Email");
-
-                    b.Property<string>("EmailDisplay");
-
-                    b.Property<string>("NickName");
-
-                    b.Property<string>("QQorWechat");
-
-                    b.Property<string>("QQorWechatDisplay");
-
-                    b.Property<int>("Status");
-
-                    b.Property<string>("Via");
-
-                    b.HasKey("Id");
-
-                    b.ToTable("Donate");
-                });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.FastShare", b =>
-                {
-                    b.Property<int>("Id")
-                        .ValueGeneratedOnAdd();
-
-                    b.Property<string>("Link");
-
-                    b.Property<int>("Sort");
-
-                    b.Property<int>("Status");
-
-                    b.Property<string>("Title");
-
-                    b.HasKey("Id");
-
-                    b.ToTable("FastShare");
-                });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.InternalMessage", b =>
-                {
-                    b.Property<int>("Id")
-                        .ValueGeneratedOnAdd();
-
-                    b.Property<string>("Content");
-
-                    b.Property<string>("Link");
-
-                    b.Property<bool>("Read");
-
-                    b.Property<int>("Status");
-
-                    b.Property<DateTime>("Time");
-
-                    b.Property<string>("Title");
-
-                    b.HasKey("Id");
-
-                    b.ToTable("InternalMessage");
-                });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.LeaveMessage", b =>
-                {
-                    b.Property<int>("Id")
-                        .ValueGeneratedOnAdd();
-
-                    b.Property<string>("Browser")
-                        .HasMaxLength(255);
-
-                    b.Property<string>("Content")
-                        .IsRequired();
-
-                    b.Property<string>("Email");
-
-                    b.Property<string>("IP");
-
-                    b.Property<bool>("IsMaster");
-
-                    b.Property<string>("NickName")
-                        .IsRequired();
-
-                    b.Property<string>("OperatingSystem")
-                        .HasMaxLength(255);
-
-                    b.Property<int>("ParentId");
-
-                    b.Property<DateTime>("PostDate");
-
-                    b.Property<string>("QQorWechat");
-
-                    b.Property<int>("Status");
-
-                    b.HasKey("Id");
-
-                    b.ToTable("LeaveMessage");
-                });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.Links", b =>
-                {
-                    b.Property<int>("Id")
-                        .ValueGeneratedOnAdd();
-
-                    b.Property<bool>("Except");
-
-                    b.Property<string>("Name")
-                        .IsRequired();
-
-                    b.Property<bool>("Recommend");
-
-                    b.Property<int>("Status");
-
-                    b.Property<string>("Url")
-                        .IsRequired();
-
-                    b.HasKey("Id");
-
-                    b.ToTable("Links");
-                });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.LoginRecord", b =>
-                {
-                    b.Property<int>("Id")
-                        .ValueGeneratedOnAdd();
-
-                    b.Property<string>("IP");
-
-                    b.Property<DateTime>("LoginTime");
-
-                    b.Property<int>("LoginType");
-
-                    b.Property<string>("PhysicAddress");
-
-                    b.Property<string>("Province");
-
-                    b.Property<int>("Status");
-
-                    b.Property<int>("UserInfoId");
-
-                    b.HasKey("Id");
-
-                    b.HasIndex("UserInfoId");
-
-                    b.ToTable("LoginRecord");
-                });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.Menu", b =>
-                {
-                    b.Property<int>("Id")
-                        .ValueGeneratedOnAdd();
-
-                    b.Property<string>("Icon");
-
-                    b.Property<int>("MenuType");
-
-                    b.Property<string>("Name")
-                        .IsRequired();
-
-                    b.Property<bool>("NewTab");
-
-                    b.Property<int>("ParentId");
-
-                    b.Property<int>("Sort");
-
-                    b.Property<int>("Status");
-
-                    b.Property<string>("Url")
-                        .IsRequired();
-
-                    b.HasKey("Id");
-
-                    b.ToTable("Menu");
-                });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.Misc", b =>
-                {
-                    b.Property<int>("Id")
-                        .ValueGeneratedOnAdd();
-
-                    b.Property<string>("Content")
-                        .IsRequired();
-
-                    b.Property<DateTime>("ModifyDate");
-
-                    b.Property<DateTime>("PostDate");
-
-                    b.Property<int>("Status");
-
-                    b.Property<string>("Title")
-                        .IsRequired();
-
-                    b.HasKey("Id");
-
-                    b.ToTable("Misc");
-                });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.Notice", b =>
-                {
-                    b.Property<int>("Id")
-                        .ValueGeneratedOnAdd();
-
-                    b.Property<string>("Content")
-                        .IsRequired();
-
-                    b.Property<DateTime>("ModifyDate");
-
-                    b.Property<DateTime>("PostDate");
-
-                    b.Property<int>("Status");
-
-                    b.Property<string>("Title")
-                        .IsRequired();
-
-                    b.Property<int>("ViewCount");
-
-                    b.HasKey("Id");
-
-                    b.ToTable("Notice");
-                });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.Post", b =>
-                {
-                    b.Property<int>("Id")
-                        .ValueGeneratedOnAdd();
-
-                    b.Property<string>("Author")
-                        .IsRequired()
-                        .HasMaxLength(24);
-
-                    b.Property<double>("AverageViewCount");
-
-                    b.Property<int>("CategoryId");
-
-                    b.Property<string>("Content")
-                        .IsRequired();
-
-                    b.Property<string>("Email")
-                        .IsRequired()
-                        .IsUnicode(true);
-
-                    b.Property<string>("IP");
-
-                    b.Property<bool>("IsFixedTop");
-
-                    b.Property<bool>("IsWordDocument");
-
-                    b.Property<string>("Keyword")
-                        .HasMaxLength(256);
-
-                    b.Property<string>("Label")
-                        .HasMaxLength(256)
-                        .IsUnicode(true);
-
-                    b.Property<DateTime>("ModifyDate");
-
-                    b.Property<DateTime>("PostDate");
-
-                    b.Property<string>("ProtectContent");
-
-                    b.Property<string>("ResourceName");
-
-                    b.Property<int>("Status");
-
-                    b.Property<string>("Title")
-                        .IsRequired();
-
-                    b.Property<int>("TotalViewCount");
-
-                    b.Property<int>("VoteDownCount")
-                        .ValueGeneratedOnAddOrUpdate();
-
-                    b.Property<int>("VoteUpCount");
-
-                    b.HasKey("Id");
-
-                    b.HasIndex("CategoryId");
-
-                    b.ToTable("Post");
-                });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.PostAccessRecord", b =>
-                {
-                    b.Property<int>("Id")
-                        .ValueGeneratedOnAdd();
-
-                    b.Property<DateTime>("AccessTime");
-
-                    b.Property<int>("ClickCount");
-
-                    b.Property<int>("PostId");
-
-                    b.Property<int>("Status");
-
-                    b.HasKey("Id");
-
-                    b.HasIndex("PostId");
-
-                    b.ToTable("PostAccessRecord");
-                });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.PostHistoryVersion", b =>
-                {
-                    b.Property<int>("Id")
-                        .ValueGeneratedOnAdd();
-
-                    b.Property<int>("CategoryId");
-
-                    b.Property<string>("Content")
-                        .IsRequired();
-
-                    b.Property<string>("Email")
-                        .HasMaxLength(255);
-
-                    b.Property<bool>("IsWordDocument");
-
-                    b.Property<string>("Label")
-                        .HasMaxLength(255);
-
-                    b.Property<DateTime>("ModifyDate");
-
-                    b.Property<int>("PostId");
-
-                    b.Property<string>("ProtectContent");
-
-                    b.Property<string>("ResourceName");
-
-                    b.Property<int>("Status");
-
-                    b.Property<string>("Title")
-                        .IsRequired()
-                        .HasMaxLength(64);
-
-                    b.Property<int>("ViewCount");
-
-                    b.HasKey("Id");
-
-                    b.HasIndex("CategoryId");
-
-                    b.HasIndex("PostId");
-
-                    b.ToTable("PostHistoryVersion");
-                });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.SearchDetails", b =>
-                {
-                    b.Property<int>("Id")
-                        .ValueGeneratedOnAdd();
-
-                    b.Property<string>("IP");
-
-                    b.Property<string>("KeyWords")
-                        .IsRequired()
-                        .IsUnicode(true);
-
-                    b.Property<DateTime>("SearchTime");
-
-                    b.HasKey("Id");
-
-                    b.ToTable("SearchDetails");
-                });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.Seminar", b =>
-                {
-                    b.Property<int>("Id")
-                        .ValueGeneratedOnAdd();
-
-                    b.Property<string>("Description")
-                        .IsRequired();
-
-                    b.Property<int>("Status");
-
-                    b.Property<string>("SubTitle");
-
-                    b.Property<string>("Title")
-                        .IsRequired();
-
-                    b.HasKey("Id");
-
-                    b.ToTable("Seminar");
-                });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.SeminarPost", b =>
-                {
-                    b.Property<int>("SeminarId")
-                        .HasColumnName("Seminar_Id");
-
-                    b.Property<int>("PostId")
-                        .HasColumnName("Post_Id");
-
-                    b.HasKey("SeminarId", "PostId");
-
-                    b.HasIndex("PostId");
-
-                    b.ToTable("SeminarPost");
-                });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.SeminarPostHistoryVersion", b =>
-                {
-                    b.Property<int>("SeminarId")
-                        .HasColumnName("Seminar_Id");
-
-                    b.Property<int>("PostHistoryVersionId")
-                        .HasColumnName("PostHistoryVersion_Id");
-
-                    b.HasKey("SeminarId", "PostHistoryVersionId");
-
-                    b.HasIndex("PostHistoryVersionId");
-
-                    b.ToTable("SeminarPostHistoryVersion");
-                });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.SystemSetting", b =>
-                {
-                    b.Property<int>("Id")
-                        .ValueGeneratedOnAdd();
-
-                    b.Property<string>("Name")
-                        .IsRequired();
-
-                    b.Property<int>("Status");
-
-                    b.Property<string>("Value")
-                        .IsRequired();
-
-                    b.HasKey("Id");
-
-                    b.ToTable("SystemSetting");
-                });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.UserInfo", b =>
-                {
-                    b.Property<int>("Id")
-                        .ValueGeneratedOnAdd();
-
-                    b.Property<string>("AccessToken");
-
-                    b.Property<string>("Avatar");
-
-                    b.Property<string>("Email");
-
-                    b.Property<bool>("IsAdmin");
-
-                    b.Property<string>("NickName")
-                        .IsRequired();
-
-                    b.Property<string>("Password")
-                        .IsRequired();
-
-                    b.Property<string>("QQorWechat");
-
-                    b.Property<string>("SaltKey")
-                        .IsRequired();
-
-                    b.Property<int>("Status");
-
-                    b.Property<string>("Username")
-                        .IsRequired();
-
-                    b.HasKey("Id");
-
-                    b.ToTable("UserInfo");
-                });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.Comment", b =>
-                {
-                    b.HasOne("Masuit.MyBlogs.Core.Models.Entity.Post", "Post")
-                        .WithMany("Comment")
-                        .HasForeignKey("PostId")
-                        .OnDelete(DeleteBehavior.Cascade);
-                });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.LoginRecord", b =>
-                {
-                    b.HasOne("Masuit.MyBlogs.Core.Models.Entity.UserInfo", "UserInfo")
-                        .WithMany("LoginRecord")
-                        .HasForeignKey("UserInfoId")
-                        .OnDelete(DeleteBehavior.Cascade);
-                });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.Post", b =>
-                {
-                    b.HasOne("Masuit.MyBlogs.Core.Models.Entity.Category", "Category")
-                        .WithMany("Post")
-                        .HasForeignKey("CategoryId")
-                        .OnDelete(DeleteBehavior.Cascade);
-                });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.PostAccessRecord", b =>
-                {
-                    b.HasOne("Masuit.MyBlogs.Core.Models.Entity.Post", "Post")
-                        .WithMany("PostAccessRecord")
-                        .HasForeignKey("PostId")
-                        .OnDelete(DeleteBehavior.Cascade);
-                });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.PostHistoryVersion", b =>
-                {
-                    b.HasOne("Masuit.MyBlogs.Core.Models.Entity.Category", "Category")
-                        .WithMany("PostHistoryVersion")
-                        .HasForeignKey("CategoryId")
-                        .OnDelete(DeleteBehavior.Cascade);
-
-                    b.HasOne("Masuit.MyBlogs.Core.Models.Entity.Post", "Post")
-                        .WithMany("PostHistoryVersion")
-                        .HasForeignKey("PostId")
-                        .OnDelete(DeleteBehavior.Cascade);
-                });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.SeminarPost", b =>
-                {
-                    b.HasOne("Masuit.MyBlogs.Core.Models.Entity.Post", "Post")
-                        .WithMany("Seminar")
-                        .HasForeignKey("PostId")
-                        .OnDelete(DeleteBehavior.Cascade);
-
-                    b.HasOne("Masuit.MyBlogs.Core.Models.Entity.Seminar", "Seminar")
-                        .WithMany("Post")
-                        .HasForeignKey("SeminarId")
-                        .OnDelete(DeleteBehavior.Cascade);
-                });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.SeminarPostHistoryVersion", b =>
-                {
-                    b.HasOne("Masuit.MyBlogs.Core.Models.Entity.PostHistoryVersion", "PostHistoryVersion")
-                        .WithMany("Seminar")
-                        .HasForeignKey("PostHistoryVersionId")
-                        .OnDelete(DeleteBehavior.Cascade);
-
-                    b.HasOne("Masuit.MyBlogs.Core.Models.Entity.Seminar", "Seminar")
-                        .WithMany("PostHistoryVersion")
-                        .HasForeignKey("SeminarId")
-                        .OnDelete(DeleteBehavior.Cascade);
-                });
-#pragma warning restore 612, 618
-        }
-    }
-}

+ 0 - 414
src/Masuit.MyBlogs.Core/Migrations/20190321050816_Init.cs

@@ -1,414 +0,0 @@
-using Microsoft.EntityFrameworkCore.Metadata;
-using Microsoft.EntityFrameworkCore.Migrations;
-using System;
-
-namespace Masuit.MyBlogs.Core.Migrations
-{
-    public partial class Init : Migration
-    {
-        protected override void Up(MigrationBuilder migrationBuilder)
-        {
-            migrationBuilder.CreateTable(name: "Banner", columns: table => new
-            {
-                Id = table.Column<int>(nullable: false).Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
-                Status = table.Column<int>(nullable: false),
-                Title = table.Column<string>(nullable: false),
-                Description = table.Column<string>(maxLength: 255, nullable: false),
-                Url = table.Column<string>(maxLength: 255, nullable: false),
-                ImageUrl = table.Column<string>(maxLength: 255, nullable: false)
-            }, constraints: table =>
-            {
-                table.PrimaryKey("PK_Banner", x => x.Id);
-            });
-
-            migrationBuilder.CreateTable(name: "Broadcast", columns: table => new
-            {
-                Id = table.Column<int>(nullable: false).Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
-                Status = table.Column<int>(nullable: false),
-                Email = table.Column<string>(nullable: true),
-                ValidateCode = table.Column<string>(nullable: true),
-                UpdateTime = table.Column<DateTime>(nullable: false),
-                SubscribeType = table.Column<int>(nullable: false)
-            }, constraints: table =>
-            {
-                table.PrimaryKey("PK_Broadcast", x => x.Id);
-            });
-
-            migrationBuilder.CreateTable(name: "Category", columns: table => new
-            {
-                Id = table.Column<int>(nullable: false).Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
-                Status = table.Column<int>(nullable: false),
-                Name = table.Column<string>(maxLength: 64, nullable: false),
-                Description = table.Column<string>(nullable: true)
-            }, constraints: table =>
-            {
-                table.PrimaryKey("PK_Category", x => x.Id);
-            });
-
-            migrationBuilder.CreateTable(name: "Donate", columns: table => new
-            {
-                Id = table.Column<int>(nullable: false).Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
-                Status = table.Column<int>(nullable: false),
-                NickName = table.Column<string>(nullable: true),
-                Email = table.Column<string>(nullable: true),
-                QQorWechat = table.Column<string>(nullable: true),
-                EmailDisplay = table.Column<string>(nullable: true),
-                QQorWechatDisplay = table.Column<string>(nullable: true),
-                Amount = table.Column<string>(nullable: true),
-                Via = table.Column<string>(nullable: true),
-                DonateTime = table.Column<DateTime>(nullable: false)
-            }, constraints: table =>
-            {
-                table.PrimaryKey("PK_Donate", x => x.Id);
-            });
-
-            migrationBuilder.CreateTable(name: "FastShare", columns: table => new
-            {
-                Id = table.Column<int>(nullable: false).Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
-                Status = table.Column<int>(nullable: false),
-                Title = table.Column<string>(nullable: true),
-                Link = table.Column<string>(nullable: true),
-                Sort = table.Column<int>(nullable: false)
-            }, constraints: table =>
-            {
-                table.PrimaryKey("PK_FastShare", x => x.Id);
-            });
-
-            migrationBuilder.CreateTable(name: "InternalMessage", columns: table => new
-            {
-                Id = table.Column<int>(nullable: false).Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
-                Status = table.Column<int>(nullable: false),
-                Title = table.Column<string>(nullable: true),
-                Content = table.Column<string>(nullable: true),
-                Link = table.Column<string>(nullable: true),
-                Time = table.Column<DateTime>(nullable: false),
-                Read = table.Column<bool>(nullable: false)
-            }, constraints: table =>
-            {
-                table.PrimaryKey("PK_InternalMessage", x => x.Id);
-            });
-
-            migrationBuilder.CreateTable(name: "LeaveMessage", columns: table => new
-            {
-                Id = table.Column<int>(nullable: false).Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
-                Status = table.Column<int>(nullable: false),
-                NickName = table.Column<string>(nullable: false),
-                Content = table.Column<string>(nullable: false),
-                PostDate = table.Column<DateTime>(nullable: false),
-                Email = table.Column<string>(nullable: true),
-                QQorWechat = table.Column<string>(nullable: true),
-                ParentId = table.Column<int>(nullable: false),
-                Browser = table.Column<string>(maxLength: 255, nullable: true),
-                OperatingSystem = table.Column<string>(maxLength: 255, nullable: true),
-                IsMaster = table.Column<bool>(nullable: false),
-                IP = table.Column<string>(nullable: true)
-            }, constraints: table =>
-            {
-                table.PrimaryKey("PK_LeaveMessage", x => x.Id);
-            });
-
-            migrationBuilder.CreateTable(name: "Links", columns: table => new
-            {
-                Id = table.Column<int>(nullable: false).Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
-                Status = table.Column<int>(nullable: false),
-                Name = table.Column<string>(nullable: false),
-                Url = table.Column<string>(nullable: false),
-                Except = table.Column<bool>(nullable: false),
-                Recommend = table.Column<bool>(nullable: false)
-            }, constraints: table =>
-            {
-                table.PrimaryKey("PK_Links", x => x.Id);
-            });
-
-            migrationBuilder.CreateTable(name: "Menu", columns: table => new
-            {
-                Id = table.Column<int>(nullable: false).Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
-                Status = table.Column<int>(nullable: false),
-                Name = table.Column<string>(nullable: false),
-                Icon = table.Column<string>(nullable: true),
-                Url = table.Column<string>(nullable: false),
-                Sort = table.Column<int>(nullable: false),
-                ParentId = table.Column<int>(nullable: false),
-                MenuType = table.Column<int>(nullable: false),
-                NewTab = table.Column<bool>(nullable: false)
-            }, constraints: table =>
-            {
-                table.PrimaryKey("PK_Menu", x => x.Id);
-            });
-
-            migrationBuilder.CreateTable(name: "Misc", columns: table => new
-            {
-                Id = table.Column<int>(nullable: false).Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
-                Status = table.Column<int>(nullable: false),
-                Title = table.Column<string>(nullable: false),
-                Content = table.Column<string>(nullable: false),
-                PostDate = table.Column<DateTime>(nullable: false),
-                ModifyDate = table.Column<DateTime>(nullable: false)
-            }, constraints: table =>
-            {
-                table.PrimaryKey("PK_Misc", x => x.Id);
-            });
-
-            migrationBuilder.CreateTable(name: "Notice", columns: table => new
-            {
-                Id = table.Column<int>(nullable: false).Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
-                Status = table.Column<int>(nullable: false),
-                Title = table.Column<string>(nullable: false),
-                Content = table.Column<string>(nullable: false),
-                PostDate = table.Column<DateTime>(nullable: false),
-                ModifyDate = table.Column<DateTime>(nullable: false),
-                ViewCount = table.Column<int>(nullable: false)
-            }, constraints: table =>
-            {
-                table.PrimaryKey("PK_Notice", x => x.Id);
-            });
-
-            migrationBuilder.CreateTable(name: "SearchDetails", columns: table => new
-            {
-                Id = table.Column<int>(nullable: false).Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
-                KeyWords = table.Column<string>(nullable: false),
-                SearchTime = table.Column<DateTime>(nullable: false),
-                IP = table.Column<string>(nullable: true)
-            }, constraints: table =>
-            {
-                table.PrimaryKey("PK_SearchDetails", x => x.Id);
-            });
-
-            migrationBuilder.CreateTable(name: "Seminar", columns: table => new
-            {
-                Id = table.Column<int>(nullable: false).Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
-                Status = table.Column<int>(nullable: false),
-                Title = table.Column<string>(nullable: false),
-                SubTitle = table.Column<string>(nullable: true),
-                Description = table.Column<string>(nullable: false)
-            }, constraints: table =>
-            {
-                table.PrimaryKey("PK_Seminar", x => x.Id);
-            });
-
-            migrationBuilder.CreateTable(name: "SystemSetting", columns: table => new
-            {
-                Id = table.Column<int>(nullable: false).Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
-                Status = table.Column<int>(nullable: false),
-                Name = table.Column<string>(nullable: false),
-                Value = table.Column<string>(nullable: false)
-            }, constraints: table =>
-            {
-                table.PrimaryKey("PK_SystemSetting", x => x.Id);
-            });
-
-            migrationBuilder.CreateTable(name: "UserInfo", columns: table => new
-            {
-                Id = table.Column<int>(nullable: false).Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
-                Status = table.Column<int>(nullable: false),
-                Username = table.Column<string>(nullable: false),
-                NickName = table.Column<string>(nullable: false),
-                Password = table.Column<string>(nullable: false),
-                SaltKey = table.Column<string>(nullable: false),
-                IsAdmin = table.Column<bool>(nullable: false),
-                Email = table.Column<string>(nullable: true),
-                QQorWechat = table.Column<string>(nullable: true),
-                Avatar = table.Column<string>(nullable: true),
-                AccessToken = table.Column<string>(nullable: true)
-            }, constraints: table =>
-            {
-                table.PrimaryKey("PK_UserInfo", x => x.Id);
-            });
-
-            migrationBuilder.CreateTable(name: "Post", columns: table => new
-            {
-                Id = table.Column<int>(nullable: false).Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
-                Status = table.Column<int>(nullable: false),
-                Title = table.Column<string>(nullable: false),
-                Author = table.Column<string>(maxLength: 24, nullable: false),
-                Content = table.Column<string>(nullable: false),
-                ProtectContent = table.Column<string>(nullable: true),
-                PostDate = table.Column<DateTime>(nullable: false),
-                ModifyDate = table.Column<DateTime>(nullable: false),
-                IsFixedTop = table.Column<bool>(nullable: false),
-                CategoryId = table.Column<int>(nullable: false),
-                ResourceName = table.Column<string>(nullable: true),
-                IsWordDocument = table.Column<bool>(nullable: false),
-                Email = table.Column<string>(nullable: false),
-                Label = table.Column<string>(maxLength: 256, nullable: true),
-                Keyword = table.Column<string>(maxLength: 256, nullable: true),
-                VoteUpCount = table.Column<int>(nullable: false),
-                VoteDownCount = table.Column<int>(nullable: false),
-                AverageViewCount = table.Column<double>(nullable: false),
-                TotalViewCount = table.Column<int>(nullable: false),
-                IP = table.Column<string>(nullable: true)
-            }, constraints: table =>
-            {
-                table.PrimaryKey("PK_Post", x => x.Id);
-                table.ForeignKey(name: "FK_Post_Category_CategoryId", column: x => x.CategoryId, principalTable: "Category", principalColumn: "Id", onDelete: ReferentialAction.Cascade);
-            });
-
-            migrationBuilder.CreateTable(name: "LoginRecord", columns: table => new
-            {
-                Id = table.Column<int>(nullable: false).Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
-                Status = table.Column<int>(nullable: false),
-                IP = table.Column<string>(nullable: true),
-                LoginTime = table.Column<DateTime>(nullable: false),
-                Province = table.Column<string>(nullable: true),
-                PhysicAddress = table.Column<string>(nullable: true),
-                LoginType = table.Column<int>(nullable: false),
-                UserInfoId = table.Column<int>(nullable: false)
-            }, constraints: table =>
-            {
-                table.PrimaryKey("PK_LoginRecord", x => x.Id);
-                table.ForeignKey(name: "FK_LoginRecord_UserInfo_UserInfoId", column: x => x.UserInfoId, principalTable: "UserInfo", principalColumn: "Id", onDelete: ReferentialAction.Cascade);
-            });
-
-            migrationBuilder.CreateTable(name: "Comment", columns: table => new
-            {
-                Id = table.Column<int>(nullable: false).Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
-                Status = table.Column<int>(nullable: false),
-                NickName = table.Column<string>(maxLength: 24, nullable: false),
-                Email = table.Column<string>(nullable: true),
-                QQorWechat = table.Column<string>(nullable: true),
-                Content = table.Column<string>(nullable: false),
-                ParentId = table.Column<int>(nullable: false),
-                PostId = table.Column<int>(nullable: false),
-                CommentDate = table.Column<DateTime>(nullable: false),
-                Browser = table.Column<string>(maxLength: 255, nullable: true),
-                OperatingSystem = table.Column<string>(maxLength: 255, nullable: true),
-                IsMaster = table.Column<bool>(nullable: false),
-                VoteCount = table.Column<int>(nullable: false),
-                AgainstCount = table.Column<int>(nullable: false),
-                IP = table.Column<string>(nullable: true)
-            }, constraints: table =>
-            {
-                table.PrimaryKey("PK_Comment", x => x.Id);
-                table.ForeignKey(name: "FK_Comment_Post_PostId", column: x => x.PostId, principalTable: "Post", principalColumn: "Id", onDelete: ReferentialAction.Cascade);
-            });
-
-            migrationBuilder.CreateTable(name: "PostAccessRecord", columns: table => new
-            {
-                Id = table.Column<int>(nullable: false).Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
-                Status = table.Column<int>(nullable: false),
-                PostId = table.Column<int>(nullable: false),
-                AccessTime = table.Column<DateTime>(nullable: false),
-                ClickCount = table.Column<int>(nullable: false)
-            }, constraints: table =>
-            {
-                table.PrimaryKey("PK_PostAccessRecord", x => x.Id);
-                table.ForeignKey(name: "FK_PostAccessRecord_Post_PostId", column: x => x.PostId, principalTable: "Post", principalColumn: "Id", onDelete: ReferentialAction.Cascade);
-            });
-
-            migrationBuilder.CreateTable(name: "PostHistoryVersion", columns: table => new
-            {
-                Id = table.Column<int>(nullable: false).Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
-                Status = table.Column<int>(nullable: false),
-                Title = table.Column<string>(maxLength: 64, nullable: false),
-                Content = table.Column<string>(nullable: false),
-                ProtectContent = table.Column<string>(nullable: true),
-                ViewCount = table.Column<int>(nullable: false),
-                ModifyDate = table.Column<DateTime>(nullable: false),
-                CategoryId = table.Column<int>(nullable: false),
-                PostId = table.Column<int>(nullable: false),
-                ResourceName = table.Column<string>(nullable: true),
-                IsWordDocument = table.Column<bool>(nullable: false),
-                Email = table.Column<string>(maxLength: 255, nullable: true),
-                Label = table.Column<string>(maxLength: 255, nullable: true)
-            }, constraints: table =>
-            {
-                table.PrimaryKey("PK_PostHistoryVersion", x => x.Id);
-                table.ForeignKey(name: "FK_PostHistoryVersion_Category_CategoryId", column: x => x.CategoryId, principalTable: "Category", principalColumn: "Id", onDelete: ReferentialAction.Cascade);
-                table.ForeignKey(name: "FK_PostHistoryVersion_Post_PostId", column: x => x.PostId, principalTable: "Post", principalColumn: "Id", onDelete: ReferentialAction.Cascade);
-            });
-
-            migrationBuilder.CreateTable(name: "SeminarPost", columns: table => new
-            {
-                Seminar_Id = table.Column<int>(nullable: false),
-                Post_Id = table.Column<int>(nullable: false)
-            }, constraints: table =>
-            {
-                table.PrimaryKey("PK_SeminarPost", x => new
-                {
-                    x.Seminar_Id,
-                    x.Post_Id
-                });
-                table.ForeignKey(name: "FK_SeminarPost_Post_Post_Id", column: x => x.Post_Id, principalTable: "Post", principalColumn: "Id", onDelete: ReferentialAction.Cascade);
-                table.ForeignKey(name: "FK_SeminarPost_Seminar_Seminar_Id", column: x => x.Seminar_Id, principalTable: "Seminar", principalColumn: "Id", onDelete: ReferentialAction.Cascade);
-            });
-
-            migrationBuilder.CreateTable(name: "SeminarPostHistoryVersion", columns: table => new
-            {
-                Seminar_Id = table.Column<int>(nullable: false),
-                PostHistoryVersion_Id = table.Column<int>(nullable: false)
-            }, constraints: table =>
-            {
-                table.PrimaryKey("PK_SeminarPostHistoryVersion", x => new
-                {
-                    x.Seminar_Id,
-                    x.PostHistoryVersion_Id
-                });
-                table.ForeignKey(name: "FK_SeminarPostHistoryVersion_PostHistoryVersion_PostHistoryVers~", column: x => x.PostHistoryVersion_Id, principalTable: "PostHistoryVersion", principalColumn: "Id", onDelete: ReferentialAction.Cascade);
-                table.ForeignKey(name: "FK_SeminarPostHistoryVersion_Seminar_Seminar_Id", column: x => x.Seminar_Id, principalTable: "Seminar", principalColumn: "Id", onDelete: ReferentialAction.Cascade);
-            });
-
-            migrationBuilder.CreateIndex(name: "IX_Comment_PostId", table: "Comment", column: "PostId");
-
-            migrationBuilder.CreateIndex(name: "IX_LoginRecord_UserInfoId", table: "LoginRecord", column: "UserInfoId");
-
-            migrationBuilder.CreateIndex(name: "IX_Post_CategoryId", table: "Post", column: "CategoryId");
-
-            migrationBuilder.CreateIndex(name: "IX_PostAccessRecord_PostId", table: "PostAccessRecord", column: "PostId");
-
-            migrationBuilder.CreateIndex(name: "IX_PostHistoryVersion_CategoryId", table: "PostHistoryVersion", column: "CategoryId");
-
-            migrationBuilder.CreateIndex(name: "IX_PostHistoryVersion_PostId", table: "PostHistoryVersion", column: "PostId");
-
-            migrationBuilder.CreateIndex(name: "IX_SeminarPost_Post_Id", table: "SeminarPost", column: "Post_Id");
-
-            migrationBuilder.CreateIndex(name: "IX_SeminarPostHistoryVersion_PostHistoryVersion_Id", table: "SeminarPostHistoryVersion", column: "PostHistoryVersion_Id");
-        }
-
-        protected override void Down(MigrationBuilder migrationBuilder)
-        {
-            migrationBuilder.DropTable(name: "Banner");
-
-            migrationBuilder.DropTable(name: "Broadcast");
-
-            migrationBuilder.DropTable(name: "Comment");
-
-            migrationBuilder.DropTable(name: "Donate");
-
-            migrationBuilder.DropTable(name: "FastShare");
-
-            migrationBuilder.DropTable(name: "InternalMessage");
-
-            migrationBuilder.DropTable(name: "LeaveMessage");
-
-            migrationBuilder.DropTable(name: "Links");
-
-            migrationBuilder.DropTable(name: "LoginRecord");
-
-            migrationBuilder.DropTable(name: "Menu");
-
-            migrationBuilder.DropTable(name: "Misc");
-
-            migrationBuilder.DropTable(name: "Notice");
-
-            migrationBuilder.DropTable(name: "PostAccessRecord");
-
-            migrationBuilder.DropTable(name: "SearchDetails");
-
-            migrationBuilder.DropTable(name: "SeminarPost");
-
-            migrationBuilder.DropTable(name: "SeminarPostHistoryVersion");
-
-            migrationBuilder.DropTable(name: "SystemSetting");
-
-            migrationBuilder.DropTable(name: "UserInfo");
-
-            migrationBuilder.DropTable(name: "PostHistoryVersion");
-
-            migrationBuilder.DropTable(name: "Seminar");
-
-            migrationBuilder.DropTable(name: "Post");
-
-            migrationBuilder.DropTable(name: "Category");
-        }
-    }
-}

+ 0 - 565
src/Masuit.MyBlogs.Core/Migrations/DataContextModelSnapshot.cs

@@ -1,565 +0,0 @@
-// <auto-generated />
-
-using Masuit.MyBlogs.Core.Infrastructure;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using System;
-
-namespace Masuit.MyBlogs.Core.Migrations
-{
-    [DbContext(typeof(DataContext))]
-    partial class DataContextModelSnapshot : ModelSnapshot
-    {
-        protected override void BuildModel(ModelBuilder modelBuilder)
-        {
-#pragma warning disable 612, 618
-            modelBuilder.HasAnnotation("ProductVersion", "2.2.3-servicing-35854").HasAnnotation("Relational:MaxIdentifierLength", 64);
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.Banner", b =>
-            {
-                b.Property<int>("Id").ValueGeneratedOnAdd();
-
-                b.Property<string>("Description").IsRequired().HasMaxLength(255);
-
-                b.Property<string>("ImageUrl").IsRequired().HasMaxLength(255);
-
-                b.Property<int>("Status");
-
-                b.Property<string>("Title").IsRequired();
-
-                b.Property<string>("Url").IsRequired().HasMaxLength(255);
-
-                b.HasKey("Id");
-
-                b.ToTable("Banner");
-            });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.Broadcast", b =>
-            {
-                b.Property<int>("Id").ValueGeneratedOnAdd();
-
-                b.Property<string>("Email");
-
-                b.Property<int>("Status");
-
-                b.Property<int>("SubscribeType");
-
-                b.Property<DateTime>("UpdateTime");
-
-                b.Property<string>("ValidateCode");
-
-                b.HasKey("Id");
-
-                b.ToTable("Broadcast");
-            });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.Category", b =>
-            {
-                b.Property<int>("Id").ValueGeneratedOnAdd();
-
-                b.Property<string>("Description");
-
-                b.Property<string>("Name").IsRequired().HasMaxLength(64);
-
-                b.Property<int>("Status");
-
-                b.HasKey("Id");
-
-                b.ToTable("Category");
-            });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.Comment", b =>
-            {
-                b.Property<int>("Id").ValueGeneratedOnAdd();
-
-                b.Property<int>("AgainstCount");
-
-                b.Property<string>("Browser").HasMaxLength(255);
-
-                b.Property<DateTime>("CommentDate");
-
-                b.Property<string>("Content").IsRequired();
-
-                b.Property<string>("Email");
-
-                b.Property<string>("IP");
-
-                b.Property<bool>("IsMaster");
-
-                b.Property<string>("NickName").IsRequired().HasMaxLength(24);
-
-                b.Property<string>("OperatingSystem").HasMaxLength(255);
-
-                b.Property<int>("ParentId");
-
-                b.Property<int>("PostId");
-
-                b.Property<string>("QQorWechat");
-
-                b.Property<int>("Status");
-
-                b.Property<int>("VoteCount");
-
-                b.HasKey("Id");
-
-                b.HasIndex("PostId");
-
-                b.ToTable("Comment");
-            });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.Donate", b =>
-            {
-                b.Property<int>("Id").ValueGeneratedOnAdd();
-
-                b.Property<string>("Amount");
-
-                b.Property<DateTime>("DonateTime");
-
-                b.Property<string>("Email");
-
-                b.Property<string>("EmailDisplay");
-
-                b.Property<string>("NickName");
-
-                b.Property<string>("QQorWechat");
-
-                b.Property<string>("QQorWechatDisplay");
-
-                b.Property<int>("Status");
-
-                b.Property<string>("Via");
-
-                b.HasKey("Id");
-
-                b.ToTable("Donate");
-            });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.FastShare", b =>
-            {
-                b.Property<int>("Id").ValueGeneratedOnAdd();
-
-                b.Property<string>("Link");
-
-                b.Property<int>("Sort");
-
-                b.Property<int>("Status");
-
-                b.Property<string>("Title");
-
-                b.HasKey("Id");
-
-                b.ToTable("FastShare");
-            });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.InternalMessage", b =>
-            {
-                b.Property<int>("Id").ValueGeneratedOnAdd();
-
-                b.Property<string>("Content");
-
-                b.Property<string>("Link");
-
-                b.Property<bool>("Read");
-
-                b.Property<int>("Status");
-
-                b.Property<DateTime>("Time");
-
-                b.Property<string>("Title");
-
-                b.HasKey("Id");
-
-                b.ToTable("InternalMessage");
-            });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.LeaveMessage", b =>
-            {
-                b.Property<int>("Id").ValueGeneratedOnAdd();
-
-                b.Property<string>("Browser").HasMaxLength(255);
-
-                b.Property<string>("Content").IsRequired();
-
-                b.Property<string>("Email");
-
-                b.Property<string>("IP");
-
-                b.Property<bool>("IsMaster");
-
-                b.Property<string>("NickName").IsRequired();
-
-                b.Property<string>("OperatingSystem").HasMaxLength(255);
-
-                b.Property<int>("ParentId");
-
-                b.Property<DateTime>("PostDate");
-
-                b.Property<string>("QQorWechat");
-
-                b.Property<int>("Status");
-
-                b.HasKey("Id");
-
-                b.ToTable("LeaveMessage");
-            });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.Links", b =>
-            {
-                b.Property<int>("Id").ValueGeneratedOnAdd();
-
-                b.Property<bool>("Except");
-
-                b.Property<string>("Name").IsRequired();
-
-                b.Property<bool>("Recommend");
-
-                b.Property<int>("Status");
-
-                b.Property<string>("Url").IsRequired();
-
-                b.HasKey("Id");
-
-                b.ToTable("Links");
-            });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.LoginRecord", b =>
-            {
-                b.Property<int>("Id").ValueGeneratedOnAdd();
-
-                b.Property<string>("IP");
-
-                b.Property<DateTime>("LoginTime");
-
-                b.Property<int>("LoginType");
-
-                b.Property<string>("PhysicAddress");
-
-                b.Property<string>("Province");
-
-                b.Property<int>("Status");
-
-                b.Property<int>("UserInfoId");
-
-                b.HasKey("Id");
-
-                b.HasIndex("UserInfoId");
-
-                b.ToTable("LoginRecord");
-            });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.Menu", b =>
-            {
-                b.Property<int>("Id").ValueGeneratedOnAdd();
-
-                b.Property<string>("Icon");
-
-                b.Property<int>("MenuType");
-
-                b.Property<string>("Name").IsRequired();
-
-                b.Property<bool>("NewTab");
-
-                b.Property<int>("ParentId");
-
-                b.Property<int>("Sort");
-
-                b.Property<int>("Status");
-
-                b.Property<string>("Url").IsRequired();
-
-                b.HasKey("Id");
-
-                b.ToTable("Menu");
-            });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.Misc", b =>
-            {
-                b.Property<int>("Id").ValueGeneratedOnAdd();
-
-                b.Property<string>("Content").IsRequired();
-
-                b.Property<DateTime>("ModifyDate");
-
-                b.Property<DateTime>("PostDate");
-
-                b.Property<int>("Status");
-
-                b.Property<string>("Title").IsRequired();
-
-                b.HasKey("Id");
-
-                b.ToTable("Misc");
-            });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.Notice", b =>
-            {
-                b.Property<int>("Id").ValueGeneratedOnAdd();
-
-                b.Property<string>("Content").IsRequired();
-
-                b.Property<DateTime>("ModifyDate");
-
-                b.Property<DateTime>("PostDate");
-
-                b.Property<int>("Status");
-
-                b.Property<string>("Title").IsRequired();
-
-                b.Property<int>("ViewCount");
-
-                b.HasKey("Id");
-
-                b.ToTable("Notice");
-            });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.Post", b =>
-            {
-                b.Property<int>("Id").ValueGeneratedOnAdd();
-
-                b.Property<string>("Author").IsRequired().HasMaxLength(24);
-
-                b.Property<double>("AverageViewCount");
-
-                b.Property<int>("CategoryId");
-
-                b.Property<string>("Content").IsRequired();
-
-                b.Property<string>("Email").IsRequired().IsUnicode(true);
-
-                b.Property<string>("IP");
-
-                b.Property<bool>("IsFixedTop");
-
-                b.Property<bool>("IsWordDocument");
-
-                b.Property<string>("Keyword").HasMaxLength(256);
-
-                b.Property<string>("Label").HasMaxLength(256).IsUnicode(true);
-
-                b.Property<DateTime>("ModifyDate");
-
-                b.Property<DateTime>("PostDate");
-
-                b.Property<string>("ProtectContent");
-
-                b.Property<string>("ResourceName");
-
-                b.Property<int>("Status");
-
-                b.Property<string>("Title").IsRequired();
-
-                b.Property<int>("TotalViewCount");
-
-                b.Property<int>("VoteDownCount").ValueGeneratedOnAddOrUpdate();
-
-                b.Property<int>("VoteUpCount");
-
-                b.HasKey("Id");
-
-                b.HasIndex("CategoryId");
-
-                b.ToTable("Post");
-            });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.PostAccessRecord", b =>
-            {
-                b.Property<int>("Id").ValueGeneratedOnAdd();
-
-                b.Property<DateTime>("AccessTime");
-
-                b.Property<int>("ClickCount");
-
-                b.Property<int>("PostId");
-
-                b.Property<int>("Status");
-
-                b.HasKey("Id");
-
-                b.HasIndex("PostId");
-
-                b.ToTable("PostAccessRecord");
-            });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.PostHistoryVersion", b =>
-            {
-                b.Property<int>("Id").ValueGeneratedOnAdd();
-
-                b.Property<int>("CategoryId");
-
-                b.Property<string>("Content").IsRequired();
-
-                b.Property<string>("Email").HasMaxLength(255);
-
-                b.Property<bool>("IsWordDocument");
-
-                b.Property<string>("Label").HasMaxLength(255);
-
-                b.Property<DateTime>("ModifyDate");
-
-                b.Property<int>("PostId");
-
-                b.Property<string>("ProtectContent");
-
-                b.Property<string>("ResourceName");
-
-                b.Property<int>("Status");
-
-                b.Property<string>("Title").IsRequired().HasMaxLength(64);
-
-                b.Property<int>("ViewCount");
-
-                b.HasKey("Id");
-
-                b.HasIndex("CategoryId");
-
-                b.HasIndex("PostId");
-
-                b.ToTable("PostHistoryVersion");
-            });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.SearchDetails", b =>
-            {
-                b.Property<int>("Id").ValueGeneratedOnAdd();
-
-                b.Property<string>("IP");
-
-                b.Property<string>("KeyWords").IsRequired().IsUnicode(true);
-
-                b.Property<DateTime>("SearchTime");
-
-                b.HasKey("Id");
-
-                b.ToTable("SearchDetails");
-            });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.Seminar", b =>
-            {
-                b.Property<int>("Id").ValueGeneratedOnAdd();
-
-                b.Property<string>("Description").IsRequired();
-
-                b.Property<int>("Status");
-
-                b.Property<string>("SubTitle");
-
-                b.Property<string>("Title").IsRequired();
-
-                b.HasKey("Id");
-
-                b.ToTable("Seminar");
-            });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.SeminarPost", b =>
-            {
-                b.Property<int>("SeminarId").HasColumnName("Seminar_Id");
-
-                b.Property<int>("PostId").HasColumnName("Post_Id");
-
-                b.HasKey("SeminarId", "PostId");
-
-                b.HasIndex("PostId");
-
-                b.ToTable("SeminarPost");
-            });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.SeminarPostHistoryVersion", b =>
-            {
-                b.Property<int>("SeminarId").HasColumnName("Seminar_Id");
-
-                b.Property<int>("PostHistoryVersionId").HasColumnName("PostHistoryVersion_Id");
-
-                b.HasKey("SeminarId", "PostHistoryVersionId");
-
-                b.HasIndex("PostHistoryVersionId");
-
-                b.ToTable("SeminarPostHistoryVersion");
-            });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.SystemSetting", b =>
-            {
-                b.Property<int>("Id").ValueGeneratedOnAdd();
-
-                b.Property<string>("Name").IsRequired();
-
-                b.Property<int>("Status");
-
-                b.Property<string>("Value").IsRequired();
-
-                b.HasKey("Id");
-
-                b.ToTable("SystemSetting");
-            });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.UserInfo", b =>
-            {
-                b.Property<int>("Id").ValueGeneratedOnAdd();
-
-                b.Property<string>("AccessToken");
-
-                b.Property<string>("Avatar");
-
-                b.Property<string>("Email");
-
-                b.Property<bool>("IsAdmin");
-
-                b.Property<string>("NickName").IsRequired();
-
-                b.Property<string>("Password").IsRequired();
-
-                b.Property<string>("QQorWechat");
-
-                b.Property<string>("SaltKey").IsRequired();
-
-                b.Property<int>("Status");
-
-                b.Property<string>("Username").IsRequired();
-
-                b.HasKey("Id");
-
-                b.ToTable("UserInfo");
-            });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.Comment", b =>
-            {
-                b.HasOne("Masuit.MyBlogs.Core.Models.Entity.Post", "Post").WithMany("Comment").HasForeignKey("PostId").OnDelete(DeleteBehavior.Cascade);
-            });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.LoginRecord", b =>
-            {
-                b.HasOne("Masuit.MyBlogs.Core.Models.Entity.UserInfo", "UserInfo").WithMany("LoginRecord").HasForeignKey("UserInfoId").OnDelete(DeleteBehavior.Cascade);
-            });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.Post", b =>
-            {
-                b.HasOne("Masuit.MyBlogs.Core.Models.Entity.Category", "Category").WithMany("Post").HasForeignKey("CategoryId").OnDelete(DeleteBehavior.Cascade);
-            });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.PostAccessRecord", b =>
-            {
-                b.HasOne("Masuit.MyBlogs.Core.Models.Entity.Post", "Post").WithMany("PostAccessRecord").HasForeignKey("PostId").OnDelete(DeleteBehavior.Cascade);
-            });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.PostHistoryVersion", b =>
-            {
-                b.HasOne("Masuit.MyBlogs.Core.Models.Entity.Category", "Category").WithMany("PostHistoryVersion").HasForeignKey("CategoryId").OnDelete(DeleteBehavior.Cascade);
-
-                b.HasOne("Masuit.MyBlogs.Core.Models.Entity.Post", "Post").WithMany("PostHistoryVersion").HasForeignKey("PostId").OnDelete(DeleteBehavior.Cascade);
-            });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.SeminarPost", b =>
-            {
-                b.HasOne("Masuit.MyBlogs.Core.Models.Entity.Post", "Post").WithMany("Seminar").HasForeignKey("PostId").OnDelete(DeleteBehavior.Cascade);
-
-                b.HasOne("Masuit.MyBlogs.Core.Models.Entity.Seminar", "Seminar").WithMany("Post").HasForeignKey("SeminarId").OnDelete(DeleteBehavior.Cascade);
-            });
-
-            modelBuilder.Entity("Masuit.MyBlogs.Core.Models.Entity.SeminarPostHistoryVersion", b =>
-            {
-                b.HasOne("Masuit.MyBlogs.Core.Models.Entity.PostHistoryVersion", "PostHistoryVersion").WithMany("Seminar").HasForeignKey("PostHistoryVersionId").OnDelete(DeleteBehavior.Cascade);
-
-                b.HasOne("Masuit.MyBlogs.Core.Models.Entity.Seminar", "Seminar").WithMany("PostHistoryVersion").HasForeignKey("SeminarId").OnDelete(DeleteBehavior.Cascade);
-            });
-#pragma warning restore 612, 618
-        }
-    }
-}

+ 0 - 13
src/Masuit.MyBlogs.Core/Models/DTO/PostInputDto.cs

@@ -1,7 +1,6 @@
 using Masuit.MyBlogs.Core.Models.Entity;
 using Masuit.MyBlogs.Core.Models.Enum;
 using Masuit.MyBlogs.Core.Models.Validation;
-using System.ComponentModel;
 using System.ComponentModel.DataAnnotations;
 
 namespace Masuit.MyBlogs.Core.Models.DTO
@@ -14,7 +13,6 @@ namespace Masuit.MyBlogs.Core.Models.DTO
         public PostInputDto()
         {
             Status = Status.Pending;
-            IsWordDocument = false;
         }
 
         /// <summary>
@@ -51,17 +49,6 @@ namespace Masuit.MyBlogs.Core.Models.DTO
         /// </summary>
         public int CategoryId { get; set; }
 
-        /// <summary>
-        /// 资源名
-        /// </summary>
-        public string ResourceName { get; set; }
-
-        /// <summary>
-        /// 是否是Word文档
-        /// </summary>
-        [DefaultValue(false)]
-        public bool IsWordDocument { get; set; }
-
         /// <summary>
         /// 作者邮箱
         /// </summary>

+ 0 - 10
src/Masuit.MyBlogs.Core/Models/DTO/PostOutputDto.cs

@@ -57,16 +57,6 @@ namespace Masuit.MyBlogs.Core.Models.DTO
         /// </summary>
         public bool IsFixedTop { get; set; }
 
-        /// <summary>
-        /// 资源名
-        /// </summary>
-        public string ResourceName { get; set; }
-
-        /// <summary>
-        /// 是否是Word文档
-        /// </summary>
-        public bool IsWordDocument { get; set; }
-
         /// <summary>
         /// 作者邮箱
         /// </summary>

+ 0 - 12
src/Masuit.MyBlogs.Core/Models/Entity/Post.cs

@@ -22,7 +22,6 @@ namespace Masuit.MyBlogs.Core.Models.Entity
             ModifyDate = DateTime.Now;
             IsFixedTop = false;
             Status = Status.Pending;
-            IsWordDocument = false;
             Seminar = new HashSet<SeminarPost>();
             PostMergeRequests = new HashSet<PostMergeRequest>();
         }
@@ -71,17 +70,6 @@ namespace Masuit.MyBlogs.Core.Models.Entity
         /// </summary>
         public int CategoryId { get; set; }
 
-        /// <summary>
-        /// 资源名
-        /// </summary>
-        public string ResourceName { get; set; }
-
-        /// <summary>
-        /// 是否是Word文档
-        /// </summary>
-        [DefaultValue(false)]
-        public bool IsWordDocument { get; set; }
-
         /// <summary>
         /// 作者邮箱
         /// </summary>

+ 0 - 12
src/Masuit.MyBlogs.Core/Models/Entity/PostHistoryVersion.cs

@@ -18,7 +18,6 @@ namespace Masuit.MyBlogs.Core.Models.Entity
         {
             ModifyDate = DateTime.Now;
             Status = Status.Pending;
-            IsWordDocument = false;
             Seminar = new HashSet<SeminarPostHistoryVersion>();
         }
 
@@ -62,17 +61,6 @@ namespace Masuit.MyBlogs.Core.Models.Entity
         [ForeignKey("Post")]
         public int PostId { get; set; }
 
-        /// <summary>
-        /// 资源名
-        /// </summary>
-        public string ResourceName { get; set; }
-
-        /// <summary>
-        /// 是否是Word文档
-        /// </summary>
-        [DefaultValue(false)]
-        public bool IsWordDocument { get; set; }
-
         /// <summary>
         /// 作者邮箱
         /// </summary>

+ 0 - 10
src/Masuit.MyBlogs.Core/Models/ViewModel/PostDataModel.cs

@@ -32,16 +32,6 @@
         /// </summary>
         public bool IsFixedTop { get; set; }
 
-        /// <summary>
-        /// 资源名
-        /// </summary>
-        public string ResourceName { get; set; }
-
-        /// <summary>
-        /// 是否是Word文档
-        /// </summary>
-        public bool IsWordDocument { get; set; }
-
         /// <summary>
         /// 作者邮箱
         /// </summary>

+ 0 - 10
src/Masuit.MyBlogs.Core/Models/ViewModel/PostViewModel.cs

@@ -48,16 +48,6 @@ namespace Masuit.MyBlogs.Core.Models.ViewModel
         /// </summary>
         public bool IsFixedTop { get; set; }
 
-        /// <summary>
-        /// 资源名
-        /// </summary>
-        public string ResourceName { get; set; }
-
-        /// <summary>
-        /// 是否是Word文档
-        /// </summary>
-        public bool IsWordDocument { get; set; }
-
         /// <summary>
         /// 作者邮箱
         /// </summary>

+ 0 - 4
src/Masuit.MyBlogs.Core/Views/Post/Details.cshtml

@@ -175,10 +175,6 @@
                             <button type="button" id="donate" class="btn btn-@colors[new Random().Next() % colors.Length] btn-lg">
                                 <i class="icon-coin-yen"></i><span>支持站长</span>
                             </button>
-                            @if (Model.IsWordDocument)
-                            {
-                                <a class="btn btn-@colors[new Random().Next() % colors.Length] btn-lg" href="~/upload/@(Model.ResourceName)" target="_blank"><i class="icon-download4"></i>下载为Word文档</a>
-                            }
                         </div>
                     </div>
                 </section>

+ 0 - 4
src/Masuit.MyBlogs.Core/Views/Post/Details_Admin.cshtml

@@ -154,10 +154,6 @@
                             <button type="button" id="donate" class="btn btn-@colors[new Random().Next() % colors.Length] btn-lg">
                                 <i class="icon-coin-yen"></i><span>支持站长</span>
                             </button>
-                            @if (Model.IsWordDocument)
-                            {
-                                <a class="btn btn-@colors[new Random().Next() % colors.Length] btn-lg" href="~/upload/@(Model.ResourceName)" target="_blank"><i class="icon-download4"></i>下载为Word文档</a>
-                            }
                         </div>
                     </div>
                 </section>

+ 0 - 2
src/Masuit.MyBlogs.Core/Views/Post/Publish.cshtml

@@ -16,8 +16,6 @@
     <form class="form-group" id="article-form" method="post" onsubmit="return false">
         @*文章表单*@
         @Html.AntiForgeryToken()
-        <input type="hidden" name="IsWordDocument" id="IsWordDocument" value="false" />
-        <input type="hidden" name="ResourceName" id="ResourceName" />
         <div class="input-group">
             <span class="input-group-addon size18"><label for="article">文章标题:</label></span>
             <input type="text" id="article" class="form-control input-lg" name="Title" required placeholder="请输入文章标题">

+ 0 - 5
src/Masuit.MyBlogs.Core/wwwroot/ng-views/controllers/post.js

@@ -262,7 +262,6 @@ myApp.controller("writeblog", ["$scope", "$http", "$timeout", function ($scope,
 					});
 					$scope.$apply(function() {
 						$scope.post.Content = data.Data.Content;
-						$scope.post.IsWordDocument = true;
 						$scope.post.ResourceName = data.Data.ResourceName;
 						$scope.post.Title = data.Data.Title;
 					});
@@ -316,8 +315,6 @@ myApp.controller("writeblog", ["$scope", "$http", "$timeout", function ($scope,
 				});
 				$scope.post.Content = "";
 				$scope.post.Title = "";
-				$scope.post.IsWordDocument = false;
-				$scope.post.ResourceName = "";
 				clearInterval(window.interval);
 				localStorage.removeItem("write-post-draft");
 			} else {
@@ -478,8 +475,6 @@ myApp.controller("postedit", ["$scope", "$http", "$location", "$timeout", functi
 					});
 					$scope.$apply(function () {
 						$scope.post.Content = data.Data.Content;
-						$scope.post.IsWordDocument = true;
-						$scope.post.ResourceName = data.Data.ResourceName;
 						$scope.post.Title = data.Data.Title;
 					});
 					layer.closeAll();

+ 0 - 2
src/Masuit.MyBlogs.Core/wwwroot/ng-views/views/post/edit.html

@@ -1,6 +1,4 @@
 <form class="form-group" id="article-form" method="post" onsubmit="return false">
-    <input type="hidden" ng-model="post.IsWordDocument"/>
-    <input type="hidden" ng-model="post.ResourceName"/>
     <input type="hidden" ng-model="post.Author">
     <input type="hidden" ng-model="post.Email">
     <div class="input-group">

+ 0 - 2
src/Masuit.MyBlogs.Core/wwwroot/ng-views/views/post/writeblog.html

@@ -17,8 +17,6 @@
     }
 </style>
 <form class="form-group" id="article-form" method="post" onsubmit="return false">
-    <input type="hidden" ng-model="post.IsWordDocument" />
-    <input type="hidden" ng-model="post.ResourceName" />
     <input type="hidden" ng-model="post.Author">
     <input type="hidden" ng-model="post.Email">
     <div class="input-group">