Browse Source

增加图片类型

master
Nice 3 years ago
parent
commit
5f51630ab5
  1. 1
      ReptileCaptures/DTO/ImagesInfo.cs
  2. 1
      ReptileCaptures/Entites/ODbContext.cs
  3. 4
      ReptileCaptures/Entites/ReptileCapture.cs
  4. 2
      ReptileCaptures/Program.cs
  5. 3
      ReptileCaptures/Repositories/IReptileCaptureRespository.cs
  6. 1
      ReptileCaptures/Repositories/ReptileCaptureRespository.cs

1
ReptileCaptures/DTO/ImagesInfo.cs

@ -4,6 +4,7 @@
{
public string CaptureUrl { get; set; }
public string CamName { get; set; }
public int CamType { get; set; }
public string CamIndexCode { get; set; }
public string CaptureId { get; set; }
public DateTime CaptureTime { get; set; }

1
ReptileCaptures/Entites/ODbContext.cs

@ -28,6 +28,7 @@ namespace PC.Entites
{
o.ToTable(nameof(ReptileCapture));
o.HasKey(o => o.Id);
o.Property(o => o.CamType).HasColumnType("int").HasColumnName("CamType");
o.Property(o => o.RegionId).HasColumnType("nvarchar(50)").HasColumnName("RegionId");
o.Property(o => o.CaptureTime).HasColumnType("datetime").HasColumnName("CaptureTime");
o.Property(o => o.CaptureUrl).HasColumnType("nvarchar(100)").HasColumnName("CaptureUrl");

4
ReptileCaptures/Entites/ReptileCapture.cs

@ -21,6 +21,10 @@ namespace PC.Entites
/// </summary>
public DateTime CaptureTime { get; set; }
/// <summary>
/// 图片类型
/// </summary>
public int CamType { get; set; }
/// <summary>
/// 图片Id
/// </summary>
public string CaptureId { get; set; }

2
ReptileCaptures/Program.cs

@ -123,7 +123,7 @@ while (true)
foreach (var data in page.Data)
{
await reptileCaptureRespository.NotNullAddCaptureAsync(new IReptileCaptureRespository
.CaptureDTO(data.CaptureUrl, data.CamIndexCode, data.CaptureTime, data.CaptureId));
.CaptureDTO(data.CaptureUrl, data.CamIndexCode, data.CaptureTime, data.CaptureId, data.CamType));
}
}
}

3
ReptileCaptures/Repositories/IReptileCaptureRespository.cs

@ -13,7 +13,8 @@
string CaptureUrl,
string RegionId,
DateTime CaptureTime,
string CaptureId);
string CaptureId,
int CamType);
/// <summary>
/// 添加图片
/// </summary>

1
ReptileCaptures/Repositories/ReptileCaptureRespository.cs

@ -22,6 +22,7 @@ namespace PC.Repositories
RegionId = captureDTO.RegionId,
CaptureUrl = imageURL,
CaptureId = captureDTO.CaptureId,
CamType = captureDTO.CamType
}.Create());
_oDbContext.SaveChanges();
}

Loading…
Cancel
Save