Exemplo n.º 1
0
        public void OnDockedPass(IUserDockedService userDockedService, long pid, string projectName)
        {
            ExceptionHelper.ThrowIfNull(userDockedService, nameof(userDockedService));
            var receiver = userDockedService.Sender;
            var name     = _UserManager.GetUserNames(new long[] { receiver }, null).Select(p => p.Value).FirstOrDefault();
            var message  = string.Format("你好,我叫{0},希望能和你合作~", name);
            var content  = new
            {
                fid          = userDockedService.Fid,
                pid          = pid,
                project_name = projectName,
                message      = message,
            };
            var actionType = ActionType.FOOTPRINT_DOCKED_PASS;

            var notifyRequest = new NotifyMessageRequest(actionType, receiver, userDockedService.Receiver, new long[] { receiver }, content);

            Tgnet.Log.LoggerResolver.Current.Debug("OnDockedPass", Newtonsoft.Json.JsonConvert.SerializeObject(notifyRequest));
            _NotifyServiceProxy.Notify(notifyRequest);

            //发送足聊小蜜
            var adminContent = string.Format("您的对接请求已通过,快去交流吧!项目:{0}", projectName);
            var request      = new NotifyMessageRequest(ActionType.ADMIN_MESSAGE, 0, 0, new long[] { receiver }, ContentType.Text, adminContent);

            _NotifyServiceProxy.AdminNotify(request, true);
            // _NotifyServiceProxy.SendAdminMessageToUser(receiver, "");
        }
Exemplo n.º 2
0
        public void OnUnpass()
        {
            //推送到图数据库
            var taskFactory = new TaskFactory();
            var fid         = _FootPrintService.Fid;

            taskFactory.StartNew(() =>
            {
                _FCRMAPIPushManager.DeleteFootPrint(fid, transmitToMQ: false);
            });

            var uid    = _FootPrintService.Uid;
            var remark = _FootPrintService.ExamineRemark;

            if (_FootPrintService.State == FootPrintState.UnPass)
            {
                var    pid      = _FootPrintService.Pid;
                string projName = "";
                var    proj     = _ProjSourceManager.GetSource(pid);
                if (proj != null)
                {
                    projName = proj.name;
                }
                var reason = "";
                if (!string.IsNullOrWhiteSpace(remark))
                {
                    reason = ",原因:{" + remark + "}";
                }
                var content = string.Format("您发布的#{0}#关联的足迹未通过审核,原因:{1},请重新发布,以免错失项目交流机会~", projName, reason);
                var request = new NotifyMessageRequest(ActionType.ADMIN_MESSAGE, 0, 0, new long[] { uid }, ContentType.Text, content);
                _NotifyServiceProxy.AdminNotify(request, true);
            }
        }
Exemplo n.º 3
0
 public void PayFail(long uid, out bool ispayFail)
 {
     ispayFail = false;
     if (_TradeManager.CheckLastTradeIsUnpaid(uid, null))
     {
         ispayFail = true;
         var content = "您的vip会员付费未成功,请重新支付,以免影响功能正常体验,错失项目交流机会!";
         var request = new NotifyMessageRequest(ActionType.ADMIN_MESSAGE, 0, 0, new long[] { uid }, ContentType.Text, content);
         _NotifyServiceProxy.AdminNotify(request, true);
     }
 }
Exemplo n.º 4
0
 public void OnPass(IUserService user, bool openTrail)
 {
     if (user.VerifyStatus == VerifyStatus.Pass)
     {
         var content = "";
         if (openTrail)
         {
             content = "您提交的认证资料已通过审核,即刻开始7天VIP会员免费体验!查看其他项目足迹,跟其他人交流对接更多项目~";
         }
         else
         {
             content = "您提交的认证资料已通过审核,查看其他项目足迹,跟其他人交流对接更多项目~";
         }
         var request = new NotifyMessageRequest(ActionType.ADMIN_MESSAGE, 0, 0, new long[] { user.Uid }, ContentType.Text, content);
         _NotifyServiceProxy.AdminNotify(request, true);
     }
 }
Exemplo n.º 5
0
        /// <summary>
        /// 管理员发送足聊小蜜
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="recivers"></param>
        /// <param name="message"></param>
        /// <param name="contentType"></param>
        public void SendAdminMessage(long sender, long[] recivers, string message, string contentType)
        {
            ExceptionHelper.ThrowIfNotId(sender, "sender");
            ExceptionHelper.ThrowIfNullOrWhiteSpace(message, "message", "不能发送空内容");

            var request = new Tgnet.FootChat.Push.NotifyMessageRequest(Tgnet.FootChat.Push.ActionType.ADMIN_MESSAGE, 0, sender, recivers, contentType, message);

            _NotifyService.AdminNotify(request, true);
            if (recivers != null && recivers.Length == 1)
            {
                _MessageService.SetAdminMessageReplied(recivers);
            }
        }
Exemplo n.º 6
0
        public void OnAttention(string mobile)
        {
            ExceptionHelper.ThrowIfNullOrEmpty(mobile, nameof(mobile));
            var users = _UserManager.GetUsers(new string[] { mobile }).ToArray();

            if (users != null && users.Count() > 0)
            {
                var content = string.Format("您的好友<a href=\"http://m.fc.tgnet.com/User/Info?uid={0}\">{1}</a>关注了您!马上关注TA,查看好友足迹,快速交流,获取更多项目资源!~", _User.Uid, _User.Name);
                var request = new NotifyMessageRequest(ActionType.ADMIN_MESSAGE, 0, 0, new long[] { users[0].uid }, ContentType.Html, content);
                _NotifyServiceProxy.AdminNotify(request, true);
            }
            else
            {
                Dictionary <string, string> values = new Dictionary <string, string>();
                values.Add("name", _User.Name);
                values.Add("status", "使用业务签单新模式,期待与你进行更多的");
                _PushManager.SendSms(131, new String[] { mobile }, values, "足聊");
            }
        }