feat(app): 添加重新生成应用配置文件功能
- 在AppController中新增regenerateConfigFile接口 - 在AppService中实现重新生成配置文件的业务逻辑 - 记录重新生成配置文件的操作日志 - 在前端API中添加重新生成功能调用方法 - 在应用详情页面添加重新生成按钮和确认对话框 - 实现重新生成配置文件的前端交互逻辑
这个提交包含在:
父节点
596927c1c6
当前提交
e3d7fbd591
@ -182,6 +182,13 @@ public class AppController {
|
||||
.body(encrypted.getBytes(java.nio.charset.StandardCharsets.UTF_8));
|
||||
}
|
||||
|
||||
@PostMapping("/{appKey}/config-file/regenerate")
|
||||
public ResponseEntity<ApiResponse<Void>> regenerateConfigFile(@PathVariable String appKey,
|
||||
@AuthenticationPrincipal String tenantId) {
|
||||
appService.regenerateConfigFile(appKey, tenantId);
|
||||
return ResponseEntity.ok(ApiResponse.ok());
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse an uploaded config file and return its decrypted contents.
|
||||
* Used by the security center to verify config file information.
|
||||
|
||||
@ -100,6 +100,18 @@ public class AppService {
|
||||
return content;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public String regenerateConfigFile(String appKey, String tenantId) {
|
||||
AppEntity app = getByAppKey(appKey, tenantId);
|
||||
String content = generateConfigFileContent(app);
|
||||
app.setConfigFileContent(content);
|
||||
appRepository.save(app);
|
||||
operationLogService.record(tenantId, "APP", "APP", appKey, "REGENERATE_CONFIG",
|
||||
"重新生成应用「" + app.getName() + "」的 Config 文件",
|
||||
Map.of("name", app.getName()));
|
||||
return content;
|
||||
}
|
||||
|
||||
public AppEntity update(String appKey, String tenantId, CreateAppRequest req) {
|
||||
AppEntity app = getByAppKey(appKey, tenantId);
|
||||
Map<String, Object> before = new LinkedHashMap<>();
|
||||
|
||||
正在加载...
在新工单中引用
屏蔽一个用户