package com.xy.service.factory.sim.impl;

import com.xy.annotate.FactoryRoute;
import com.xy.error.CommRuntimeException;
import com.xy.service.factory.sim.SimInfoFactory;
import com.xy.utils.FactoryUtils;
import lombok.AllArgsConstructor;

/**
 * <p>
 * Sim物联网卡工厂路由
 * </p>
 *
 * @author hechunping
 * @since 2024/8/20
 */
@AllArgsConstructor
@FactoryRoute(interfaceClass = SimInfoFactory.class)
public class SimInfoFactoryRoute implements FactoryUtils.RouteService {

    @Override
    public String route(Object object) {
        String isp = String.valueOf(object).trim();
        String route = "";
        switch (isp) {
            case "电信":
            case "中国电信":
                route = "电信";
                break;
            default:
                throw new CommRuntimeException("接口不支持！");
        }
        return route;
    }
}
