TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
XhotelHouseRoomtypeAddRequest req = new XhotelHouseRoomtypeAddRequest();
req.setHid(100000L);
req.setName("标准间");
req.setMaxOccupancy(2L);
req.setArea("10");
req.setFloor("3-5层");
req.setInternet("A");
req.setService("{\"bar\":false,\"catv\":false,\"ddd\":false,\"idd\":false,\"pubtoilet\":false,\"toilet\":false}");
req.setExtend("空");
req.setOuterId("100000");
req.setWindowType(1L);
req.setSrid(123123L);
req.setVendor("taobao");
req.setOutHid("123123");
req.setPics("[{\"url\":\"http://taobao.com/123.jpg\",\"ismain\":\"true\"},{\"url\":\"http://taobao.com/456.jpg\",\"ismain\":\"false\"},{\"url\":\"http://taobao.com/789.jpg\",\"ismain\":\"false\"}]");
req.setNameE("standard room");
req.setOperator("operator");
req.setConnectionType(1L);
req.setHouseModel("{\"bedroom\":4, \"bathroom\": 2, \"livingroom\": 1, \"study\": 1, \"balcony\": 1,\"kitchen\":0}");
req.setHouseSize(120L);
req.setRentType(1L);
req.setRentSize(120L);
req.setHasLandlord(0L);
req.setBedInfo("[{\"bedType\":1,\"desc\":\"双人床\",\"width\":\"1.8\",\"length\":\"2\",\"bedNum\":1}]");
req.setStatus(0L);
XhotelHouseRoomtypeAddResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
XhotelHouseRoomtypeAddRequest req = new XhotelHouseRoomtypeAddRequest();
req.Hid = 100000L;
req.Name = "标准间";
req.MaxOccupancy = 2L;
req.Area = "10";
req.Floor = "3-5层";
req.Internet = "A";
req.Service = "{\"bar\":false,\"catv\":false,\"ddd\":false,\"idd\":false,\"pubtoilet\":false,\"toilet\":false}";
req.Extend = "空";
req.OuterId = "100000";
req.WindowType = 1L;
req.Srid = 123123L;
req.Vendor = "taobao";
req.OutHid = "123123";
req.Pics = "[{\"url\":\"http://taobao.com/123.jpg\",\"ismain\":\"true\"},{\"url\":\"http://taobao.com/456.jpg\",\"ismain\":\"false\"},{\"url\":\"http://taobao.com/789.jpg\",\"ismain\":\"false\"}]";
req.NameE = "standard room";
req.Operator = "operator";
req.ConnectionType = 1L;
req.HouseModel = "{\"bedroom\":4, \"bathroom\": 2, \"livingroom\": 1, \"study\": 1, \"balcony\": 1,\"kitchen\":0}";
req.HouseSize = 120L;
req.RentType = 1L;
req.RentSize = 120L;
req.HasLandlord = 0L;
req.BedInfo = "[{\"bedType\":1,\"desc\":\"双人床\",\"width\":\"1.8\",\"length\":\"2\",\"bedNum\":1}]";
req.Status = 0L;
XhotelHouseRoomtypeAddResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new XhotelHouseRoomtypeAddRequest;
$req->setHid("100000");
$req->setName("标准间");
$req->setMaxOccupancy("2");
$req->setArea("10");
$req->setFloor("3-5层");
$req->setInternet("A");
$req->setService("{\"bar\":false,\"catv\":false,\"ddd\":false,\"idd\":false,\"pubtoilet\":false,\"toilet\":false}");
$req->setExtend("空");
$req->setOuterId("100000");
$req->setWindowType("1");
$req->setSrid("123123");
$req->setVendor("taobao");
$req->setOutHid("123123");
$req->setPics("[{\"url\":\"http://taobao.com/123.jpg\",\"ismain\":\"true\"},{\"url\":\"http://taobao.com/456.jpg\",\"ismain\":\"false\"},{\"url\":\"http://taobao.com/789.jpg\",\"ismain\":\"false\"}]");
$req->setNameE("standard room");
$req->setOperator("operator");
$req->setConnectionType("1");
$req->setHouseModel("{\"bedroom\":4, \"bathroom\": 2, \"livingroom\": 1, \"study\": 1, \"balcony\": 1,\"kitchen\":0}");
$req->setHouseSize("120");
$req->setRentType("1");
$req->setRentSize("120");
$req->setHasLandlord("0");
$req->setBedInfo("[{\"bedType\":1,\"desc\":\"双人床\",\"width\":\"1.8\",\"length\":\"2\",\"bedNum\":1}]");
$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.roomtype.add' \
-d 'partner_id=apidoc' \
-d 'session=20ee941f-c53f-46e6-bc5e-dacaf7ba5d9b' \
-d 'sign=1413C9E983C250569D63C1E8A45E9FB7' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-23+17%3A40%3A16' \
-d 'v=2.0' \
-d 'area=10' \
-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 'connection_type=1' \
-d 'extend=%E7%A9%BA' \
-d 'floor=3-5%E5%B1%82' \
-d 'has_landlord=0' \
-d 'hid=100000' \
-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=120' \
-d 'internet=A' \
-d 'max_occupancy=2' \
-d 'name=%E6%A0%87%E5%87%86%E9%97%B4' \
-d 'name_e=standard+room' \
-d 'operator=operator' \
-d 'out_hid=123123' \
-d 'outer_id=100000' \
-d 'pics=%7B%22url%22%3A%22http%3A%2F%2Ftaobao.com%2F123.jpg%22%2C%22ismain%22%3A%22true%22%7D%2C%7B%22url%22%3A%22http%3A%2F%2Ftaobao.com%2F456.jpg%22%2C%22ismain%22%3A%22false%22%7D%2C%7B%22url%22%3A%22http%3A%2F%2Ftaobao.com%2F789.jpg%22%2C%22ismain%22%3A%22false%22%7D' \
-d 'rent_size=120' \
-d 'rent_type=1' \
-d 'service=%7B%5C%22bar%5C%22%3Afalse%2C%5C%22catv%5C%22%3Afalse%2C%5C%22ddd%5C%22%3Afalse%2C%5C%22idd%5C%22%3Afalse%2C%5C%22pubtoilet%5C%22%3Afalse%2C%5C%22toilet%5C%22%3Afalse%7D' \
-d 'srid=123123' \
-d 'status=0' \
-d 'vendor=taobao' \
-d 'window_type=1'
# -*- coding: utf-8 -*-
import top.api
req=top.api.XhotelHouseRoomtypeAddRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.hid=100000
req.name="标准间"
req.max_occupancy=2
req.area="10"
req.floor="3-5层"
req.internet="A"
req.service="{\"bar\":false,\"catv\":false,\"ddd\":false,\"idd\":false,\"pubtoilet\":false,\"toilet\":false}"
req.extend="空"
req.outer_id="100000"
req.window_type=1
req.srid=123123
req.vendor="taobao"
req.out_hid="123123"
req.pics="[{\"url\":\"http://taobao.com/123.jpg\",\"ismain\":\"true\"},{\"url\":\"http://taobao.com/456.jpg\",\"ismain\":\"false\"},{\"url\":\"http://taobao.com/789.jpg\",\"ismain\":\"false\"}]"
req.name_e="standard room"
req.operator="operator"
req.connection_type=1
req.house_model="{\"bedroom\":4, \"bathroom\": 2, \"livingroom\": 1, \"study\": 1, \"balcony\": 1,\"kitchen\":0}"
req.house_size=120
req.rent_type=1
req.rent_size=120
req.has_landlord=0
req.bed_info="[{\"bedType\":1,\"desc\":\"双人床\",\"width\":\"1.8\",\"length\":\"2\",\"bedNum\":1}]"
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.roomtype.add");
add_param(pRequest,"hid","100000");
add_param(pRequest,"name","标准间");
add_param(pRequest,"max_occupancy","2");
add_param(pRequest,"area","10");
add_param(pRequest,"floor","3-5层");
add_param(pRequest,"internet","A");
add_param(pRequest,"service","{\"bar\":false,\"catv\":false,\"ddd\":false,\"idd\":false,\"pubtoilet\":false,\"toilet\":false}");
add_param(pRequest,"extend","空");
add_param(pRequest,"outer_id","100000");
add_param(pRequest,"window_type","1");
add_param(pRequest,"srid","123123");
add_param(pRequest,"vendor","taobao");
add_param(pRequest,"out_hid","123123");
add_param(pRequest,"pics","{"url":"http://taobao.com/123.jpg","ismain":"true"},{"url":"http://taobao.com/456.jpg","ismain":"false"},{"url":"http://taobao.com/789.jpg","ismain":"false"}");
add_param(pRequest,"name_e","standard room");
add_param(pRequest,"operator","operator");
add_param(pRequest,"connection_type","1");
add_param(pRequest,"house_model","{\"bedroom\":4, \"bathroom\": 2, \"livingroom\": 1, \"study\": 1, \"balcony\": 1,\"kitchen\":0}");
add_param(pRequest,"house_size","120");
add_param(pRequest,"rent_type","1");
add_param(pRequest,"rent_size","120");
add_param(pRequest,"has_landlord","0");
add_param(pRequest,"bed_info","{"bedType":1,"desc":"双人床","width":"1.8","length":"2","bedNum":1}");
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.roomtype.add', {
'hid':'100000',
'name':'标准间',
'max_occupancy':'2',
'area':'10',
'floor':'3-5层',
'internet':'A',
'service':'{\"bar\":false,\"catv\":false,\"ddd\":false,\"idd\":false,\"pubtoilet\":false,\"toilet\":false}',
'extend':'空',
'outer_id':'100000',
'window_type':'1',
'srid':'123123',
'vendor':'taobao',
'out_hid':'123123',
'pics':'{"url":"http://taobao.com/123.jpg","ismain":"true"},{"url":"http://taobao.com/456.jpg","ismain":"false"},{"url":"http://taobao.com/789.jpg","ismain":"false"}',
'name_e':'standard room',
'operator':'operator',
'connection_type':'1',
'house_model':'{\"bedroom\":4, \"bathroom\": 2, \"livingroom\": 1, \"study\": 1, \"balcony\": 1,\"kitchen\":0}',
'house_size':'120',
'rent_type':'1',
'rent_size':'120',
'has_landlord':'0',
'bed_info':'{"bedType":1,"desc":"双人床","width":"1.8","length":"2","bedNum":1}',
'status':'0'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})