Initial commit
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using WebDesktopBackend.Entitys.Files;
|
||||
|
||||
namespace WebDesktopBackend.Contract.Persistance {
|
||||
public interface IFileRepository {
|
||||
void InitUser(string userId);
|
||||
void DeleteUserFolder(string userId);
|
||||
bool CreateDirectory(string directory, string name);
|
||||
Task UploadFile(IFormFile file, string directory);
|
||||
Task UploadJson(string directory, string name, string data);
|
||||
FileStream DownloadFile(string path);
|
||||
Task<string> DownloadJson(string file);
|
||||
DirectoryContent GetDirectory(string directory);
|
||||
DirectoryInformation GetDirectoryInformation(string directory);
|
||||
FileInformation GetFileInformation(string file);
|
||||
void MoveDirectory(string directory, string to);
|
||||
void MoveFile(string file, string to);
|
||||
void Delete(string url);
|
||||
string GenerateShareId(string url, string owner);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using WebDesktopBackend.Entitys.Permissions;
|
||||
|
||||
namespace WebDesktopBackend.Contract.Persistance {
|
||||
public interface IGroupRepository {
|
||||
PermissionGroup GetPermissionGroup(string name);
|
||||
PermissionGroup[] GetGroupsFromUser(string userId);
|
||||
PermissionGroup[] ExtractGroups(Permission[] permissions);
|
||||
Permission[] GetUserPermissions(string id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
using WebDesktopBackend.Entitys.Permissions;
|
||||
using WebDesktopBackend.Entitys.Tokens;
|
||||
|
||||
namespace WebDesktopBackend.Contract.Persistance {
|
||||
public interface ITokenRepository {
|
||||
RefreshToken GetRefreshToken(string id);
|
||||
AccessToken GetAccessToken(string id);
|
||||
bool ValidateAccessToken(string id);
|
||||
bool ValidateRefreshToken(string id);
|
||||
RefreshToken CreateRefreshToken(string userId);
|
||||
AccessToken CreateAccessToken(string refreshTokenId);
|
||||
void DeleteUserTokens(string id);
|
||||
void DeleteRefreshToken(string id);
|
||||
Permission[] GetUserPermissions(string id);
|
||||
void AddPermission(string id, string permission);
|
||||
void DeletePermission(string id, string permission);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using WebDesktopBackend.Entitys.User;
|
||||
|
||||
namespace WebDesktopBackend.Contract.Persistance {
|
||||
public interface IUserRepository {
|
||||
User AddUser(UserEditor editor);
|
||||
void EditUser(string id, UserEditor editor);
|
||||
void DeleteUser(string id);
|
||||
User GetUser(string id);
|
||||
User GetUserByUsername(string username);
|
||||
User GetUserByEmail(string email);
|
||||
User GetUserFromLogin(UserLogin login);
|
||||
User[] GetUsers();
|
||||
bool Login(UserLogin login);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user