NginxSyncCtrl.java 1.13 KB
package com.ui.ctrl;

import com.ui.http.HttpRestClient;
import com.ui.model.BaseResponse;
import com.ui.model.req.NginxSyncTask;
import org.springframework.beans.factory.annotation.Autowired;
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 = "/nginxSync")
public class NginxSyncCtrl {

    @Autowired
    HttpRestClient httpRestClient;

    @RequestMapping("/toNginxSync")
    public ModelAndView toNginxView() {
        return new  ModelAndView("nginx/nginxSync");
    }


    @RequestMapping("/pushTask")
    public BaseResponse pushTask(NginxSyncTask task)
    {
        BaseResponse response = httpRestClient.defaultPost("/nginxsync/pushtask", task, BaseResponse.class);

        return response;

    }

    @RequestMapping("/getTaskLog")
    public BaseResponse getTaskLog(NginxSyncTask task)
    {
        BaseResponse response = httpRestClient.defaultPost("/nginxsync/getasklog", task, BaseResponse.class);

        return response;

    }
}