Initial commit
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
namespace WebDesktopBackend.Entitys.Files {
|
||||
public class DirectoryContent {
|
||||
public string[] Files { get; set; }
|
||||
public string[] Directories { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
|
||||
namespace WebDesktopBackend.Entitys.Files {
|
||||
public class DirectoryInformation {
|
||||
public string Name { get; set; }
|
||||
public DateTime Created { get; set; }
|
||||
public long Size { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
|
||||
namespace WebDesktopBackend.Entitys.Files {
|
||||
public class FileInformation {
|
||||
public string Name { get; set; }
|
||||
public DateTime Created { get; set; }
|
||||
public long Size { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace WebDesktopBackend.Entitys.Files {
|
||||
public class FileShare {
|
||||
public string Id { get; set; }
|
||||
public string Owner { get; set; }
|
||||
public string File { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace WebDesktopBackend.Entitys.Permissions {
|
||||
public class Permission {
|
||||
public const int NotSet = 0;
|
||||
public const int Allow = 1;
|
||||
public const int Deny = 2;
|
||||
|
||||
public int Id { get; set; }
|
||||
public string UserId { get; set; }
|
||||
public string PermissionName { get; set; }
|
||||
public int Type { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace WebDesktopBackend.Entitys.Permissions {
|
||||
public class PermissionGroup {
|
||||
public string Permission { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string[] Permissions { get; set; }
|
||||
public string[] Inherits { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
|
||||
namespace WebDesktopBackend.Entitys.Tokens {
|
||||
public class AccessToken {
|
||||
public string Id { get; set; }
|
||||
public string RefreshTokenId { get; set; }
|
||||
public DateTime ExpirationDate { get; set; }
|
||||
}
|
||||
|
||||
public class AccessTokenResponse {
|
||||
public string Id { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
|
||||
namespace WebDesktopBackend.Entitys.Tokens {
|
||||
public class RefreshToken {
|
||||
public string Id { get; set; }
|
||||
public string UserId { get; set; }
|
||||
public DateTime ExpirationDate { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace WebDesktopBackend.Entitys.Tokens {
|
||||
public class Tokens {
|
||||
public RefreshToken refreshToken { get; set; }
|
||||
public AccessToken accessToken { get; set; }
|
||||
}
|
||||
}
|
||||
20
Projekte/WebDesktop/WebDesktopBackend/Entitys/User/User.cs
Normal file
20
Projekte/WebDesktop/WebDesktopBackend/Entitys/User/User.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
|
||||
namespace WebDesktopBackend.Entitys.User {
|
||||
public class User : UserEditor {
|
||||
public string Id { get; set; }
|
||||
public DateTime Created { get; set; }
|
||||
|
||||
public User CreateCopy() {
|
||||
return new User {
|
||||
Id = Id,
|
||||
Created = Created,
|
||||
FirstName = FirstName,
|
||||
LastName = LastName,
|
||||
Email = Email,
|
||||
Username = Username,
|
||||
Password = "ENCRYPTED"
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
namespace WebDesktopBackend.Entitys.User {
|
||||
public class UserEditor {
|
||||
public string FirstName { get; set; }
|
||||
public string LastName { get; set; }
|
||||
public string Email { get; set; }
|
||||
public string Username { get; set; }
|
||||
public string Password { get; set; }
|
||||
|
||||
public void EditUser(User user) {
|
||||
Trim();
|
||||
user.FirstName = string.IsNullOrEmpty(FirstName) ? user.FirstName : FirstName;
|
||||
user.LastName = string.IsNullOrEmpty(LastName) ? user.LastName : LastName;
|
||||
user.Email = string.IsNullOrEmpty(Email) ? user.Email : Email;
|
||||
user.Username = string.IsNullOrEmpty(Username) ? user.Username : Username;
|
||||
user.Password = string.IsNullOrEmpty(Password) ? user.Password : Password;
|
||||
}
|
||||
|
||||
public void Trim() {
|
||||
FirstName = FirstName.Trim();
|
||||
LastName = LastName.Trim();
|
||||
Email = Email.Trim();
|
||||
Username = Username.Trim();
|
||||
Password = Password.Trim();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace WebDesktopBackend.Entitys.User {
|
||||
public class UserLogin {
|
||||
public string Username { get; set; }
|
||||
public string Email { get; set; }
|
||||
public string Password { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user