add: Контракты пользователя
This commit is contained in:
parent
a7529c4e5e
commit
1e107f86ec
9
back/Contracts/DTOs/UserDTO.cs
Normal file
9
back/Contracts/DTOs/UserDTO.cs
Normal file
@ -0,0 +1,9 @@
|
||||
namespace Contracts.DTO;
|
||||
|
||||
public class UserDto
|
||||
{
|
||||
public Guid? Id { get; set; }
|
||||
public string? Username { get; set; }
|
||||
public string? Password { get; set; }
|
||||
public decimal? Balance { get; set; }
|
||||
}
|
12
back/Contracts/Repositories/IUserRepo.cs
Normal file
12
back/Contracts/Repositories/IUserRepo.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using Contracts.DTO;
|
||||
using Contracts.SearchModels;
|
||||
|
||||
namespace Contracts.Repositories;
|
||||
|
||||
public interface IUserRepo
|
||||
{
|
||||
public Task<UserDto> Get(UserSearch search);
|
||||
public Task<UserDto> Create(UserDto user);
|
||||
public Task<UserDto> Update(UserDto user);
|
||||
public Task<UserDto> Delete(UserSearch search);
|
||||
}
|
6
back/Contracts/SearchModels/UserSearch.cs
Normal file
6
back/Contracts/SearchModels/UserSearch.cs
Normal file
@ -0,0 +1,6 @@
|
||||
namespace Contracts.SearchModels;
|
||||
|
||||
public class UserSearch
|
||||
{
|
||||
public Guid? Id { get; set; }
|
||||
}
|
12
back/Contracts/Services/IAuthService.cs
Normal file
12
back/Contracts/Services/IAuthService.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using Contracts.DTO;
|
||||
using Contracts.ViewModels;
|
||||
|
||||
namespace Contracts.Services;
|
||||
|
||||
public interface IAuthService
|
||||
{
|
||||
public Task<UserViewModel> Login();
|
||||
public Task<UserViewModel> Register(UserDto user);
|
||||
public Task<UserViewModel> UpdateUserData(UserDto user);
|
||||
public Task<UserViewModel> Delete(Guid id);
|
||||
}
|
8
back/Contracts/ViewModels/UserViewModel.cs
Normal file
8
back/Contracts/ViewModels/UserViewModel.cs
Normal file
@ -0,0 +1,8 @@
|
||||
namespace Contracts.ViewModels;
|
||||
|
||||
public class UserViewModel
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public decimal Balance { get; set; }
|
||||
}
|
Loading…
Reference in New Issue
Block a user