Add a controler for "User" (add and authenticate)
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using skydiveLogs_api.Model;
|
||||
|
||||
|
||||
namespace skydiveLogs_api.Business.Interface
|
||||
{
|
||||
public interface IAircraftService
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
using skydiveLogs_api.Model;
|
||||
|
||||
|
||||
namespace skydiveLogs_api.Business.Interface
|
||||
{
|
||||
public interface IDropZoneService
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
using skydiveLogs_api.Model;
|
||||
|
||||
|
||||
namespace skydiveLogs_api.Business.Interface
|
||||
{
|
||||
public interface IGearService
|
||||
@@ -11,8 +13,8 @@ namespace skydiveLogs_api.Business.Interface
|
||||
|
||||
void DeleteGearById(int id);
|
||||
|
||||
void UpdateGear(int id, Gear Gear);
|
||||
void UpdateGear(int id, Gear gear);
|
||||
|
||||
void AddNewGear(Gear Gear);
|
||||
void AddNewGear(Gear gear);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using skydiveLogs_api.Model;
|
||||
|
||||
|
||||
namespace skydiveLogs_api.Business.Interface
|
||||
{
|
||||
public interface IJumpService
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using skydiveLogs_api.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using skydiveLogs_api.Model;
|
||||
|
||||
|
||||
namespace skydiveLogs_api.Business.Interface
|
||||
{
|
||||
|
||||
11
Back/skydiveLogs-api.Business/Interface/IUserService.cs
Normal file
11
Back/skydiveLogs-api.Business/Interface/IUserService.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using skydiveLogs_api.Model;
|
||||
|
||||
namespace skydiveLogs_api.Business.Interface
|
||||
{
|
||||
public interface IUserService
|
||||
{
|
||||
User GetByLogin(string login, string password);
|
||||
|
||||
void AddNewUser(User user);
|
||||
}
|
||||
}
|
||||
32
Back/skydiveLogs-api.Business/UserService.cs
Normal file
32
Back/skydiveLogs-api.Business/UserService.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using skydiveLogs_api.Business.Interface;
|
||||
using skydiveLogs_api.Model;
|
||||
using skydiveLogs_api.Data.Interface;
|
||||
|
||||
|
||||
namespace skydiveLogs_api.Business
|
||||
{
|
||||
public class UserService : IUserService
|
||||
{
|
||||
public UserService(IUserRepository userRepository)
|
||||
{
|
||||
_userRepository = userRepository;
|
||||
}
|
||||
|
||||
public User GetByLogin(string login, string password)
|
||||
{
|
||||
var tmp = _userRepository.GetByLogin(login, password);
|
||||
|
||||
return tmp;
|
||||
}
|
||||
|
||||
public void AddNewUser(User newUser)
|
||||
{
|
||||
_userRepository.Add(newUser);
|
||||
}
|
||||
|
||||
private readonly IUserRepository _userRepository;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user