This commit is contained in:
2018-06-28 23:08:13 +00:00
commit 877637f1e5
69 changed files with 13521 additions and 0 deletions

26
Models/ApiError.cs Normal file
View File

@@ -0,0 +1,26 @@
using System;
namespace GZTW.Pecklist.Models
{
public class ApiError
{
public int code { get; set; }
public string message { get; set; }
//public string type { get; set; }
public string source { get; set; }
public string helpurl { get; set; }
public static ApiError generalError(string msg, string src)
{
return new ApiError { code = 100, helpurl = "peck.ayanova.com", message = msg, source = src };
}
}
}
/*
codes
100 = general error until we have more specific ones
*/

12
Models/ListData.cs Normal file
View File

@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
namespace GZTW.Pecklist.Models
{
public partial class ListData
{
public long Id { get; set; }
public string TheList { get; set; }
}
}

67
Models/PecklistContext.cs Normal file
View File

@@ -0,0 +1,67 @@
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
//using pecklist.Util;
using Microsoft.Extensions.Logging;
namespace GZTW.Pecklist.Models
{
public partial class PecklistContext : DbContext
{
public virtual DbSet<User> User { get; set; }
public virtual DbSet<ListData> ListData { get; set; }
public PecklistContext(DbContextOptions<PecklistContext> options) : base(options)
{ }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<User>(entity =>
{
entity.ToTable("user");
entity.Property(e => e.Id).HasColumnName("id");
entity.Property(e => e.Login)
.IsRequired()
.HasColumnName("login")
.HasColumnType("text");
entity.Property(e => e.Name)
.IsRequired()
.HasColumnName("name")
.HasColumnType("text");
entity.Property(e => e.DlKey)
.HasColumnName("dlkey")
.HasColumnType("text");
entity.Property(e => e.DlKeyExp)
.HasColumnName("dlkeyexp")
.HasColumnType("integer");
});
modelBuilder.Entity<ListData>(entity =>
{
entity.ToTable("listdata");
entity.Property(e => e.Id).HasColumnName("id");
entity.Property(e => e.TheList)
.IsRequired()
.HasColumnName("thelist")
.HasColumnType("text");
});
//-----------
}
}
}

17
Models/User.cs Normal file
View File

@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
namespace GZTW.Pecklist.Models
{
public partial class User
{
public long Id { get; set; }
public string Name { get; set; }
public string Login { get; set; }
public string Password { get; set; }
public string Salt { get; set; }
public string DlKey { get; set; }
public long? DlKeyExp { get; set; }
}
}