package com.ots.project.exam.controller;
|
|
import java.util.List;
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.ui.ModelMap;
|
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
import com.ots.framework.aspectj.lang.annotation.Log;
|
import com.ots.framework.aspectj.lang.enums.BusinessType;
|
import com.ots.project.exam.domain.EntOperLog;
|
import com.ots.project.exam.service.IEntOperLogService;
|
import com.ots.framework.web.controller.BaseController;
|
import com.ots.framework.web.domain.AjaxResult;
|
import com.ots.common.utils.poi.ExcelUtil;
|
import com.ots.framework.web.page.TableDataInfo;
|
import org.springframework.stereotype.Controller;
|
|
/**
|
* 使用次数操作记录Controller
|
*
|
* @author ots
|
* @date 2020-01-19
|
*/
|
@Controller
|
@RequestMapping("/exam/entOperLog")
|
public class EntOperLogController extends BaseController
|
{
|
private String prefix = "exam/entOperLog";
|
|
@Autowired
|
private IEntOperLogService entOperLogService;
|
|
@RequiresPermissions("exam:entOperLog:view")
|
@GetMapping()
|
public String entOperLog()
|
{
|
return prefix + "/entOperLog";
|
}
|
|
/**
|
* 查询使用次数操作记录列表
|
*/
|
@RequiresPermissions("exam:entOperLog:list")
|
@PostMapping("/list")
|
@ResponseBody
|
public TableDataInfo list(EntOperLog entOperLog)
|
{
|
startPage();
|
List<EntOperLog> list = entOperLogService.selectEntOperLogList(entOperLog);
|
return getDataTable(list);
|
}
|
|
/**
|
* 导出使用次数操作记录列表
|
*/
|
@RequiresPermissions("exam:entOperLog:export")
|
@PostMapping("/export")
|
@ResponseBody
|
public AjaxResult export(EntOperLog entOperLog)
|
{
|
List<EntOperLog> list = entOperLogService.selectEntOperLogList(entOperLog);
|
ExcelUtil<EntOperLog> util = new ExcelUtil<EntOperLog>(EntOperLog.class);
|
return util.exportExcel(list, "entOperLog");
|
}
|
|
/**
|
* 新增使用次数操作记录
|
*/
|
@GetMapping("/add")
|
public String add()
|
{
|
return prefix + "/add";
|
}
|
|
/**
|
* 新增保存使用次数操作记录
|
*/
|
@RequiresPermissions("exam:entOperLog:add")
|
@Log(title = "使用次数操作记录", businessType = BusinessType.INSERT)
|
@PostMapping("/add")
|
@ResponseBody
|
public AjaxResult addSave(EntOperLog entOperLog)
|
{
|
return toAjax(entOperLogService.insertEntOperLog(entOperLog));
|
}
|
|
/**
|
* 修改使用次数操作记录
|
*/
|
@GetMapping("/edit/{logId}")
|
public String edit(@PathVariable("logId") Long logId, ModelMap mmap)
|
{
|
EntOperLog entOperLog = entOperLogService.selectEntOperLogById(logId);
|
mmap.put("entOperLog", entOperLog);
|
return prefix + "/edit";
|
}
|
|
/**
|
* 修改保存使用次数操作记录
|
*/
|
@RequiresPermissions("exam:entOperLog:edit")
|
@Log(title = "使用次数操作记录", businessType = BusinessType.UPDATE)
|
@PostMapping("/edit")
|
@ResponseBody
|
public AjaxResult editSave(EntOperLog entOperLog)
|
{
|
return toAjax(entOperLogService.updateEntOperLog(entOperLog));
|
}
|
|
/**
|
* 删除使用次数操作记录
|
*/
|
@RequiresPermissions("exam:entOperLog:remove")
|
@Log(title = "使用次数操作记录", businessType = BusinessType.DELETE)
|
@PostMapping( "/remove")
|
@ResponseBody
|
public AjaxResult remove(String ids)
|
{
|
return toAjax(entOperLogService.deleteEntOperLogByIds(ids));
|
}
|
}
|