Esempio n. 1
0
        public async Task <ActionResult <PrescriptionDto> > GetPrescriptionById(
            [FromRoute] GetById.Query query)
        {
            var res = await _mediator.Send(query);

            return(res is null?NotFound() : Ok(res));
        }
Esempio n. 2
0
        public async Task ViewAsync(int applicationId)
        {
            var query = new GetById.Query {
                Id = applicationId
            };
            var app = await _mediator.Send(query);

            if (app is null)
            {
                var errorEmbed = new ErrorEmbedBuilder()
                                 .WithErrorMessage($"Application with ID `{applicationId}` does not exist.")
                                 .Build();
                await Context.Channel.SendEmbedAsync(errorEmbed);

                return;
            }

            var embed = new EmbedBuilder()
                        .AddField($"{app.AppStatus.ToString().ToUpper()}: Application by {app.AuthorName}",
                                  $"Author's Discord ID: {app.AuthorDiscordId}\nApplication ID: {app.AppId}")
                        .AddField("Provided details",
                                  string.IsNullOrWhiteSpace(app.MessageContent)
                        ? "*Player did not provide any details.*"
                        : app.MessageContent)
                        .AddField("Link to original message", app.MessageUrl)
                        .WithThumbnailUrl(app.ImageUrl)
                        .WithFooter($"Applied at {app.AppTime}")
                        .WithApplicationStatusColour(app.AppStatus)
                        .Build();

            await Context.Channel.SendEmbedAsync(embed);
        }
Esempio n. 3
0
        public async Task <ActionResult <GlobalNotificationDto> > GetById(GetById.Query query)
        {
            var res = await _mediator.Send(query);

            return(res is null?NotFound() : Ok(res));
        }
Esempio n. 4
0
        public async Task <ActionResult <PainEventDto> > GetForMeById([FromRoute] GetById.Query query)
        {
            var res = await _mediator.Send(query);

            return(res is null?NotFound() : Ok());
        }