TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
XhotelHouseAddRequest req = new XhotelHouseAddRequest();
req.setOuterId("123123131");
req.setName("北京饭店");
req.setUsedName("北京饭店");
req.setDomestic(0L);
req.setCountry("China");
req.setProvince(110000L);
req.setCity(110100L);
req.setDistrict(110101L);
req.setBusiness("aaa");
req.setAddress("西直门");
req.setLongitude("111.13");
req.setLatitude("111.1222");
req.setPositionType("G");
req.setTel("0086#010#12345678");
req.setExtend("{\"keyword\":”上地”}");
req.setShid(123123L);
req.setVendor("taobao");
req.setStar("1");
req.setOpeningTime("2015-01-01");
req.setDecorateTime("2015-01-01");
req.setFloors("4-6层");
req.setRooms(10L);
req.setDescription("酒店描述");
req.setHotelPolicies("{\"10003\":\"仅2岁以上儿童可随同入住\"}");
req.setHotelFacilities("{\"24058\":\"true\",\"24198\":\"true\",\"24200\":\"true\"}");
req.setService("{\"24152\":true,\"24149\":true,\"24150\":true}");
req.setRoomFacilities("{\"24101\":\"true\",\"24091\":\"true\",\"24095\":\"true\"}");
req.setPics("[{\"url\":\"http://123.jpg\",\"ismain\":\"false\",\"type\":\"大堂\",\"attribute\":\"普通图\"},{\"url\":\"http://456.jpg\",\"ismain\":\"true\",\"type\":\"公共区域\",\"attribute\":\"全景图\"},{\"url\":\"http://789.jpg\",\"ismain\":\"false\",\"type\":\"大堂\",\"attribute\":\"普通图\"}]");
req.setBrand("1");
req.setPostalCode("邮编");
req.setBookingNotice("{\"10001\":\"14:00\",\"10002\":\"12:00\",\"10005\":\"清洁福50元\",\"10006\":\"请准备好您的身份证件,我需要登记 不允许吸烟\"}");
req.setCreditCardTypes("1,2,3");
req.setOrbitTrack("{ \"orbitTrack\":[ { \"platform\":\"飞猪\", \"ways\":\"直连\" }, { \"platform\":\"去哪儿\", \"ways\":\"直连\" } { \"platform\":\"如家\", \"ways\":\"电话\" }, { \"platform\":\"如家西湖店\", \"ways\":\"人工\" } ] }");
req.setNameE("Beijing hotel");
req.setSupplier("abc");
req.setSettlementCurrency("HKD");
req.setOwnerInfo("{\"outerId: 外部房东ID,\": \"xxxx\", \"nickName\": \"张三\", \"avatarUrl\": \"http://test.com/1.jpg\", \"telephone\": \"0571-1234567\", \"mobilePhone\": \"12334567678\", \"email\":\"test@test.com\", \"gender\": \"F\", \"avgConfirmTime\": 30, \"responseRate\": 100, \"description\": \"房东太懒,什么也没有填\", \"birthday\":\"2018-01-01\", \"qualifacation\": 1, \"bloodType\": 1, \"profession\":\"交互设计师\", \"country\":\"CN\", \"province\":\"420000\", \"city\":\"421200\", \"real_name_status\": true, \"validate\":\"1,2,4,8\",\"confirmRate\": 98}");
req.setArroundDesc("{\"inside\": \"内部描述\", \"traffic\": \"交通情况\", \"arround\": \"周边情况\"}");
req.setRealAddress("杭州大厦A座1101");
req.setStatus(0L);
XhotelHouseAddResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
XhotelHouseAddRequest req = new XhotelHouseAddRequest();
req.OuterId = "123123131";
req.Name = "北京饭店";
req.UsedName = "北京饭店";
req.Domestic = 0L;
req.Country = "China";
req.Province = 110000L;
req.City = 110100L;
req.District = 110101L;
req.Business = "aaa";
req.Address = "西直门";
req.Longitude = "111.13";
req.Latitude = "111.1222";
req.PositionType = "G";
req.Tel = "0086#010#12345678";
req.Extend = "{\"keyword\":”上地”}";
req.Shid = 123123L;
req.Vendor = "taobao";
req.Star = "1";
req.OpeningTime = "2015-01-01";
req.DecorateTime = "2015-01-01";
req.Floors = "4-6层";
req.Rooms = 10L;
req.Description = "酒店描述";
req.HotelPolicies = "{\"10003\":\"仅2岁以上儿童可随同入住\"}";
req.HotelFacilities = "{\"24058\":\"true\",\"24198\":\"true\",\"24200\":\"true\"}";
req.Service = "{\"24152\":true,\"24149\":true,\"24150\":true}";
req.RoomFacilities = "{\"24101\":\"true\",\"24091\":\"true\",\"24095\":\"true\"}";
req.Pics = "[{\"url\":\"http://123.jpg\",\"ismain\":\"false\",\"type\":\"大堂\",\"attribute\":\"普通图\"},{\"url\":\"http://456.jpg\",\"ismain\":\"true\",\"type\":\"公共区域\",\"attribute\":\"全景图\"},{\"url\":\"http://789.jpg\",\"ismain\":\"false\",\"type\":\"大堂\",\"attribute\":\"普通图\"}]";
req.Brand = "1";
req.PostalCode = "邮编";
req.BookingNotice = "{\"10001\":\"14:00\",\"10002\":\"12:00\",\"10005\":\"清洁福50元\",\"10006\":\"请准备好您的身份证件,我需要登记 不允许吸烟\"}";
req.CreditCardTypes = "1,2,3";
req.OrbitTrack = "{ \"orbitTrack\":[ { \"platform\":\"飞猪\", \"ways\":\"直连\" }, { \"platform\":\"去哪儿\", \"ways\":\"直连\" } { \"platform\":\"如家\", \"ways\":\"电话\" }, { \"platform\":\"如家西湖店\", \"ways\":\"人工\" } ] }";
req.NameE = "Beijing hotel";
req.Supplier = "abc";
req.SettlementCurrency = "HKD";
req.OwnerInfo = "{\"outerId: 外部房东ID,\": \"xxxx\", \"nickName\": \"张三\", \"avatarUrl\": \"http://test.com/1.jpg\", \"telephone\": \"0571-1234567\", \"mobilePhone\": \"12334567678\", \"email\":\"test@test.com\", \"gender\": \"F\", \"avgConfirmTime\": 30, \"responseRate\": 100, \"description\": \"房东太懒,什么也没有填\", \"birthday\":\"2018-01-01\", \"qualifacation\": 1, \"bloodType\": 1, \"profession\":\"交互设计师\", \"country\":\"CN\", \"province\":\"420000\", \"city\":\"421200\", \"real_name_status\": true, \"validate\":\"1,2,4,8\",\"confirmRate\": 98}";
req.ArroundDesc = "{\"inside\": \"内部描述\", \"traffic\": \"交通情况\", \"arround\": \"周边情况\"}";
req.RealAddress = "杭州大厦A座1101";
req.Status = 0L;
XhotelHouseAddResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new XhotelHouseAddRequest;
$req->setOuterId("123123131");
$req->setName("北京饭店");
$req->setUsedName("北京饭店");
$req->setDomestic("0");
$req->setCountry("China");
$req->setProvince("110000");
$req->setCity("110100");
$req->setDistrict("110101");
$req->setBusiness("aaa");
$req->setAddress("西直门");
$req->setLongitude("111.13");
$req->setLatitude("111.1222");
$req->setPositionType("G");
$req->setTel("0086#010#12345678");
$req->setExtend("{\"keyword\":”上地”}");
$req->setShid("123123");
$req->setVendor("taobao");
$req->setStar("1");
$req->setOpeningTime("2015-01-01");
$req->setDecorateTime("2015-01-01");
$req->setFloors("4-6层");
$req->setRooms("10");
$req->setDescription("酒店描述");
$req->setHotelPolicies("{\"10003\":\"仅2岁以上儿童可随同入住\"}");
$req->setHotelFacilities("{\"24058\":\"true\",\"24198\":\"true\",\"24200\":\"true\"}");
$req->setService("{\"24152\":true,\"24149\":true,\"24150\":true}");
$req->setRoomFacilities("{\"24101\":\"true\",\"24091\":\"true\",\"24095\":\"true\"}");
$req->setPics("[{\"url\":\"http://123.jpg\",\"ismain\":\"false\",\"type\":\"大堂\",\"attribute\":\"普通图\"},{\"url\":\"http://456.jpg\",\"ismain\":\"true\",\"type\":\"公共区域\",\"attribute\":\"全景图\"},{\"url\":\"http://789.jpg\",\"ismain\":\"false\",\"type\":\"大堂\",\"attribute\":\"普通图\"}]");
$req->setBrand("1");
$req->setPostalCode("邮编");
$req->setBookingNotice("{\"10001\":\"14:00\",\"10002\":\"12:00\",\"10005\":\"清洁福50元\",\"10006\":\"请准备好您的身份证件,我需要登记 不允许吸烟\"}");
$req->setCreditCardTypes("1,2,3");
$req->setOrbitTrack("{ \"orbitTrack\":[ { \"platform\":\"飞猪\", \"ways\":\"直连\" }, { \"platform\":\"去哪儿\", \"ways\":\"直连\" } { \"platform\":\"如家\", \"ways\":\"电话\" }, { \"platform\":\"如家西湖店\", \"ways\":\"人工\" } ] }");
$req->setNameE("Beijing hotel");
$req->setSupplier("abc");
$req->setSettlementCurrency("HKD");
$req->setOwnerInfo("{\"outerId: 外部房东ID,\": \"xxxx\", \"nickName\": \"张三\", \"avatarUrl\": \"http://test.com/1.jpg\", \"telephone\": \"0571-1234567\", \"mobilePhone\": \"12334567678\", \"email\":\"test@test.com\", \"gender\": \"F\", \"avgConfirmTime\": 30, \"responseRate\": 100, \"description\": \"房东太懒,什么也没有填\", \"birthday\":\"2018-01-01\", \"qualifacation\": 1, \"bloodType\": 1, \"profession\":\"交互设计师\", \"country\":\"CN\", \"province\":\"420000\", \"city\":\"421200\", \"real_name_status\": true, \"validate\":\"1,2,4,8\",\"confirmRate\": 98}");
$req->setArroundDesc("{\"inside\": \"内部描述\", \"traffic\": \"交通情况\", \"arround\": \"周边情况\"}");
$req->setRealAddress("杭州大厦A座1101");
$req->setStatus("0");
$resp = $c->execute($req, $sessionKey);
curl -X POST 'http://gw.api.taobao.com/router/rest' \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'app_key=12129701' \
-d 'format=json' \
-d 'method=taobao.xhotel.house.add' \
-d 'partner_id=apidoc' \
-d 'session=ad2a2371-7ead-413b-87f3-42f9897468ad' \
-d 'sign=82D89A380A42452C0CF4748AE928B10A' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-21+20%3A39%3A21' \
-d 'v=2.0' \
-d 'address=%E8%A5%BF%E7%9B%B4%E9%97%A8' \
-d 'arround_desc=%7B%5C%22inside%5C%22%3A+%5C%22%E5%86%85%E9%83%A8%E6%8F%8F%E8%BF%B0%5C%22%2C+%5C%22traffic%5C%22%3A+%5C%22%E4%BA%A4%E9%80%9A%E6%83%85%E5%86%B5%5C%22%2C+%5C%22arround%5C%22%3A+%5C%22%E5%91%A8%E8%BE%B9%E6%83%85%E5%86%B5%5C%22%7D' \
-d 'booking_notice=%7B%5C%2210001%5C%22%3A%5C%2214%3A00%5C%22%2C%5C%2210002%5C%22%3A%5C%2212%3A00%5C%22%2C%5C%2210005%5C%22%3A%5C%22%E6%B8%85%E6%B4%81%E7%A6%8F50%E5%85%83%5C%22%2C%5C%2210006%5C%22%3A%5C%22%E8%AF%B7%E5%87%86%E5%A4%87%E5%A5%BD%E6%82%A8%E7%9A%84%E8%BA%AB%E4%BB%BD%E8%AF%81%E4%BB%B6%EF%BC%8C%E6%88%91%E9%9C%80%E8%A6%81%E7%99%BB%E8%AE%B0+%E4%B8%8D%E5%85%81%E8%AE%B8%E5%90%B8%E7%83%9F%5C%22%7D' \
-d 'brand=1' \
-d 'business=aaa' \
-d 'city=110100' \
-d 'country=China' \
-d 'credit_card_types=1%2C2%2C3' \
-d 'decorate_time=2015-01-01' \
-d 'description=%E9%85%92%E5%BA%97%E6%8F%8F%E8%BF%B0' \
-d 'district=110101' \
-d 'domestic=0' \
-d 'extend=%7B%5C%22keyword%5C%22%3A%E2%80%9D%E4%B8%8A%E5%9C%B0%E2%80%9D%7D' \
-d 'floors=4-6%E5%B1%82' \
-d 'hotel_facilities=%7B%5C%2224058%5C%22%3A%5C%22true%5C%22%2C%5C%2224198%5C%22%3A%5C%22true%5C%22%2C%5C%2224200%5C%22%3A%5C%22true%5C%22%7D' \
-d 'hotel_policies=%7B%5C%2210003%5C%22%3A%5C%22%E4%BB%852%E5%B2%81%E4%BB%A5%E4%B8%8A%E5%84%BF%E7%AB%A5%E5%8F%AF%E9%9A%8F%E5%90%8C%E5%85%A5%E4%BD%8F%5C%22%7D' \
-d 'latitude=111.1222' \
-d 'longitude=111.13' \
-d 'name=%E5%8C%97%E4%BA%AC%E9%A5%AD%E5%BA%97' \
-d 'name_e=Beijing+hotel' \
-d 'opening_time=2015-01-01' \
-d 'orbit_track=%7B+%09%5C%22orbitTrack%5C%22%3A%5B+%09%09%7B+%09%09%09%5C%22platform%5C%22%3A%5C%22%E9%A3%9E%E7%8C%AA%5C%22%2C+%09%09%09%5C%22ways%5C%22%3A%5C%22%E7%9B%B4%E8%BF%9E%5C%22++%09%09%7D%2C+%09%09%7B+%09%09%09%5C%22platform%5C%22%3A%5C%22%E5%8E%BB%E5%93%AA%E5%84%BF%5C%22%2C+%09%09%09%5C%22ways%5C%22%3A%5C%22%E7%9B%B4%E8%BF%9E%5C%22+%09%09%7D+%09%09%7B+%09%09%09%5C%22platform%5C%22%3A%5C%22%E5%A6%82%E5%AE%B6%5C%22%2C+%09%09%09%5C%22ways%5C%22%3A%5C%22%E7%94%B5%E8%AF%9D%5C%22+%09%09%7D%2C+%09%09%7B+%09%09%09%5C%22platform%5C%22%3A%5C%22%E5%A6%82%E5%AE%B6%E8%A5%BF%E6%B9%96%E5%BA%97%5C%22%2C+%09%09%09%5C%22ways%5C%22%3A%5C%22%E4%BA%BA%E5%B7%A5%5C%22+%09%09%7D+%09%5D+%7D' \
-d 'outer_id=123123131' \
-d 'owner_info=%7B%5C%22outerId%3A+%E5%A4%96%E9%83%A8%E6%88%BF%E4%B8%9CID%2C%5C%22%3A+%5C%22xxxx%5C%22%2C+%5C%22nickName%5C%22%3A+%5C%22%E5%BC%A0%E4%B8%89%5C%22%2C+%5C%22avatarUrl%5C%22%3A+%5C%22http%3A%2F%2Ftest.com%2F1.jpg%5C%22%2C+%5C%22telephone%5C%22%3A+%5C%220571-1234567%5C%22%2C+%5C%22mobilePhone%5C%22%3A+%5C%2212334567678%5C%22%2C+%5C%22email%5C%22%3A%5C%22test%40test.com%5C%22%2C+%5C%22gender%5C%22%3A+%5C%22F%5C%22%2C+%5C%22avgConfirmTime%5C%22%3A+30%2C+%5C%22responseRate%5C%22%3A+100%2C+%5C%22description%5C%22%3A+%5C%22%E6%88%BF%E4%B8%9C%E5%A4%AA%E6%87%92%2C%E4%BB%80%E4%B9%88%E4%B9%9F%E6%B2%A1%E6%9C%89%E5%A1%AB%5C%22%2C+%5C%22birthday%5C%22%3A%5C%222018-01-01%5C%22%2C+%5C%22qualifacation%5C%22%3A+1%2C+%5C%22bloodType%5C%22%3A+1%2C+%5C%22profession%5C%22%3A%5C%22%E4%BA%A4%E4%BA%92%E8%AE%BE%E8%AE%A1%E5%B8%88%5C%22%2C+%5C%22country%5C%22%3A%5C%22CN%5C%22%2C+%5C%22province%5C%22%3A%5C%22420000%5C%22%2C+%5C%22city%5C%22%3A%5C%22421200%5C%22%2C+%5C%22real_name_status%5C%22%3A+true%2C+%5C%22validate%5C%22%3A%5C%221%2C2%2C4%2C8%5C%22%2C%5C%22confirmRate%5C%22%3A+98%7D' \
-d 'pics=%7B%22url%22%3A%22http%3A%2F%2F123.jpg%22%2C%22ismain%22%3A%22false%22%2C%22type%22%3A%22%E5%A4%A7%E5%A0%82%22%2C%22attribute%22%3A%22%E6%99%AE%E9%80%9A%E5%9B%BE%22%7D%2C%7B%22url%22%3A%22http%3A%2F%2F456.jpg%22%2C%22ismain%22%3A%22true%22%2C%22type%22%3A%22%E5%85%AC%E5%85%B1%E5%8C%BA%E5%9F%9F%22%2C%22attribute%22%3A%22%E5%85%A8%E6%99%AF%E5%9B%BE%22%7D%2C%7B%22url%22%3A%22http%3A%2F%2F789.jpg%22%2C%22ismain%22%3A%22false%22%2C%22type%22%3A%22%E5%A4%A7%E5%A0%82%22%2C%22attribute%22%3A%22%E6%99%AE%E9%80%9A%E5%9B%BE%22%7D' \
-d 'position_type=G' \
-d 'postal_code=%E9%82%AE%E7%BC%96' \
-d 'province=110000' \
-d 'real_address=%E6%9D%AD%E5%B7%9E%E5%A4%A7%E5%8E%A6A%E5%BA%A71101' \
-d 'room_facilities=%7B%5C%2224101%5C%22%3A%5C%22true%5C%22%2C%5C%2224091%5C%22%3A%5C%22true%5C%22%2C%5C%2224095%5C%22%3A%5C%22true%5C%22%7D' \
-d 'rooms=10' \
-d 'service=%7B%5C%2224152%5C%22%3Atrue%2C%5C%2224149%5C%22%3Atrue%2C%5C%2224150%5C%22%3Atrue%7D' \
-d 'settlement_currency=HKD' \
-d 'shid=123123' \
-d 'star=1' \
-d 'status=0' \
-d 'supplier=abc' \
-d 'tel=0086%23010%2312345678' \
-d 'used_name=%E5%8C%97%E4%BA%AC%E9%A5%AD%E5%BA%97' \
-d 'vendor=taobao'
# -*- coding: utf-8 -*-
import top.api
req=top.api.XhotelHouseAddRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.outer_id="123123131"
req.name="北京饭店"
req.used_name="北京饭店"
req.domestic=0
req.country="China"
req.province=110000
req.city=110100
req.district=110101
req.business="aaa"
req.address="西直门"
req.longitude="111.13"
req.latitude="111.1222"
req.position_type="G"
req.tel="0086#010#12345678"
req.extend="{\"keyword\":”上地”}"
req.shid=123123
req.vendor="taobao"
req.star="1"
req.opening_time="2015-01-01"
req.decorate_time="2015-01-01"
req.floors="4-6层"
req.rooms=10
req.description="酒店描述"
req.hotel_policies="{\"10003\":\"仅2岁以上儿童可随同入住\"}"
req.hotel_facilities="{\"24058\":\"true\",\"24198\":\"true\",\"24200\":\"true\"}"
req.service="{\"24152\":true,\"24149\":true,\"24150\":true}"
req.room_facilities="{\"24101\":\"true\",\"24091\":\"true\",\"24095\":\"true\"}"
req.pics="[{\"url\":\"http://123.jpg\",\"ismain\":\"false\",\"type\":\"大堂\",\"attribute\":\"普通图\"},{\"url\":\"http://456.jpg\",\"ismain\":\"true\",\"type\":\"公共区域\",\"attribute\":\"全景图\"},{\"url\":\"http://789.jpg\",\"ismain\":\"false\",\"type\":\"大堂\",\"attribute\":\"普通图\"}]"
req.brand="1"
req.postal_code="邮编"
req.booking_notice="{\"10001\":\"14:00\",\"10002\":\"12:00\",\"10005\":\"清洁福50元\",\"10006\":\"请准备好您的身份证件,我需要登记 不允许吸烟\"}"
req.credit_card_types="1,2,3"
req.orbit_track="{ \"orbitTrack\":[ { \"platform\":\"飞猪\", \"ways\":\"直连\" }, { \"platform\":\"去哪儿\", \"ways\":\"直连\" } { \"platform\":\"如家\", \"ways\":\"电话\" }, { \"platform\":\"如家西湖店\", \"ways\":\"人工\" } ] }"
req.name_e="Beijing hotel"
req.supplier="abc"
req.settlement_currency="HKD"
req.owner_info="{\"outerId: 外部房东ID,\": \"xxxx\", \"nickName\": \"张三\", \"avatarUrl\": \"http://test.com/1.jpg\", \"telephone\": \"0571-1234567\", \"mobilePhone\": \"12334567678\", \"email\":\"test@test.com\", \"gender\": \"F\", \"avgConfirmTime\": 30, \"responseRate\": 100, \"description\": \"房东太懒,什么也没有填\", \"birthday\":\"2018-01-01\", \"qualifacation\": 1, \"bloodType\": 1, \"profession\":\"交互设计师\", \"country\":\"CN\", \"province\":\"420000\", \"city\":\"421200\", \"real_name_status\": true, \"validate\":\"1,2,4,8\",\"confirmRate\": 98}"
req.arround_desc="{\"inside\": \"内部描述\", \"traffic\": \"交通情况\", \"arround\": \"周边情况\"}"
req.real_address="杭州大厦A座1101"
req.status=0
try:
resp= req.getResponse(sessionkey)
print(resp)
except Exception,e:
print(e)
pTopRequest pRequest = alloc_top_request();
pTopResponse pResponse = NULL;
pTaobaoClient pClient = alloc_taobao_client(url, appkey, appsecret);
set_api_name(pRequest,"taobao.xhotel.house.add");
add_param(pRequest,"outer_id","123123131");
add_param(pRequest,"name","北京饭店");
add_param(pRequest,"used_name","北京饭店");
add_param(pRequest,"domestic","0");
add_param(pRequest,"country","China");
add_param(pRequest,"province","110000");
add_param(pRequest,"city","110100");
add_param(pRequest,"district","110101");
add_param(pRequest,"business","aaa");
add_param(pRequest,"address","西直门");
add_param(pRequest,"longitude","111.13");
add_param(pRequest,"latitude","111.1222");
add_param(pRequest,"position_type","G");
add_param(pRequest,"tel","0086#010#12345678");
add_param(pRequest,"extend","{\"keyword\":”上地”}");
add_param(pRequest,"shid","123123");
add_param(pRequest,"vendor","taobao");
add_param(pRequest,"star","1");
add_param(pRequest,"opening_time","2015-01-01");
add_param(pRequest,"decorate_time","2015-01-01");
add_param(pRequest,"floors","4-6层");
add_param(pRequest,"rooms","10");
add_param(pRequest,"description","酒店描述");
add_param(pRequest,"hotel_policies","{\"10003\":\"仅2岁以上儿童可随同入住\"}");
add_param(pRequest,"hotel_facilities","{\"24058\":\"true\",\"24198\":\"true\",\"24200\":\"true\"}");
add_param(pRequest,"service","{\"24152\":true,\"24149\":true,\"24150\":true}");
add_param(pRequest,"room_facilities","{\"24101\":\"true\",\"24091\":\"true\",\"24095\":\"true\"}");
add_param(pRequest,"pics","{"url":"http://123.jpg","ismain":"false","type":"大堂","attribute":"普通图"},{"url":"http://456.jpg","ismain":"true","type":"公共区域","attribute":"全景图"},{"url":"http://789.jpg","ismain":"false","type":"大堂","attribute":"普通图"}");
add_param(pRequest,"brand","1");
add_param(pRequest,"postal_code","邮编");
add_param(pRequest,"booking_notice","{\"10001\":\"14:00\",\"10002\":\"12:00\",\"10005\":\"清洁福50元\",\"10006\":\"请准备好您的身份证件,我需要登记 不允许吸烟\"}");
add_param(pRequest,"credit_card_types","1,2,3");
add_param(pRequest,"orbit_track","{ \"orbitTrack\":[ { \"platform\":\"飞猪\", \"ways\":\"直连\" }, { \"platform\":\"去哪儿\", \"ways\":\"直连\" } { \"platform\":\"如家\", \"ways\":\"电话\" }, { \"platform\":\"如家西湖店\", \"ways\":\"人工\" } ] }");
add_param(pRequest,"name_e","Beijing hotel");
add_param(pRequest,"supplier","abc");
add_param(pRequest,"settlement_currency","HKD");
add_param(pRequest,"owner_info","{\"outerId: 外部房东ID,\": \"xxxx\", \"nickName\": \"张三\", \"avatarUrl\": \"http://test.com/1.jpg\", \"telephone\": \"0571-1234567\", \"mobilePhone\": \"12334567678\", \"email\":\"test@test.com\", \"gender\": \"F\", \"avgConfirmTime\": 30, \"responseRate\": 100, \"description\": \"房东太懒,什么也没有填\", \"birthday\":\"2018-01-01\", \"qualifacation\": 1, \"bloodType\": 1, \"profession\":\"交互设计师\", \"country\":\"CN\", \"province\":\"420000\", \"city\":\"421200\", \"real_name_status\": true, \"validate\":\"1,2,4,8\",\"confirmRate\": 98}");
add_param(pRequest,"arround_desc","{\"inside\": \"内部描述\", \"traffic\": \"交通情况\", \"arround\": \"周边情况\"}");
add_param(pRequest,"real_address","杭州大厦A座1101");
add_param(pRequest,"status","0");
pResponse = top_execute(pClient,pRequest,sessionKey);
printf("ret code:%d\n",pResponse->code);
if(pResponse->code == 0){
pTopResponseIterator ite = init_response_iterator(pResponse);
pResultItem pResultItem = alloc_result_item();
while(parseNext(ite, pResultItem) == 0){
printf("%s:%s\n",pResultItem->key,pResultItem->value);
}
destroy_response_iterator(ite);
destroy_result_item(pResultItem);
}
destroy_top_request(pRequest);
destroy_top_response(pResponse);
destroy_taobao_client(pClient);
TopClient = require('./topClient').TopClient;
var client = new TopClient({
'appkey': 'appkey',
'appsecret': 'secret',
'REST_URL': 'http://gw.api.taobao.com/router/rest'
});
client.execute('taobao.xhotel.house.add', {
'outer_id':'123123131',
'name':'北京饭店',
'used_name':'北京饭店',
'domestic':'0',
'country':'China',
'province':'110000',
'city':'110100',
'district':'110101',
'business':'aaa',
'address':'西直门',
'longitude':'111.13',
'latitude':'111.1222',
'position_type':'G',
'tel':'0086#010#12345678',
'extend':'{\"keyword\":”上地”}',
'shid':'123123',
'vendor':'taobao',
'star':'1',
'opening_time':'2015-01-01',
'decorate_time':'2015-01-01',
'floors':'4-6层',
'rooms':'10',
'description':'酒店描述',
'hotel_policies':'{\"10003\":\"仅2岁以上儿童可随同入住\"}',
'hotel_facilities':'{\"24058\":\"true\",\"24198\":\"true\",\"24200\":\"true\"}',
'service':'{\"24152\":true,\"24149\":true,\"24150\":true}',
'room_facilities':'{\"24101\":\"true\",\"24091\":\"true\",\"24095\":\"true\"}',
'pics':'{"url":"http://123.jpg","ismain":"false","type":"大堂","attribute":"普通图"},{"url":"http://456.jpg","ismain":"true","type":"公共区域","attribute":"全景图"},{"url":"http://789.jpg","ismain":"false","type":"大堂","attribute":"普通图"}',
'brand':'1',
'postal_code':'邮编',
'booking_notice':'{\"10001\":\"14:00\",\"10002\":\"12:00\",\"10005\":\"清洁福50元\",\"10006\":\"请准备好您的身份证件,我需要登记 不允许吸烟\"}',
'credit_card_types':'1,2,3',
'orbit_track':'{ \"orbitTrack\":[ { \"platform\":\"飞猪\", \"ways\":\"直连\" }, { \"platform\":\"去哪儿\", \"ways\":\"直连\" } { \"platform\":\"如家\", \"ways\":\"电话\" }, { \"platform\":\"如家西湖店\", \"ways\":\"人工\" } ] }',
'name_e':'Beijing hotel',
'supplier':'abc',
'settlement_currency':'HKD',
'owner_info':'{\"outerId: 外部房东ID,\": \"xxxx\", \"nickName\": \"张三\", \"avatarUrl\": \"http://test.com/1.jpg\", \"telephone\": \"0571-1234567\", \"mobilePhone\": \"12334567678\", \"email\":\"test@test.com\", \"gender\": \"F\", \"avgConfirmTime\": 30, \"responseRate\": 100, \"description\": \"房东太懒,什么也没有填\", \"birthday\":\"2018-01-01\", \"qualifacation\": 1, \"bloodType\": 1, \"profession\":\"交互设计师\", \"country\":\"CN\", \"province\":\"420000\", \"city\":\"421200\", \"real_name_status\": true, \"validate\":\"1,2,4,8\",\"confirmRate\": 98}',
'arround_desc':'{\"inside\": \"内部描述\", \"traffic\": \"交通情况\", \"arround\": \"周边情况\"}',
'real_address':'杭州大厦A座1101',
'status':'0'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})