/// <summary> /// 添加分组。仅添加分组,不添加版本 /// </summary> /// <param name="title">标题</param> /// <param name="name">名称</param> /// <param name="description">描述</param> public void AddGroup(string title, string name, string description) { ApiGroupInfo apiGroup = GetApiGroup(name) ?? new ApiGroupInfo { Title = title, Name = name, Description = string.Empty, IsCustomGroup = true }; if (!ExistsApiGroup(name)) { ApiGroups.Add(apiGroup); } }
/// <summary> /// 添加APi分组 /// </summary> /// <param name="name">名称</param> public void AddApiGroupByCustomGroup(string name) { ApiGroupInfo apiGroup = GetApiGroup(name) ?? new ApiGroupInfo { Title = name, Name = name, Description = string.Empty, IsCustomGroup = true }; apiGroup.AddItem(new ApiVersionInfo() { Name = name, Version = string.Empty }); if (!ExistsApiGroup(name)) { ApiGroups.Add(apiGroup); } }
/// <summary> /// 添加API分组 /// </summary> /// <param name="title">标题</param> /// <param name="name">名称</param> /// <param name="description">描述</param> /// <param name="versionName">版本名称</param> /// <param name="version">版本号</param> public void AddApiGroup(string title, string name, string description, string versionName, string version) { ApiGroupInfo apiGroup = GetApiGroup(name) ?? new ApiGroupInfo { Title = title, Name = name, Description = description }; apiGroup.AddItem(new ApiVersionInfo() { Name = versionName, Version = version }); if (!ExistsApiGroup(name)) { ApiGroups.Add(apiGroup); } }