NginxSyncCtrl.java
1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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;
}
}