BigDataCtrl.java 2.48 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.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

/**
 * Created by craig.qin on 2017/8/10.
 */
@Controller
@RequestMapping("/bigdata")
public class BigDataCtrl {

    @Autowired
    private HttpRestClient httpRestClient;

    @RequestMapping("/toDashboardinfo")
    @ResponseBody
    public ModelAndView toDashboardinfo(Model model) {
        String url=httpRestClient.defaultPost(HttpUriContants.BIGDATA_GETACCESSURL,null,String.class);
        model.addAttribute("accessUrl",url);
        return new ModelAndView("bigdata/dashboardinfo");
    }

    @RequestMapping("/toHostinfo")
    @ResponseBody
    public ModelAndView toHostinfo(Model model) {
        String url=httpRestClient.defaultPost(HttpUriContants.BIGDATA_GETACCESSURL,null,String.class);
        model.addAttribute("accessUrl",url);
        return new ModelAndView("bigdata/hostinfo");
    }

    @RequestMapping("/toGroupinfo")
    @ResponseBody
    public ModelAndView toGroupinfo(Model model) {
        String url=httpRestClient.defaultPost(HttpUriContants.BIGDATA_GETACCESSURL,null,String.class);
        model.addAttribute("accessUrl",url);
        return new ModelAndView("bigdata/groupinfo");
    }

    @RequestMapping("/toStrategyinfo")
    @ResponseBody
    public ModelAndView toStrategyinfo(Model model)
    {
        String url=httpRestClient.defaultPost(HttpUriContants.BIGDATA_GETACCESSURL,null,String.class);
        model.addAttribute("accessUrl",url);
        return new ModelAndView("bigdata/strategyinfo");
    }

    @RequestMapping("/toAlarminfo")
    @ResponseBody
    public ModelAndView toAlarminfo(Model model) {
        String url=httpRestClient.defaultPost(HttpUriContants.BIGDATA_GETACCESSURL,null,String.class);
        model.addAttribute("accessUrl",url);
        return new ModelAndView("bigdata/alarminfo");
    }

    @RequestMapping("/toMetricinfo")
    @ResponseBody
    public ModelAndView toMetricinfo(Model model) {
        String url=httpRestClient.defaultPost(HttpUriContants.BIGDATA_GETACCESSURL,null,String.class);
        model.addAttribute("accessUrl",url);
        return new ModelAndView("bigdata/metricinfo");
    }

}