aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/DevHive.Services/Interfaces/IUserService.cs4
-rw-r--r--src/DevHive.Services/Services/UserService.cs2
-rw-r--r--src/DevHive.Web/Controllers/RoleController.cs2
-rw-r--r--src/DevHive.Web/Controllers/UserController.cs6
-rw-r--r--src/DevHive.Web/Properties/launchSettings.json59
-rw-r--r--src/DevHive.Web/appsettings.json30
-rw-r--r--src/DevHive.code-workspace20
7 files changed, 61 insertions, 62 deletions
diff --git a/src/DevHive.Services/Interfaces/IUserService.cs b/src/DevHive.Services/Interfaces/IUserService.cs
index 19bb939..ef22000 100644
--- a/src/DevHive.Services/Interfaces/IUserService.cs
+++ b/src/DevHive.Services/Interfaces/IUserService.cs
@@ -2,8 +2,6 @@ using System;
using System.Threading.Tasks;
using DevHive.Common.Models.Identity;
using DevHive.Services.Models.Identity.User;
-using DevHive.Services.Models.Language;
-using DevHive.Services.Models.Technology;
namespace DevHive.Services.Interfaces
{
@@ -14,7 +12,7 @@ namespace DevHive.Services.Interfaces
Task<bool> AddFriend(Guid userId, Guid friendId);
- Task<UserServiceModel> GetFriend(string username);
+ Task<UserServiceModel> GetUserByUsername(string username);
Task<UserServiceModel> GetUserById(Guid id);
Task<UserServiceModel> UpdateUser(UpdateUserServiceModel updateModel);
diff --git a/src/DevHive.Services/Services/UserService.cs b/src/DevHive.Services/Services/UserService.cs
index d4c6f81..bf18007 100644
--- a/src/DevHive.Services/Services/UserService.cs
+++ b/src/DevHive.Services/Services/UserService.cs
@@ -118,7 +118,7 @@ namespace DevHive.Services.Services
return this._userMapper.Map<UserServiceModel>(user);
}
- public async Task<UserServiceModel> GetFriend(string username)
+ public async Task<UserServiceModel> GetUserByUsername(string username)
{
User friend = await this._userRepository.GetByUsernameAsync(username);
diff --git a/src/DevHive.Web/Controllers/RoleController.cs b/src/DevHive.Web/Controllers/RoleController.cs
index 5b3dca5..f173ea4 100644
--- a/src/DevHive.Web/Controllers/RoleController.cs
+++ b/src/DevHive.Web/Controllers/RoleController.cs
@@ -8,7 +8,7 @@ using DevHive.Services.Models.Identity.Role;
namespace DevHive.Web.Controllers
{
- [ApiController]
+ [ApiController]
[Route("/api/[controller]")]
//[Authorize(Roles = "Admin")]
public class RoleController
diff --git a/src/DevHive.Web/Controllers/UserController.cs b/src/DevHive.Web/Controllers/UserController.cs
index a306007..dc27cbf 100644
--- a/src/DevHive.Web/Controllers/UserController.cs
+++ b/src/DevHive.Web/Controllers/UserController.cs
@@ -72,11 +72,11 @@ namespace DevHive.Web.Controllers
}
[HttpGet]
- [Route("GetFriend")]
+ [Route("GetUser")]
[AllowAnonymous]
- public async Task<IActionResult> GetAFriend(string username)
+ public async Task<IActionResult> GetUser(string username)
{
- UserServiceModel friendServiceModel = await this._userService.GetFriend(username);
+ UserServiceModel friendServiceModel = await this._userService.GetUserByUsername(username);
UserWebModel friend = this._userMapper.Map<UserWebModel>(friendServiceModel);
return new OkObjectResult(friend);
diff --git a/src/DevHive.Web/Properties/launchSettings.json b/src/DevHive.Web/Properties/launchSettings.json
index 44d86fc..5deaadb 100644
--- a/src/DevHive.Web/Properties/launchSettings.json
+++ b/src/DevHive.Web/Properties/launchSettings.json
@@ -1,31 +1,28 @@
-{
- "$schema": "http://json.schemastore.org/launchsettings.json",
- "iisSettings": {
- "windowsAuthentication": false,
- "anonymousAuthentication": true,
- "iisExpress": {
- "applicationUrl": "http://localhost:1955",
- "sslPort": 44326
- }
- },
- "profiles": {
- "IIS Express": {
- "commandName": "IISExpress",
- "launchBrowser": true,
- "launchUrl": "swagger",
- "environmentVariables": {
- "ASPNETCORE_ENVIRONMENT": "Development"
- }
- },
- "DevHive.Web": {
- "commandName": "Project",
- "dotnetRunMessages": "true",
- "launchBrowser": true,
- "launchUrl": "swagger",
- "applicationUrl": "http://localhost:5000",
- "environmentVariables": {
- "ASPNETCORE_ENVIRONMENT": "Development"
- }
- }
- }
-}
+{
+ "$schema": "http://json.schemastore.org/launchsettings.json",
+ "iisSettings": {
+ "windowsAuthentication": false,
+ "anonymousAuthentication": true,
+ "iisExpress": {
+ "applicationUrl": "http://localhost:1955",
+ "sslPort": 44326
+ }
+ },
+ "profiles": {
+ "IIS Express": {
+ "commandName": "IISExpress",
+ "launchBrowser": false,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ },
+ "DevHive.Web": {
+ "commandName": "Project",
+ "dotnetRunMessages": "true",
+ "launchBrowser": false,
+ "environmentVariables": {
+ "ASPNETCORE_ENVIRONMENT": "Development"
+ }
+ }
+ }
+}
diff --git a/src/DevHive.Web/appsettings.json b/src/DevHive.Web/appsettings.json
index a460532..83932a7 100644
--- a/src/DevHive.Web/appsettings.json
+++ b/src/DevHive.Web/appsettings.json
@@ -1,15 +1,15 @@
-{
- "AppSettings": {
- "Secret": "gXfQlU6qpDleFWyimscjYcT3tgFsQg3yoFjcvSLxG56n1Vu2yptdIUq254wlJWjm"
- },
- "ConnectionStrings": {
- "DEV": "Server=localhost;Port=5432;Database=API;User Id=postgres;Password=;"
- },
- "Logging" : {
- "LogLevel" : {
- "Default" : "Information",
- "Microsoft" : "Warning",
- "Microsoft.Hosting.Lifetime" : "Information"
- }
- }
-}
+{
+ "AppSettings": {
+ "Secret": "gXfQlU6qpDleFWyimscjYcT3tgFsQg3yoFjcvSLxG56n1Vu2yptdIUq254wlJWjm"
+ },
+ "ConnectionStrings": {
+ "DEV": "Server=localhost;Port=5432;Database=API;User Id=postgres;Password=;"
+ },
+ "Logging": {
+ "LogLevel": {
+ "Default": "Information",
+ "Microsoft": "Warning",
+ "Microsoft.Hosting.Lifetime": "Information"
+ }
+ }
+}
diff --git a/src/DevHive.code-workspace b/src/DevHive.code-workspace
index 28b1e3c..10c4276 100644
--- a/src/DevHive.code-workspace
+++ b/src/DevHive.code-workspace
@@ -46,7 +46,7 @@
"launch": {
"configurations": [
{
- "name": ".NET Core Launch (web)",
+ "name": "Launch API",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "workspace-build",
@@ -54,16 +54,20 @@
"args": [],
"cwd": "${workspaceFolder:DevHive.Web}",
"stopAtEntry": false,
- "serverReadyAction": {
- "action": "openExternally",
- "pattern": "\\bNow listening on:\\s+(https?://\\S+)"
- },
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
- "launchBrowser": {
- "enabled": false
- }
+ },
+ {
+ "name": "Launch Data Tests",
+ "type": "coreclr",
+ "request": "launch",
+ "preLaunchTask": "workspace-build",
+ "program": "${workspaceFolder:DevHive.Tests}/DevHive.Data.Tests/bin/Debug/net5.0/DevHive.Data.Tests.dll",
+ "args": [],
+ "cwd": "${workspaceFolder:DevHive.Tests}/DevHive.Data.Tests",
+ "console": "internalConsole",
+ "stopAtEntry": false
},
],
"compounds": []