コード例 #1
0
ファイル: FeedController.cs プロジェクト: robin88/wojilu
 public FeedController()
 {
     feedService = new FeedService();
     friendService = new FriendService();
     visitorService = new VisitorService();
     followService = new FollowerService();
 }
コード例 #2
0
 public FriendController() {
     followService = new FollowerService();
     friendService = new FriendService();
     userService = new UserService();
     blacklistService = new BlacklistService();
     LayoutControllerType = typeof( MicroblogController );
 }
コード例 #3
0
ファイル: MicroblogService.cs プロジェクト: robin88/wojilu
 public MicroblogService()
 {
     feedService = new FeedService();
     nfService = new NotificationService();
     friendService = new FriendService();
     followerService = new FollowerService();
 }
コード例 #4
0
ファイル: PhotoPostService.cs プロジェクト: NOTHEN/wojilu
 public PhotoPostService()
 {
     friendService = new FriendService();
     pickedService = new PickedService();
     incomeService = new UserIncomeService();
     followerService = new FollowerService();
 }
コード例 #5
0
ファイル: FriendService.cs プロジェクト: zuhuizou/wojilu
        public virtual void DeleteFriend(long userId, long fid, String ip)
        {
            FollowerService followService = new FollowerService();

            String     condition = "User.Id=" + userId + " and Friend.Id=" + fid + " and Status=" + FriendStatus.Approved;
            FriendShip ship      = db.find <FriendShip>(condition).first();

            if (ship != null)
            {
                db.delete(ship);
                if (followService.IsFollowing(userId, fid) == false)
                {
                    followService.Follow(userId, fid, ip);
                }
                recountFriends(userId);
                recountFriends(fid);

                return;
            }

            condition = "User.Id=" + fid + " and Friend.Id=" + userId + " and Status=" + FriendStatus.Approved;
            ship      = db.find <FriendShip>(condition).first();
            if (ship != null)
            {
                db.delete(ship);
                if (followService.IsFollowing(fid, userId) == false)
                {
                    followService.Follow(fid, userId, ip);
                }
                recountFriends(userId);
                recountFriends(fid);
            }
        }
コード例 #6
0
ファイル: ViewerContext.cs プロジェクト: Boshin/wojilu
 public ViewerContext( MvcContext ctx )
 {
     friendService = new FriendService();
     msgService = new MessageService();
     followService = new FollowerService();
     this.ctx = ctx;
 }
コード例 #7
0
ファイル: FriendController.cs プロジェクト: Boshin/wojilu
 public FriendController()
 {
     friendService = new FriendService();
     userService = new UserService();
     followService = new FollowerService();
     blacklistService = new BlacklistService();
 }
コード例 #8
0
ファイル: FriendService.cs プロジェクト: robin88/wojilu
        public virtual Result AddFriend( int userId, int friendId, String msg )
        {
            Result result = CanAddFriend( userId, friendId );
            if (result.HasErrors) return result;

            FriendShip fs = new FriendShip();

            User user = userService.GetById( userId );
            User friend = userService.GetById( friendId );

            fs.User = user;
            fs.Friend = friend;
            fs.Msg = msg;

            fs.Status = FriendStatus.Waiting;

            result = db.insert( fs );
            if (result.IsValid) {
                string userLink = Link.ToMember( user );
                String note = string.Format( "<a href=\"{0}\" target=\"_blank\" class=\"requestUser\">{1}</a> " + lang.get( "requestFriend" ), userLink, user.Name );
                if (strUtil.HasText( msg )) {
                    note += "<br/><span class=\"quote\">" + msg + "</span>";
                }
                notificationService.sendFriendRequest( userId, friendId, note );

                // 顺带添加关注
                FollowerService followService = new FollowerService();
                if (followService.IsFollowing( userId, friendId ) == false)
                    followService.Follow( userId, friendId );
            }
            return result;
        }
コード例 #9
0
        public MicroblogCommentsController()
        {
            microblogService = new MicroblogService();
            followService = new FollowerService();
            commentService = new MicroblogCommentService();

            LayoutControllerType = typeof( MicroblogController );
        }
コード例 #10
0
ファイル: ShareController.cs プロジェクト: Boshin/wojilu
        public ShareController()
        {
            feedService = new FeedService();
            friendService = new FriendService();
            followService = new FollowerService();

            shareService = new ShareService();
        }
コード例 #11
0
ファイル: MicroblogController.cs プロジェクト: Boshin/wojilu
 public MicroblogController()
 {
     microblogService = new MicroblogService();
     followService = new FollowerService();
     visitorService = new VisitorService();
     mfService = new MicroblogFavoriteService();
     commentService = new MicroblogCommentService();
     matService = new MicroblogAtService();
     userTagService = new UserTagService();
 }
コード例 #12
0
ファイル: MicroblogController.cs プロジェクト: hzc13/wojilu
 public MicroblogController()
 {
     microblogService = new MicroblogService();
     followService = new FollowerService();
     visitorService = new VisitorService();
     mfService = new MicroblogFavoriteService();
     commentService = new MicroblogCommentService();
     matService = new MicroblogAtService();
     videoSpider = new WojiluVideoSpider();
 }
コード例 #13
0
ファイル: HomeController.cs プロジェクト: NOTHEN/wojilu
 public HomeController()
 {
     microblogService = new MicroblogService();
     followService = new FollowerService();
     visitorService = new VisitorService();
     mfService = new MicroblogFavoriteService();
     commentService = new OpenCommentService();
     photoPostService = new PhotoPostService();
     friendService = new FriendService();
     blogAppService = new BlogService();
     photoAppService = new PhotoService();
 }
コード例 #14
0
ファイル: FriendService.cs プロジェクト: zuhuizou/wojilu
        public virtual Result AddFriend(long userId, long friendId, String msg, String ip)
        {
            Result result = CanAddFriend(userId, friendId);

            if (result.HasErrors)
            {
                return(result);
            }

            FriendShip fs = new FriendShip();

            User user   = userService.GetById(userId);
            User friend = userService.GetById(friendId);

            fs.User   = user;
            fs.Friend = friend;
            fs.Msg    = msg;

            fs.Status = FriendStatus.Waiting;
            fs.Ip     = ip;

            result = db.insert(fs);
            if (result.IsValid)
            {
                string userLink = Link.ToMember(user);
                String note     = string.Format("<a href=\"{0}\" target=\"_blank\" class=\"requestUser\">{1}</a> " + lang.get("requestFriend"), userLink, user.Name);
                if (strUtil.HasText(msg))
                {
                    note += "<br/><span class=\"quote\">" + msg + "</span>";
                }
                notificationService.sendFriendRequest(userId, friendId, note);

                // 顺带添加关注
                FollowerService followService = new FollowerService();
                if (followService.IsFollowing(userId, friendId) == false)
                {
                    followService.Follow(userId, friendId, ip);
                }
            }
            return(result);
        }
コード例 #15
0
        public virtual void DeleteFriend( long userId, long fid, String ip )
        {
            FollowerService followService = new FollowerService();

            String condition = "User.Id=" + userId + " and Friend.Id=" + fid + " and Status=" + FriendStatus.Approved;
            FriendShip ship = db.find<FriendShip>( condition ).first();
            if (ship != null) {
                db.delete( ship );
                if (followService.IsFollowing( userId, fid ) == false) {
                    followService.Follow( userId, fid, ip );
                }
                recountFriends( userId );
                recountFriends( fid );

                return;
            }

            condition = "User.Id=" + fid + " and Friend.Id=" + userId + " and Status=" + FriendStatus.Approved;
            ship = db.find<FriendShip>( condition ).first();
            if (ship != null) {
                db.delete( ship );
                if (followService.IsFollowing( fid, userId ) == false) {
                    followService.Follow( fid, userId, ip );
                }
                recountFriends( userId );
                recountFriends( fid );

            }
        }
コード例 #16
0
ファイル: FriendService.cs プロジェクト: robin88/wojilu
        public virtual void DeleteFriendByBlacklist( int userId, int fid )
        {
            FollowerService followService = new FollowerService();

            String condition = "User.Id=" + userId + " and Friend.Id=" + fid + " and Status=" + FriendStatus.Approved;
            FriendShip ship = db.find<FriendShip>( condition ).first();
            if (ship != null) {
                db.delete( ship );
                if (followService.IsFollowing( userId, fid )) followService.DeleteFollow( userId, fid );
                recountFriends( userId );
                recountFriends( fid );

                return;
            }

            condition = "User.Id=" + fid + " and Friend.Id=" + userId + " and Status=" + FriendStatus.Approved;
            ship = db.find<FriendShip>( condition ).first();
            if (ship != null) {
                db.delete( ship );
                if (followService.IsFollowing( fid, userId )) followService.DeleteFollow( fid, userId );
                recountFriends( userId );
                recountFriends( fid );

            }
        }
コード例 #17
0
ファイル: BlacklistService.cs プロジェクト: robin88/wojilu
 public BlacklistService()
 {
     userService = new UserService();
     friendService = new FriendService();
     followerService = new FollowerService();
 }
コード例 #18
0
ファイル: FeedService.cs プロジェクト: LeoLcy/cnblogsbywojilu
 public FeedService()
 {
     friendService = new FriendService();
     followerService = new FollowerService();
     nfService = new NotificationService();
 }
コード例 #19
0
 public ShareCommentsController()
 {
     shareService = new ShareService();
     followService = new FollowerService();
 }
コード例 #20
0
ファイル: ViewerContext.cs プロジェクト: jilumvc/Sajoo
 public ViewerContext()
 {
     friendService = new FriendService();
     msgService = new MessageService();
     followService = new FollowerService();
 }