@Profile 控制接口的可見
假設有多個配置文件
application.properties 默認
application-pet.properties 性能測試
application-dev.properties xxx
@RestController
@Profile({
"pet"
})
@RequestMapping("/v1/ops/performanceTest/")
public class DebugPerformanceTestController {
}
DebugPerformanceTestController 只在 application-pet.properties 啓用,也就是壓測時生效。