Skip to content

Commit ddbda9c

Browse files
author
D857794690
committed
修改爬虫API 并修改该数据库模型
1 parent 7c4ec08 commit ddbda9c

11 files changed

+200
-187
lines changed

WebApplication1/Comment.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ public partial class Comment
2121
public System.DateTime Time { get; set; }
2222
public string Content { get; set; }
2323

24-
public virtual Paper Paper { get; set; }
2524
public virtual Users Users { get; set; }
2625
public virtual Patent Patent { get; set; }
26+
public virtual Paper Paper { get; set; }
2727
}
2828
}

WebApplication1/Controllers/ResourceController.cs

+9
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,15 @@ public string PostPaper(Paper paper)
248248
try
249249
{
250250
paper.PaperID = GenPaperID();
251+
if (paper.Abstract == "[]"){paper.Abstract = null;}
252+
if (paper.Title == "[]") { paper.Title = null; }
253+
if (paper.IPC == "[]") { paper.IPC = null; }
254+
if (paper.Type == "[]") { paper.Type = null; }
255+
if (paper.DOI == "[]") { paper.DOI = null; }
256+
if (paper.Publisher == "[]") { paper.Publisher = null; }
257+
if (paper.KeyWord == "[]") { paper.KeyWord = null; }
258+
if (paper.Address == "[]") { paper.Address = null; }
259+
if (paper.Authors == "[]") { paper.Authors = null; }
251260
db.Paper.Add(paper);
252261
db.SaveChanges();
253262
return "success";

WebApplication1/Download.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public partial class Download
1818
public Nullable<long> PaperID { get; set; }
1919
public int DownloadID { get; set; }
2020

21-
public virtual Paper Paper { get; set; }
2221
public virtual Users Users { get; set; }
22+
public virtual Paper Paper { get; set; }
2323
}
2424
}

WebApplication1/ExpertPaper.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public partial class ExpertPaper
1818
public int ExpertPaperID { get; set; }
1919
public Nullable<long> ExpertID { get; set; }
2020

21-
public virtual Paper Paper { get; set; }
2221
public virtual ExpertInfo ExpertInfo { get; set; }
22+
public virtual Paper Paper { get; set; }
2323
}
2424
}

WebApplication1/Like.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ public partial class Like
1919
public int LikeID { get; set; }
2020
public Nullable<long> ExpertID { get; set; }
2121

22-
public virtual Paper Paper { get; set; }
2322
public virtual ExpertInfo ExpertInfo { get; set; }
2423
public virtual Patent Patent { get; set; }
24+
public virtual Paper Paper { get; set; }
2525
}
2626
}

WebApplication1/Paper.cs

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public Paper()
4141
public Nullable<bool> IsFree { get; set; }
4242
public Nullable<int> Price { get; set; }
4343
public Nullable<bool> IsPass { get; set; }
44+
public string Authors { get; set; }
4445

4546
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
4647
public virtual ICollection<Comment> Comment { get; set; }

WebApplication1/Review.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ public partial class Review
2121
public int ID { get; set; }
2222

2323
public virtual Users Users { get; set; }
24-
public virtual Paper Paper { get; set; }
2524
public virtual Reviewer Reviewer { get; set; }
2625
public virtual Patent Patent { get; set; }
26+
public virtual Paper Paper { get; set; }
2727
}
2828
}

WebApplication1/Users.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ public Users()
2121
this.UserExpert = new HashSet<UserExpert>();
2222
this.Download = new HashSet<Download>();
2323
this.ManageUser = new HashSet<ManageUser>();
24-
this.Paper = new HashSet<Paper>();
2524
this.Attention = new HashSet<Attention>();
2625
this.Patent = new HashSet<Patent>();
26+
this.Paper = new HashSet<Paper>();
2727
}
2828

2929
public long UserID { get; set; }
@@ -45,10 +45,10 @@ public Users()
4545
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
4646
public virtual ICollection<ManageUser> ManageUser { get; set; }
4747
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
48-
public virtual ICollection<Paper> Paper { get; set; }
49-
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
5048
public virtual ICollection<Attention> Attention { get; set; }
5149
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
5250
public virtual ICollection<Patent> Patent { get; set; }
51+
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
52+
public virtual ICollection<Paper> Paper { get; set; }
5353
}
5454
}

WebApplication1/WebAPI.Context.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ protected override void OnModelCreating(DbModelBuilder modelBuilder)
3535
public virtual DbSet<ManagePaper> ManagePaper { get; set; }
3636
public virtual DbSet<ManagePatent> ManagePatent { get; set; }
3737
public virtual DbSet<ManageUser> ManageUser { get; set; }
38-
public virtual DbSet<Paper> Paper { get; set; }
3938
public virtual DbSet<Users> Users { get; set; }
4039
public virtual DbSet<Review> Review { get; set; }
4140
public virtual DbSet<Reviewer> Reviewer { get; set; }
4241
public virtual DbSet<UserExpert> UserExpert { get; set; }
4342
public virtual DbSet<Attention> Attention { get; set; }
4443
public virtual DbSet<ExpertInfo> ExpertInfo { get; set; }
4544
public virtual DbSet<Patent> Patent { get; set; }
45+
public virtual DbSet<Paper> Paper { get; set; }
4646
}
4747
}

0 commit comments

Comments
 (0)