CompareIpsCtrl.java 1.57 KB
package com.ui.ctrl;

import com.ui.http.HttpRestClient;
import com.ui.model.BaseResponse;
import com.ui.model.req.CompareReq;
import com.ui.model.req.NginxSyncTask;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

/**
 * Created by yoho on 2016/8/23.
 */
@RestController
@RequestMapping(value = "/compareIps")
public class CompareIpsCtrl {

    @Autowired
    HttpRestClient httpRestClient;

    @RequestMapping("/toCompareIps")
    public ModelAndView toCompareIpsView() {
        return new  ModelAndView("compare/compareIps");
    }

    /**
     * 在线ip配置对比--新(一次性对比所有的)
     * @return
     */
    @RequestMapping("/toCompareIpsNew")
    public ModelAndView toCompareIpsNewView() {
        return new  ModelAndView("compare/compareIpsNew");
    }

    @RequestMapping("/compare")
    public BaseResponse pushTask(CompareReq req)
    {
        BaseResponse response = httpRestClient.defaultPost("/compareIps/compare", req, BaseResponse.class);

        return response;
    }

    /**
     * 在线ip对比--一键比对所有的服务
     * @param cloud
     * @return
     */
    @RequestMapping("/compareAll")
    public BaseResponse compareAll( String cloud)
    {
        BaseResponse response = httpRestClient.defaultPost("/compareIps/compareAll", cloud, BaseResponse.class);

        return response;
    }
}