Ejemplo n.º 1
0
        public void TrialWillExpiredAfter3Days()
        {
            var uids = _UserServiceStateRepository.GetWillOrExipredUid(User.UserServiceLevel.Trail, 3);

            if (uids.Any())
            {
                var content = "您的VIP体验即将到期,请及时续费,以免影响功能正常体验,错失项目交流机会!";
                var remind  = new PushRemindRequest()
                {
                    Title       = "足聊",
                    Body        = content,
                    MessageType = MessageType.Once,
                    URL         = "http://m.fc.tgnet.com/User/Index",
                };
                _NotifyServiceProxy.PushRemind(remind, uids);
            }
        }
Ejemplo n.º 2
0
        public void VipWillExpiredBefore7Days()
        {
            var uids = _UserServiceStateRepository.GetWillOrExipredUid(User.UserServiceLevel.Official, 7);

            if (uids.Any())
            {
                var content = "您的VIP会员即将到期,请及时续费,以免影响项目交流合作,错失项目签单机会!";
                var remind  = new PushRemindRequest()
                {
                    Title       = "足聊",
                    Body        = content,
                    MessageType = MessageType.Once,
                    URL         = "http://m.fc.tgnet.com/User/Index",
                };
                _NotifyServiceProxy.PushRemind(remind, uids);
            }
        }
Ejemplo n.º 3
0
        public void TrialWillExpiredAfterSomeDays(int day)
        {
            var uids = _UserServiceStateRepository.GetWillOrExipredUid(User.UserServiceLevel.Trail, day);

            if (uids.Any())
            {
                var content = "您的VIP体验已过期,将无法与其他人快速交流对接!马上续费,以免错失更多项目签单机会!";
                var remind  = new PushRemindRequest()
                {
                    Title       = "足聊",
                    Body        = content,
                    MessageType = MessageType.Once,
                    URL         = "http://m.fc.tgnet.com/User/Index",
                };
                _NotifyServiceProxy.PushRemind(remind, uids);
            }
        }
Ejemplo n.º 4
0
        public void NotifyFollowSameProjUser()
        {
            var uid           = _FootPrintService.Uid;
            var pid           = _FootPrintService.Pid;
            var focusProjUids = _FootPrintRepository.GetFollowAndFavoriteUids(pid).Where(p => p != uid).Distinct().ToArray();

            if (focusProjUids.Any())
            {
                var projName = ProjectSource.name;
                var content  = string.Format("您的在跟/收藏项目{0}新增1人也在跟进,马上查看跟进状况,获得更多签单帮助!", projName);
                var remind   = new PushRemindRequest()
                {
                    Title       = "足聊",
                    Body        = content,
                    MessageType = MessageType.Once,
                    URL         = "http://m.fc.tgnet.com/ProjFollow/List",
                };
                _NotifyServiceProxy.PushRemind(remind, focusProjUids);
            }
        }
Ejemplo n.º 5
0
        public void OnProjUpdate(long pid)
        {
            var proj = _ProjSourceManager.GetSource(pid);

            if (proj != null)
            {
                var name          = proj.name;
                var focusProjUids = _FootPrintRepository.GetFollowAndFavoriteUids(pid).Distinct().ToArray();
                if (focusProjUids.Any())
                {
                    var content = string.Format("您的在跟/收藏项目{0}有新的动态/联系人,点击查看最新资料!", name);
                    var remind  = new PushRemindRequest()
                    {
                        Title       = "足聊",
                        Body        = content,
                        MessageType = MessageType.Once,
                        URL         = "http://m.fc.tgnet.com/ProjFollow/List",
                    };
                    _NotifyServiceProxy.PushRemind(remind, focusProjUids);
                }
            }
        }
Ejemplo n.º 6
0
        public void NotifyFriendsOnecInDay(long pid)
        {
            var uid   = _FootPrintService.Uid;
            var user  = _UserServiceFactory.GetService(uid);
            var today = DateTime.Now.Date;
            var isPublishedIn7Days = _FootPrintRepository.Entities.Count(p => p.uid == uid && p.state == FootPrintState.Pass && p.orderUpdated > today) > 1;
            var name = user.Name;

            if (!isPublishedIn7Days)
            {
                var fcfriendUids = _AddressBookMobileRepository.GetFootUidOfInBook(uid).Distinct().ToArray();
                var content      = string.Format("您的好友{0}分享了一条最新的项目动态,马上查看了解更多关系项目~", user.Name);

                var remind = new PushRemindRequest()
                {
                    Title       = "足聊",
                    Body        = content,
                    MessageType = MessageType.Once,
                    URL         = string.Format("http://m.fc.tgnet.com/Footprint/Detail?pid={0}", pid),
                };
                _NotifyServiceProxy.PushRemind(remind, fcfriendUids);
            }
        }
Ejemplo n.º 7
0
        public void PushRemind(PushRemindRequest remind, long[] receivers, NotifyTypes?notifyType = null)
        {
            ExceptionHelper.ThrowIfNull(remind, "remind");
            receivers = (receivers ?? Enumerable.Empty <long>()).Where(id => id > 0).Distinct().ToArray();
            PushService.PushSetting setting = new PushService.PushSetting
            {
                NotifyType = notifyType == null ? PushService.PushSettingNotifyTypes.SoundAndVibration : (PushService.PushSettingNotifyTypes)notifyType.To <byte>()
            };
            if (remind.MessageType != MessageType.Online)
            {
                setting.ExpireTime   = TimeSpan.FromDays(1);
                setting.StoreOffline = true;
            }
            var extensions = remind.Extensions ?? new Dictionary <string, string>();

            if (!String.IsNullOrWhiteSpace(remind.URL))
            {
                extensions["url"] = remind.URL.Trim();
            }
            List <PushService.TargetsAppKinds> apps = new List <PushService.TargetsAppKinds>()
            {
                PushService.TargetsAppKinds.FootChatAndroid, PushService.TargetsAppKinds.FootChatiOS
            };

            _PushManager.PushRemind(new PushService.PushRemindRequest
            {
                Accumulate           = remind.Accumulate,
                Body                 = remind.Body,
                Extensions           = extensions,
                Title                = remind.Title,
                AndroidPopupActivity = ANDROIDPOPUPACTIVITY,
            }, new PushService.Targets
            {
                Uids = receivers,
                Apps = apps.ToArray(),
            }, setting);
        }