Ejemplo n.º 1
0
        public void GetPoiListTest()
        {
            var accessToken = AccessTokenContainer.GetAccessToken(_appId);

            var result = PoiApi.GetPoiList(accessToken, 0);

            Assert.IsNotNull(result);
            Assert.AreEqual(result.errcode, ReturnCode.请求成功);
        }
Ejemplo n.º 2
0
        public List <GetStoreList_BaseInfo> GetPoiList()
        {
            GetStoreListResultJson poiList = PoiApi.GetPoiList(_accessToken, 0, 50, 10000);

            if (poiList.errcode != ReturnCode.请求成功)
            {
                throw new Exception(poiList.errmsg);
            }
            return((
                       from l in poiList.business_list
                       select l.base_info).ToList());
        }
Ejemplo n.º 3
0
        public List <GetStoreList_BaseInfo> GetPoiList()
        {
            var result = PoiApi.GetPoiList(this._accessToken, 0, 50);

            if (result.errcode != 0)
            {
                throw new Exception(result.errmsg);
            }
            var obj = (from l in result.business_list
                       select l.base_info).ToList();

            return(obj);
        }
Ejemplo n.º 4
0
        public GetStoreListResultJson GetPoiList(int page, int rows)
        {
            int num = 0;

            if (page > 1)
            {
                num = (page - 1) * rows;
            }
            GetStoreListResultJson poiList = PoiApi.GetPoiList(_accessToken, num, rows, 10000);

            if (poiList.errcode != ReturnCode.请求成功 && poiList.errcode != ReturnCode.api功能未授权)
            {
                throw new Exception(poiList.errmsg);
            }
            return(poiList);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 查询门店列表
        /// </summary>
        /// <returns></returns>
        public List <string> fghj()
        {
            List <Senparc.Weixin.MP.AdvancedAPIs.Poi.GetStoreList_Business> ss = new List <Senparc.Weixin.MP.AdvancedAPIs.Poi.GetStoreList_Business>();
            var           accessToken = Token();
            var           result      = PoiApi.GetPoiList(accessToken, 0);
            List <string> sss         = new List <string>();

            for (int i = 0; i < result.business_list.Count; i++)
            {
                ss.Add(result.business_list[i]);

                sss.Add(result.business_list[i].base_info.poi_id);
            }

            return(sss);
        }
Ejemplo n.º 6
0
        public GetStoreListResultJson GetPoiList(int page, int rows)
        {
            int begin = 0;

            if (page > 1)
            {
                begin = (page - 1) * rows;
            }

            var result = PoiApi.GetPoiList(this._accessToken, begin, rows);

            if (result.errcode != 0 && result.errcode != Senparc.Weixin.ReturnCode.api功能未授权)
            {
                throw new Exception(result.errmsg);
            }
            return(result);
        }
Ejemplo n.º 7
0
        public static List <Store> GetAllPoiList()
        {
            int                    num           = 0;
            int                    num2          = 20;
            List <Store>           business_list = new List <Store>();
            GetStoreListResultJson poiList       = PoiApi.GetPoiList(WXStoreHelper.siteSettings.WeixinAppId, num, num2, 10000);

            while (poiList.business_list.Count > 0)
            {
                poiList.business_list.ForEach(delegate(GetStoreList_Business c)
                {
                    business_list.Add(c);
                });
                num    += num2;
                poiList = PoiApi.GetPoiList(WXStoreHelper.siteSettings.WeixinAppId, num, num2, 10000);
            }
            return(business_list);
        }
Ejemplo n.º 8
0
 public static GetStoreListResultJson GetPoiList(int begin, int limit = 20)
 {
     return(PoiApi.GetPoiList(WXStoreHelper.siteSettings.WeixinAppId, begin, limit, 10000));
 }