Class ChannelsController
- Namespace
- EchoHub.Server.Controllers
- Assembly
- EchoHub.Server.dll
[ApiController]
[Route("api/channels")]
[Authorize]
[EnableRateLimiting("general")]
public class ChannelsController : ControllerBase
- Inheritance
-
ChannelsController
- Inherited Members
Constructors
ChannelsController(EchoHubDbContext, FileStorageService, ImageToAsciiService, IHttpClientFactory, IHubContext<ChatHub, IEchoHubClient>)
public ChannelsController(EchoHubDbContext db, FileStorageService fileStorage, ImageToAsciiService asciiService, IHttpClientFactory httpClientFactory, IHubContext<ChatHub, IEchoHubClient> hubContext)
Parameters
dbEchoHubDbContextfileStorageFileStorageServiceasciiServiceImageToAsciiServicehttpClientFactoryIHttpClientFactoryhubContextIHubContext<ChatHub, IEchoHubClient>
Methods
CreateChannel(CreateChannelRequest)
[HttpPost]
public Task<IActionResult> CreateChannel(CreateChannelRequest request)
Parameters
requestCreateChannelRequest
Returns
DeleteChannel(string)
[HttpDelete("{channel}")]
public Task<IActionResult> DeleteChannel(string channel)
Parameters
channelstring
Returns
GetChannels(int, int)
[HttpGet]
public Task<IActionResult> GetChannels(int offset = 0, int limit = 50)
Parameters
Returns
SendUrl(string, SendUrlRequest)
[HttpPost("{channel}/send-url")]
[EnableRateLimiting("upload")]
public Task<IActionResult> SendUrl(string channel, SendUrlRequest request)
Parameters
channelstringrequestSendUrlRequest
Returns
UpdateTopic(string, UpdateTopicRequest)
[HttpPut("{channel}/topic")]
public Task<IActionResult> UpdateTopic(string channel, UpdateTopicRequest request)
Parameters
channelstringrequestUpdateTopicRequest
Returns
Upload(string)
[HttpPost("{channel}/upload")]
[EnableRateLimiting("upload")]
public Task<IActionResult> Upload(string channel)
Parameters
channelstring