class GeneralConfigController {
    private Map<String, GeneralConfigService> configServiceMap;

    public GeneralConfigController(List<GeneralConfigService> generalConfigServices) {
        configServiceMap = new HashMap<>(8);
        if (generalConfigServices != null) {
            generalConfigServices.forEach(config -> configServiceMap.put(config.type(), config));
        }
    }

    @PostMapping(path = "/{type}")
    @Operation(summary = "Save or update common config", description = "保存公共配置")
    public ResponseEntity<Message<String>> saveOrUpdateConfig(
            @Parameter(description = "Config Type", example = "email")
            @PathVariable("type") @NotNull final String type,
            @RequestBody Object config) {
        GeneralConfigService configService = configServiceMap.get(type);
        if (configService == null) {
            throw new IllegalArgumentException("Not supported this config type: " + type);
        }
        configService.saveConfig(config);
        return ResponseEntity.ok(Message.success("Update config success"));
    }

    @GetMapping(path = "/{type}")
    @Operation(summary = "Get the sender config", description = "获取发送端配置")
    public ResponseEntity<Message<Object>> getConfig(
            @Parameter(description = "Config Type", example = "email")
            @PathVariable("type") @NotNull final String type) {<FILL_FUNCTION_BODY>}

    @PutMapping(path = "/template/{app}")
    @Operation(summary = "Update the app template config")
    public ResponseEntity<Message<Void>> updateTemplateAppConfig(
            @PathVariable("app") @NotNull final String app,
            @RequestBody TemplateConfig.AppTemplate template) {
        GeneralConfigService configService = configServiceMap.get("template");
        if (configService == null || !(configService instanceof TemplateConfigServiceImpl)) {
            throw new IllegalArgumentException("Not supported this config type: template");
        }
        TemplateConfig config = ((TemplateConfigServiceImpl) configService).getConfig();
        if (config == null) {
            config = new TemplateConfig();
        }
        if (config.getApps() == null) {
            config.setApps(new HashMap<>(8));
        }
        config.getApps().put(app, template);
        configService.saveConfig(config);
        return ResponseEntity.ok(Message.success());
    }
}

        GeneralConfigService configService = configServiceMap.get(type);
        if (configService == null) {
            throw new IllegalArgumentException("Not supported this config type: " + type);
        }
        return ResponseEntity.ok(Message.success(configService.getConfig()));
    
<no_super_class>