コード例 #1
0
 public HomeController(IPostData postData, ICommentData commentData, IContactMessageData contactMessageData,
                       IAdministratorData administratorData)
 {
     _postData           = postData;
     _commentData        = commentData;
     _contactMessageData = contactMessageData;
     _administratorData  = administratorData;
 }
コード例 #2
0
ファイル: UserController.cs プロジェクト: BulatL/Youtube2
 public UserController(IUserData userData, IHostingEnvironment hostingEnvironment,
                       IFollowData followData, IVideoData videoData, ICommentData commentData)
 {
     _userData           = userData;
     _followData         = followData;
     _videoData          = videoData;
     _commentData        = commentData;
     _hostingEnvironment = hostingEnvironment;
 }
コード例 #3
0
 public CommentController(IUserData userData, IFollowData followData,
                          IVideoData videoData, ICommentData commentData, ILikeCommentData likeCommentData)
 {
     _userData        = userData;
     _followData      = followData;
     _videoData       = videoData;
     _commentData     = commentData;
     _likeCommentData = likeCommentData;
 }
コード例 #4
0
        public Task UpdateAsync(ICommentData projectCommentData)
        {
            var partitionKey = CommentEntity.GeneratePartitionKey(projectCommentData.ProjectId);
            var rowKey       = CommentEntity.GenerateRowKey(projectCommentData.Id);

            return(_projectCommentsTableStorage.ReplaceAsync(partitionKey, rowKey, itm =>
            {
                itm.Update(projectCommentData);
                return itm;
            }));
        }
コード例 #5
0
 public VideoController(IVideoData videoData, IUserData userData,
                        IHostingEnvironment hostingEnvironment, IFollowData followData, ICommentData commentData
                        , ILikeVideoData likeDislike)
 {
     _videoData          = videoData;
     _userData           = userData;
     _commentData        = commentData;
     _hostingEnvironment = hostingEnvironment;
     _followData         = followData;
     _likeDislikeData    = likeDislike;
 }
コード例 #6
0
        public void OnCommentReceived(ICommentData data)
        {
            if (!_options.IsEnabled || data.IsNgUser || data.IsFirstComment || (data.Is184 && !_options.Want184Read))
            {
                return;
            }

            try
            {
                //棒読みちゃんが事前に起動されていたらそれを使いたい。
                //起動していなかったら起動させて、準備ができ次第それ以降のコメントを読んで貰う

                //とりあえず何も確認せずにコメントを送信する。起動していなかったら例外が起きる。
                if (_options.IsReadHandleName && !string.IsNullOrEmpty(data.Nickname))
                {
                    var nick = data.Nickname;

                    if (_options.IsAppendNickTitle)
                    {
                        nick += _options.NickTitle;
                    }
                    _bouyomiChanClient.AddTalkTask2(nick);
                }
                if (_options.IsReadComment)
                {
                    _bouyomiChanClient.AddTalkTask2(data.Comment);
                }
            }
            catch (System.Runtime.Remoting.RemotingException)
            {
                //多分棒読みちゃんが起動していない。
                if (_bouyomiChanProcess == null && System.IO.File.Exists(_options.BouyomiChanPath))
                {
                    _bouyomiChanProcess = Process.Start(_options.BouyomiChanPath);
                    _bouyomiChanProcess.EnableRaisingEvents = true;
                    _bouyomiChanProcess.Exited += (s, e) =>
                    {
                        try
                        {
                            _bouyomiChanProcess?.Close();//2018/03/25ここで_bouyomiChanProcessがnullになる場合があった
                        }
                        catch { }
                        _bouyomiChanProcess = null;
                    };
                }
                //起動するまでの間にコメントが投稿されたらここに来てしまうが諦める。
            }
            catch (Exception)
            {
            }
        }
コード例 #7
0
 public ShoePicController(
     IShoePicService shoePicService,
     IAiService aiService,
     UserService userService,
     IShoePicData shoePicData,
     IUserData userData,
     ICommentData commentData
     )
 {
     _shoePicService = shoePicService;
     _aiService      = aiService;
     _userService    = userService;
     _shoePicData    = shoePicData;
     _userData       = userData;
     _commentData    = commentData;
 }
コード例 #8
0
        public void OnCommentReceived(ICommentData data)
        {
            if (!Options.IsEnabled || data.IsNgUser || data.IsFirstComment)
            {
                return;
            }

            var a = new Data
            {
                Comment  = data.Comment,
                Nickname = data.Nickname,
                SiteName = data.SiteName,
            };

            _commentCollection.Add(a);
        }
コード例 #9
0
        private async Task SendNewCommentNotification(ICommentData model)
        {
            var message = new Lykke.Messages.Email.MessageData.PlainTextData
            {
                Sender = "Lykke Notifications",
                Text   = "New Comment was created. \n" + "Comment Author - " + model.FullName + "\n" +
                         "Comment - " + model.Comment + "\n" +
                         "Project Link - https://streams.lykke.com/Project/ProjectDetails/" + model.ProjectId + "#tab_Comments",
                Subject = "New Comment!"
            };

            foreach (var email in _settings.LykkeStreams.ProjectCreateNotificationReceiver)
            {
                await _emailSender.SendEmailAsync("Lykke", email, message);
            }
        }
コード例 #10
0
        public static CommentEntity Create(ICommentData src)
        {
            var id     = Guid.NewGuid().ToString("N");
            var result = new CommentEntity
            {
                PartitionKey = GeneratePartitionKey(src.ProjectId),
                RowKey       = GenerateRowKey(id),
                Id           = id,
                Comment      = src.Comment,
                UserId       = src.UserId,
                FullName     = src.FullName,
                Created      = src.Created,
                LastModified = src.LastModified,
                ParentId     = src.ParentId
            };

            return(result);
        }
コード例 #11
0
 public AdminController(
     IArticleData articleData,
     RoleManager <IdentityRole> roleManager,
     UserManager <ApplicationUser> userManager,
     IHttpContextAccessor httpContext,
     ICommentData commentData,
     IAdmin admin,
     HttpClient client
     )
 {
     _articleData = articleData;
     _roleManager = roleManager;
     _userManager = userManager;
     _httpContext = httpContext;
     _commentData = commentData;
     _admin       = admin;
     _client      = client;
 }
コード例 #12
0
 public HomeController(IArticleData articleData,
                       IPreview preview,
                       ILogger <HomeController> logger,
                       ICommentData comment,
                       UserManager <ApplicationUser> user,
                       IHttpContextAccessor context,
                       RoleManager <IdentityRole> role,
                       BlogDbContext DbContext
                       )
 {
     _articleData    = articleData;
     _previewContent = preview;
     _logger         = logger;
     _commentData    = comment;
     _user           = user;
     _httpContext    = context;
     _role           = role;
     _DbContext      = DbContext;
 }
 public async Task SaveAsync(ICommentData projectCommentData)
 {
     var newEntity = CommentEntity.Create(projectCommentData);
     await _projectCommentsTableStorage.InsertAsync(newEntity);
 }
コード例 #14
0
 public HomeController(ICommentData commentData, IDBTag dBTag, IConfiguration configuration)
 {
     _commentData   = commentData;
     _dbTag         = dBTag;
     _configuration = configuration;
 }
コード例 #15
0
 public CommentController(ICommentData commentData)
 {
     this.commentData = commentData;
 }
コード例 #16
0
ファイル: SearchController.cs プロジェクト: BulatL/Youtube2
 public SearchController(IUserData userData, IVideoData videoData, ICommentData commentData)
 {
     _userData    = userData;
     _videoData   = videoData;
     _commentData = commentData;
 }
コード例 #17
0
 public CommentController(ICommentData comment)
 {
     _commentData = comment;
 }
コード例 #18
0
 public CommentsController(ICommentData db)
 {
     _db = db;
 }
コード例 #19
0
 public void OnCommentReceived(ICommentData data)
 {
 }
 internal void Update(ICommentData src)
 {
     Comment      = src.Comment;
     LastModified = DateTime.UtcNow;
     Deleted      = src.Deleted;
 }
コード例 #21
0
ファイル: HomeController.cs プロジェクト: BenYoshi/ShareIt
 public HomeController(IPostData postData, IGreeter greeter, UserManager <User> userManager, ICommentData commentData)
 {
     _postData    = postData;
     _greeter     = greeter;
     _userManager = userManager;
     _commentData = commentData;
 }
コード例 #22
0
 public HomeController(IPostData postData, ICommentData commentData)
 {
     this.postData    = postData;
     this.commentData = commentData;
 }