private UpdateResult UpdateConfigBean(ConfigurationPayLoad configPayload) { UpdateResult result = new UpdateResult(); int status = configService.UpdateConfigBean(configPayload); switch (status) { case 1: result.Code = 200; result.Detail = "修改成功"; break; case 2: result.Code = 400; result.Detail = "修改失败,不符合修改条件"; break; case 3: result.Code = 401; result.Detail = "修改失败,字段是只读状态,不能修改"; break; case 4: result.Code = 402; result.Detail = "修改失败,修改字段类型和原来类型不一致"; break; default: result.Code = 500; result.Detail = "修改失败"; break; } return result; }
private IConfigBean GetFileConfigBean(ConfigurationPayLoad config, string serviceName) { IConfigBean bean = manager.GetConfigBean(serviceName); if (bean == null) { PropertiesConfigBean propert = new PropertiesConfigBean(); IConfigFile file = propert.GetConfigFile(config.AppPath, config.ID); if (file.Exists) { propert.SetID(serviceName); manager.Register(propert); return manager.GetConfigBean(serviceName); } } return bean; }
private IPayLoad CreatePayLoad(IHandler handler) { if (handler is ConfigBeanHandler) { ConfigurationPayLoad config = new ConfigurationPayLoad(); if (config.ConfigType == "files") { config.Type = RenderType.Xml; } else { config.Type = ContextHelper.GetRenderType(); } return config; } ComponentPayLoad component = new ComponentPayLoad(); component.Type = ContextHelper.GetRenderType(); return component; }