TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlitripFreetourProductUploadRequest req = new AlitripFreetourProductUploadRequest();
req.setGoTrafficType(1L);
List<AlitripFreetourProductUploadRequest.FreeTourPackageInfo> list2 = new ArrayList<AlitripFreetourProductUploadRequest.FreeTourPackageInfo>();
AlitripFreetourProductUploadRequest.FreeTourPackageInfo obj3 = new AlitripFreetourProductUploadRequest.FreeTourPackageInfo();
list2.add(obj3);
obj3.setOutProductId("1234");
List<AlitripFreetourProductUploadRequest.FreeTourScenicInfo> list6 = new ArrayList<AlitripFreetourProductUploadRequest.FreeTourScenicInfo>();
AlitripFreetourProductUploadRequest.FreeTourScenicInfo obj7 = new AlitripFreetourProductUploadRequest.FreeTourScenicInfo();
list6.add(obj7);
obj7.setCnName("黄鹤楼");
obj7.setTicketType("大门票");
obj7.setCity("武汉");
list4.setFreeTourScenicInfoList(list6);
obj3.setPackageName("套餐名称");
obj3.setToLocations("目的地");
List<AlitripFreetourProductUploadRequest.FreeTourTrafficInfo> list10 = new ArrayList<AlitripFreetourProductUploadRequest.FreeTourTrafficInfo>();
AlitripFreetourProductUploadRequest.FreeTourTrafficInfo obj11 = new AlitripFreetourProductUploadRequest.FreeTourTrafficInfo();
list10.add(obj11);
obj11.setDay(1L);
obj11.setTrafficNo("CA1710");
obj11.setVendor("中国国航");
obj11.setPlaneType("中型机");
obj11.setDeparture("杭州");
obj11.setDestination("北京");
obj11.setDepartureTime("13:00");
obj11.setArrivalTime("15:00");
obj11.setTrafficDesc("交通描述");
obj11.setNonStop(1L);
obj11.setGroup(1L);
obj11.setStopOver(true);
obj11.setStopCity("北京");
list8.setBackTrafficInfoList(list10);
obj3.setFeeExclude("费用不含1,费用不含2");
obj3.setScenicDesc("1111");
List<AlitripFreetourProductUploadRequest.FreeTourTrafficInfo> list14 = new ArrayList<AlitripFreetourProductUploadRequest.FreeTourTrafficInfo>();
AlitripFreetourProductUploadRequest.FreeTourTrafficInfo obj15 = new AlitripFreetourProductUploadRequest.FreeTourTrafficInfo();
list14.add(obj15);
obj15.setDay(1L);
obj15.setTrafficNo("CA1710");
obj15.setVendor("中国国航");
obj15.setPlaneType("中型机");
obj15.setDeparture("杭州");
obj15.setDestination("北京");
obj15.setDepartureTime("13:00");
obj15.setArrivalTime("15:00");
obj15.setTrafficDesc("交通描述");
obj15.setNonStop(1L);
obj15.setGroup(1L);
obj15.setStopOver(true);
obj15.setStopCity("北京");
list12.setGoTrafficInfoList(list14);
obj3.setOrderInfo("买家预定须知");
List<AlitripFreetourProductUploadRequest.ItemResourceInfo> list18 = new ArrayList<AlitripFreetourProductUploadRequest.ItemResourceInfo>();
AlitripFreetourProductUploadRequest.ItemResourceInfo obj19 = new AlitripFreetourProductUploadRequest.ItemResourceInfo();
list18.add(obj19);
obj19.setDesc("1111");
obj19.setType(1L);
list16.setItemResourceInfoList(list18);
obj3.setFromLocations("武汉");
obj3.setFeeInclude("费用包含1,费用包含2");
List<AlitripFreetourProductUploadRequest.FreeTourHotelInfo> list22 = new ArrayList<AlitripFreetourProductUploadRequest.FreeTourHotelInfo>();
AlitripFreetourProductUploadRequest.FreeTourHotelInfo obj23 = new AlitripFreetourProductUploadRequest.FreeTourHotelInfo();
list22.add(obj23);
obj23.setHotelDesc("酒店描述");
obj23.setPicUrls("酒店图片地址");
obj23.setCity("北京");
obj23.setHouseType("标间");
obj23.setHotelLevel("豪华");
obj23.setHotelStar("五星级");
obj23.setCnName("如家酒店");
list20.setFreeTourHotelInfoList(list22);
obj3.setPackageOperation(0L);
req.setFreeTourPackageInfo(list2);
req.setTripDay(1L);
req.setSubStock(0L);
req.setWapDesc("<wapDesc><shortDesc>标题1</shortDesc> <txt>描述1</txt> <img>图片路径1</img> <shortDesc>标题2</shortDesc> <txt>描述2</txt> <img>图片路径2</img> </wapDesc>");
req.setBackTrafficType(1L);
req.setDescXml("<DESC><HIGHLIGHT><title>亮点1</title> <txt>亮点描述1</txt> <img>亮点图片链接1</img></HIGHLIGHT> <HIGHLIGHT><title>亮点2</title> <txt>亮点描述2</txt> <img>亮点图片链接2</img></HIGHLIGHT></DESC>");
req.setConfirmTime(1L);
req.setTitle("商品标题");
req.setRefundRegulations("30_30_0,30_15_5,14_7_15,6_4_70,3_1_85,1_1_90");
req.setConfirmType(1L);
req.setItemCustomTag("美食");
req.setOutProductId("1111");
req.setToLocations("东京,京都");
req.setTripNight(1L);
req.setPicUrls("https://img.daily.taobaocdn.net/imgextra/i3/2024098454/TB2C4VXXXXXXXc1XXXXXXXXXXXX_!!2024098454.jpg,http://ww1.sinaimg.cn/large/005EDdjYgw1fanv4d823dj31gs0z6qb8.jpg");
req.setItemId(12345L);
req.setReserveLimit("1_18_00");
req.setRefundType(0L);
req.setDescHtml("PC端详情描述");
req.setFromLocations("东京");
req.setSubTitles("亮点1,亮点2,亮点3");
req.setTravellerTemplateId(111L);
req.setIsOverseasTour(0L);
req.setRefundRegulationsJson("[{\"firstDay\":-1,\"secondDay\":5,\"percent\":50,\"sellerPercent\":20},{\"firstDay\":4,\"secondDay\":1,\"percent\":80,\"sellerPercent\":50},{\"firstDay\":0,\"secondDay\":0,\"percent\":100,\"sellerPercent\":70},{\"firstDay\":0,\"secondDay\":0,\"percent\":100,\"sellerPercent\":90,\"isHoliday\":true}]");
req.setPackageOperation(0L);
req.setSellerCids("12344,24332");
req.setSecondKill("wap_only");
req.setHasDiscount(false);
AlitripFreetourProductUploadResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlitripFreetourProductUploadRequest req = new AlitripFreetourProductUploadRequest();
req.GoTrafficType = 1L;
List<AlitripFreetourProductUploadRequest.FreeTourPackageInfoDomain> list2 = new List<AlitripFreetourProductUploadRequest.FreeTourPackageInfoDomain>();
AlitripFreetourProductUploadRequest.FreeTourPackageInfoDomain obj3 = new AlitripFreetourProductUploadRequest.FreeTourPackageInfoDomain();
list2.Add(obj3);
obj3.OutProductId = "1234";
List<AlitripFreetourProductUploadRequest.FreeTourScenicInfoDomain> list5 = new List<AlitripFreetourProductUploadRequest.FreeTourScenicInfoDomain>();
AlitripFreetourProductUploadRequest.FreeTourScenicInfoDomain obj6 = new AlitripFreetourProductUploadRequest.FreeTourScenicInfoDomain();
list5.Add(obj6);
obj6.CnName = "黄鹤楼";
obj6.TicketType = "大门票";
obj6.City = "武汉";
obj3.FreeTourScenicInfoList= list5;
obj3.PackageName = "套餐名称";
obj3.ToLocations = "目的地";
List<AlitripFreetourProductUploadRequest.FreeTourTrafficInfoDomain> list8 = new List<AlitripFreetourProductUploadRequest.FreeTourTrafficInfoDomain>();
AlitripFreetourProductUploadRequest.FreeTourTrafficInfoDomain obj9 = new AlitripFreetourProductUploadRequest.FreeTourTrafficInfoDomain();
list8.Add(obj9);
obj9.Day = 1L;
obj9.TrafficNo = "CA1710";
obj9.Vendor = "中国国航";
obj9.PlaneType = "中型机";
obj9.Departure = "杭州";
obj9.Destination = "北京";
obj9.DepartureTime = "13:00";
obj9.ArrivalTime = "15:00";
obj9.TrafficDesc = "交通描述";
obj9.NonStop = 1L;
obj9.Group = 1L;
obj9.StopOver = true;
obj9.StopCity = "北京";
obj3.BackTrafficInfoList= list8;
obj3.FeeExclude = "费用不含1,费用不含2";
obj3.ScenicDesc = "1111";
List<AlitripFreetourProductUploadRequest.FreeTourTrafficInfoDomain> list11 = new List<AlitripFreetourProductUploadRequest.FreeTourTrafficInfoDomain>();
AlitripFreetourProductUploadRequest.FreeTourTrafficInfoDomain obj12 = new AlitripFreetourProductUploadRequest.FreeTourTrafficInfoDomain();
list11.Add(obj12);
obj12.Day = 1L;
obj12.TrafficNo = "CA1710";
obj12.Vendor = "中国国航";
obj12.PlaneType = "中型机";
obj12.Departure = "杭州";
obj12.Destination = "北京";
obj12.DepartureTime = "13:00";
obj12.ArrivalTime = "15:00";
obj12.TrafficDesc = "交通描述";
obj12.NonStop = 1L;
obj12.Group = 1L;
obj12.StopOver = true;
obj12.StopCity = "北京";
obj3.GoTrafficInfoList= list11;
obj3.OrderInfo = "买家预定须知";
List<AlitripFreetourProductUploadRequest.ItemResourceInfoDomain> list14 = new List<AlitripFreetourProductUploadRequest.ItemResourceInfoDomain>();
AlitripFreetourProductUploadRequest.ItemResourceInfoDomain obj15 = new AlitripFreetourProductUploadRequest.ItemResourceInfoDomain();
list14.Add(obj15);
obj15.Desc = "1111";
obj15.Type = 1L;
obj3.ItemResourceInfoList= list14;
obj3.FromLocations = "武汉";
obj3.FeeInclude = "费用包含1,费用包含2";
List<AlitripFreetourProductUploadRequest.FreeTourHotelInfoDomain> list17 = new List<AlitripFreetourProductUploadRequest.FreeTourHotelInfoDomain>();
AlitripFreetourProductUploadRequest.FreeTourHotelInfoDomain obj18 = new AlitripFreetourProductUploadRequest.FreeTourHotelInfoDomain();
list17.Add(obj18);
obj18.HotelDesc = "酒店描述";
obj18.PicUrls = "酒店图片地址";
obj18.City = "北京";
obj18.HouseType = "标间";
obj18.HotelLevel = "豪华";
obj18.HotelStar = "五星级";
obj18.CnName = "如家酒店";
obj3.FreeTourHotelInfoList= list17;
obj3.PackageOperation = 0L;
req.FreeTourPackageInfo_ = list2;
req.TripDay = 1L;
req.SubStock = 0L;
req.WapDesc = "<wapDesc><shortDesc>标题1</shortDesc> <txt>描述1</txt> <img>图片路径1</img> <shortDesc>标题2</shortDesc> <txt>描述2</txt> <img>图片路径2</img> </wapDesc>";
req.BackTrafficType = 1L;
req.DescXml = "<DESC><HIGHLIGHT><title>亮点1</title> <txt>亮点描述1</txt> <img>亮点图片链接1</img></HIGHLIGHT> <HIGHLIGHT><title>亮点2</title> <txt>亮点描述2</txt> <img>亮点图片链接2</img></HIGHLIGHT></DESC>";
req.ConfirmTime = 1L;
req.Title = "商品标题";
req.RefundRegulations = "30_30_0,30_15_5,14_7_15,6_4_70,3_1_85,1_1_90";
req.ConfirmType = 1L;
req.ItemCustomTag = "美食";
req.OutProductId = "1111";
req.ToLocations = "东京,京都";
req.TripNight = 1L;
req.PicUrls = "https://img.daily.taobaocdn.net/imgextra/i3/2024098454/TB2C4VXXXXXXXc1XXXXXXXXXXXX_!!2024098454.jpg,http://ww1.sinaimg.cn/large/005EDdjYgw1fanv4d823dj31gs0z6qb8.jpg";
req.ItemId = 12345L;
req.ReserveLimit = "1_18_00";
req.RefundType = 0L;
req.DescHtml = "PC端详情描述";
req.FromLocations = "东京";
req.SubTitles = "亮点1,亮点2,亮点3";
req.TravellerTemplateId = 111L;
req.IsOverseasTour = 0L;
req.RefundRegulationsJson = "[{\"firstDay\":-1,\"secondDay\":5,\"percent\":50,\"sellerPercent\":20},{\"firstDay\":4,\"secondDay\":1,\"percent\":80,\"sellerPercent\":50},{\"firstDay\":0,\"secondDay\":0,\"percent\":100,\"sellerPercent\":70},{\"firstDay\":0,\"secondDay\":0,\"percent\":100,\"sellerPercent\":90,\"isHoliday\":true}]";
req.PackageOperation = 0L;
req.SellerCids = "12344,24332";
req.SecondKill = "wap_only";
req.HasDiscount = false;
AlitripFreetourProductUploadResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlitripFreetourProductUploadRequest;
$req->setGoTrafficType("1");
$free_tour_package_info = new FreeTourPackageInfo;
$free_tour_package_info->out_product_id="1234";
$free_tour_scenic_info_list = new FreeTourScenicInfo;
$free_tour_scenic_info_list->cn_name="黄鹤楼";
$free_tour_scenic_info_list->ticket_type="大门票";
$free_tour_scenic_info_list->city="武汉";
$free_tour_package_info->free_tour_scenic_info_list = $free_tour_scenic_info_list;
$free_tour_package_info->package_name="套餐名称";
$free_tour_package_info->to_locations="目的地";
$back_traffic_info_list = new FreeTourTrafficInfo;
$back_traffic_info_list->day="1";
$back_traffic_info_list->traffic_no="CA1710";
$back_traffic_info_list->vendor="中国国航";
$back_traffic_info_list->plane_type="中型机";
$back_traffic_info_list->departure="杭州";
$back_traffic_info_list->destination="北京";
$back_traffic_info_list->departure_time="13:00";
$back_traffic_info_list->arrival_time="15:00";
$back_traffic_info_list->traffic_desc="交通描述";
$back_traffic_info_list->non_stop="1";
$back_traffic_info_list->group="1";
$back_traffic_info_list->stop_over="true";
$back_traffic_info_list->stop_city="北京";
$free_tour_package_info->back_traffic_info_list = $back_traffic_info_list;
$free_tour_package_info->fee_exclude="费用不含1,费用不含2";
$free_tour_package_info->scenic_desc="1111";
$go_traffic_info_list = new FreeTourTrafficInfo;
$go_traffic_info_list->day="1";
$go_traffic_info_list->traffic_no="CA1710";
$go_traffic_info_list->vendor="中国国航";
$go_traffic_info_list->plane_type="中型机";
$go_traffic_info_list->departure="杭州";
$go_traffic_info_list->destination="北京";
$go_traffic_info_list->departure_time="13:00";
$go_traffic_info_list->arrival_time="15:00";
$go_traffic_info_list->traffic_desc="交通描述";
$go_traffic_info_list->non_stop="1";
$go_traffic_info_list->group="1";
$go_traffic_info_list->stop_over="true";
$go_traffic_info_list->stop_city="北京";
$free_tour_package_info->go_traffic_info_list = $go_traffic_info_list;
$free_tour_package_info->order_info="买家预定须知";
$item_resource_info_list = new ItemResourceInfo;
$item_resource_info_list->desc="1111";
$item_resource_info_list->type="1";
$free_tour_package_info->item_resource_info_list = $item_resource_info_list;
$free_tour_package_info->from_locations="武汉";
$free_tour_package_info->fee_include="费用包含1,费用包含2";
$free_tour_hotel_info_list = new FreeTourHotelInfo;
$free_tour_hotel_info_list->hotel_desc="酒店描述";
$free_tour_hotel_info_list->pic_urls="酒店图片地址";
$free_tour_hotel_info_list->city="北京";
$free_tour_hotel_info_list->house_type="标间";
$free_tour_hotel_info_list->hotel_level="豪华";
$free_tour_hotel_info_list->hotel_star="五星级";
$free_tour_hotel_info_list->cn_name="如家酒店";
$free_tour_package_info->free_tour_hotel_info_list = $free_tour_hotel_info_list;
$free_tour_package_info->package_operation="0";
$req->setFreeTourPackageInfo(json_encode($free_tour_package_info));
$req->setTripDay("1");
$req->setSubStock("0");
$req->setWapDesc("<wapDesc><shortDesc>标题1</shortDesc> <txt>描述1</txt> <img>图片路径1</img> <shortDesc>标题2</shortDesc> <txt>描述2</txt> <img>图片路径2</img> </wapDesc>");
$req->setBackTrafficType("1");
$req->setDescXml("<DESC><HIGHLIGHT><title>亮点1</title> <txt>亮点描述1</txt> <img>亮点图片链接1</img></HIGHLIGHT> <HIGHLIGHT><title>亮点2</title> <txt>亮点描述2</txt> <img>亮点图片链接2</img></HIGHLIGHT></DESC>");
$req->setConfirmTime("1");
$req->setTitle("商品标题");
$req->setRefundRegulations("30_30_0,30_15_5,14_7_15,6_4_70,3_1_85,1_1_90");
$req->setConfirmType("1");
$req->setItemCustomTag("美食");
$req->setOutProductId("1111");
$req->setToLocations("东京,京都");
$req->setTripNight("1");
$req->setPicUrls("https://img.daily.taobaocdn.net/imgextra/i3/2024098454/TB2C4VXXXXXXXc1XXXXXXXXXXXX_!!2024098454.jpg,http://ww1.sinaimg.cn/large/005EDdjYgw1fanv4d823dj31gs0z6qb8.jpg");
$req->setItemId("12345");
$req->setReserveLimit("1_18_00");
$req->setRefundType("0");
$req->setDescHtml("PC端详情描述");
$req->setFromLocations("东京");
$req->setSubTitles("亮点1,亮点2,亮点3");
$req->setTravellerTemplateId("111");
$req->setIsOverseasTour("0");
$req->setRefundRegulationsJson("[{\"firstDay\":-1,\"secondDay\":5,\"percent\":50,\"sellerPercent\":20},{\"firstDay\":4,\"secondDay\":1,\"percent\":80,\"sellerPercent\":50},{\"firstDay\":0,\"secondDay\":0,\"percent\":100,\"sellerPercent\":70},{\"firstDay\":0,\"secondDay\":0,\"percent\":100,\"sellerPercent\":90,\"isHoliday\":true}]");
$req->setPackageOperation("0");
$req->setSellerCids("12344,24332");
$req->setSecondKill("wap_only");
$req->setHasDiscount("false");
$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.freetour.product.upload' \
-d 'partner_id=apidoc' \
-d 'session=fd051812-0bb1-4a27-a177-4bddc9e7096e' \
-d 'sign=015197B864D3519A3277E0B008E748D5' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-23+21%3A41%3A39' \
-d 'v=2.0' \
-d 'back_traffic_type=1' \
-d 'confirm_time=1' \
-d 'confirm_type=1' \
-d 'desc_html=PC%E7%AB%AF%E8%AF%A6%E6%83%85%E6%8F%8F%E8%BF%B0' \
-d 'desc_xml=%3CDESC%3E%3CHIGHLIGHT%3E%3Ctitle%3E%E4%BA%AE%E7%82%B91%3C%2Ftitle%3E+%3Ctxt%3E%E4%BA%AE%E7%82%B9%E6%8F%8F%E8%BF%B01%3C%2Ftxt%3E+%3Cimg%3E%E4%BA%AE%E7%82%B9%E5%9B%BE%E7%89%87%E9%93%BE%E6%8E%A51%3C%2Fimg%3E%3C%2FHIGHLIGHT%3E+%3CHIGHLIGHT%3E%3Ctitle%3E%E4%BA%AE%E7%82%B92%3C%2Ftitle%3E+%3Ctxt%3E%E4%BA%AE%E7%82%B9%E6%8F%8F%E8%BF%B02%3C%2Ftxt%3E+%3Cimg%3E%E4%BA%AE%E7%82%B9%E5%9B%BE%E7%89%87%E9%93%BE%E6%8E%A52%3C%2Fimg%3E%3C%2FHIGHLIGHT%3E%3C%2FDESC%3E' \
-d 'free_tour_package_info=null' \
-d 'from_locations=%E4%B8%9C%E4%BA%AC' \
-d 'go_traffic_type=1' \
-d 'has_discount=false' \
-d 'is_overseas_tour=0' \
-d 'item_custom_tag=%E7%BE%8E%E9%A3%9F' \
-d 'item_id=12345' \
-d 'out_product_id=1111' \
-d 'package_operation=0' \
-d 'pic_urls=https%3A%2F%2Fimg.daily.taobaocdn.net%2Fimgextra%2Fi3%2F2024098454%2FTB2C4VXXXXXXXc1XXXXXXXXXXXX_%21%212024098454.jpg%2Chttp%3A%2F%2Fww1.sinaimg.cn%2Flarge%2F005EDdjYgw1fanv4d823dj31gs0z6qb8.jpg' \
-d 'refund_regulations=30_30_0%2C30_15_5%2C14_7_15%2C6_4_70%2C3_1_85%2C1_1_90' \
-d 'refund_regulations_json=%7B%22firstDay%22%3A-1%2C%22secondDay%22%3A5%2C%22percent%22%3A50%2C%22sellerPercent%22%3A20%7D%2C%7B%22firstDay%22%3A4%2C%22secondDay%22%3A1%2C%22percent%22%3A80%2C%22sellerPercent%22%3A50%7D%2C%7B%22firstDay%22%3A0%2C%22secondDay%22%3A0%2C%22percent%22%3A100%2C%22sellerPercent%22%3A70%7D%2C%7B%22firstDay%22%3A0%2C%22secondDay%22%3A0%2C%22percent%22%3A100%2C%22sellerPercent%22%3A90%2C%22isHoliday%22%3Atrue%7D' \
-d 'refund_type=0' \
-d 'reserve_limit=1_18_00' \
-d 'second_kill=wap_only' \
-d 'seller_cids=12344%2C24332' \
-d 'sub_stock=0' \
-d 'sub_titles=%E4%BA%AE%E7%82%B91%2C%E4%BA%AE%E7%82%B92%2C%E4%BA%AE%E7%82%B93' \
-d 'title=%E5%95%86%E5%93%81%E6%A0%87%E9%A2%98' \
-d 'to_locations=%E4%B8%9C%E4%BA%AC%2C%E4%BA%AC%E9%83%BD' \
-d 'traveller_template_id=111' \
-d 'trip_day=1' \
-d 'trip_night=1' \
-d 'wap_desc=%3CwapDesc%3E%3CshortDesc%3E%E6%A0%87%E9%A2%981%3C%2FshortDesc%3E+%3Ctxt%3E%E6%8F%8F%E8%BF%B01%3C%2Ftxt%3E+%3Cimg%3E%E5%9B%BE%E7%89%87%E8%B7%AF%E5%BE%841%3C%2Fimg%3E+%3CshortDesc%3E%E6%A0%87%E9%A2%982%3C%2FshortDesc%3E+%3Ctxt%3E%E6%8F%8F%E8%BF%B02%3C%2Ftxt%3E+%3Cimg%3E%E5%9B%BE%E7%89%87%E8%B7%AF%E5%BE%842%3C%2Fimg%3E+%3C%2FwapDesc%3E'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlitripFreetourProductUploadRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.go_traffic_type=1
req.free_tour_package_info=""
req.trip_day=1
req.sub_stock=0
req.wap_desc="<wapDesc><shortDesc>标题1</shortDesc> <txt>描述1</txt> <img>图片路径1</img> <shortDesc>标题2</shortDesc> <txt>描述2</txt> <img>图片路径2</img> </wapDesc>"
req.back_traffic_type=1
req.desc_xml="<DESC><HIGHLIGHT><title>亮点1</title> <txt>亮点描述1</txt> <img>亮点图片链接1</img></HIGHLIGHT> <HIGHLIGHT><title>亮点2</title> <txt>亮点描述2</txt> <img>亮点图片链接2</img></HIGHLIGHT></DESC>"
req.confirm_time=1
req.title="商品标题"
req.refund_regulations="30_30_0,30_15_5,14_7_15,6_4_70,3_1_85,1_1_90"
req.confirm_type=1
req.item_custom_tag="美食"
req.out_product_id="1111"
req.to_locations="东京,京都"
req.trip_night=1
req.pic_urls="https://img.daily.taobaocdn.net/imgextra/i3/2024098454/TB2C4VXXXXXXXc1XXXXXXXXXXXX_!!2024098454.jpg,http://ww1.sinaimg.cn/large/005EDdjYgw1fanv4d823dj31gs0z6qb8.jpg"
req.item_id=12345
req.reserve_limit="1_18_00"
req.refund_type=0
req.desc_html="PC端详情描述"
req.from_locations="东京"
req.sub_titles="亮点1,亮点2,亮点3"
req.traveller_template_id=111
req.is_overseas_tour=0
req.refund_regulations_json="[{\"firstDay\":-1,\"secondDay\":5,\"percent\":50,\"sellerPercent\":20},{\"firstDay\":4,\"secondDay\":1,\"percent\":80,\"sellerPercent\":50},{\"firstDay\":0,\"secondDay\":0,\"percent\":100,\"sellerPercent\":70},{\"firstDay\":0,\"secondDay\":0,\"percent\":100,\"sellerPercent\":90,\"isHoliday\":true}]"
req.package_operation=0
req.seller_cids="12344,24332"
req.second_kill="wap_only"
req.has_discount=false
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.freetour.product.upload");
add_param(pRequest,"go_traffic_type","1");
add_param(pRequest,"free_tour_package_info","数据结构JSON示例");
add_param(pRequest,"trip_day","1");
add_param(pRequest,"sub_stock","0");
add_param(pRequest,"wap_desc","<wapDesc><shortDesc>标题1</shortDesc> <txt>描述1</txt> <img>图片路径1</img> <shortDesc>标题2</shortDesc> <txt>描述2</txt> <img>图片路径2</img> </wapDesc>");
add_param(pRequest,"back_traffic_type","1");
add_param(pRequest,"desc_xml","<DESC><HIGHLIGHT><title>亮点1</title> <txt>亮点描述1</txt> <img>亮点图片链接1</img></HIGHLIGHT> <HIGHLIGHT><title>亮点2</title> <txt>亮点描述2</txt> <img>亮点图片链接2</img></HIGHLIGHT></DESC>");
add_param(pRequest,"confirm_time","1");
add_param(pRequest,"title","商品标题");
add_param(pRequest,"refund_regulations","30_30_0,30_15_5,14_7_15,6_4_70,3_1_85,1_1_90");
add_param(pRequest,"confirm_type","1");
add_param(pRequest,"item_custom_tag","美食");
add_param(pRequest,"out_product_id","1111");
add_param(pRequest,"to_locations","东京,京都");
add_param(pRequest,"trip_night","1");
add_param(pRequest,"pic_urls","https://img.daily.taobaocdn.net/imgextra/i3/2024098454/TB2C4VXXXXXXXc1XXXXXXXXXXXX_!!2024098454.jpg,http://ww1.sinaimg.cn/large/005EDdjYgw1fanv4d823dj31gs0z6qb8.jpg");
add_param(pRequest,"item_id","12345");
add_param(pRequest,"reserve_limit","1_18_00");
add_param(pRequest,"refund_type","0");
add_param(pRequest,"desc_html","PC端详情描述");
add_param(pRequest,"from_locations","东京");
add_param(pRequest,"sub_titles","亮点1,亮点2,亮点3");
add_param(pRequest,"traveller_template_id","111");
add_param(pRequest,"is_overseas_tour","0");
add_param(pRequest,"refund_regulations_json","{"firstDay":-1,"secondDay":5,"percent":50,"sellerPercent":20},{"firstDay":4,"secondDay":1,"percent":80,"sellerPercent":50},{"firstDay":0,"secondDay":0,"percent":100,"sellerPercent":70},{"firstDay":0,"secondDay":0,"percent":100,"sellerPercent":90,"isHoliday":true}");
add_param(pRequest,"package_operation","0");
add_param(pRequest,"seller_cids","12344,24332");
add_param(pRequest,"second_kill","wap_only");
add_param(pRequest,"has_discount","false");
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.freetour.product.upload', {
'go_traffic_type':'1',
'free_tour_package_info':'数据结构JSON示例',
'trip_day':'1',
'sub_stock':'0',
'wap_desc':'<wapDesc><shortDesc>标题1</shortDesc> <txt>描述1</txt> <img>图片路径1</img> <shortDesc>标题2</shortDesc> <txt>描述2</txt> <img>图片路径2</img> </wapDesc>',
'back_traffic_type':'1',
'desc_xml':'<DESC><HIGHLIGHT><title>亮点1</title> <txt>亮点描述1</txt> <img>亮点图片链接1</img></HIGHLIGHT> <HIGHLIGHT><title>亮点2</title> <txt>亮点描述2</txt> <img>亮点图片链接2</img></HIGHLIGHT></DESC>',
'confirm_time':'1',
'title':'商品标题',
'refund_regulations':'30_30_0,30_15_5,14_7_15,6_4_70,3_1_85,1_1_90',
'confirm_type':'1',
'item_custom_tag':'美食',
'out_product_id':'1111',
'to_locations':'东京,京都',
'trip_night':'1',
'pic_urls':'https://img.daily.taobaocdn.net/imgextra/i3/2024098454/TB2C4VXXXXXXXc1XXXXXXXXXXXX_!!2024098454.jpg,http://ww1.sinaimg.cn/large/005EDdjYgw1fanv4d823dj31gs0z6qb8.jpg',
'item_id':'12345',
'reserve_limit':'1_18_00',
'refund_type':'0',
'desc_html':'PC端详情描述',
'from_locations':'东京',
'sub_titles':'亮点1,亮点2,亮点3',
'traveller_template_id':'111',
'is_overseas_tour':'0',
'refund_regulations_json':'{"firstDay":-1,"secondDay":5,"percent":50,"sellerPercent":20},{"firstDay":4,"secondDay":1,"percent":80,"sellerPercent":50},{"firstDay":0,"secondDay":0,"percent":100,"sellerPercent":70},{"firstDay":0,"secondDay":0,"percent":100,"sellerPercent":90,"isHoliday":true}',
'package_operation':'0',
'seller_cids':'12344,24332',
'second_kill':'wap_only',
'has_discount':'false'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})