DashboardCtrl.java 997 Bytes
package com.ui.ctrl;


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.servlet.ModelAndView;

@Controller
@RequestMapping("dashboard")
public class DashboardCtrl {
    @Autowired
    private HttpRestClient httpClient;


    @RequestMapping("/toDashboard")
    public ModelAndView toDashboard(Model model) {
        BaseResponse response=httpClient.defaultGet("/dashboardPortal/queryAll", BaseResponse.class);
        if(response!=null&&response.getCode()==200){
            model.addAttribute("portalMap",response.getData());
        }
        return new ModelAndView("dashBoard/dashBoard");
    }

    @RequestMapping("/toOthers")
    public ModelAndView toOthers() {
        return new ModelAndView("dashBoard/others");
    }

}