-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
9c8bafc
commit a155c6e
Showing
7 changed files
with
117 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
|
||
namespace UserService.Application.Interfaces | ||
{ | ||
public interface ILogger | ||
{ | ||
void Log(string message); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
UserService/UserService.Application/Interfaces/Persistence/IUserRepository.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,19 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using UserService.Domain.Entities; | ||
|
||
namespace UserService.Application.Interfaces.Persistence | ||
{ | ||
|
||
/* All concrete implementations for a user repository will implement this interface */ | ||
public interface IUserRepository | ||
{ | ||
|
||
void CreateUser(string email, string password); | ||
|
||
User GetUser(string email); | ||
|
||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
UserService/UserService.Application/Interfaces/Persistence/IUserService.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,16 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using UserService.Domain.Entities; | ||
|
||
namespace UserService.Application.Interfaces.Persistence | ||
{ | ||
public interface IUserService | ||
{ | ||
|
||
void Register(string username, string password); | ||
|
||
User Login(string username, string password); | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
UserService/UserService.Application/Services/UserService.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,41 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using UserService.Application.Interfaces; | ||
using UserService.Application.Interfaces.Persistence; | ||
using UserService.Domain.Entities; | ||
|
||
namespace UserService.Application.Services | ||
{ | ||
public class UserService : IUserService | ||
{ | ||
|
||
private readonly IUserRepository _userRepository; | ||
private readonly ILogger _logger; | ||
|
||
public UserService(IUserRepository userRepository, ILogger logger) | ||
{ | ||
this._userRepository = userRepository; | ||
this._logger = logger; | ||
} | ||
|
||
public void Register(string username, string password) | ||
{ | ||
try { | ||
|
||
//logic | ||
|
||
} catch(Exception err) { | ||
_logger.Log(err.Message); | ||
} | ||
} | ||
|
||
public User Login(string username, string password) | ||
{ | ||
|
||
throw new NotImplementedException(); | ||
|
||
} | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
UserService/UserService.Application/UserService.Application.csproj
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
25 changes: 25 additions & 0 deletions
25
UserService/UserService.Application/UserService.Application.sln
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,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.5.002.0 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UserService.Application", "UserService.Application.csproj", "{C43A8D5F-7F20-43D7-9D6F-275641EB9147}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{C43A8D5F-7F20-43D7-9D6F-275641EB9147}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{C43A8D5F-7F20-43D7-9D6F-275641EB9147}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{C43A8D5F-7F20-43D7-9D6F-275641EB9147}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{C43A8D5F-7F20-43D7-9D6F-275641EB9147}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {1E9CE0BC-CBEC-4B1D-BCEA-3E7D7FAFC1AB} | ||
EndGlobalSection | ||
EndGlobal |
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 |
---|---|---|
|
@@ -35,7 +35,5 @@ public HashSet<UserId> GetFollowers() | |
{ | ||
return this._followers; | ||
} | ||
|
||
|
||
|
||
} |