-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
cuong
committed
Apr 6, 2024
1 parent
d48e3cc
commit eee7b9d
Showing
6 changed files
with
199 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System.IO; | ||
|
||
namespace DotnetGRPC.Model.DTO | ||
{ | ||
public class Email | ||
{ | ||
public string[] To { get; set; } | ||
public string[] Cc { get; set; } | ||
public string[] Bcc { get; set; } | ||
public string Subject { get; set; } | ||
public string HtmlBody { get; set; } | ||
public FileInfo FileAttachment { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace DotnetGRPC.Model.DTO | ||
{ | ||
public class EmailSettings | ||
{ | ||
public string Host { get; set; } | ||
public int Port { get; set; } | ||
public string Username { get; set; } | ||
public string Password { get; set; } | ||
public bool EnableSsl { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System; | ||
using System.ComponentModel.DataAnnotations; | ||
using System.ComponentModel.DataAnnotations.Schema; | ||
|
||
namespace DotnetGRPC.Model | ||
{ | ||
[Table("faculty")] | ||
public class Faculty | ||
{ | ||
[Key] | ||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] | ||
public long Id { get; set; } | ||
|
||
[Required] | ||
public string Name { get; set; } | ||
|
||
[Required] | ||
[Column("created_at")] | ||
public DateTime CreatedAt { get; set; } | ||
|
||
[Required] | ||
[Column("updated_at")] | ||
public DateTime UpdatedAt { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System; | ||
using System.ComponentModel.DataAnnotations; | ||
using System.ComponentModel.DataAnnotations.Schema; | ||
|
||
namespace DotnetGRPC.Model | ||
{ | ||
[Table("notification")] | ||
public class Notification | ||
{ | ||
[Key] | ||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] | ||
[Column("id")] | ||
public long Id { get; set; } | ||
|
||
[ForeignKey("UserId")] | ||
public User User { get; set; } | ||
|
||
[Required] | ||
[Column("user_id")] | ||
public long UserId { get; set; } | ||
|
||
|
||
[Required] | ||
[Column("with_email")] | ||
public bool WithEmail { get; set; } | ||
|
||
[Required] | ||
[Column("content")] | ||
public string Content { get; set; } | ||
|
||
[Column("url")] | ||
public string? Url { get; set; } | ||
|
||
[Required] | ||
[Column("seen")] | ||
public bool Seen { get; set; } | ||
|
||
[Required] | ||
[Column("created_at")] | ||
public DateTime CreatedAt { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System; | ||
using System.ComponentModel.DataAnnotations; | ||
using System.ComponentModel.DataAnnotations.Schema; | ||
|
||
namespace DotnetGRPC.Model | ||
{ | ||
[Table("template")] | ||
public class Template | ||
{ | ||
[Key] | ||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] | ||
[Column("id")] | ||
public long Id { get; set; } | ||
|
||
[Required] | ||
[Column("template_code")] | ||
public string TemplateCode { get; set; } | ||
|
||
[Required] | ||
[Column("template_name")] | ||
public string TemplateName { get; set; } | ||
|
||
[Required] | ||
[Column("template_description")] | ||
public string TemplateDescription { get; set; } | ||
|
||
[Required] | ||
[Column("template_content")] | ||
public string TemplateContent { get; set; } | ||
|
||
[Required] | ||
[Column("created_at")] | ||
public DateTime CreatedAt { get; set; } | ||
|
||
[Required] | ||
[Column("updated_at")] | ||
public DateTime UpdatedAt { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
using System; | ||
using System.ComponentModel.DataAnnotations; | ||
using System.ComponentModel.DataAnnotations.Schema; | ||
|
||
namespace DotnetGRPC.Model | ||
{ | ||
[Table("user")] | ||
public class User | ||
{ | ||
[Key] | ||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)] | ||
[Column("id")] | ||
public long Id { get; set; } | ||
|
||
[Required] | ||
[Column("username")] | ||
public string Username { get; set; } | ||
Check warning on line 17 in DotnetGRPC/Model/User.cs GitHub Actions / build
|
||
|
||
[Required] | ||
[Column("password")] | ||
public string Password { get; set; } | ||
|
||
[Required] | ||
[Column("secret")] | ||
public string Secret { get; set; } | ||
|
||
[Required] | ||
[Column("role")] | ||
public RoleType Role { get; set; } | ||
|
||
public enum RoleType | ||
{ | ||
Administrator, Student, Guest | ||
} | ||
|
||
[Required] | ||
[Column("email")] | ||
public string Email { get; set; } | ||
|
||
[Required] | ||
[Column("first_name")] | ||
public string FirstName { get; set; } | ||
|
||
[Required] | ||
[Column("last_name")] | ||
public string LastName { get; set; } | ||
|
||
[Required] | ||
[Column("account_status")] | ||
public AccountType AccountStatus { get; set; } | ||
|
||
public enum AccountType | ||
{ | ||
Active, Locked, Inactive | ||
} | ||
|
||
[Required] | ||
[Column("created_at")] | ||
public DateTime CreatedAt { get; set; } | ||
|
||
[Required] | ||
[Column("updated_at")] | ||
public DateTime UpdatedAt { get; set; } | ||
|
||
[ForeignKey("FacultyId")] | ||
public Faculty Faculty { get; set; } | ||
} | ||
} |