class AlertReportController {

    @Autowired
    private AlertService alertService;

    @PostMapping("/{cloud}")
    @Operation(summary = "Interface for reporting external alarm information of cloud service")
    public ResponseEntity<Message<Void>> addNewAlertReportFromCloud(@PathVariable("cloud") String cloudServiceName,
                                                                    @RequestBody String alertReport) {<FILL_FUNCTION_BODY>}
    
    @PostMapping
    @Operation(summary = "Interface for reporting external and general alarm information",
            description = "The interface is used to report external and general alarm information")
    public ResponseEntity<Message<Void>> addNewAlertReport(@RequestBody GeneralCloudAlertReport alertReport) {
        alertReport.refreshAlertTime();
        alertService.addNewAlertReport(alertReport);
        return ResponseEntity.ok(Message.success("Add report success"));
    }
}

        CloudServiceAlarmInformationEnum cloudService = CloudServiceAlarmInformationEnum
                .getEnumFromCloudServiceName(cloudServiceName);

        AlertReport alert = null;
        if (cloudService != null) {
            try {
                CloudAlertReportAbstract cloudAlertReport = JsonUtil
                        .fromJson(alertReport, cloudService.getCloudServiceAlarmInformationEntity());
                assert cloudAlertReport != null;
                alert = AlertReport.builder()
                        .content(cloudAlertReport.getContent())
                        .alertName(cloudAlertReport.getAlertName())
                        .alertTime(cloudAlertReport.getAlertTime())
                        .alertDuration(cloudAlertReport.getAlertDuration())
                        .priority(cloudAlertReport.getPriority())
                        .reportType(cloudAlertReport.getReportType())
                        .labels(cloudAlertReport.getLabels())
                        .annotations(cloudAlertReport.getAnnotations())
                        .build();
            } catch (Exception e) {
                log.error("[alert report] parse cloud service alarm content failed! cloud service: {} conrent: {}",
                        cloudService.name(), alertReport);
            }
        } else {
            alert = AlertReport.builder()
                    .content("error do not has cloud service api")
                    .alertName("/api/alerts/report/" + cloudServiceName)
                    .alertTime(new Date().getTime())
                    .priority(1)
                    .reportType(1)
                    .build();
        }
        Optional.ofNullable(alert).ifPresent(alertReportPresent ->
                alertService.addNewAlertReport(alertReportPresent));
        return ResponseEntity.ok(Message.success("Add report success"));
    
<no_super_class>