ScheduleJobLogController.java 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. package com.kmall.schedule.controller;
  2. import com.kmall.schedule.entity.ScheduleJobLogEntity;
  3. import com.kmall.schedule.service.ScheduleJobLogService;
  4. import com.kmall.common.utils.PageUtils;
  5. import com.kmall.common.utils.Query;
  6. import com.kmall.common.utils.R;
  7. import org.apache.shiro.authz.annotation.RequiresPermissions;
  8. import org.springframework.beans.factory.annotation.Autowired;
  9. import org.springframework.web.bind.annotation.PathVariable;
  10. import org.springframework.web.bind.annotation.RequestMapping;
  11. import org.springframework.web.bind.annotation.RequestParam;
  12. import org.springframework.web.bind.annotation.RestController;
  13. import java.util.List;
  14. import java.util.Map;
  15. /**
  16. * 定时任务日志
  17. *
  18. * @author Scott
  19. * @email
  20. * @date 2016年12月1日 下午10:39:52
  21. */
  22. @RestController
  23. @RequestMapping("/sys/scheduleLog")
  24. public class ScheduleJobLogController {
  25. @Autowired
  26. private ScheduleJobLogService scheduleJobLogService;
  27. /**
  28. * 定时任务日志列表
  29. */
  30. @RequestMapping("/list")
  31. @RequiresPermissions("sys:schedule:log")
  32. public R list(@RequestParam Map<String, Object> params) {
  33. //查询列表数据
  34. Query query = new Query(params);
  35. List<ScheduleJobLogEntity> jobList = scheduleJobLogService.queryList(query);
  36. int total = scheduleJobLogService.queryTotal(query);
  37. PageUtils pageUtil = new PageUtils(jobList, total, query.getLimit(), query.getPage());
  38. return R.ok().put("page", pageUtil);
  39. }
  40. /**
  41. * 定时任务日志信息
  42. */
  43. @RequestMapping("/info/{logId}")
  44. public R info(@PathVariable("logId") Long logId) {
  45. ScheduleJobLogEntity log = scheduleJobLogService.queryObject(logId);
  46. return R.ok().put("log", log);
  47. }
  48. }