コード例 #1
0
        public async Task <IActionResult> CreateCuitcase(CreateClothesCommand command)
        {
            //var image = clh.Image;

            //     var imageResponse = await AmazonS3Service.UploadObject(image);
            var userName = User.Identity.Name;

            var commandResult = await _mediator.Send(command);

            return(Ok(commandResult));
        }
コード例 #2
0
        public async Task <IActionResult> CreateClothings([FromForm] string name, [FromForm] int idClothingType, [FromForm] string tags, IFormFile image)
        {
            var imageResponse = await AmazonS3Service.UploadObject(image);

            var idUser = User.FindFirstValue(ClaimTypes.NameIdentifier);
            CreateClothesCommand command = new CreateClothesCommand()
            {
                Name           = name,
                idUser         = Int32.Parse(idUser),
                Url            = imageResponse.FileName,
                idClothingType = idClothingType,
                Tags           = tags
            };
            var commandResult = await _mediator.Send(command);

            return(Ok(commandResult));
        }