

package com.zcloud.modules.job.controller;

import com.zcloud.common.utils.PageUtils;
import com.zcloud.common.utils.R;
import com.zcloud.modules.job.entity.ScheduleJobLogEntity;
import com.zcloud.modules.job.service.ScheduleJobLogService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * 定时任务日志
 *
 *
 */
@RestController
@RequestMapping("/sys/scheduleLog")
public class ScheduleJobLogController {
	@Autowired
	private ScheduleJobLogService scheduleJobLogService;

	/**
	 * 定时任务日志列表
	 */
	@RequestMapping("/list")
	//@RequiresPermission("sys:schedule:log")
	public R list(@RequestBody Map<String, Object> params){
		PageUtils page = scheduleJobLogService.queryPage(params);

		return R.ok().put("page", page);
	}

	/**
	 * 定时任务日志信息
	 */
	@RequestMapping("/info/{logId}")
	public R info(@PathVariable("logId") String logId){
		ScheduleJobLogEntity log = scheduleJobLogService.getById(logId);

		return R.ok().put("log", log);
	}
}
