Template
feat: productize ingest lifecycle and library health
This commit is contained in:
@@ -1,15 +1,30 @@
|
||||
package com.music.controller;
|
||||
|
||||
import com.music.common.Result;
|
||||
import com.music.dto.DependencyStatus;
|
||||
import com.music.service.RuntimeDependencyService;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
public class HealthController {
|
||||
|
||||
private final RuntimeDependencyService dependencyService;
|
||||
|
||||
public HealthController(RuntimeDependencyService dependencyService) {
|
||||
this.dependencyService = dependencyService;
|
||||
}
|
||||
|
||||
@GetMapping("/api/health")
|
||||
public Result<String> health() {
|
||||
return Result.success("OK");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 运行时依赖检查:报告 ffmpeg / ffprobe 是否可用及版本,便于部署自检与排障。
|
||||
*/
|
||||
@GetMapping("/api/health/dependencies")
|
||||
public Result<DependencyStatus> dependencies() {
|
||||
return Result.success(dependencyService.check());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user