All Downloads are FREE. Search and download functionalities are using the official Maven repository.

club.zhcs.openapi.SwaggerCustomerController Maven / Gradle / Ivy

There is a newer version: 3.3.4
Show newest version
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