Class ChannelsController
- Namespace
- EchoHub.Server.Controllers
- Assembly
- EchoHub.Server.dll
[ApiController]
[Route("api/channels")]
[Authorize]
[EnableRateLimiting("general")]
public class ChannelsController : ControllerBase
- Inheritance
-
ControllerBase
ChannelsController
- Inherited Members
-
Constructors
ChannelsController(IChannelService, EchoHubDbContext, FileStorageService, ImageToAsciiService, IHttpClientFactory, IChatService, IMessageEncryptionService)
public ChannelsController(IChannelService channelService, EchoHubDbContext db, FileStorageService fileStorage, ImageToAsciiService asciiService, IHttpClientFactory httpClientFactory, IChatService chatService, IMessageEncryptionService encryption)
Parameters
channelService IChannelService
db EchoHubDbContext
fileStorage FileStorageService
asciiService ImageToAsciiService
httpClientFactory IHttpClientFactory
chatService IChatService
encryption IMessageEncryptionService
Methods
CreateChannel(CreateChannelRequest)
[HttpPost]
public Task<IActionResult> CreateChannel(CreateChannelRequest request)
Parameters
request CreateChannelRequest
Returns
- Task<IActionResult>
DeleteChannel(string)
[HttpDelete("{channel}")]
public Task<IActionResult> DeleteChannel(string channel)
Parameters
channel string
Returns
- Task<IActionResult>
GetChannels(int, int)
[HttpGet]
public Task<IActionResult> GetChannels(int offset = 0, int limit = 50)
Parameters
offset int
limit int
Returns
- Task<IActionResult>
SendUrl(string, SendUrlRequest, string?)
[HttpPost("{channel}/send-url")]
[EnableRateLimiting("upload")]
public Task<IActionResult> SendUrl(string channel, SendUrlRequest request, string? size = null)
Parameters
channel string
request SendUrlRequest
size string
Returns
- Task<IActionResult>
UpdateTopic(string, UpdateTopicRequest)
[HttpPut("{channel}/topic")]
public Task<IActionResult> UpdateTopic(string channel, UpdateTopicRequest request)
Parameters
channel string
request UpdateTopicRequest
Returns
- Task<IActionResult>
Upload(string, string?)
[HttpPost("{channel}/upload")]
[EnableRateLimiting("upload")]
[RequestSizeLimit(104857600)]
[RequestFormLimits(MultipartBodyLengthLimit = 104857600)]
public Task<IActionResult> Upload(string channel, string? size = null)
Parameters
channel string
size string
Returns
- Task<IActionResult>