Inheritance: ISettingGroup
コード例 #1
0
 public MediaController(MediaService mediaService, MediaSettings mediaSettings, IMobSocialVideoProcessor videoProcessor, GeneralSettings generalSettings)
 {
     _mediaService = mediaService;
     _mediaSettings = mediaSettings;
     _videoProcessor = videoProcessor;
     _generalSettings = generalSettings;
 }
コード例 #2
0
        public static SponsorPublicModel ToPublicModel(this Sponsor sponsor, IUserService userService, IMediaService pictureService, ISponsorService sponsorService, IFormatterService formatterService, MediaSettings mediaSettings)
        {
            var user = userService.Get(sponsor.UserId);
            if (user == null)
                return null;

            //get sponsor data
            var sponsorData = sponsorService.GetSponsorData(sponsor.BattleId, sponsor.BattleType, sponsor.UserId);

            var model = new SponsorPublicModel
            {
                SponsorshipStatus = sponsor.SponsorshipStatus,
                SponsorshipStatusName = sponsor.SponsorshipStatus.ToString(),
                CustomerId = sponsor.UserId,
                SeName = user.GetPermalink().ToString(),
                SponsorName = user.GetPropertyValueAs<string>(PropertyNames.DisplayName),
                SponsorProfileImageUrl =
                    pictureService.GetPictureUrl(user.GetPropertyValueAs<int>(PropertyNames.DefaultPictureId)),
                SponsorshipAmount = sponsor.SponsorshipAmount,
                SponsorshipAmountFormatted = formatterService.FormatCurrency(sponsor.SponsorshipAmount, ApplicationContext.Current.ActiveCurrency),
                SponsorData = sponsorData.ToModel(pictureService),
                SponsorshipType = sponsor.SponsorshipType
            };

            return model;
        }
コード例 #3
0
        public static UserResponseModel ToModel(this User user, IMediaService mediaService, MediaSettings mediaSettings)
        {
            var model = new UserResponseModel()
            {
                Id = user.Id,
                FirstName = user.FirstName,
                LastName = user.LastName,
                Name = user.Name,
                DateCreatedUtc = user.DateCreated,
                DateCreatedLocal = DateTimeHelper.GetDateInUserTimeZone(user.DateCreated, DateTimeKind.Utc, user),
                UserName = user.UserName,
                CoverImageUrl = mediaService.GetPictureUrl(user.GetPropertyValueAs<int>(PropertyNames.DefaultCoverId), PictureSizeNames.MediumCover),
                ProfileImageUrl = mediaService.GetPictureUrl(user.GetPropertyValueAs<int>(PropertyNames.DefaultPictureId), PictureSizeNames.MediumProfileImage),
                Active = user.Active
            };

            if (!string.IsNullOrEmpty(model.CoverImageUrl) && !string.IsNullOrEmpty(model.ProfileImageUrl))
                return model;

            if (string.IsNullOrEmpty(model.CoverImageUrl))
                model.CoverImageUrl = mediaSettings.DefaultUserProfileCoverUrl;
            if (string.IsNullOrEmpty(model.ProfileImageUrl))
                model.ProfileImageUrl = mediaSettings.DefaultUserProfileImageUrl;

            return model;
        }
コード例 #4
0
 public AuthenticationController(IUserService userService,
     ICryptographyService cryptographyService, IMediaService mediaService, MediaSettings mediaSettings)
 {
     _userService = userService;
     _cryptographyService = cryptographyService;
     _mediaService = mediaService;
     _mediaSettings = mediaSettings;
 }
コード例 #5
0
 public UserController(IUserService userService, IRoleService roleService, UserSettings userSettings, SecuritySettings securitySettings, IUserRegistrationService userRegistrationService, ICryptographyService cryptographyService, IMediaService mediaService, MediaSettings mediaSettings)
 {
     _userService = userService;
     _userSettings = userSettings;
     _securitySettings = securitySettings;
     _userRegistrationService = userRegistrationService;
     _cryptographyService = cryptographyService;
     _mediaService = mediaService;
     _mediaSettings = mediaSettings;
     _roleService = roleService;
 }
コード例 #6
0
 public CommentController(ICommentService customerCommentService,
     IUserService customerService,
     ILikeService customerLikeService,
     IMediaService pictureService, MediaSettings mediaSettings)
 {
     _customerCommentService = customerCommentService;
     _customerService = customerService;
     _customerLikeService = customerLikeService;
     _pictureService = pictureService;
     _mediaSettings = mediaSettings;
 }
コード例 #7
0
 public VideoBattleController(
     IVideoBattleService videoBattleService,
     IVideoBattleParticipantService videoBattleParticipantService,
     IVideoBattleVideoService videoBattleVideoService,
     IVideoBattleVoteService videoBattleVoteService,
     IVideoBattlePrizeService videoBattlePrizeService,
     IUserService userService,
     IWatchedVideoService watchedVideoService,
     IMediaService pictureService,
     ISponsorService sponsorService,
     ITimelineAutoPublisher timelineAutoPublisher,
     ISettingService settingService,
     IPaymentProcessingService paymentProcessingService,
     IFollowService followService,
     ICreditService creditService,
     IFormatterService formatterService,
     IEmailSender emailSender,
     IMobSocialVideoProcessor videoProcessor,
     MediaSettings mediaSettings,
     PaymentSettings paymentSettings,
     BattleSettings battleSettings,
     GeneralSettings generalSettings)
 {
     _videoBattleService = videoBattleService;
     _videoBattleParticipantService = videoBattleParticipantService;
     _videoBattleVideoService = videoBattleVideoService;
     _videoBattleVoteService = videoBattleVoteService;
     _videoBattlePrizeService = videoBattlePrizeService;
     _userService = userService;
     _watchedVideoService = watchedVideoService;
     _timelineAutoPublisher = timelineAutoPublisher;
     _settingService = settingService;
     _paymentProcessingService = paymentProcessingService;
     _followService = followService;
     _creditService = creditService;
     _paymentSettings = paymentSettings;
     _battleSettings = battleSettings;
     _formatterService = formatterService;
     _emailSender = emailSender;
     _generalSettings = generalSettings;
     _videoProcessor = videoProcessor;
     _sponsorService = sponsorService;
     _pictureService = pictureService;
     _mediaSettings = mediaSettings;
 }
コード例 #8
0
 public TimelineController(ITimelineService timelineService,
     IFollowService customerFollowService,
     IUserService userService,
     IMediaService pictureService,
     MediaSettings mediaSettings,
     IVideoBattleService videoBattleService, 
     ILikeService customerLikeService, 
     ICommentService customerCommentService)
 {
     _timelineService = timelineService;
     _customerFollowService = customerFollowService;
     _userService = userService;
     _pictureService = pictureService;
     _mediaSettings = mediaSettings;
     _videoBattleService = videoBattleService;
     _customerLikeService = customerLikeService;
     _customerCommentService = customerCommentService;
 }
コード例 #9
0
 public SponsorController(ISponsorService sponsorService,
     IVideoBattleService videoBattleService,
     IUserService customerService,
     IMediaService mediaService,
     IFormatterService formatterService,
     MediaSettings mediaSettings,
     IEmailSender emailSender,
     IVideoBattlePrizeService videoBattlePrizeService,
     ICreditService creditService)
 {
     _sponsorService = sponsorService;
     _videoBattleService = videoBattleService;
     _userService = customerService;
     _mediaService = mediaService;
     _formatterService = formatterService;
     _mediaSettings = mediaSettings;
     _emailSender = emailSender;
     _videoBattlePrizeService = videoBattlePrizeService;
     _creditService = creditService;
 }
コード例 #10
0
 public SongController(ILocalizationService localizationService,
     IPictureService pictureService,
     ICustomerService customerService,
     IDateTimeHelper dateTimeHelper,
     CustomerSettings customerSettings,
     MediaSettings mediaSettings,
     IArtistPageService artistPageService,
     IArtistPageAPIService artistPageApiService,
     ISongService songService,
     IMusicService musicService,
     mobSocialSettings mobSocialSettings,
     IMobSocialService mobSocialService,
     IWorkContext workContext,
     IMobSocialMessageService mobsocialMessageService,
     ISharedSongService sharedSongService,
     IStoreContext storeContext,
     IProductService productService,
     IDownloadService downloadService,
     IPriceFormatter priceFormatter)
 {
     _localizationService = localizationService;
     _pictureService = pictureService;
     _customerService = customerService;
     _dateTimeHelper = dateTimeHelper;
     _customerSettings = customerSettings;
     _mediaSettings = mediaSettings;
     _mobSocialSettings = mobSocialSettings;
     _mobSocialService = mobSocialService;
     _workContext = workContext;
     _artistPageApiService = artistPageApiService;
     _artistPageService = artistPageService;
     _songService = songService;
     _musicService = musicService;
     _mobsocialMessageService = mobsocialMessageService;
     _sharedSongService = sharedSongService;
     _storeContext = storeContext;
     _productService = productService;
     _downloadService = downloadService;
     _priceFormatter = priceFormatter;
 }
コード例 #11
0
 public static UserEntityModel ToEntityModel(this User user, IMediaService mediaService, MediaSettings mediaSettings)
 {
     var userCoverId = user.GetPropertyValueAs<int>(PropertyNames.DefaultCoverId);
     var userProfileImageId = user.GetPropertyValueAs<int>(PropertyNames.DefaultPictureId);
     var model = new UserEntityModel() {
         Id = user.Id,
         FirstName = user.FirstName,
         LastName = user.LastName,
         Name = user.Name,
         UserName = user.UserName,
         Email = user.Email,
         Active = user.Active,
         Remarks = user.Remarks,
         RoleIds = user.UserRoles.Select(x => x.RoleId).ToList(),
         LastLoginDateUtc = user.LastLoginDate,
         LastLoginDateLocal = DateTimeHelper.GetDateInUserTimeZone(user.LastLoginDate, DateTimeKind.Utc, user),
         CoverImageId = userCoverId,
         ProfileImageId = userProfileImageId
     };
     model.CoverImageUrl = userCoverId == 0 ? mediaSettings.DefaultUserProfileCoverUrl : mediaService.GetPictureUrl(userCoverId, PictureSizeNames.MediumCover);
     model.ProfileImageUrl = userProfileImageId == 0 ? mediaSettings.DefaultUserProfileImageUrl : mediaService.GetPictureUrl(userProfileImageId, PictureSizeNames.MediumProfileImage);
     return model;
 }
コード例 #12
0
 public ArtistPageController(IMediaService pictureService,
     IUserService userService,
     UserSettings customerSettings,
     MediaSettings mediaSettings,
     IArtistPageService artistPageService,
     IArtistPageApiService artistPageApiService,
     IArtistPageManagerService artistPageManagerService,
     ISongService songService,
     IArtistPagePaymentService artistPagePaymentService, 
     IMusicService musicService, 
     IFriendService friendService)
 {
     _pictureService = pictureService;
     _userService = userService;
     _customerSettings = customerSettings;
     _mediaSettings = mediaSettings;
     _artistPageService = artistPageService;
     _artistPageApiService = artistPageApiService;
     _artistPageManagerService = artistPageManagerService;
     _songService = songService;
     _artistPagePaymentService = artistPagePaymentService;
     _musicService = musicService;
     _friendService = friendService;
 }