/// <summary> /// 解析一个 id /// </summary> /// <param name="id"></param> /// <returns></returns> public static IdModel Parser(long id) { IdParser idParser = IdParserFactory.GetInstance(id); IdModel model = new IdModel(); idParser.DoParser(id, ref model); return(model); }
public static IdParser GetInstance(long id) { int sign = IdParser.GetSign(id); switch (sign) { case 1: return(Sign1IdParser); case 2: return(Sign2IdParser); default: throw new ArgumentException("未知的协议号"); } }