aboutsummaryrefslogtreecommitdiff
path: root/API/Service/UserService.cs
blob: a2d671a7889fd4f71feae44fbfa830638e32f6e7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System.Net;
using System.Net.Http;
using System.Net.Http.Json;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
using API.Database;
using Microsoft.AspNetCore.Mvc;
using Models.Classes;
using Models.DTOs;
using Newtonsoft.Json;

namespace API.Service
{
	public class UserService
	{
		private readonly DbRepository<User> _dbRepository;

		public UserService(DevHiveContext context)
		{
			this._dbRepository = new DbRepository<User>(context);
		}
	
		[HttpPost]
		public async Task<HttpStatusCode> CreateUser(UserDTO userDTO)
		{
			//TODO: MAKE VALIDATIONS OF PROPER REQUEST
			//UserDTO newUser = JsonConvert.DeserializeObject<UserDTO>(userDTO);

			//await this._dbRepository.AddAsync(newUser);
			return HttpStatusCode.OK;
		}
	}
}