Commit c5176b55 by linboxuan

Merge branch 'center-channel' of http://gitlab.gongsibao.com/jiangyong/zhichan into center-channel

parents 2494fd36 74cb3d2e
...@@ -9,6 +9,7 @@ class AccessAuthAPI extends APIBase { ...@@ -9,6 +9,7 @@ class AccessAuthAPI extends APIBase {
this.pushlogSve = system.getObject("service.common.pushlogSve"); this.pushlogSve = system.getObject("service.common.pushlogSve");
this.aliclient = system.getObject("util.aliyunClient"); this.aliclient = system.getObject("util.aliyunClient");
this.utilsTmAliyunSve = system.getObject("service.utilsSve.utilsTmAliyunSve"); this.utilsTmAliyunSve = system.getObject("service.utilsSve.utilsTmAliyunSve");
this.utilsTmOrderCallService = system.getObject("service.utilsSve.utilsTmOrderCallSve");
} }
async taskAliIcapi() { async taskAliIcapi() {
var rtn = await this.gatewaypushlogSve.taskAliIcapi(); var rtn = await this.gatewaypushlogSve.taskAliIcapi();
...@@ -34,6 +35,11 @@ class AccessAuthAPI extends APIBase { ...@@ -34,6 +35,11 @@ class AccessAuthAPI extends APIBase {
return rtn; return rtn;
} }
async taskAlijsonfile(pobj, qobj, req) {//操作阿里商标交易上架
var rtn = await this.utilsTmOrderCallService.createjsonfile();
return rtn;
}
async taskAliRpcAgainPush(pobj, qobj, req) { async taskAliRpcAgainPush(pobj, qobj, req) {
var result = await this.pushlogSve.getFailLogList(); var result = await this.pushlogSve.getFailLogList();
if (result.status != 0 || !result.data || result.data.length == 0) { if (result.status != 0 || !result.data || result.data.length == 0) {
......
...@@ -4,7 +4,7 @@ const querystring = require('querystring'); ...@@ -4,7 +4,7 @@ const querystring = require('querystring');
const AppServiceBase = require("../../app.base"); const AppServiceBase = require("../../app.base");
const { or } = require("sequelize"); const { or } = require("sequelize");
//订单操作类 //订单操作类
class UtilsOpOrderService extends AppServiceBase { class UtilsTmOrderCallService extends AppServiceBase {
constructor() { constructor() {
super(); super();
this.aliclient = system.getObject("util.aliyunClient"); this.aliclient = system.getObject("util.aliyunClient");
...@@ -23,5 +23,46 @@ class UtilsOpOrderService extends AppServiceBase { ...@@ -23,5 +23,46 @@ class UtilsOpOrderService extends AppServiceBase {
console.log("orderList",orderList) console.log("orderList",orderList)
return system.getResultSuccess(orderList); return system.getResultSuccess(orderList);
} }
async createjsonfile() {
var self = this;;
var gobj = {
action: "GenerateUploadFilePolicy",
reqbody: { FileType: "PARTNER_SYNC_FILE" },
type: 'TM'
}
var rst = await self.aliclient.reqbyget(gobj);
console.log(rst);
var obj={
actionType:"createjsonfile",
actionBody:{}
}
var getjsonurl=settings.tmtransactionUrl()+"/api/action/trademarktransaction"
var jsonurl=await this.restPostUrl(obj,getjsonurl);
if(!jsonurl){
console.log(jsonurl);
return system.getResultSuccess();
}
var upobj={
ossurl:jsonurl.data.url,
filedir:rst.data.FileDir,
objectName:jsonurl.data.name,
encodePolicy:rst.data.EncodedPolicy,
endpoint:"http://partner-sync-file.oss-cn-beijing.aliyuncs.com",
accessKeyId:rst.data.AccessId,
bucketName:"partner-sync-file"
}
var aliOssFileInfo = await this.execPostUrl(upobj, settings.aliossjavaUrl());
if (aliOssFileInfo == true) {
var fileUrl = rst.data.FileDir + "/" + jsonurl.data.name;
console.log(fileUrl)
return system.getResultSuccess(fileUrl);
}
}
} }
module.exports = UtilsOpOrderService; module.exports = UtilsTmOrderCallService;
// var a=new UtilsTmOrderCallService();
// a.createjsonfile();
...@@ -14,6 +14,15 @@ class aliyunClient { ...@@ -14,6 +14,15 @@ class aliyunClient {
apiVersion: "2020-03-06" apiVersion: "2020-03-06"
}); });
} }
getAliTMClient() {
return new RPCClient({
accessKeyId: 'LTAI4FmyipY1wuLHjLhMWiPa',
accessKeySecret: 'hp4FF18IDCSym1prqzxrAjnnhNH3ju',
endpoint: 'https://trademark.aliyuncs.com',
apiVersion: '2018-07-24'
}
);
}
async post(aliReqUrl, key, secret, actionBody) { async post(aliReqUrl, key, secret, actionBody) {
const client = new Client(key, secret); const client = new Client(key, secret);
var param = { var param = {
...@@ -32,8 +41,14 @@ class aliyunClient { ...@@ -32,8 +41,14 @@ class aliyunClient {
async reqbyget(obj, cbk) { async reqbyget(obj, cbk) {
var action = obj.action; var action = obj.action;
var reqbody = obj.reqbody; var reqbody = obj.reqbody;
var self=this;
try { try {
var reqAliclient = this.getAliClient();// { ... this.aliclient }; var reqAliclient = null;// { ... this.aliclient };
if(obj.type && obj.type =="TM"){
reqAliclient=self.getAliTMClient();
}else{
reqAliclient=self.getAliClient();
}
if (obj.apiVersion) { if (obj.apiVersion) {
reqAliclient.apiVersion = obj.apiVersion; reqAliclient.apiVersion = obj.apiVersion;
} }
......
var settings = { var settings = {
redis: { redis: {
host: "43.247.184.32", host: "121.36.3.35",
port: 8967, port: 8967,
password: "Gongsibao2018", password: "Gongsibao2018",
db: 5, db: 5,
......
...@@ -51,6 +51,14 @@ var settings = { ...@@ -51,6 +51,14 @@ var settings = {
return "http://aliossjava-service/uploadfile"; return "http://aliossjava-service/uploadfile";
} }
}, },
tmtransactionUrl: function () {
if (this.env == "dev") {
return "http://192.168.2.109:8080/uploadfile";
} else {
return "http://center-tmtransaction-service";
}
},
qifuPayAfterH5JumpUrl: function () { qifuPayAfterH5JumpUrl: function () {
if (this.env == "dev") { if (this.env == "dev") {
return "http://tm.qifu.gongsibao.com:4012/#/home/indent_list"; return "http://tm.qifu.gongsibao.com:4012/#/home/indent_list";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment