Search in sources :

Example 1 with SaturnJunkData

use of com.vip.saturn.job.console.domain.SaturnJunkData in project Saturn by vipshop.

the class SaturnJunkDataController method getJunkData.

@ResponseBody
@RequestMapping(value = "getJunkdata", method = RequestMethod.GET)
public RequestResult getJunkData(HttpServletRequest request, String newZkClusterKey) {
    RequestResult requestResult = new RequestResult();
    try {
        List<SaturnJunkData> junkData = saturnJunkDataService.getJunkData(newZkClusterKey);
        requestResult.setSuccess(true);
        requestResult.setObj(junkData);
    } catch (Throwable t) {
        requestResult.setSuccess(false);
        if (t instanceof SaturnJobConsoleException) {
            requestResult.setMessage(t.getMessage());
        } else {
            requestResult.setMessage(t.toString());
        }
        LOGGER.error(t.getMessage(), t);
    }
    return requestResult;
}
Also used : RequestResult(com.vip.saturn.job.console.domain.RequestResult) SaturnJobConsoleException(com.vip.saturn.job.console.exception.SaturnJobConsoleException) SaturnJunkData(com.vip.saturn.job.console.domain.SaturnJunkData) ResponseBody(org.springframework.web.bind.annotation.ResponseBody) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

RequestResult (com.vip.saturn.job.console.domain.RequestResult)1 SaturnJunkData (com.vip.saturn.job.console.domain.SaturnJunkData)1 SaturnJobConsoleException (com.vip.saturn.job.console.exception.SaturnJobConsoleException)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)1