var system = require("../../../system")
const http = require("http")
const querystring = require('querystring');
var settings = require("../../../../config/settings");
const CtlBase = require("../../ctl.base");


var cacheBaseComp = null;
class PricecatCtl extends CtlBase {
  constructor() {
    super("product", CtlBase.getServiceName(PricecatCtl));
    this.pricestrategyService=system.getObject("service.product.pricestrategySve")
  }
  async buildPriceStrategy(p,q,req){
    let pricetypes=p.pricetypes
     let rtn=await this.pricestrategyService.buildPriceStrategy(pricetypes)
     if(rtn){
       if(rtn.status==-1){
         return system.getResult(null,rtn.msg)
       }else{
        return system.getResult({})
       }
     }
     return system.getResult({})
  }
}
module.exports = PricecatCtl;
