|
@@ -218,25 +218,15 @@ void CenterSettingsMicroServiceHelper::InitCenterSettingInfo()
|
|
|
|
|
|
CSimpleStringA strMicroServiceURLSection = "MicroServiceURL";
|
|
|
|
|
|
- ///**TODO(Gifur@8/29/2023): */
|
|
|
-#ifdef DEVOPS_ON_ST /*DevOps流水线编译,ST环境*/
|
|
|
- strMicroServiceURLSection = "MicroServiceURL-ST";
|
|
|
-#elif defined(DEVOPS_ON_UAT)/*DevOps流水线编译,UAT环境*/
|
|
|
- strMicroServiceURLSection = "MicroServiceURL-UAT";
|
|
|
-#elif defined(DEVOPS_ON_PRD)/*DevOps流水线编译,PRD环境*/
|
|
|
- //strMicroServiceURLSection = "MicroServiceURL-PRD";
|
|
|
-#elif defined(DEVOPS_ON_DEV)/*DevOps流水线编译,Dev环境*/
|
|
|
- strMicroServiceURLSection = "MicroServiceURL-Dev";
|
|
|
-#else/*本地编译等非DevOps环境编译的版本*/
|
|
|
- strMicroServiceURLSection = "MicroServiceURL-Dev";
|
|
|
-#endif
|
|
|
+ strMicroServiceURLSection = "MicroServiceURL";
|
|
|
+
|
|
|
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("InitCenterSettingInfo")("获取集中配置服务地址 Section name:%s", strMicroServiceURLSection.GetData());
|
|
|
|
|
|
shellConfig->ReadAllKeys(strMicroServiceURLSection, m_arrKeys);
|
|
|
|
|
|
CSimpleStringA strUrl;
|
|
|
- for (int i = 0; i < m_arrKeys.GetCount() && m_arrKeys[i].IsStartWith("CenterConfigUrl"); i++) {
|
|
|
+ for(int i = 0; i < m_arrKeys.GetCount() && m_arrKeys[i].IsStartWith("CenterConfigUrl", true); i++){
|
|
|
shellConfig->ReadConfigValue(strMicroServiceURLSection, m_arrKeys[i].GetData(), strUrl);
|
|
|
if (!strUrl.IsNullOrEmpty())
|
|
|
m_urlsFromShell.push_back(strUrl);
|
|
@@ -255,11 +245,12 @@ bool CenterSettingsMicroServiceHelper::WriteToConfig(CenterSettingResponse& sRes
|
|
|
CSimpleStringA newPath = m_strBakPath + ".new";
|
|
|
|
|
|
for (int i = 0; i < sResponse.m_config.size(); i++) {
|
|
|
- string module = sResponse.m_config[i].m_moudle;
|
|
|
- string name = sResponse.m_config[i].m_name;
|
|
|
- string value = sResponse.m_config[i].m_value;
|
|
|
+ auto item = sResponse.m_config[i];
|
|
|
+ string module = item.m_moudle;
|
|
|
+ string name = item.m_name;
|
|
|
+ string value = item.m_value;
|
|
|
|
|
|
- if (inifile_write_str(newPath, module.c_str(), name.c_str(), value.c_str()) == -1) {
|
|
|
+ if (inifile_write_str(newPath.GetData(), module.c_str(), name.c_str(), value.c_str()) == -1) {
|
|
|
DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_SYSTEM).setAPI("WriteToConfig")
|
|
|
("write %s:%s:%s fail", module.c_str(), name.c_str(), value.c_str());
|
|
|
m_strErrMsg = "集中配置写入失败";
|