club.zhcs.openapi.SwaggerCustomerController Maven / Gradle / Ivy
package club.zhcs.openapi;
import java.util.Arrays;
import java.util.List;
import org.nutz.lang.util.NutMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import club.zhcs.openapi.SpringdocConfigurationProperties.Customer;
import club.zhcs.openapi.SpringdocConfigurationProperties.Customer.Theme;
import lombok.RequiredArgsConstructor;
@RestController
@RequiredArgsConstructor
public class SwaggerCustomerController {
private final SpringdocConfigurationProperties config;
@GetMapping(value = "swagger-customer")
public Customer customer() {
return config.getCustomer();
}
@GetMapping(value = "swagger-themes")
public List themes() {
return Arrays.stream(Theme.values())
.map(theme -> NutMap.NEW().addv("code", theme.getCode()).addv("description", theme.getDescription()).addv("name", theme.name()))
.toList();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy