TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
CainiaoCntecLocallifePrintDeviceSyncRequest req = new CainiaoCntecLocallifePrintDeviceSyncRequest();
req.setPrinterModel("HP-001");
req.setProvinceFullName("陕西省");
req.setDistrictCode(10012L);
req.setCityCode(100123L);
req.setManagerPer(12L);
req.setCityFullName("西安市");
req.setMac("desdw121");
req.setDistrictFullName("雁塔区");
req.setPrinterState("0");
req.setIndustryId(1L);
req.setClientType("测试端口类型");
req.setBindTime("2025-06-01 00:00:00");
req.setEnable(true);
req.setSn("10011");
req.setState("在线");
req.setHumanPrinterState("正常");
req.setPrinterMaker("惠普打印机厂商");
req.setAddress("陕西省西安市雁塔区");
req.setBoxModel("XNT001");
req.setProvinceCode(1001L);
req.setThirdNumber("100262");
req.setUnbindTime("2025-06-01 00:00:00");
req.setName("测试门店1");
req.setClientNum("3306");
req.setBusinessPer(12L);
req.setPrinterSerial("121212132dsds");
req.setUpdateTime("2025-06-01 00:00:00");
CainiaoCntecLocallifePrintDeviceSyncResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
CainiaoCntecLocallifePrintDeviceSyncRequest req = new CainiaoCntecLocallifePrintDeviceSyncRequest();
req.PrinterModel = "HP-001";
req.ProvinceFullName = "陕西省";
req.DistrictCode = 10012L;
req.CityCode = 100123L;
req.ManagerPer = 12L;
req.CityFullName = "西安市";
req.Mac = "desdw121";
req.DistrictFullName = "雁塔区";
req.PrinterState = "0";
req.IndustryId = 1L;
req.ClientType = "测试端口类型";
req.BindTime = "2025-06-01 00:00:00";
req.Enable = true;
req.Sn = "10011";
req.State = "在线";
req.HumanPrinterState = "正常";
req.PrinterMaker = "惠普打印机厂商";
req.Address = "陕西省西安市雁塔区";
req.BoxModel = "XNT001";
req.ProvinceCode = 1001L;
req.ThirdNumber = "100262";
req.UnbindTime = "2025-06-01 00:00:00";
req.Name = "测试门店1";
req.ClientNum = "3306";
req.BusinessPer = 12L;
req.PrinterSerial = "121212132dsds";
req.UpdateTime = "2025-06-01 00:00:00";
CainiaoCntecLocallifePrintDeviceSyncResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new CainiaoCntecLocallifePrintDeviceSyncRequest;
$req->setPrinterModel("HP-001");
$req->setProvinceFullName("陕西省");
$req->setDistrictCode("10012");
$req->setCityCode("100123");
$req->setManagerPer("12");
$req->setCityFullName("西安市");
$req->setMac("desdw121");
$req->setDistrictFullName("雁塔区");
$req->setPrinterState("0");
$req->setIndustryId("1");
$req->setClientType("测试端口类型");
$req->setBindTime("2025-06-01 00:00:00");
$req->setEnable("true");
$req->setSn("10011");
$req->setState("在线");
$req->setHumanPrinterState("正常");
$req->setPrinterMaker("惠普打印机厂商");
$req->setAddress("陕西省西安市雁塔区");
$req->setBoxModel("XNT001");
$req->setProvinceCode("1001");
$req->setThirdNumber("100262");
$req->setUnbindTime("2025-06-01 00:00:00");
$req->setName("测试门店1");
$req->setClientNum("3306");
$req->setBusinessPer("12");
$req->setPrinterSerial("121212132dsds");
$req->setUpdateTime("2025-06-01 00:00:00");
$resp = $c->execute($req);
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=cainiao.cntec.locallife.print.device.sync' \
-d 'partner_id=apidoc' \
-d 'sign=84CEB3030DD180FCB6FD137F1BB9DEA1' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-07-01+07%3A15%3A48' \
-d 'v=2.0' \
-d 'address=%E9%99%95%E8%A5%BF%E7%9C%81%E8%A5%BF%E5%AE%89%E5%B8%82%E9%9B%81%E5%A1%94%E5%8C%BA' \
-d 'bind_time=2025-06-01+00%3A00%3A00' \
-d 'box_model=XNT001' \
-d 'business_per=12' \
-d 'city_code=100123' \
-d 'city_full_name=%E8%A5%BF%E5%AE%89%E5%B8%82' \
-d 'client_num=3306' \
-d 'client_type=%E6%B5%8B%E8%AF%95%E7%AB%AF%E5%8F%A3%E7%B1%BB%E5%9E%8B' \
-d 'district_code=10012' \
-d 'district_full_name=%E9%9B%81%E5%A1%94%E5%8C%BA' \
-d 'enable=true' \
-d 'human_printer_state=%E6%AD%A3%E5%B8%B8' \
-d 'industry_id=1' \
-d 'mac=desdw121' \
-d 'manager_per=12' \
-d 'name=%E6%B5%8B%E8%AF%95%E9%97%A8%E5%BA%971' \
-d 'printer_maker=%E6%83%A0%E6%99%AE%E6%89%93%E5%8D%B0%E6%9C%BA%E5%8E%82%E5%95%86' \
-d 'printer_model=HP-001' \
-d 'printer_serial=121212132dsds' \
-d 'printer_state=0' \
-d 'province_code=1001' \
-d 'province_full_name=%E9%99%95%E8%A5%BF%E7%9C%81' \
-d 'sn=10011' \
-d 'state=%E5%9C%A8%E7%BA%BF' \
-d 'third_number=100262' \
-d 'unbind_time=2025-06-01+00%3A00%3A00' \
-d 'update_time=2025-06-01+00%3A00%3A00'
# -*- coding: utf-8 -*-
import top.api
req=top.api.CainiaoCntecLocallifePrintDeviceSyncRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.printer_model="HP-001"
req.province_full_name="陕西省"
req.district_code=10012
req.city_code=100123
req.manager_per=12
req.city_full_name="西安市"
req.mac="desdw121"
req.district_full_name="雁塔区"
req.printer_state="0"
req.industry_id=1
req.client_type="测试端口类型"
req.bind_time="2025-06-01 00:00:00"
req.enable=true
req.sn="10011"
req.state="在线"
req.human_printer_state="正常"
req.printer_maker="惠普打印机厂商"
req.address="陕西省西安市雁塔区"
req.box_model="XNT001"
req.province_code=1001
req.third_number="100262"
req.unbind_time="2025-06-01 00:00:00"
req.name="测试门店1"
req.client_num="3306"
req.business_per=12
req.printer_serial="121212132dsds"
req.update_time="2025-06-01 00:00:00"
try:
resp= req.getResponse()
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,"cainiao.cntec.locallife.print.device.sync");
add_param(pRequest,"printer_model","HP-001");
add_param(pRequest,"province_full_name","陕西省");
add_param(pRequest,"district_code","10012");
add_param(pRequest,"city_code","100123");
add_param(pRequest,"manager_per","12");
add_param(pRequest,"city_full_name","西安市");
add_param(pRequest,"mac","desdw121");
add_param(pRequest,"district_full_name","雁塔区");
add_param(pRequest,"printer_state","0");
add_param(pRequest,"industry_id","1");
add_param(pRequest,"client_type","测试端口类型");
add_param(pRequest,"bind_time","2025-06-01 00:00:00");
add_param(pRequest,"enable","true");
add_param(pRequest,"sn","10011");
add_param(pRequest,"state","在线");
add_param(pRequest,"human_printer_state","正常");
add_param(pRequest,"printer_maker","惠普打印机厂商");
add_param(pRequest,"address","陕西省西安市雁塔区");
add_param(pRequest,"box_model","XNT001");
add_param(pRequest,"province_code","1001");
add_param(pRequest,"third_number","100262");
add_param(pRequest,"unbind_time","2025-06-01 00:00:00");
add_param(pRequest,"name","测试门店1");
add_param(pRequest,"client_num","3306");
add_param(pRequest,"business_per","12");
add_param(pRequest,"printer_serial","121212132dsds");
add_param(pRequest,"update_time","2025-06-01 00:00:00");
pResponse = top_execute(pClient,pRequest,NULL);
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('cainiao.cntec.locallife.print.device.sync', {
'printer_model':'HP-001',
'province_full_name':'陕西省',
'district_code':'10012',
'city_code':'100123',
'manager_per':'12',
'city_full_name':'西安市',
'mac':'desdw121',
'district_full_name':'雁塔区',
'printer_state':'0',
'industry_id':'1',
'client_type':'测试端口类型',
'bind_time':'2025-06-01 00:00:00',
'enable':'true',
'sn':'10011',
'state':'在线',
'human_printer_state':'正常',
'printer_maker':'惠普打印机厂商',
'address':'陕西省西安市雁塔区',
'box_model':'XNT001',
'province_code':'1001',
'third_number':'100262',
'unbind_time':'2025-06-01 00:00:00',
'name':'测试门店1',
'client_num':'3306',
'business_per':'12',
'printer_serial':'121212132dsds',
'update_time':'2025-06-01 00:00:00'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})