import TIM from "./sp/tencent";
import GoEasyIM from "./sp/goEasy";

class IMFactory {
  constructor(sp) {
    this.policy = sp || "tencent";
  }

  static getInstance(policy, options) {
    switch (policy) {
      case "tencent":
        return new TIM(options);
      case "goeasy":
        return new GoEasyIM(options);
      default:
        return new TIM(options);
    }
  }
}

export default IMFactory;
