...
|
...
|
@@ -10,7 +10,9 @@ import org.slf4j.LoggerFactory; |
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
|
...
|
...
|
@@ -27,10 +29,10 @@ public class HostInfoCtrl { |
|
|
@Autowired
|
|
|
IHostInfoService hostInfoService;
|
|
|
|
|
|
@RequestMapping("/getMechineInfos")
|
|
|
@RequestMapping("/getHostInfos")
|
|
|
@ResponseBody
|
|
|
public Response<PageResponse<HostInfo>> getHostInfos(HostInfoReq req) throws Exception {
|
|
|
log.info("getMechineInfos with param is {}", req);
|
|
|
log.info("getHostInfos with param is {}", req);
|
|
|
// 查询列表
|
|
|
PageResponse<HostInfo> responseBO = hostInfoService.getHostInfos(req);
|
|
|
if (responseBO == null || CollectionUtils.isEmpty(responseBO.getRows())) {
|
...
|
...
|
@@ -41,29 +43,29 @@ public class HostInfoCtrl { |
|
|
response.setRows(responseBO.getRows());
|
|
|
response.setPageSize(responseBO.getPageSize());
|
|
|
response.setTotal(responseBO.getTotal());
|
|
|
log.info("getMechineInfos success and total={}", response.getTotal());
|
|
|
log.info("getHostInfos success and total={}", response.getTotal());
|
|
|
return new Response<PageResponse<HostInfo>>(response);
|
|
|
}
|
|
|
|
|
|
@RequestMapping("/saveMechineInfo")
|
|
|
@RequestMapping("/saveHostInfo")
|
|
|
@ResponseBody
|
|
|
public Response<Integer> saveMechineInfo(String req) throws Exception {
|
|
|
public Response<Integer> saveHostInfo(@RequestBody HostInfo req) throws Exception {
|
|
|
log.info("saveMechineInfo with param is {}", req);
|
|
|
return hostInfoService.saveHostInfo(req);
|
|
|
return hostInfoService.saveHostInfo(null);
|
|
|
}
|
|
|
|
|
|
|
|
|
@RequestMapping("/delMechineInfo")
|
|
|
@RequestMapping("/delHostInfo")
|
|
|
@ResponseBody
|
|
|
public Response<Integer> delMechineInfo(int id) throws Exception {
|
|
|
public Response<Integer> delHostInfo(@RequestParam(value = "id", required = true) Integer id ) throws Exception {
|
|
|
log.info("delMechineInfo with param is {}", id);
|
|
|
return hostInfoService.delHostInfoById(id);
|
|
|
}
|
|
|
|
|
|
@RequestMapping("/getMechineInfoById")
|
|
|
@RequestMapping("/getHostInfoById")
|
|
|
@ResponseBody
|
|
|
public Response<HostInfo> getMechineInfoById(int id) throws Exception {
|
|
|
log.info("getMechineInfoById with param is {}", id);
|
|
|
public Response<HostInfo> getHostInfoById(int id) throws Exception {
|
|
|
log.info("getHostInfoById with param is {}", id);
|
|
|
return hostInfoService.getHostInfoById(id);
|
|
|
}
|
|
|
|
...
|
...
|
|