Exemplo n.º 1
0
        /// <summary>
        /// 同步处理,递归算法
        /// </summary>
        /// <param name="totCount"></param>
        /// <param name="wid"></param>
        /// <param name="accessToken"></param>
        /// <param name="nexOpenid"></param>
        /// <param name="updateTime"></param>
        public string SysPersonFun(int totCount, string wxid, string accessToken, string nexOpenid, DateTime updateTime)
        {
            string           ret       = "";
            OpenIdResultJson gJson     = UserApi.Get(accessToken, nexOpenid);
            List <string>    openidStr = gJson.data.openid;//此次拉取的openid字符串

            totCount += InsertUserInfo(wxid, accessToken, openidStr, updateTime);
            if (gJson.next_openid != "" && gJson.count == 1000)
            {
                SysPersonFun(totCount, wxid, accessToken, gJson.next_openid, updateTime);
            }
            else
            {
                int sjTtCount = gJson.total;
                if (sjTtCount == totCount)
                {
                    //将此次同步的日期更新到设置表里
                    WxBaseConfigEntity weixin = config.GetDefaultConfig();
                    weixin.PersonSynDate = updateTime;
                    weixin.OpenidCount   = totCount;
                    config.SubmitForm(weixin);
                    ret = "粉丝同步成功!";
                }
                else
                {
                    ret = "粉丝同步失败!";
                }
            }
            return(ret);
        }
 public ActionResult SubmitForm(WxBaseConfigEntity userEntity, string keyValue)
 {
     app.SubmitForm(userEntity, keyValue);
     return(Success("操作成功。"));
 }
Exemplo n.º 3
0
 public ActionResult SubmitForm(WxBaseConfigEntity userEntity)
 {
     app.SubmitForm(userEntity);
     return(Success("操作成功。"));
 }