public void AddStoreTest() { var req = new WXStoreBasicSmallMo(); req.city = "北京"; req.district = "朝阳区"; req.address = "英特国际公寓A座"; req.branch_name = "西坝河分部"; req.business_name = "OSSCoder作坊"; req.avg_price = 80; req.categories = new List <string>() { "公司企业,企业/工厂" }; req.offset_type = 1; req.latitude = 39.967420F; req.longitude = 116.437680F; req.province = "北京市"; req.telephone = "18610933383"; req.introduction = "OSSCoder分部接待单位"; req.open_time = "8:00-18:00"; req.sid = "osss2"; var res = m_Api.AddStoreAsync(req).WaitResult(); Assert.IsTrue(res.IsSuccess()); //{"errcode":0,"errmsg":"ok","poi_id":"467122530"} }
//static WXPlatStoreApi() //{ // #region 增加全局错误码 // RegisteErrorCode(40009, "图片大小为0或者超过1M"); // RegisteErrorCode(40097, "参数不正确,请参考字段要求检查json 字段"); // RegisteErrorCode(65104, "门店的类型不合法,必须严格按照附表的分类填写"); // RegisteErrorCode(65105, "图片url 不合法,必须使用接口1 的图片上传接口所获取的url"); // RegisteErrorCode(65106, "门店状态必须未审核通过"); // RegisteErrorCode(65107, "扩展字段为不允许修改的状态"); // RegisteErrorCode(65109, "门店名为空"); // RegisteErrorCode(65110, "门店所在详细街道地址为空"); // RegisteErrorCode(65111, "门店的电话为空"); // RegisteErrorCode(65112, "门店所在的城市为空"); // RegisteErrorCode(65113, "门店所在的省份为空"); // RegisteErrorCode(65114, "图片列表为空"); // RegisteErrorCode(65115, "poi_id 不正确"); // #endregion //} #region 门店接口 /// <summary> /// 添加门店 /// </summary> /// <param name="storeMo"></param> /// <returns></returns> public async Task <WXAddStoreResp> AddStoreAsync(WXStoreBasicSmallMo storeMo) { var req = new OssHttpRequest(); req.HttpMethod = HttpMethod.Post; req.AddressUrl = String.Concat(m_ApiUrl, "/cgi-bin/poi/addpoi"); req.CustomBody = JsonConvert.SerializeObject(new { business = new { base_info = storeMo } }); return(await RestCommonOffcialAsync <WXAddStoreResp>(req)); }