TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
XhotelBnbroomtypeAddRequest req = new XhotelBnbroomtypeAddRequest();
req.setRentSize(100L);
req.setSupportIm(1L);
req.setOuterTags("xxx,x,xx");
req.setCleaningCharge(1L);
req.setInvoice(1L);
req.setDecorateLevel(1L);
XhotelBnbroomtypeAddRequest.BnbBookingTimeDto obj1 = new XhotelBnbroomtypeAddRequest.BnbBookingTimeDto();
obj1.setStartReceptionTime("12:00");
obj1.setEndReceptionTime("12:00");
obj1.setEarliestCheckInTime("12:00");
obj1.setLatestBookingTime("12:00");
obj1.setLatestCheckInTime("12:00");
obj1.setLatestCheckOutTime("12:00");
req.setBnbBookingTime(obj1);
req.setOutHid("05181208");
req.setTel("0086#010#12345678");
req.setReceiveForeigners(1L);
req.setLocalInfo("位置描述");
req.setBrand("品牌名称");
List<XhotelBnbroomtypeAddRequest.BnbPictureDTO> list3 = new ArrayList<XhotelBnbroomtypeAddRequest.BnbPictureDTO>();
XhotelBnbroomtypeAddRequest.BnbPictureDTO obj4 = new XhotelBnbroomtypeAddRequest.BnbPictureDTO();
list3.add(obj4);
obj4.setAttribute("平面图");
obj4.setIsmain(true);
obj4.setDes("客厅照片");
obj4.setType("大堂");
obj4.setUrl("http://taobao.com/123.jpg");
req.setPics(list3);
req.setCleaningType(1L);
req.setDepositAmount(1212L);
req.setNameE("xxx");
req.setDecorateTime("2015-01-01");
req.setExtraBedsNum(0L);
req.setInvoiceType(2L);
req.setHasFrontDesk(1L);
req.setGuestAge(1L);
req.setSettlementCurrency("HKD");
req.setName("大床房");
req.setSurroundInfo("周边描述");
req.setMaxOccupancy(1L);
req.setIsUseShootImage(1L);
req.setStatus("0");
req.setGuestGender(1L);
req.setActivitiesAllowed("12,23");
req.setExtraCleaningCharge(1L);
req.setOpeningTime("2021-01-01");
req.setRentType(1L);
req.setNewOuterId("xxx");
req.setHouseModel("{\"bedroom\":4, \"bathroom\": 2, \"livingroom\": 1, \"study\": 1, \"balcony\": 1,\"kitchen\":0}");
req.setWindowType(1L);
req.setHasLicense(1L);
req.setVideoUrl("视频地址");
req.setVendor("taobao");
req.setBrightspot("亮点描述");
req.setQuickOrder(1L);
req.setFloor("3-5层");
req.setHouseSize(100L);
req.setProductType(1L);
req.setIntroduction("不错房源");
req.setHasLandlord(1L);
XhotelBnbroomtypeAddRequest.BnbChargeDto obj5 = new XhotelBnbroomtypeAddRequest.BnbChargeDto();
obj5.setNum(3L);
obj5.setFee(1L);
obj5.setAddPeople(1L);
obj5.setMinChargingAge(5L);
req.setCharge(obj5);
req.setDecorateStyle(1L);
req.setSupportcredit(1L);
req.setCheckInNotes("入住须知");
req.setRealTel("139888xxx");
req.setService("{\"24272\":\"true\",\"24263\":\"true\",\"24267\":\"true\"}");
req.setCleaningFrequency(1L);
req.setOuterId("xxx");
XhotelBnbroomtypeAddRequest.BnbLocationDto obj6 = new XhotelBnbroomtypeAddRequest.BnbLocationDto();
obj6.setCountry("China");
obj6.setAddress("北京朝阳金辉大厦");
obj6.setBusiness("望京");
obj6.setCity(110100L);
obj6.setLatitude("111.1222");
obj6.setPositionType("G");
obj6.setDomestic(0L);
obj6.setProvince(110000L);
obj6.setEnAddress("xxx");
obj6.setReceptionAddress("接待地址");
obj6.setDistrict(101100L);
obj6.setTimezone("+8");
obj6.setDoorplate("xxx");
obj6.setLongitude("111.13");
req.setLocation(obj6);
req.setScenicFeature(1L);
req.setDepositType(1L);
req.setBedInfo("[{\"bedType\":1,\"desc\":\"双人床\",\"width\":\"1.8\",\"length\":\"2\",\"bedNum\":1}]");
req.setExtraFee("额外收费");
req.setExtraBedsFee(14500L);
req.setBnbName("阳光民宿");
req.setSrid(1234L);
req.setStandardRoomFacilities("{\"dataVersion\":\"2.0.0\",\"facilityList\":[{\"500\":true,\"fee\":true},{\"501\":true,\"option\":\"1\"},{\"506\":true,\"mul-option\":[\"1\",\"2\"],\"desc\":\"说明\"},{\"507\":true,\"desc\":\"说明\"},{\"509\":true,\"value\":\"12:00\",\"fee\":true},{\"2\":true,\"list\":[{\"inDoorType\":\"1\",\"fee\":true},{\"inDoorType\":\"2\",\"fee\":true}]},{\"7\":true,\"list\":[{\"restaurantType\":\"1\",\"name\":\"品珍中餐厅\"},{\"restaurantType\":\"2\",\"name\":\"和日式料理\"}]}]}");
req.setBnbExtend("{}");
XhotelBnbroomtypeAddResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
XhotelBnbroomtypeAddRequest req = new XhotelBnbroomtypeAddRequest();
req.RentSize = 100L;
req.SupportIm = 1L;
req.OuterTags = "xxx,x,xx";
req.CleaningCharge = 1L;
req.Invoice = 1L;
req.DecorateLevel = 1L;
XhotelBnbroomtypeAddRequest.BnbBookingTimeDtoDomain obj1 = new XhotelBnbroomtypeAddRequest.BnbBookingTimeDtoDomain();
obj1.StartReceptionTime = "12:00";
obj1.EndReceptionTime = "12:00";
obj1.EarliestCheckInTime = "12:00";
obj1.LatestBookingTime = "12:00";
obj1.LatestCheckInTime = "12:00";
obj1.LatestCheckOutTime = "12:00";
req.BnbBookingTime_ = obj1;
req.OutHid = "05181208";
req.Tel = "0086#010#12345678";
req.ReceiveForeigners = 1L;
req.LocalInfo = "位置描述";
req.Brand = "品牌名称";
List<XhotelBnbroomtypeAddRequest.BnbPictureDTODomain> list3 = new List<XhotelBnbroomtypeAddRequest.BnbPictureDTODomain>();
XhotelBnbroomtypeAddRequest.BnbPictureDTODomain obj4 = new XhotelBnbroomtypeAddRequest.BnbPictureDTODomain();
list3.Add(obj4);
obj4.Attribute = "平面图";
obj4.Ismain = true;
obj4.Des = "客厅照片";
obj4.Type = "大堂";
obj4.Url = "http://taobao.com/123.jpg";
req.Pics_ = list3;
req.CleaningType = 1L;
req.DepositAmount = 1212L;
req.NameE = "xxx";
req.DecorateTime = "2015-01-01";
req.ExtraBedsNum = 0L;
req.InvoiceType = 2L;
req.HasFrontDesk = 1L;
req.GuestAge = 1L;
req.SettlementCurrency = "HKD";
req.Name = "大床房";
req.SurroundInfo = "周边描述";
req.MaxOccupancy = 1L;
req.IsUseShootImage = 1L;
req.Status = "0";
req.GuestGender = 1L;
req.ActivitiesAllowed = "12,23";
req.ExtraCleaningCharge = 1L;
req.OpeningTime = "2021-01-01";
req.RentType = 1L;
req.NewOuterId = "xxx";
req.HouseModel = "{\"bedroom\":4, \"bathroom\": 2, \"livingroom\": 1, \"study\": 1, \"balcony\": 1,\"kitchen\":0}";
req.WindowType = 1L;
req.HasLicense = 1L;
req.VideoUrl = "视频地址";
req.Vendor = "taobao";
req.Brightspot = "亮点描述";
req.QuickOrder = 1L;
req.Floor = "3-5层";
req.HouseSize = 100L;
req.ProductType = 1L;
req.Introduction = "不错房源";
req.HasLandlord = 1L;
XhotelBnbroomtypeAddRequest.BnbChargeDtoDomain obj5 = new XhotelBnbroomtypeAddRequest.BnbChargeDtoDomain();
obj5.Num = 3L;
obj5.Fee = 1L;
obj5.AddPeople = 1L;
obj5.MinChargingAge = 5L;
req.Charge_ = obj5;
req.DecorateStyle = 1L;
req.Supportcredit = 1L;
req.CheckInNotes = "入住须知";
req.RealTel = "139888xxx";
req.Service = "{\"24272\":\"true\",\"24263\":\"true\",\"24267\":\"true\"}";
req.CleaningFrequency = 1L;
req.OuterId = "xxx";
XhotelBnbroomtypeAddRequest.BnbLocationDtoDomain obj6 = new XhotelBnbroomtypeAddRequest.BnbLocationDtoDomain();
obj6.Country = "China";
obj6.Address = "北京朝阳金辉大厦";
obj6.Business = "望京";
obj6.City = 110100L;
obj6.Latitude = "111.1222";
obj6.PositionType = "G";
obj6.Domestic = 0L;
obj6.Province = 110000L;
obj6.EnAddress = "xxx";
obj6.ReceptionAddress = "接待地址";
obj6.District = 101100L;
obj6.Timezone = "+8";
obj6.Doorplate = "xxx";
obj6.Longitude = "111.13";
req.Location_ = obj6;
req.ScenicFeature = 1L;
req.DepositType = 1L;
req.BedInfo = "[{\"bedType\":1,\"desc\":\"双人床\",\"width\":\"1.8\",\"length\":\"2\",\"bedNum\":1}]";
req.ExtraFee = "额外收费";
req.ExtraBedsFee = 14500L;
req.BnbName = "阳光民宿";
req.Srid = 1234L;
req.StandardRoomFacilities = "{\"dataVersion\":\"2.0.0\",\"facilityList\":[{\"500\":true,\"fee\":true},{\"501\":true,\"option\":\"1\"},{\"506\":true,\"mul-option\":[\"1\",\"2\"],\"desc\":\"说明\"},{\"507\":true,\"desc\":\"说明\"},{\"509\":true,\"value\":\"12:00\",\"fee\":true},{\"2\":true,\"list\":[{\"inDoorType\":\"1\",\"fee\":true},{\"inDoorType\":\"2\",\"fee\":true}]},{\"7\":true,\"list\":[{\"restaurantType\":\"1\",\"name\":\"品珍中餐厅\"},{\"restaurantType\":\"2\",\"name\":\"和日式料理\"}]}]}";
req.BnbExtend = "{}";
XhotelBnbroomtypeAddResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new XhotelBnbroomtypeAddRequest;
$req->setRentSize("100");
$req->setSupportIm("1");
$req->setOuterTags("xxx,x,xx");
$req->setCleaningCharge("1");
$req->setInvoice("1");
$req->setDecorateLevel("1");
$bnb_booking_time = new BnbBookingTimeDto;
$bnb_booking_time->start_reception_time="12:00";
$bnb_booking_time->end_reception_time="12:00";
$bnb_booking_time->earliest_check_in_time="12:00";
$bnb_booking_time->latest_booking_time="12:00";
$bnb_booking_time->latest_check_in_time="12:00";
$bnb_booking_time->latest_check_out_time="12:00";
$req->setBnbBookingTime(json_encode($bnb_booking_time));
$req->setOutHid("05181208");
$req->setTel("0086#010#12345678");
$req->setReceiveForeigners("1");
$req->setLocalInfo("位置描述");
$req->setBrand("品牌名称");
$pics = new BnbPictureDTO;
$pics->attribute="平面图";
$pics->ismain="true";
$pics->des="客厅照片";
$pics->type="大堂";
$pics->url="http://taobao.com/123.jpg";
$req->setPics(json_encode($pics));
$req->setCleaningType("1");
$req->setDepositAmount("1212");
$req->setNameE("xxx");
$req->setDecorateTime("2015-01-01");
$req->setExtraBedsNum("0");
$req->setInvoiceType("2");
$req->setHasFrontDesk("1");
$req->setGuestAge("1");
$req->setSettlementCurrency("HKD");
$req->setName("大床房");
$req->setSurroundInfo("周边描述");
$req->setMaxOccupancy("1");
$req->setIsUseShootImage("1");
$req->setStatus("0");
$req->setGuestGender("1");
$req->setActivitiesAllowed("12,23");
$req->setExtraCleaningCharge("1");
$req->setOpeningTime("2021-01-01");
$req->setRentType("1");
$req->setNewOuterId("xxx");
$req->setHouseModel("{\"bedroom\":4, \"bathroom\": 2, \"livingroom\": 1, \"study\": 1, \"balcony\": 1,\"kitchen\":0}");
$req->setWindowType("1");
$req->setHasLicense("1");
$req->setVideoUrl("视频地址");
$req->setVendor("taobao");
$req->setBrightspot("亮点描述");
$req->setQuickOrder("1");
$req->setFloor("3-5层");
$req->setHouseSize("100");
$req->setProductType("1");
$req->setIntroduction("不错房源");
$req->setHasLandlord("1");
$charge = new BnbChargeDto;
$charge->num="3";
$charge->fee="1";
$charge->add_people="1";
$charge->min_charging_age="5";
$req->setCharge(json_encode($charge));
$req->setDecorateStyle("1");
$req->setSupportcredit("1");
$req->setCheckInNotes("入住须知");
$req->setRealTel("139888xxx");
$req->setService("{\"24272\":\"true\",\"24263\":\"true\",\"24267\":\"true\"}");
$req->setCleaningFrequency("1");
$req->setOuterId("xxx");
$location = new BnbLocationDto;
$location->country="China";
$location->address="北京朝阳金辉大厦";
$location->business="望京";
$location->city="110100";
$location->latitude="111.1222";
$location->position_type="G";
$location->domestic="0";
$location->province="110000";
$location->en_address="xxx";
$location->reception_address="接待地址";
$location->district="101100";
$location->timezone="+8";
$location->doorplate="xxx";
$location->longitude="111.13";
$req->setLocation(json_encode($location));
$req->setScenicFeature("1");
$req->setDepositType("1");
$req->setBedInfo("[{\"bedType\":1,\"desc\":\"双人床\",\"width\":\"1.8\",\"length\":\"2\",\"bedNum\":1}]");
$req->setExtraFee("额外收费");
$req->setExtraBedsFee("14500");
$req->setBnbName("阳光民宿");
$req->setSrid("1234");
$req->setStandardRoomFacilities("{\"dataVersion\":\"2.0.0\",\"facilityList\":[{\"500\":true,\"fee\":true},{\"501\":true,\"option\":\"1\"},{\"506\":true,\"mul-option\":[\"1\",\"2\"],\"desc\":\"说明\"},{\"507\":true,\"desc\":\"说明\"},{\"509\":true,\"value\":\"12:00\",\"fee\":true},{\"2\":true,\"list\":[{\"inDoorType\":\"1\",\"fee\":true},{\"inDoorType\":\"2\",\"fee\":true}]},{\"7\":true,\"list\":[{\"restaurantType\":\"1\",\"name\":\"品珍中餐厅\"},{\"restaurantType\":\"2\",\"name\":\"和日式料理\"}]}]}");
$req->setBnbExtend("{}");
$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.bnbroomtype.add' \
-d 'partner_id=apidoc' \
-d 'session=6406ee97-93c1-45fe-974d-3d66ed2e673f' \
-d 'sign=24770BDB81469714413A3F806234C7BB' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-21+20%3A30%3A58' \
-d 'v=2.0' \
-d 'activities_allowed=12%2C23' \
-d 'bed_info=%7B%22bedType%22%3A1%2C%22desc%22%3A%22%E5%8F%8C%E4%BA%BA%E5%BA%8A%22%2C%22width%22%3A%221.8%22%2C%22length%22%3A%222%22%2C%22bedNum%22%3A1%7D' \
-d 'bnb_booking_time=null' \
-d 'bnb_extend=%7B%7D' \
-d 'bnb_name=%E9%98%B3%E5%85%89%E6%B0%91%E5%AE%BF' \
-d 'brand=%E5%93%81%E7%89%8C%E5%90%8D%E7%A7%B0' \
-d 'brightspot=%E4%BA%AE%E7%82%B9%E6%8F%8F%E8%BF%B0' \
-d 'charge=null' \
-d 'check_in_notes=%E5%85%A5%E4%BD%8F%E9%A1%BB%E7%9F%A5' \
-d 'cleaning_charge=1' \
-d 'cleaning_frequency=1' \
-d 'cleaning_type=1' \
-d 'decorate_level=1' \
-d 'decorate_style=1' \
-d 'decorate_time=2015-01-01' \
-d 'deposit_amount=1212' \
-d 'deposit_type=1' \
-d 'extra_beds_fee=14500' \
-d 'extra_beds_num=0' \
-d 'extra_cleaning_charge=1' \
-d 'extra_fee=%E9%A2%9D%E5%A4%96%E6%94%B6%E8%B4%B9' \
-d 'floor=3-5%E5%B1%82' \
-d 'guest_age=1' \
-d 'guest_gender=1' \
-d 'has_front_desk=1' \
-d 'has_landlord=1' \
-d 'has_license=1' \
-d 'house_model=%7B%5C%22bedroom%5C%22%3A4%2C+%5C%22bathroom%5C%22%3A+2%2C+%5C%22livingroom%5C%22%3A+1%2C+%5C%22study%5C%22%3A+1%2C+%5C%22balcony%5C%22%3A+1%2C%5C%22kitchen%5C%22%3A0%7D' \
-d 'house_size=100' \
-d 'introduction=%E4%B8%8D%E9%94%99%E6%88%BF%E6%BA%90' \
-d 'invoice=1' \
-d 'invoice_type=2' \
-d 'is_use_shoot_image=1' \
-d 'local_info=%E4%BD%8D%E7%BD%AE%E6%8F%8F%E8%BF%B0' \
-d 'location=null' \
-d 'max_occupancy=1' \
-d 'name=%E5%A4%A7%E5%BA%8A%E6%88%BF' \
-d 'name_e=xxx' \
-d 'new_outer_id=xxx' \
-d 'opening_time=2021-01-01' \
-d 'out_hid=05181208' \
-d 'outer_id=xxx' \
-d 'outer_tags=xxx%2Cx%2Cxx' \
-d 'pics=null' \
-d 'product_type=1' \
-d 'quick_order=1' \
-d 'real_tel=139888xxx' \
-d 'receive_foreigners=1' \
-d 'rent_size=100' \
-d 'rent_type=1' \
-d 'scenic_feature=1' \
-d 'service=%7B%5C%2224272%5C%22%3A%5C%22true%5C%22%2C%5C%2224263%5C%22%3A%5C%22true%5C%22%2C%5C%2224267%5C%22%3A%5C%22true%5C%22%7D' \
-d 'settlement_currency=HKD' \
-d 'srid=1234' \
-d 'standard_room_facilities=%7B%5C%22dataVersion%5C%22%3A%5C%222.0.0%5C%22%2C%5C%22facilityList%5C%22%3A%5B%7B%5C%22500%5C%22%3Atrue%2C%5C%22fee%5C%22%3Atrue%7D%2C%7B%5C%22501%5C%22%3Atrue%2C%5C%22option%5C%22%3A%5C%221%5C%22%7D%2C%7B%5C%22506%5C%22%3Atrue%2C%5C%22mul-option%5C%22%3A%5B%5C%221%5C%22%2C%5C%222%5C%22%5D%2C%5C%22desc%5C%22%3A%5C%22%E8%AF%B4%E6%98%8E%5C%22%7D%2C%7B%5C%22507%5C%22%3Atrue%2C%5C%22desc%5C%22%3A%5C%22%E8%AF%B4%E6%98%8E%5C%22%7D%2C%7B%5C%22509%5C%22%3Atrue%2C%5C%22value%5C%22%3A%5C%2212%3A00%5C%22%2C%5C%22fee%5C%22%3Atrue%7D%2C%7B%5C%222%5C%22%3Atrue%2C%5C%22list%5C%22%3A%5B%7B%5C%22inDoorType%5C%22%3A%5C%221%5C%22%2C%5C%22fee%5C%22%3Atrue%7D%2C%7B%5C%22inDoorType%5C%22%3A%5C%222%5C%22%2C%5C%22fee%5C%22%3Atrue%7D%5D%7D%2C%7B%5C%227%5C%22%3Atrue%2C%5C%22list%5C%22%3A%5B%7B%5C%22restaurantType%5C%22%3A%5C%221%5C%22%2C%5C%22name%5C%22%3A%5C%22%E5%93%81%E7%8F%8D%E4%B8%AD%E9%A4%90%E5%8E%85%5C%22%7D%2C%7B%5C%22restaurantType%5C%22%3A%5C%222%5C%22%2C%5C%22name%5C%22%3A%5C%22%E5%92%8C%E6%97%A5%E5%BC%8F%E6%96%99%E7%90%86%5C%22%7D%5D%7D%5D%7D' \
-d 'status=0' \
-d 'support_im=1' \
-d 'supportcredit=1' \
-d 'surround_info=%E5%91%A8%E8%BE%B9%E6%8F%8F%E8%BF%B0' \
-d 'tel=0086%23010%2312345678' \
-d 'vendor=taobao' \
-d 'video_url=%E8%A7%86%E9%A2%91%E5%9C%B0%E5%9D%80' \
-d 'window_type=1'
# -*- coding: utf-8 -*-
import top.api
req=top.api.XhotelBnbroomtypeAddRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.rent_size=100
req.support_im=1
req.outer_tags="xxx,x,xx"
req.cleaning_charge=1
req.invoice=1
req.decorate_level=1
req.bnb_booking_time=""
req.out_hid="05181208"
req.tel="0086#010#12345678"
req.receive_foreigners=1
req.local_info="位置描述"
req.brand="品牌名称"
req.pics="[]"
req.cleaning_type=1
req.deposit_amount=1212
req.name_e="xxx"
req.decorate_time="2015-01-01"
req.extra_beds_num=0
req.invoice_type=2
req.has_front_desk=1
req.guest_age=1
req.settlement_currency="HKD"
req.name="大床房"
req.surround_info="周边描述"
req.max_occupancy=1
req.is_use_shoot_image=1
req.status="0"
req.guest_gender=1
req.activities_allowed="12,23"
req.extra_cleaning_charge=1
req.opening_time="2021-01-01"
req.rent_type=1
req.new_outer_id="xxx"
req.house_model="{\"bedroom\":4, \"bathroom\": 2, \"livingroom\": 1, \"study\": 1, \"balcony\": 1,\"kitchen\":0}"
req.window_type=1
req.has_license=1
req.video_url="视频地址"
req.vendor="taobao"
req.brightspot="亮点描述"
req.quick_order=1
req.floor="3-5层"
req.house_size=100
req.product_type=1
req.introduction="不错房源"
req.has_landlord=1
req.charge=""
req.decorate_style=1
req.supportcredit=1
req.check_in_notes="入住须知"
req.real_tel="139888xxx"
req.service="{\"24272\":\"true\",\"24263\":\"true\",\"24267\":\"true\"}"
req.cleaning_frequency=1
req.outer_id="xxx"
req.location=""
req.scenic_feature=1
req.deposit_type=1
req.bed_info="[{\"bedType\":1,\"desc\":\"双人床\",\"width\":\"1.8\",\"length\":\"2\",\"bedNum\":1}]"
req.extra_fee="额外收费"
req.extra_beds_fee=14500
req.bnb_name="阳光民宿"
req.srid=1234
req.standard_room_facilities="{\"dataVersion\":\"2.0.0\",\"facilityList\":[{\"500\":true,\"fee\":true},{\"501\":true,\"option\":\"1\"},{\"506\":true,\"mul-option\":[\"1\",\"2\"],\"desc\":\"说明\"},{\"507\":true,\"desc\":\"说明\"},{\"509\":true,\"value\":\"12:00\",\"fee\":true},{\"2\":true,\"list\":[{\"inDoorType\":\"1\",\"fee\":true},{\"inDoorType\":\"2\",\"fee\":true}]},{\"7\":true,\"list\":[{\"restaurantType\":\"1\",\"name\":\"品珍中餐厅\"},{\"restaurantType\":\"2\",\"name\":\"和日式料理\"}]}]}"
req.bnb_extend="{}"
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.bnbroomtype.add");
add_param(pRequest,"rent_size","100");
add_param(pRequest,"support_im","1");
add_param(pRequest,"outer_tags","xxx,x,xx");
add_param(pRequest,"cleaning_charge","1");
add_param(pRequest,"invoice","1");
add_param(pRequest,"decorate_level","1");
add_param(pRequest,"bnb_booking_time","数据结构JSON示例");
add_param(pRequest,"out_hid","05181208");
add_param(pRequest,"tel","0086#010#12345678");
add_param(pRequest,"receive_foreigners","1");
add_param(pRequest,"local_info","位置描述");
add_param(pRequest,"brand","品牌名称");
add_param(pRequest,"pics","数据结构JSON示例");
add_param(pRequest,"cleaning_type","1");
add_param(pRequest,"deposit_amount","1212");
add_param(pRequest,"name_e","xxx");
add_param(pRequest,"decorate_time","2015-01-01");
add_param(pRequest,"extra_beds_num","0");
add_param(pRequest,"invoice_type","2");
add_param(pRequest,"has_front_desk","1");
add_param(pRequest,"guest_age","1");
add_param(pRequest,"settlement_currency","HKD");
add_param(pRequest,"name","大床房");
add_param(pRequest,"surround_info","周边描述");
add_param(pRequest,"max_occupancy","1");
add_param(pRequest,"is_use_shoot_image","1");
add_param(pRequest,"status","0");
add_param(pRequest,"guest_gender","1");
add_param(pRequest,"activities_allowed","12,23");
add_param(pRequest,"extra_cleaning_charge","1");
add_param(pRequest,"opening_time","2021-01-01");
add_param(pRequest,"rent_type","1");
add_param(pRequest,"new_outer_id","xxx");
add_param(pRequest,"house_model","{\"bedroom\":4, \"bathroom\": 2, \"livingroom\": 1, \"study\": 1, \"balcony\": 1,\"kitchen\":0}");
add_param(pRequest,"window_type","1");
add_param(pRequest,"has_license","1");
add_param(pRequest,"video_url","视频地址");
add_param(pRequest,"vendor","taobao");
add_param(pRequest,"brightspot","亮点描述");
add_param(pRequest,"quick_order","1");
add_param(pRequest,"floor","3-5层");
add_param(pRequest,"house_size","100");
add_param(pRequest,"product_type","1");
add_param(pRequest,"introduction","不错房源");
add_param(pRequest,"has_landlord","1");
add_param(pRequest,"charge","数据结构JSON示例");
add_param(pRequest,"decorate_style","1");
add_param(pRequest,"supportcredit","1");
add_param(pRequest,"check_in_notes","入住须知");
add_param(pRequest,"real_tel","139888xxx");
add_param(pRequest,"service","{\"24272\":\"true\",\"24263\":\"true\",\"24267\":\"true\"}");
add_param(pRequest,"cleaning_frequency","1");
add_param(pRequest,"outer_id","xxx");
add_param(pRequest,"location","数据结构JSON示例");
add_param(pRequest,"scenic_feature","1");
add_param(pRequest,"deposit_type","1");
add_param(pRequest,"bed_info","{"bedType":1,"desc":"双人床","width":"1.8","length":"2","bedNum":1}");
add_param(pRequest,"extra_fee","额外收费");
add_param(pRequest,"extra_beds_fee","14500");
add_param(pRequest,"bnb_name","阳光民宿");
add_param(pRequest,"srid","1234");
add_param(pRequest,"standard_room_facilities","{\"dataVersion\":\"2.0.0\",\"facilityList\":[{\"500\":true,\"fee\":true},{\"501\":true,\"option\":\"1\"},{\"506\":true,\"mul-option\":[\"1\",\"2\"],\"desc\":\"说明\"},{\"507\":true,\"desc\":\"说明\"},{\"509\":true,\"value\":\"12:00\",\"fee\":true},{\"2\":true,\"list\":[{\"inDoorType\":\"1\",\"fee\":true},{\"inDoorType\":\"2\",\"fee\":true}]},{\"7\":true,\"list\":[{\"restaurantType\":\"1\",\"name\":\"品珍中餐厅\"},{\"restaurantType\":\"2\",\"name\":\"和日式料理\"}]}]}");
add_param(pRequest,"bnb_extend","{}");
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.bnbroomtype.add', {
'rent_size':'100',
'support_im':'1',
'outer_tags':'xxx,x,xx',
'cleaning_charge':'1',
'invoice':'1',
'decorate_level':'1',
'bnb_booking_time':'数据结构JSON示例',
'out_hid':'05181208',
'tel':'0086#010#12345678',
'receive_foreigners':'1',
'local_info':'位置描述',
'brand':'品牌名称',
'pics':'数据结构JSON示例',
'cleaning_type':'1',
'deposit_amount':'1212',
'name_e':'xxx',
'decorate_time':'2015-01-01',
'extra_beds_num':'0',
'invoice_type':'2',
'has_front_desk':'1',
'guest_age':'1',
'settlement_currency':'HKD',
'name':'大床房',
'surround_info':'周边描述',
'max_occupancy':'1',
'is_use_shoot_image':'1',
'status':'0',
'guest_gender':'1',
'activities_allowed':'12,23',
'extra_cleaning_charge':'1',
'opening_time':'2021-01-01',
'rent_type':'1',
'new_outer_id':'xxx',
'house_model':'{\"bedroom\":4, \"bathroom\": 2, \"livingroom\": 1, \"study\": 1, \"balcony\": 1,\"kitchen\":0}',
'window_type':'1',
'has_license':'1',
'video_url':'视频地址',
'vendor':'taobao',
'brightspot':'亮点描述',
'quick_order':'1',
'floor':'3-5层',
'house_size':'100',
'product_type':'1',
'introduction':'不错房源',
'has_landlord':'1',
'charge':'数据结构JSON示例',
'decorate_style':'1',
'supportcredit':'1',
'check_in_notes':'入住须知',
'real_tel':'139888xxx',
'service':'{\"24272\":\"true\",\"24263\":\"true\",\"24267\":\"true\"}',
'cleaning_frequency':'1',
'outer_id':'xxx',
'location':'数据结构JSON示例',
'scenic_feature':'1',
'deposit_type':'1',
'bed_info':'{"bedType":1,"desc":"双人床","width":"1.8","length":"2","bedNum":1}',
'extra_fee':'额外收费',
'extra_beds_fee':'14500',
'bnb_name':'阳光民宿',
'srid':'1234',
'standard_room_facilities':'{\"dataVersion\":\"2.0.0\",\"facilityList\":[{\"500\":true,\"fee\":true},{\"501\":true,\"option\":\"1\"},{\"506\":true,\"mul-option\":[\"1\",\"2\"],\"desc\":\"说明\"},{\"507\":true,\"desc\":\"说明\"},{\"509\":true,\"value\":\"12:00\",\"fee\":true},{\"2\":true,\"list\":[{\"inDoorType\":\"1\",\"fee\":true},{\"inDoorType\":\"2\",\"fee\":true}]},{\"7\":true,\"list\":[{\"restaurantType\":\"1\",\"name\":\"品珍中餐厅\"},{\"restaurantType\":\"2\",\"name\":\"和日式料理\"}]}]}',
'bnb_extend':'{}'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})