package com.landtool.lanbase.modules.log.controller; import com.alibaba.fastjson.JSONObject; import com.landtool.lanbase.common.utils.PageUtils; import com.landtool.lanbase.common.utils.Query; import com.landtool.lanbase.common.utils.Result; import com.landtool.lanbase.modules.log.entity.LogAction; import com.landtool.lanbase.modules.log.entity.LogKettleJob; import com.landtool.lanbase.modules.log.service.LogActionService; import com.landtool.lanbase.modules.log.service.LogKettleJobService; import com.landtool.lanbase.modules.sys.controller.AbstractController; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.List; import java.util.Map; @RestController @RequestMapping("/log/kettlejob") @Api(value = "", tags = {"日志"}) public class LogKettleJobController extends AbstractController{ @Autowired private LogKettleJobService logKettleJobService; /** * 列表 */ @com.landtool.lanbase.common.annotation.LogAction("数据抽取,任务状态,任务状态列表查询,查询") @RequestMapping(value="/list",method ={RequestMethod.POST, RequestMethod.GET}) @RequiresPermissions("org_user_admin") @ApiOperation( value = "系统模块操作日志", notes = "系统模块操作日志列表" ) public Result list(@ApiParam(name="params",value="",required=true)@RequestParam Map params){ //查询列表数据 Query query = new Query(params); List actionList = logKettleJobService.queryList(query); int total = logKettleJobService.queryTotal(query); PageUtils pageUtil = new PageUtils(actionList, total, query.getLimit(), query.getPage()); return Result.ok().put("page", pageUtil); } /** * 信息 */ @GetMapping("/info/{id_job}") public Result info(@ApiParam(name="id_job",value="",required=true)@PathVariable("id_job") Integer id_job){ LogKettleJob logKettleJob = logKettleJobService.queryObject(id_job); String result = ""; if(logKettleJob != null){ result = logKettleJob.getLogfield(); } return Result.ok().put("result", result); } }