add: Контракты пользователя

This commit is contained in:
mfnefd 2024-11-25 16:05:52 +04:00
parent a7529c4e5e
commit 1e107f86ec
5 changed files with 47 additions and 0 deletions

View 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; }
}

View 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);
}

View File

@ -0,0 +1,6 @@
namespace Contracts.SearchModels;
public class UserSearch
{
public Guid? Id { get; set; }
}

View 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);
}

View 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; }
}