-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
165 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
NotaionWebApp/Notaion.Application/DTOs/Users/UserResponseDto.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Notaion.Application.DTOs.Users | ||
{ | ||
public class UserResponseDto | ||
{ | ||
public string? UserName { get; set; } | ||
public string? Email { get; set; } | ||
public string? Avatar { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
NotaionWebApp/Notaion.Application/Interfaces/IChatService.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using Notaion.Application.DTOs.Chats; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Notaion.Application.Interfaces | ||
{ | ||
public interface IChatService | ||
{ | ||
Task<List<ChatResponseDto>> GetChatsAsync(); | ||
Task<List<ChatResponseDto>> GetChatsHiddenAsync(); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
NotaionWebApp/Notaion.Application/Mappings/ChatMappingProfile.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using AutoMapper; | ||
using Notaion.Application.DTOs.Chats; | ||
using Notaion.Domain.Entities; | ||
|
||
namespace Notaion.Application.Mappings | ||
{ | ||
public class ChatMappingProfile : Profile | ||
{ | ||
public ChatMappingProfile() | ||
{ | ||
CreateMap<Chat, ChatResponseDto>() | ||
.ForMember(dest => dest.IsHiden, opt => opt.MapFrom(src => src.Hide)); // config auto mapper - prefix | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
NotaionWebApp/Notaion.Application/Mappings/UserMappingProfile.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using AutoMapper; | ||
using Notaion.Application.DTOs.Users; | ||
using Notaion.Domain.Entities; | ||
|
||
namespace Notaion.Application.Mappings | ||
{ | ||
public class UserMappingProfile : Profile | ||
{ | ||
public UserMappingProfile() | ||
{ | ||
CreateMap<User, UserResponseDto>(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using AutoMapper; | ||
using Notaion.Application.DTOs.Chats; | ||
using Notaion.Application.Interfaces; | ||
using Notaion.Domain.Interfaces; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Notaion.Application.Services | ||
{ | ||
public class ChatService : IChatService | ||
{ | ||
private readonly IChatRepository _chatRepository; | ||
private readonly IMapper _mapper; | ||
public ChatService(IChatRepository chatRepository, IMapper mapper) | ||
{ | ||
_chatRepository = chatRepository; | ||
_mapper = mapper; | ||
} | ||
public async Task<List<ChatResponseDto>> GetChatsAsync() | ||
{ | ||
var chats = await _chatRepository.GetChatsAsync(); | ||
return _mapper.Map<List<ChatResponseDto>>(chats); | ||
} | ||
|
||
public async Task<List<ChatResponseDto>> GetChatsHiddenAsync() | ||
{ | ||
var chats = await _chatRepository.GetChatsHiddenAsync(); | ||
return _mapper.Map<List<ChatResponseDto>>(chats); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
...plication/Repositories/IChatRepository.cs → ...aion.Domain/Interfaces/IChatRepository.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
using Notaion.Application.DTOs; | ||
using Notaion.Domain.Entities; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Notaion.Application.Repositories | ||
namespace Notaion.Domain.Interfaces | ||
{ | ||
public interface IChatRepository | ||
{ | ||
List<GetChatRequest> GetChats(); | ||
List<GetChatRequest> GetChatsHide(); | ||
Task<List<Chat>> GetChatsAsync(); | ||
Task<List<Chat>> GetChatsHiddenAsync(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.