3
13693261870
2022-09-16 63ba114e70e380442fcbed4a5157ee52c9491216
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
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<String, Object> params){
        //查询列表数据
        Query query = new Query(params);
        List<LogKettleJob> 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);
    }
 
}