public CampaignsController(ICampaignRepository campaignRepository,
                            UserManager <ApplicationUser> userManager, IContributionRepository contributionRepository,
                            GoogleDriveRepository googleDriveRepository)
 {
     _campaignRepository         = campaignRepository;
     this.userManager            = userManager;
     this.contributionRepository = contributionRepository;
     this.googleDriveRepository  = googleDriveRepository;
     defaultImagePath            = googleDriveRepository.GetImageLink("1hwvAYuUsMmBhXPpdx5stq3uT9IMyAY95");
 }
 public AccountController(IUserRepository userRepository, UserManager <ApplicationUser> userManager, GoogleDriveRepository googleDriveRepository,
                          SignInManager <ApplicationUser> signInManager)
 {
     this.userManager           = userManager;
     this.googleDriveRepository = googleDriveRepository;
     this.signInManager         = signInManager;
     this.userRepository        = userRepository;
     defaultAvatarPath          = googleDriveRepository
                                  .GetImageLink("1mHrI0r8-nvveYI8j53MdHDecYTVIeVk9");
 }
        private string UploadImage(IFormFile imageFile)
        {
            string imagePath = defaultImagePath;

            if (imageFile != null)
            {
                string fileName = Guid.NewGuid().ToString() + imageFile.FileName;
                imagePath = googleDriveRepository
                            .GetImageLink(googleDriveRepository
                                          .UploadFIle(fileName, imageFile.OpenReadStream()));
            }
            return(imagePath);
        }
        private string UploadAvatar(IFormFile avatarFile)
        {
            string avatarPath = defaultAvatarPath;

            if (avatarFile != null)
            {
                string fileName = Guid.NewGuid().ToString() + avatarFile.FileName;
                avatarPath = googleDriveRepository
                             .GetImageLink(googleDriveRepository
                                           .UploadFIle(fileName, avatarFile.OpenReadStream()));
            }
            return(avatarPath);
        }
예제 #5
0
 public ChaptersController(
     UserManager <ApplicationUser> userManager,
     SignInManager <ApplicationUser> signInManager,
     IFictionRepository fictionRepository,
     IChapterRepository chapterRepository,
     GoogleDriveRepository googleDriveRepository,
     ApplicationDbContext context)
 {
     _context                   = context;
     _userManager               = userManager;
     _signInManager             = signInManager;
     _fictionRepository         = fictionRepository;
     _chapterRepository         = chapterRepository;
     this.googleDriveRepository = googleDriveRepository;
     defaultImagePath           = googleDriveRepository.GetImageLink("1LkV9rOL_nxy314zW6F0V-OKYIYfUeV99");
 }