Besciamello (#1)

* Fixed login & auth
* Added dynamic breadcrumb
* Added DOC
* Added Patient
* Added Notifications
* Added Messages
* Refactoring api
* Re-writed menu
* Removed unused things
* Created README
This commit was merged in pull request #1.
This commit is contained in:
Giacomo Bertolazzi 20015159
2019-01-15 21:35:00 +01:00
committed by GitHub
parent 191daf8218
commit 1246116804
36 changed files with 1154 additions and 535 deletions

View File

@@ -7,7 +7,6 @@ namespace SeniorAssistant.Models
{
[PrimaryKey]
[NotNull]
[Association(ThisKey = nameof(Username), OtherKey = nameof(User.Username), CanBeNull = false)]
public string Username { get; set; }
[PrimaryKey]
@@ -15,5 +14,10 @@ namespace SeniorAssistant.Models
public DateTime Time { get; set; }
public double Value { get; set; }
/*
[Association(ThisKey = nameof(Username), OtherKey = nameof(User.Username), CanBeNull = false)]
public User UserObj { get; set; }
*/
}
}

View File

@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Collections.Generic;
namespace SeniorAssistant.Models
{
@@ -12,8 +9,7 @@ namespace SeniorAssistant.Models
public class MenuItem : IMenuItem
{
public MenuItem(string text) : this(text, "#") { }
public MenuItem(string text, string href)
public MenuItem(string text, string href = "#")
{
Text = text;
HRef = href;
@@ -25,6 +21,6 @@ namespace SeniorAssistant.Models
public class SubMenu : IMenuItem
{
public string Text { get; set; }
public IEnumerable<MenuItem> Items { get; set; }
public IList<MenuItem> Items { get; set; }
}
}

View File

@@ -0,0 +1,26 @@
using LinqToDB.Mapping;
using System;
namespace SeniorAssistant.Models
{
public class Message : IHasTime
{
[Column(IsPrimaryKey = true, CanBeNull = false, IsIdentity = true)]
public int Id { get; set; }
[NotNull]
public DateTime Time { get; set; }
[NotNull]
public string Username { get; set; }
[NotNull]
public string Reciver { get; set; }
[NotNull]
public string Body { get; set; }
public bool Seen { get; set; }
}
}

View File

@@ -0,0 +1,21 @@
using LinqToDB.Mapping;
using System;
namespace SeniorAssistant.Models
{
public class Notification : IHasTime
{
[Column(IsPrimaryKey = true, CanBeNull = false, IsIdentity = true)]
public int Id { get; set; }
[NotNull]
public string Username { get; set; }
[NotNull]
public DateTime Time { get; set; }
public bool Seen { get; set; }
public string Message { get; set; }
}
}

View File

@@ -1,15 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace SeniorAssistant.Models
{
public class Register
{
public string Username { get; set; }
public string Email { get; set; }
public string Password { get; set; }
public bool Doctor { get; set; }
}
}

View File

@@ -7,7 +7,6 @@ namespace SeniorAssistant.Models
{
[PrimaryKey]
[NotNull]
[Association(ThisKey = nameof(Username), OtherKey = nameof(User.Username), CanBeNull = false)]
public string Username { get; set; }
[PrimaryKey]

View File

@@ -7,7 +7,6 @@ namespace SeniorAssistant.Models
{
[PrimaryKey]
[NotNull]
[Association(ThisKey = nameof(Username), OtherKey = nameof(User.Username), CanBeNull = false)]
public string Username { get; set; }
[PrimaryKey]

View File

@@ -0,0 +1,17 @@
using LinqToDB.Mapping;
namespace SeniorAssistant.Models.Users
{
public class Doctor : IHasUsername
{
[Column(IsPrimaryKey = true, CanBeNull = false)]
public string Username { get; set; }
[Association(ThisKey = "Username", OtherKey = nameof(User.Username), CanBeNull = false)]
public User UserData { get; set; }
public string Location { get; set; }
public string Schedule { get; set; }
}
}

View File

@@ -0,0 +1,18 @@
using LinqToDB.Mapping;
namespace SeniorAssistant.Models.Users
{
public class Patient : IHasUsername
{
[Column(IsPrimaryKey = true, CanBeNull = false)]
public string Username { get; set; }
[Association(ThisKey = "Username", OtherKey = nameof(User.Username), CanBeNull = false)]
public User UserData { get; set; }
[NotNull]
public string Doctor { get; set; }
public string Notes { get; set; }
}
}

View File

@@ -1,26 +1,22 @@
using LinqToDB.Mapping;
using Microsoft.AspNetCore.Identity;
using Newtonsoft.Json;
namespace SeniorAssistant.Models
{
public class User : IHasUsername
{
[PrimaryKey]
[NotNull]
[Column(IsPrimaryKey = true, CanBeNull = false)]
public string Username { get; set; }
[NotNull]
public string Email { get; set; }
[NotNull]
[JsonIgnore]
public string Password { get; set; }
[NotNull]
public bool Doctor { get; set; }
public string Name { get; set; }
public string LastName { get; set; }
}
}