add "me" endpoint
This commit is contained in:
parent
98b38f645f
commit
ae1a8d2b97
7 changed files with 49 additions and 10 deletions
32
SurveyBackend/SurveyBackend.API/Mappers/UserMapper.cs
Normal file
32
SurveyBackend/SurveyBackend.API/Mappers/UserMapper.cs
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
using SurveyBackend.Core.Models;
|
||||
using SurveyBackend.DTOs;
|
||||
using SurveyBackend.DTOs.User;
|
||||
|
||||
namespace SurveyBackend.Mappers;
|
||||
|
||||
/// <summary>
|
||||
/// Маппер всего связанного с авторизацией
|
||||
/// </summary>
|
||||
public static class UserMapper
|
||||
{
|
||||
/// <summary>
|
||||
/// Перегнать схему регистрации в нового юзера
|
||||
/// </summary>
|
||||
/// <param name="dto"></param>
|
||||
/// <returns></returns>
|
||||
public static User UserRegistrationToModel(UserRegistrationDto dto) => new User
|
||||
{
|
||||
Email = dto.Email,
|
||||
FirstName = dto.FirstName,
|
||||
LastName = dto.LastName,
|
||||
Password = dto.Password,
|
||||
};
|
||||
|
||||
public static UserOutputDto ModelToOutput(User model) => new UserOutputDto
|
||||
{
|
||||
Id = model.Id,
|
||||
FirstName = model.FirstName,
|
||||
LastName = model.LastName,
|
||||
Email = model.Email,
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue