public string GetData(int confId, UserPublicModel currentUser) { var conf = _widgetConfRepository.GetWidgetConfById(confId); if (conf == null || conf.UserId != currentUser.Id) { return(null); } var widget = _widgetRepository.GetWidgetById(conf.WidgetId); if (widget == null) { return(null); } var service = _serviceRepository.GetServiceById(widget.ServiceId); if (service == null) { return(null); } var provider = _providerRepository.GetProviderById(service.ProvId); if (provider == null) { return(null); } var(route, method, form, token) = ParsConf(conf.Conf, provider); if (route == null || method == null) { return(null); } return(method switch { "get" => _workerRepository.Get(route, token), "post" => _workerRepository.Post(route, form, token), _ => null });
public WidgetModel GetWidgetById(uint id) { return(_widgetRepository.GetWidgetById(id)); }