blob: 092c7faf3b8b78fcd89a1fc147535357d0e878e4 (
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using DevHive.Services.Services;
using DevHive.Web.Models.Message;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace DevHive.Web.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class MessageController : ControllerBase
{
private readonly MessageService _messageService;
public MessageController(MessageService messageService)
{
this._messageService = messageService;
}
[HttpPost]
[Authorize(Roles = "User,Admin")]
public async Task<IActionResult> Create(Guid userId, [FromBody] CreateMessageWebModel createMessageWebModel, [FromHeader] string authorization)
{
throw new NotImplementedException();
}
[HttpGet]
[Authorize(Roles = "User,Admin")]
public async Task<IActionResult> Read(Guid id)
{
throw new NotImplementedException();
}
[HttpPut]
[Authorize(Roles = "User,Admin")]
public async Task<IActionResult> Update(Guid userId, [FromBody] object updateMessageWebModel, [FromHeader] string authorization)
{
//TODO: Authorize user
throw new NotImplementedException();
}
[HttpDelete]
[Authorize(Roles = "User,Admin")]
public async Task<IActionResult> Delete(Guid id, [FromHeader] string authorization)
{
//TODO: Authorize user
throw new NotImplementedException();
}
}
}
|