Commit 05ae80c0 by 王栋源

wdy

parent 2892d63a
...@@ -5,6 +5,7 @@ class OpProductAPI extends APIBase { ...@@ -5,6 +5,7 @@ class OpProductAPI extends APIBase {
constructor() { constructor() {
super(); super();
this.productSve = system.getObject("service.dbproduct.productSve"); this.productSve = system.getObject("service.dbproduct.productSve");
this.producttypeSve = system.getObject("service.dbproduct.producttypeSve");
} }
/** /**
* 接口跳转-POST请求 * 接口跳转-POST请求
...@@ -36,6 +37,8 @@ class OpProductAPI extends APIBase { ...@@ -36,6 +37,8 @@ class OpProductAPI extends APIBase {
break; break;
case "getaliicProduce"://阿里工商获取产品信息 case "getaliicProduce"://阿里工商获取产品信息
opResult = await this.productSve.getaliicProduce(pobj.actionBody); opResult = await this.productSve.getaliicProduce(pobj.actionBody);
case "getProductTypeInfo"://阿里工商获取需求類型
opResult = await this.producttypeSve.getProductTypeInfo(pobj.actionBody, pobj.appInfo);
break; break;
default: default:
opResult = system.getResult(null, "action_type参数错误"); opResult = system.getResult(null, "action_type参数错误");
......
...@@ -7,6 +7,8 @@ module.exports = (db, DataTypes) => { ...@@ -7,6 +7,8 @@ module.exports = (db, DataTypes) => {
p_id: DataTypes.INTEGER, //父id p_id: DataTypes.INTEGER, //父id
type_code: DataTypes.STRING(64), type_code: DataTypes.STRING(64),
type_name: DataTypes.STRING(64), type_name: DataTypes.STRING(64),
channel_type_code: DataTypes.STRING(64),
channel_type_name: DataTypes.STRING(64),
type_pic: DataTypes.STRING(512), type_pic: DataTypes.STRING(512),
type_desc: DataTypes.STRING(1024), //描述 type_desc: DataTypes.STRING(1024), //描述
type_icon: DataTypes.STRING(512), type_icon: DataTypes.STRING(512),
......
...@@ -6,5 +6,16 @@ class ProductTypeService extends ServiceBase { ...@@ -6,5 +6,16 @@ class ProductTypeService extends ServiceBase {
constructor() { constructor() {
super("dbproduct", ServiceBase.getDaoName(ProductTypeService)); super("dbproduct", ServiceBase.getDaoName(ProductTypeService));
} }
async getProductTypeInfo(actionBody,appInfo){
if(!actionBody.type){
return system.getResult(null, "channelCode item is data empty !");
}
if(!appInfo){
return system.getResult(null, "appInfo item is data empty !");
}
var producttypeinfo=await this.findOne({"channel_type_code":actionBody.type,"uapp_id":appInfo.uapp_id});
return system.getResultSuccess(producttypeinfo);
}
} }
module.exports = ProductTypeService; module.exports = ProductTypeService;
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