You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
2.3 KiB
69 lines
2.3 KiB
package com.platform.controller;
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
import org.apache.log4j.Logger;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
import com.base.BaseController;
|
|
import com.platform.entities.VolumeInitEntity;
|
|
import com.platform.service.IVolumeService;
|
|
import com.platform.utils.Configs;
|
|
|
|
@Controller
|
|
public class VolumeController extends BaseController{
|
|
|
|
public static Logger log = Configs.DAILY_ROLLING_LOGGER;
|
|
|
|
@Resource(name = "volumeService")
|
|
private IVolumeService volumeService;
|
|
|
|
|
|
@RequestMapping(value = "/volume/insert", method = RequestMethod.POST)
|
|
@ResponseBody
|
|
public void volumeInsert(HttpServletRequest res, HttpServletResponse req,
|
|
@RequestBody VolumeInitEntity entity) throws Exception {
|
|
Configs.CONSOLE_LOGGER.error("/oracle/{name}/extract");
|
|
volumeService.save(entity);
|
|
req.setStatus(200);
|
|
}
|
|
|
|
@RequestMapping(value = "/volume/{name}/delete", method = RequestMethod.POST)
|
|
@ResponseBody
|
|
public void volumeDelete(HttpServletRequest res, HttpServletResponse req,
|
|
@RequestBody VolumeInitEntity entity) throws Exception {
|
|
Configs.CONSOLE_LOGGER.error("/oracle/{name}/extract");
|
|
volumeService.delete(entity);
|
|
req.setStatus(200);
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/volume/{name}/start", method = RequestMethod.POST)
|
|
@ResponseBody
|
|
public void volumeStart(HttpServletRequest res, HttpServletResponse req,
|
|
@RequestBody VolumeInitEntity entity) throws Exception {
|
|
Configs.CONSOLE_LOGGER.error("/oracle/{name}/extract");
|
|
res.setCharacterEncoding("UTF-8");
|
|
volumeService.start(entity);
|
|
req.setStatus(200);
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/volume/{name}/stop", method = RequestMethod.POST)
|
|
@ResponseBody
|
|
public void volumeStop(HttpServletRequest res, HttpServletResponse req,
|
|
@RequestBody VolumeInitEntity entity) throws Exception {
|
|
Configs.CONSOLE_LOGGER.error("/oracle/{name}/extract");
|
|
res.setCharacterEncoding("UTF-8");
|
|
volumeService.stop(entity);
|
|
req.setStatus(200);
|
|
}
|
|
|
|
}
|