Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion spring-ai-alibaba-jmanus/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>com.alibaba.cloud.ai</groupId>
<name>Spring AI Alibaba JManus</name>
<artifactId>spring-ai-alibaba-jmanus</artifactId>
<version>3.0.3-SNAPSHOT</version>
<version>3.0.4-SNAPSHOT</version>

<!-- The required dependencies are maintained separately by the JManus module -->
<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ public ResponseEntity<Void> batchUpdateConfigs(@RequestBody List<ConfigEntity> c
return ResponseEntity.ok().build();
}

@PostMapping("/reset-all-defaults")
public ResponseEntity<Void> resetAllConfigsToDefaults() {
configService.resetAllConfigsToDefaults();
return ResponseEntity.ok().build();
}

@GetMapping("/available-models")
public ResponseEntity<Map<String, Object>> getAvailableModels() {
List<DynamicModelEntity> models = dynamicModelRepository.findAll();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,4 +292,25 @@ public void batchUpdateConfigs(List<ConfigEntity> configs) {
}
}

/**
* Reset all configurations to their default values
*/
@Transactional
public void resetAllConfigsToDefaults() {
List<ConfigEntity> allConfigs = configRepository.findAll();

for (ConfigEntity config : allConfigs) {
if (config.getDefaultValue() != null && !config.getDefaultValue().equals(config.getConfigValue())) {
config.setConfigValue(config.getDefaultValue());
configRepository.save(config);

// Update all beans using this configuration
Map<String, Object> configBeans = applicationContext
.getBeansWithAnnotation(ConfigurationProperties.class);
configBeans.values()
.forEach(bean -> updateBeanConfig(bean, config.getConfigPath(), config.getDefaultValue()));
}
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,9 @@ public interface IConfigService {
*/
void batchUpdateConfigs(List<ConfigEntity> configs);

/**
* Reset all configurations to their default values
*/
void resetAllConfigsToDefaults();

}

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading
Loading