Commit 6b379eb5 by linboxuan

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

parents 5146fdf9 8ecfddf6
var WEBBase = require("../../web.base");
var system = require("../../../system");
const askForSve = system.getObject("service.common.askForSve");
class askFor extends WEBBase {
constructor() {
super();
}
/**
* @description 商标 尼斯查询 收藏 注册申请
* @author liangwk
* @param {*} pobj
* @param {*} qobj
* @param {*} req
* @returns
* @memberof askFor
*/
async tradeMark (pobj, qobj, req) {
switch (pobj.actionType) {
case 'niceQuery':
const param = pobj.actionBody
const adddic = ['首位', '中位', '末位', '随机']
if (param.word_site) {
if (adddic.indexOf(param.word_site) === -1) {
return system.getResult(null, '请选择正确的位置')
}
}
if (isNaN(parseInt(param.name_size)) || parseInt(param.name_size) <= 0) {
return system.getResult(null, '字数不正确')
} else {
param.name_size = parseInt(param.name_size)
}
if (!Array.isArray(param.ncl_one_list) || param.ncl_one_list.length === 0) {
return system.getResult(null, '分类不能为空')
} else {
for (let i in param.ncl_one_list) {
if (isNaN(parseInt(param.ncl_one_list[i])) || (parseInt(param.ncl_one_list[i]) <= 0 || parseInt(param.ncl_one_list[i]) > 45)) {
return system.getResult(null, '分类选择不正确')
} else {
param.ncl_one_list[i] = parseInt(param.ncl_one_list[i])
}
}
}
let result = await askForSve.niceQuery(pobj.actionBody)
if (result.code === 200) {
return system.getResult2(result.data)
} else {
return system.getResult(null, result.message)
}
case 'collect':
if (!pobj.actionBody.type) {
let result = await askForSve.getCollect(pobj)
if (result.status === 0) {
return system.getResult2(result.data)
} else {
return system.getResult(null, result.msg)
}
} else {
let result = await askForSve.collect(pobj)
if (result.status === 0) {
return system.getResult2(result)
} else {
return system.getResult(null, result.msg)
}
}
case 'reg':
if (!pobj.actionBody.type) {
let result = await askForSve.getAskFor(pobj)
if (result.status === 0) {
return system.getResult2(result.data)
} else {
return system.getResult(null, result.msg)
}
} else {
let result = await askForSve.askFor(pobj)
if (result.status === 0) {
return system.getResult2(result.data)
} else {
return system.getResult(null, result.msg)
}
}
}
}
}
module.exports = askFor;
\ No newline at end of file
const system = require("../../../system")
const AppServiceBase = require("../../app.base")
const settings = require("../../../../config/settings")
class AskForService extends AppServiceBase {
constructor() {
super();
this.restClient = system.getObject("util.restClient")
this.centerOrderUrl = settings.centerOrderUrl()
this.centerCacheUrl = settings.centerCacheUrl()
}
/**
* @description 商标尼斯查询
* @author liangwk
* @param {*} param
* @returns
* @memberof AskForService
*/
async niceQuery (param) {
let url = `${this.centerCacheUrl}tm_treasure_name`
let result = await this.restClient.execPost(param, url)
result = result.stdout
result = JSON.parse(result)
return result;
}
/**
* @description 获取收藏列表
* @author liangwk
* @param {*} pobj
* @returns
* @memberof AskForService
*/
async getCollect (pobj) {
if (pobj.actionBody.collections) {
pobj.actionType = 'getByUidAndCollections'
} else {
pobj.actionType = 'getByUid'
}
let url = `${this.centerOrderUrl}askfor/collect/tradeMark`
let result = await this.restClient.execPost(pobj, url)
result = result.stdout
result = JSON.parse(result)
return result
}
/**
* @description
* @author liangwk
* @param {*} pobj
* @returns
* @memberof AskForService
*/
async collect (pobj) {
pobj.actionType = pobj.actionBody.id ? 'delete' : 'create'
let url = `${this.centerOrderUrl}askfor/collect/tradeMark`
let result = await this.restClient.execPost(pobj, url)
result = result.stdout
result = JSON.parse(result)
return result
}
async getAskFor (pobj) {
pobj.actionType = 'getByUid'
let url = `${this.centerOrderUrl}askfor/askfor/tradeMark`
let result = await this.restClient.execPost(pobj, url)
result = result.stdout
result = JSON.parse(result)
return result
}
async askFor (pobj) {
pobj.actionType = pobj.actionBody.id ? 'delete' : 'create'
let url = `${this.centerOrderUrl}askfor/askfor/tradeMark`
let result = await this.restClient.execPost(pobj, url)
result = result.stdout
result = JSON.parse(result)
return result
}
}
module.exports = AskForService;
\ No newline at end of file
...@@ -118,7 +118,7 @@ module.exports = function (app) { ...@@ -118,7 +118,7 @@ module.exports = function (app) {
"addOrder", "getH5PayUrl", "getOrderQrCode", "queryOrderStatus", "getOrderInfo", "getOrderDeliveryInfo", "getOrderDetails", "addOrder", "getH5PayUrl", "getOrderQrCode", "queryOrderStatus", "getOrderInfo", "getOrderDeliveryInfo", "getOrderDetails",
"getOrderDeliveryFlowInfo", "getOrderDeliveryFlowList", "getOrderLogInfo", "updateContacts", "updateTmOrder", "delOrder", "getOrderDeliveryFlowInfo", "getOrderDeliveryFlowList", "getOrderLogInfo", "updateContacts", "updateTmOrder", "delOrder",
"submitProgramme", "getProgrammeListByUser", "getProgrammeInfoByNeedNo", "abolishProgramme", "getAliPayInfo", "submitProgramme", "getProgrammeListByUser", "getProgrammeInfoByNeedNo", "abolishProgramme", "getAliPayInfo",
"getPaidLogoListByUser","getCollectibleLogoListByUser","collectLogo","getLogoMaterial","cancelCollectLogo","icpNotify","createName","getNameDetail","orderConfirm" "getPaidLogoListByUser","getCollectibleLogoListByUser","collectLogo","getLogoMaterial","cancelCollectLogo","icpNotify","createName","getNameDetail", "orderConfirm", "collect", "reg"
]; ];
if (lst.indexOf(req.body.actionType) >= 0) { if (lst.indexOf(req.body.actionType) >= 0) {
var userpin = req.headers["userpin"] || ""; var userpin = req.headers["userpin"] || "";
......
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