Files
springboot-scaffold/src/main/java/com/example/scaffold/config/LearningProfileInfo.java

27 lines
737 B
Java
Raw Normal View History

package com.example.scaffold.config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Arrays;
import java.util.Map;
@RestController
public class LearningProfileInfo {
@Value("${spring.profiles.active:learn}")
private String activeProfile;
@Value("${app.enabled-modules:ioc,aop,mybatis,transaction,users}")
private String[] enabledModules;
@GetMapping("/api/profile")
public Map<String, Object> profileInfo() {
return Map.of(
"profile", activeProfile,
"enabledModules", Arrays.asList(enabledModules)
);
}
}