All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.binarywang.spring.starter.wxjava.channel.service.WxChannelMultiServicesImpl Maven / Gradle / Ivy

package com.binarywang.spring.starter.wxjava.channel.service;

import me.chanjar.weixin.channel.api.WxChannelService;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 视频号 {@link WxChannelMultiServices} 实现
 *
 * @author Winnie
 * @date 2024/9/13
 */
public class WxChannelMultiServicesImpl implements WxChannelMultiServices {
  private final Map services = new ConcurrentHashMap<>();

  @Override
  public WxChannelService getWxChannelService(String tenantId) {
    return this.services.get(tenantId);
  }

  /**
   * 根据租户 Id,添加一个 WxChannelService 到列表
   *
   * @param tenantId         租户 Id
   * @param wxChannelService WxChannelService 实例
   */
  public void addWxChannelService(String tenantId, WxChannelService wxChannelService) {
    this.services.put(tenantId, wxChannelService);
  }

  @Override
  public void removeWxChannelService(String tenantId) {
    this.services.remove(tenantId);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy