public ControllerApiDescriptionModel AddController(ControllerApiDescriptionModel controller) { if (Controllers.ContainsKey(controller.Name)) { throw new SharePlatformException($"已经有一个名为的控制器: {controller.Name} 模块内: {Name}"); } return(Controllers[controller.Name] = controller); }
public ControllerApiDescriptionModel CreateSubModel(string[] actions) { var subModel = new ControllerApiDescriptionModel(Name); foreach (var action in Actions.Values) { if (actions == null || actions.Contains(action.Name)) { subModel.AddAction(action); } } return(subModel); }