package com.lightinit.hsdataportal.controller.open;

import com.lightinit.hsdataportal.common.ConfigUtils;
import com.lightinit.hsdataportal.common.SysContants;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;

/**
 * @author WangYao
 * @date 2018/6/29 15:21
 * @description
 */
@Controller
@RequestMapping(value = "/open/makerspace")
public class MakerSpaceController {

   /* @RequestMapping(value = "index.htm")
    public String index(HttpServletRequest request, Model model) {
        String devopsUrl = ConfigUtils.getConfiguration(SysContants.PropertyFilePath.CONFIG).getString(SysContants.PropertyKey.DEVOPS);
        String devopsService = ConfigUtils.getConfiguration(SysContants.PropertyFilePath.CONFIG).getString(SysContants.PropertyKey.DEVOPSSERVICE);
        String devopsDate = ConfigUtils.getConfiguration(SysContants.PropertyFilePath.CONFIG).getString(SysContants.PropertyKey.DEVOPSDATE);
        String devopsAnalysis = ConfigUtils.getConfiguration(SysContants.PropertyFilePath.CONFIG).getString(SysContants.PropertyKey.DEVOPSANALYSIS);
        model.addAttribute("devopsUrl",devopsUrl) ;
        model.addAttribute("devopsService",devopsService) ;
        model.addAttribute("devopsDate",devopsDate) ;
        model.addAttribute("devopsAnalysis",devopsAnalysis) ;
        return "open/makerspace/index";
    }*/

    @RequestMapping(value = "index.htm")
    public ModelAndView index(String id) {
        ModelAndView modelAndView = new ModelAndView("open/makerspace/index");
        modelAndView.addObject("id",id);
        String devopsUrl = ConfigUtils.getConfiguration(SysContants.PropertyFilePath.CONFIG).getString(SysContants.PropertyKey.DEVOPS);
        String devopsService = ConfigUtils.getConfiguration(SysContants.PropertyFilePath.CONFIG).getString(SysContants.PropertyKey.DEVOPSSERVICE);
        String devopsDate = ConfigUtils.getConfiguration(SysContants.PropertyFilePath.CONFIG).getString(SysContants.PropertyKey.DEVOPSDATE);
        String devopsAnalysis = ConfigUtils.getConfiguration(SysContants.PropertyFilePath.CONFIG).getString(SysContants.PropertyKey.DEVOPSANALYSIS);
        modelAndView.addObject("devopsUrl",devopsUrl) ;
        modelAndView.addObject("devopsService",devopsService) ;
        modelAndView.addObject("devopsDate",devopsDate) ;
        modelAndView.addObject("devopsAnalysis",devopsAnalysis) ;
        return modelAndView;
    }
}
