const system=require("../../../system");
const ServiceBase=require("../../sve.base");
var settings=require("../../../../config/settings");
class MetaService extends ServiceBase{
  constructor(){
     super("common",ServiceBase.getDaoName(MetaService));
  }
  async getApiDoc(appid){
   var p=settings.basepath+"/app/base/db/impl/common/apiDocManager.js";
    var ClassObj=  require(p) ;
    var obj=new ClassObj();
   return obj.doc;
  }
  async getUiConfig(appid){
     const cfg=await this.cacheManager["UIConfigCache"].cache(appid,null,60);
     return cfg;
  }
  async getBaseComp(){
   var basecomp=await this.apiCallWithAk(settings.paasUrl()+"api/meta/baseComp/getBaseComp",{});
   return basecomp.basecom;
  }
  async findAuthsByRole(rolesarray, appid){
   var result =await this.apiCallWithAk(settings.paasUrl()+"api/auth/roleAuth/findAuthsByRole",{
       roles:rolesarray,
       appid:appid
   });
   return result;
  }
}
module.exports=MetaService;
