Exemplo n.º 1
0
        public IActionResult UploadUserProfileImage([FromBody] UserProifileImageUploadRequest request)
        {
            byte[] NewImage = Convert.FromBase64String(request.ImageData);
            _entityCRUDResponse = _userService.AddUserProfilePicture(new IntegratorFile()
            {
                ContentType       = request.FileType,
                DateCreated       = DateTime.Now,
                FileSize          = NewImage.Length,
                FileExtension     = Path.GetExtension(request.FileName).Replace(".", ""),
                FileName          = Path.GetFileNameWithoutExtension(request.FileName),
                InegratorFileBlob = new InegratorFileBlob()
                {
                    FileBlob = NewImage
                },
                UserPicture = new UserPicture()
                {
                    IntegratorUserID        = _userService.GetUserID(),
                    IsCurrentProfilePicture = true
                }
            });

            return(new JsonResult(_entityCRUDResponse));
        }
Exemplo n.º 2
0
 public IActionResult SetUserDefaultProfilePicture([FromBody] UserProifileImageUploadRequest request)
 {
     _userService.SetUserProfilePictureAsDefault(request.Id);
     return(new JsonResult(""));
 }