var system = require("../../../system")
var settings = require("../../../../config/settings");
const CtlBase = require("../../ctl.base");
var cacheBaseComp = null;
class ProductCtl extends CtlBase {
  constructor() {
    super("aggregation", CtlBase.getServiceName(ProductCtl));
  }
  async create(pobj, qobj, req) {
    pobj.company_id = req && req.xctx && req.xctx.companyid ?req.xctx.companyid : "";
    const up = await this.service.create(pobj);
    return up;
  }

  async update(pobj, qobj, req) {
    const up = await this.service.update(pobj);
    return up;
  }

  /**
   * 获取某一类下的产品
   * @create rxs
   * @param pobj
   * @returns {Promise<void>}
   */
  async getProductsByType(pobj){
    const result = await this.service.getProductsByType(pobj);
    return result;
  }
}
module.exports = ProductCtl;
