| 1 | |
package com.ctrip.framework.apollo.portal.controller; |
| 2 | |
|
| 3 | |
import com.ctrip.framework.apollo.core.enums.Env; |
| 4 | |
import com.ctrip.framework.apollo.portal.PortalSettings; |
| 5 | |
|
| 6 | |
import org.springframework.beans.factory.annotation.Autowired; |
| 7 | |
import org.springframework.web.bind.annotation.RequestMapping; |
| 8 | |
import org.springframework.web.bind.annotation.RequestMethod; |
| 9 | |
import org.springframework.web.bind.annotation.RestController; |
| 10 | |
|
| 11 | |
import java.util.List; |
| 12 | |
|
| 13 | |
@RestController |
| 14 | |
@RequestMapping("/envs") |
| 15 | 1 | public class PortalEnvController { |
| 16 | |
|
| 17 | |
@Autowired |
| 18 | |
private PortalSettings portalSettings; |
| 19 | |
|
| 20 | |
@RequestMapping(value = "", method = RequestMethod.GET) |
| 21 | |
public List<Env> envs(){ |
| 22 | 0 | return portalSettings.getActiveEnvs(); |
| 23 | |
} |
| 24 | |
|
| 25 | |
} |