-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUserController.cs
More file actions
53 lines (47 loc) · 1.62 KB
/
UserController.cs
File metadata and controls
53 lines (47 loc) · 1.62 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using FarmLabService.Services;
using Microsoft.AspNetCore.Mvc;
namespace FarmLabService.Controllers
{
[Route("api/[controller]")]
public class UserController : Controller
{
private readonly IUserRepository _userRepository;
public UserController(IUserRepository userRepository)
{
_userRepository = userRepository;
}
// GET api/UserItem/Billy@google.com
//[HttpGet("{id}")]
//public async Task<IActionResult> Get(string id)
//{
// var user = await _userRepository.GetByIdAsync(id);
// if (user != null)
// {
// return Ok(new UserInfoXxxx(user));
// }
// return BadRequest("UserItem not registred");
//}
//[HttpPost]
//public async Task<IActionResult> Create([FromBody] UserItemXxxx item)
//{
// try
// {
// if (item == null || !ModelState.IsValid)
// {
// return BadRequest(ErrorCode.TodoItemNameAndNotesRequired.ToString());
// }
// bool itemExists = await _userRepository.DoesItemExistAsync(item.Email);
// if (itemExists)
// {
// return StatusCode(StatusCodes.Status409Conflict, ErrorCode.TodoItemIDInUse.ToString());
// }
// await _userRepository.InsertAsync(item);
// }
// catch (Exception)
// {
// return BadRequest(ErrorCode.CouldNotCreateItem.ToString());
// }
// return Ok(item);
//}
}
}