TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlitripTravelGereralproductUpdateRequest req = new AlitripTravelGereralproductUpdateRequest();
AlitripTravelGereralproductUpdateRequest.GeneralProductBaseInfo obj1 = new AlitripTravelGereralproductUpdateRequest.GeneralProductBaseInfo();
obj1.setDesc("我家的货很好很好很好");
obj1.setWapDesc("<wapDesc><shortDesc>标题</shortDesc> <txt>描述</txt><img>图片路径</img></wapDesc>");
obj1.setReserveDeadlineMinutes(30L);
obj1.setCategoryId(50018298L);
obj1.setOutId("1234");
obj1.setToLocations("上海");
obj1.setPicUrls("https://img.alicdn.com/tfs/TB1QyC0RxTpK1RjSZFMXXbG_VXa-246-246.jpg,https://img.alicdn.com/tfs/TB1QyC0RxTpK1RjSZFMXXbG_VXa-246-246.jpg");
obj1.setItemId(12345L);
obj1.setConfirmTime(1L);
obj1.setSubTitles("亮点1,亮点2");
obj1.setTitle("xxxx");
obj1.setDuration(0L);
obj1.setReserveDeadlineHours(1L);
List<AlitripTravelGereralproductUpdateRequest.CatPropInfo> list3 = new ArrayList<AlitripTravelGereralproductUpdateRequest.CatPropInfo>();
AlitripTravelGereralproductUpdateRequest.CatPropInfo obj4 = new AlitripTravelGereralproductUpdateRequest.CatPropInfo();
list3.add(obj4);
obj4.setVid("111");
obj4.setPid("222");
obj1.setProps(list3);
obj1.setConfirmType(1L);
req.setBaseInfo(obj1);
AlitripTravelGereralproductUpdateRequest.ItemRefundInfo obj5 = new AlitripTravelGereralproductUpdateRequest.ItemRefundInfo();
obj5.setRefundRegulations(""30_30_0","30_15_5","14_7_15","6_4_70","3_1_85","1_1_90"");
obj5.setRefundType(0L);
req.setRefundInfo(obj5);
List<AlitripTravelGereralproductUpdateRequest.BookingRuleInfo> list7 = new ArrayList<AlitripTravelGereralproductUpdateRequest.BookingRuleInfo>();
AlitripTravelGereralproductUpdateRequest.BookingRuleInfo obj8 = new AlitripTravelGereralproductUpdateRequest.BookingRuleInfo();
list7.add(obj8);
obj8.setRuleType("fee_included");
obj8.setRuleDesc("xxxx");
req.setBookingRules(list7);
AlitripTravelGereralproductUpdateRequest.ProductSaleInfo obj9 = new AlitripTravelGereralproductUpdateRequest.ProductSaleInfo();
obj9.setConfirmTime(1L);
obj9.setDuration(0L);
obj9.setDistribute(false);
obj9.setProductLine(123L);
obj9.setAgent(true);
obj9.setPriceUpper("11.11");
obj9.setConfirmType(1L);
obj9.setPriceLower("0.01");
req.setProductSaleInfo(obj9);
List<AlitripTravelGereralproductUpdateRequest.DateSkuInfo> list11 = new ArrayList<AlitripTravelGereralproductUpdateRequest.DateSkuInfo>();
AlitripTravelGereralproductUpdateRequest.DateSkuInfo obj12 = new AlitripTravelGereralproductUpdateRequest.DateSkuInfo();
list11.add(obj12);
List<AlitripTravelGereralproductUpdateRequest.PropertyAliasInfo> list15 = new ArrayList<AlitripTravelGereralproductUpdateRequest.PropertyAliasInfo>();
AlitripTravelGereralproductUpdateRequest.PropertyAliasInfo obj16 = new AlitripTravelGereralproductUpdateRequest.PropertyAliasInfo();
list15.add(obj16);
obj16.setValue("香港直飞 四星泳池");
obj16.setProperties("20000:33564");
list13.setAlias(list15);
List<AlitripTravelGereralproductUpdateRequest.DateInventoryAndPrice> list19 = new ArrayList<AlitripTravelGereralproductUpdateRequest.DateInventoryAndPrice>();
AlitripTravelGereralproductUpdateRequest.DateInventoryAndPrice obj20 = new AlitripTravelGereralproductUpdateRequest.DateInventoryAndPrice();
list19.add(obj20);
obj20.setStock(1000L);
obj20.setDate(StringUtils.parseDateTime("2019-09-19 09:42:12"));
obj20.setPrice(1000L);
list17.setDateList(list19);
List<AlitripTravelGereralproductUpdateRequest.CatPropInfo> list23 = new ArrayList<AlitripTravelGereralproductUpdateRequest.CatPropInfo>();
AlitripTravelGereralproductUpdateRequest.CatPropInfo obj24 = new AlitripTravelGereralproductUpdateRequest.CatPropInfo();
list23.add(obj24);
obj24.setVid("222");
obj24.setPid("111");
list21.setProperties(list23);
obj12.setOuterId("1111");
req.setDateSkuInfoList(list11);
AlitripTravelGereralproductUpdateResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlitripTravelGereralproductUpdateRequest req = new AlitripTravelGereralproductUpdateRequest();
AlitripTravelGereralproductUpdateRequest.GeneralProductBaseInfoDomain obj1 = new AlitripTravelGereralproductUpdateRequest.GeneralProductBaseInfoDomain();
obj1.Desc = "我家的货很好很好很好";
obj1.WapDesc = "<wapDesc><shortDesc>标题</shortDesc> <txt>描述</txt><img>图片路径</img></wapDesc>";
obj1.ReserveDeadlineMinutes = 30L;
obj1.CategoryId = 50018298L;
obj1.OutId = "1234";
obj1.ToLocations = "上海";
obj1.PicUrls = "https://img.alicdn.com/tfs/TB1QyC0RxTpK1RjSZFMXXbG_VXa-246-246.jpg,https://img.alicdn.com/tfs/TB1QyC0RxTpK1RjSZFMXXbG_VXa-246-246.jpg";
obj1.ItemId = 12345L;
obj1.ConfirmTime = 1L;
obj1.SubTitles = "亮点1,亮点2";
obj1.Title = "xxxx";
obj1.Duration = 0L;
obj1.ReserveDeadlineHours = 1L;
List<AlitripTravelGereralproductUpdateRequest.CatPropInfoDomain> list3 = new List<AlitripTravelGereralproductUpdateRequest.CatPropInfoDomain>();
AlitripTravelGereralproductUpdateRequest.CatPropInfoDomain obj4 = new AlitripTravelGereralproductUpdateRequest.CatPropInfoDomain();
list3.Add(obj4);
obj4.Vid = "111";
obj4.Pid = "222";
obj1.Props= list3;
obj1.ConfirmType = 1L;
req.BaseInfo_ = obj1;
AlitripTravelGereralproductUpdateRequest.ItemRefundInfoDomain obj5 = new AlitripTravelGereralproductUpdateRequest.ItemRefundInfoDomain();
obj5.RefundRegulations = ""30_30_0","30_15_5","14_7_15","6_4_70","3_1_85","1_1_90"";
obj5.RefundType = 0L;
req.RefundInfo_ = obj5;
List<AlitripTravelGereralproductUpdateRequest.BookingRuleInfoDomain> list7 = new List<AlitripTravelGereralproductUpdateRequest.BookingRuleInfoDomain>();
AlitripTravelGereralproductUpdateRequest.BookingRuleInfoDomain obj8 = new AlitripTravelGereralproductUpdateRequest.BookingRuleInfoDomain();
list7.Add(obj8);
obj8.RuleType = "fee_included";
obj8.RuleDesc = "xxxx";
req.BookingRules_ = list7;
AlitripTravelGereralproductUpdateRequest.ProductSaleInfoDomain obj9 = new AlitripTravelGereralproductUpdateRequest.ProductSaleInfoDomain();
obj9.ConfirmTime = 1L;
obj9.Duration = 0L;
obj9.Distribute = false;
obj9.ProductLine = 123L;
obj9.Agent = true;
obj9.PriceUpper = "11.11";
obj9.ConfirmType = 1L;
obj9.PriceLower = "0.01";
req.ProductSaleInfo_ = obj9;
List<AlitripTravelGereralproductUpdateRequest.DateSkuInfoDomain> list11 = new List<AlitripTravelGereralproductUpdateRequest.DateSkuInfoDomain>();
AlitripTravelGereralproductUpdateRequest.DateSkuInfoDomain obj12 = new AlitripTravelGereralproductUpdateRequest.DateSkuInfoDomain();
list11.Add(obj12);
List<AlitripTravelGereralproductUpdateRequest.PropertyAliasInfoDomain> list14 = new List<AlitripTravelGereralproductUpdateRequest.PropertyAliasInfoDomain>();
AlitripTravelGereralproductUpdateRequest.PropertyAliasInfoDomain obj15 = new AlitripTravelGereralproductUpdateRequest.PropertyAliasInfoDomain();
list14.Add(obj15);
obj15.Value = "香港直飞 四星泳池";
obj15.Properties = "20000:33564";
obj12.Alias= list14;
List<AlitripTravelGereralproductUpdateRequest.DateInventoryAndPriceDomain> list17 = new List<AlitripTravelGereralproductUpdateRequest.DateInventoryAndPriceDomain>();
AlitripTravelGereralproductUpdateRequest.DateInventoryAndPriceDomain obj18 = new AlitripTravelGereralproductUpdateRequest.DateInventoryAndPriceDomain();
list17.Add(obj18);
obj18.Stock = 1000L;
obj18.Date = DateTime.Parse(2019-09-19 09:42:12");
obj18.Price = 1000L;
obj12.DateList= list17;
List<AlitripTravelGereralproductUpdateRequest.CatPropInfoDomain> list20 = new List<AlitripTravelGereralproductUpdateRequest.CatPropInfoDomain>();
AlitripTravelGereralproductUpdateRequest.CatPropInfoDomain obj21 = new AlitripTravelGereralproductUpdateRequest.CatPropInfoDomain();
list20.Add(obj21);
obj21.Vid = "222";
obj21.Pid = "111";
obj12.Properties= list20;
obj12.OuterId = "1111";
req.DateSkuInfoList_ = list11;
AlitripTravelGereralproductUpdateResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlitripTravelGereralproductUpdateRequest;
$base_info = new GeneralProductBaseInfo;
$base_info->desc="我家的货很好很好很好";
$base_info->wap_desc="<wapDesc><shortDesc>标题</shortDesc> <txt>描述</txt><img>图片路径</img></wapDesc>";
$base_info->reserve_deadline_minutes="30";
$base_info->category_id="50018298";
$base_info->out_id="1234";
$base_info->to_locations="上海";
$base_info->pic_urls="https://img.alicdn.com/tfs/TB1QyC0RxTpK1RjSZFMXXbG_VXa-246-246.jpg,https://img.alicdn.com/tfs/TB1QyC0RxTpK1RjSZFMXXbG_VXa-246-246.jpg";
$base_info->item_id="12345";
$base_info->confirm_time="1";
$base_info->sub_titles="亮点1,亮点2";
$base_info->title="xxxx";
$base_info->duration="0";
$base_info->reserve_deadline_hours="1";
$props = new CatPropInfo;
$props->vid="111";
$props->pid="222";
$base_info->props = $props;
$base_info->confirm_type="1";
$req->setBaseInfo(json_encode($base_info));
$refund_info = new ItemRefundInfo;
$refund_info->refund_regulations="[\"30_30_0\",\"30_15_5\",\"14_7_15\",\"6_4_70\",\"3_1_85\",\"1_1_90\"]";
$refund_info->refund_type="0";
$req->setRefundInfo(json_encode($refund_info));
$booking_rules = new BookingRuleInfo;
$booking_rules->rule_type="fee_included";
$booking_rules->rule_desc="xxxx";
$req->setBookingRules(json_encode($booking_rules));
$product_sale_info = new ProductSaleInfo;
$product_sale_info->confirm_time="1";
$product_sale_info->duration="0";
$product_sale_info->distribute="false";
$product_sale_info->product_line="123";
$product_sale_info->agent="true";
$product_sale_info->price_upper="11.11";
$product_sale_info->confirm_type="1";
$product_sale_info->price_lower="0.01";
$req->setProductSaleInfo(json_encode($product_sale_info));
$date_sku_info_list = new DateSkuInfo;
$alias = new PropertyAliasInfo;
$alias->value="香港直飞 四星泳池";
$alias->properties="20000:33564";
$date_sku_info_list->alias = $alias;
$date_list = new DateInventoryAndPrice;
$date_list->stock="1000";
$date_list->date="2019-09-19 09:42:12";
$date_list->price="1000";
$date_sku_info_list->date_list = $date_list;
$properties = new CatPropInfo;
$properties->vid="222";
$properties->pid="111";
$date_sku_info_list->properties = $properties;
$date_sku_info_list->outer_id="1111";
$req->setDateSkuInfoList(json_encode($date_sku_info_list));
$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=alitrip.travel.gereralproduct.update' \
-d 'partner_id=apidoc' \
-d 'session=f3324988-e460-45f3-90de-02bcc416a176' \
-d 'sign=3B0320CC199036514EACB202D685DFB5' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-23+21%3A26%3A37' \
-d 'v=2.0' \
-d 'base_info=null' \
-d 'booking_rules=null' \
-d 'date_sku_info_list=null' \
-d 'product_sale_info=null' \
-d 'refund_info=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlitripTravelGereralproductUpdateRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.base_info=""
req.refund_info=""
req.booking_rules=""
req.product_sale_info=""
req.date_sku_info_list=""
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,"alitrip.travel.gereralproduct.update");
add_param(pRequest,"base_info","数据结构JSON示例");
add_param(pRequest,"refund_info","数据结构JSON示例");
add_param(pRequest,"booking_rules","数据结构JSON示例");
add_param(pRequest,"product_sale_info","数据结构JSON示例");
add_param(pRequest,"date_sku_info_list","数据结构JSON示例");
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('alitrip.travel.gereralproduct.update', {
'base_info':'数据结构JSON示例',
'refund_info':'数据结构JSON示例',
'booking_rules':'数据结构JSON示例',
'product_sale_info':'数据结构JSON示例',
'date_sku_info_list':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})