com.chutneytesting.feature.api.FeatureController Maven / Gradle / Ivy
The newest version!
/*
* SPDX-FileCopyrightText: 2017-2024 Enedis
*
* SPDX-License-Identifier: Apache-2.0
*
*/
package com.chutneytesting.feature.api;
import com.chutneytesting.feature.api.dto.FeatureDto;
import com.chutneytesting.server.core.domain.feature.Feature;
import java.util.List;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/api/v2/features")
@CrossOrigin(origins = "*")
public class FeatureController {
private final List features;
public FeatureController(List features) {
this.features = features;
}
@GetMapping
public List getAll() {
return features.stream().map(feature -> new FeatureDto(feature.name(), feature.active())).toList();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy