Add project files.

This commit is contained in:
2024-03-06 22:56:56 +05:30
parent 7fa8f770f7
commit 36feb20d97
12 changed files with 595 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
namespace APISocietyToolBox.Models
{
public class UserDto
{
public string Username { get; set; } = string.Empty;
public string Password { get; set; } = string.Empty;
}
}
+110
View File
@@ -0,0 +1,110 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
namespace APISocietyToolBox.Models
{
public class UserModel
{
public Int64? UserID { get; set; } = null;
public string UserName { get; set; } = string.Empty;
public string LoginName { get; set; } = string.Empty;
public string LoginPassword { get; set; } = string.Empty;
public string PasswordSalt { get; set; } = string.Empty;
public string UserRole { get; set; } = string.Empty;
public Int64? UserRoleID { get; set; }
public Int64? PropertyID { get; set; }
public string? RefreshToken { get; set; } = string.Empty;
public DateTime? TokenCreated { get; set; }
public DateTime? TokenExpires { get; set; }
}
public class UserTokenRefreshModel
{
public Int64 UserID { get; set; }
public int UserRoleID { get; set; }
public string? UserName { get; set; } = string.Empty;
public string? UserRole { get; set; } = string.Empty;
public string? RefreshToken { get; set; } = string.Empty;
}
public class UserTokenModel
{
public int? Status { get; set; }
public string StatusMessage { get; set; } = string.Empty;
public string? UserName { get; set; } = string.Empty;
public string? UserRole { get; set; } = string.Empty;
public Int64? UserRoleID { get; set; } = null;
public Int64? UserID { get; set; } = null;
public int PropertyID { get; set; }
public string? RefreshToken { get; set; } = string.Empty;
public DateTime? TokenCreated { get; set; }
public DateTime? TokenExpires { get; set; }
}
public class LoginResponseModel
{
public int? Status { get; set; }
public string StatusMessage { get; set; } = string.Empty;
[Key]
public Int64 UserID { get; set; }
public Int64 UserRoleID { get; set; }
public string UserRole { get; set; } = string.Empty;
public string UserName { get; set; } = string.Empty;
public string LoginPassword { get; set; } = string.Empty;
public string PasswordSalt { get; set; } = string.Empty;
public Int64 PropertyID { get; set; }
}
public class UserResponseModel
{
[Key]
public Int64 UserID { get; set; }
public string UserName { get; set; } = string.Empty;
public int Status { get; set; }
public string StatusMessage { get; set; } = string.Empty;
}
public class UserRequestModel
{
public string UserName { get; set; } = string.Empty;
public string LoginName { get; set; } = string.Empty;
public string LoginPassword { get; set; } = string.Empty;
public string UserRole { get; set; } = string.Empty;
public int UserRoleID { get; set; }
public int PropertyID { get; set; }
public string? RefreshToken { get; set; } = string.Empty;
public DateTime? TokenCreated { get; set; }
public DateTime? TokenExpires { get; set; }
}
public class UserTokens
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public Int64 UserTokenID { get; set; }
public Int64? UserID { get; set; }
public Int64? UserRoleID { get; set; }
public Int64? PropertyID { get; set; }
public string? RefreshToken { get; set; }
public DateTime? TokenExpires { get; set; }
public DateTime? TokenCreated { get; set; }
}
public class RefreshToken
{
public string Token { get; set; } = string.Empty;
public DateTime Created { get; set; } = DateTime.Now;
public DateTime Expires { get; set; }
public int UserID { get; set; }
public string UserName { get; set; } = string.Empty;
public int PropertyID { get; set; }
}
}