Search in sources :

Example 1 with CompileLogVO

use of com.ibeiliao.deployment.admin.vo.deploy.CompileLogVO in project Corgi by kevinYin.

the class CompileLogController method getCompileLog.

@RequestMapping("getCompileLog")
@AllowAnonymous
@ResponseBody
public CompileLogVO getCompileLog(int historyId, int offset) {
    CompileLogVO logVO = new CompileLogVO();
    logVO.setOffset(offset);
    String key = RedisLogKey.getModuleCompileKey(historyId);
    Long count = redis.llen(key);
    // logger.info("编译日志,总数:{}, 当前偏移量:{}", count, offset);
    if (offset == count) {
        return logVO;
    }
    if (count > 0) {
        List<String> logs = redis.lrange(key, offset, count);
        logVO.setLogs(logs);
        logVO.setOffset(count.intValue());
        return logVO;
    }
    return logVO;
}
Also used : CompileLogVO(com.ibeiliao.deployment.admin.vo.deploy.CompileLogVO) AllowAnonymous(com.ibeiliao.deployment.admin.annotation.authority.AllowAnonymous) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ResponseBody(org.springframework.web.bind.annotation.ResponseBody)

Aggregations

AllowAnonymous (com.ibeiliao.deployment.admin.annotation.authority.AllowAnonymous)1 CompileLogVO (com.ibeiliao.deployment.admin.vo.deploy.CompileLogVO)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)1