ElbInfoCtrl.java 1.16 KB
package com.ui.ctrl;

import com.ui.contants.HttpUriContants;
import com.ui.http.HttpRestClient;
import com.ui.model.BaseResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

/**
 * Created by xh on 2017/6/16.
 */
@RestController
@RequestMapping(value = "/elbInfo")
public class ElbInfoCtrl {
    @Autowired
    private HttpRestClient httpClient;

    /**
     * 跳转到页面
     * @param model
     * @return
     */
    @RequestMapping("/toElbInfoPage")
    public ModelAndView toElbInfoPage(Model model) {
        return new ModelAndView("manager/elbinfo");
    }

    @RequestMapping("/getElbInfo")
    @ResponseBody
    public BaseResponse<?> getElbInfo(int cloudType) {
        BaseResponse<?> response = httpClient.defaultPost(
                HttpUriContants.GET_CLOUD_ELB_INFO + "?cloudType="+cloudType, null,
                BaseResponse.class);
        return response;
    }
}