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.EntTestSendtaskMail;
|
import com.ots.project.exam.service.IEntTestSendtaskMailService;
|
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-03-09
|
*/
|
@Controller
|
@RequestMapping("/exam/mail")
|
public class EntTestSendtaskMailController extends BaseController
|
{
|
private String prefix = "exam/mail";
|
|
@Autowired
|
private IEntTestSendtaskMailService entTestSendtaskMailService;
|
|
@RequiresPermissions("exam:mail:view")
|
@GetMapping()
|
public String mail()
|
{
|
return prefix + "/mail";
|
}
|
|
/**
|
* 查询邮箱退信记录列表
|
*/
|
@RequiresPermissions("exam:mail:list")
|
@PostMapping("/list")
|
@ResponseBody
|
public TableDataInfo list(EntTestSendtaskMail entTestSendtaskMail)
|
{
|
startPage();
|
List<EntTestSendtaskMail> list = entTestSendtaskMailService.selectEntTestSendtaskMailList(entTestSendtaskMail);
|
return getDataTable(list);
|
}
|
|
/**
|
* 导出邮箱退信记录列表
|
*/
|
@RequiresPermissions("exam:mail:export")
|
@PostMapping("/export")
|
@ResponseBody
|
public AjaxResult export(EntTestSendtaskMail entTestSendtaskMail)
|
{
|
List<EntTestSendtaskMail> list = entTestSendtaskMailService.selectEntTestSendtaskMailList(entTestSendtaskMail);
|
ExcelUtil<EntTestSendtaskMail> util = new ExcelUtil<EntTestSendtaskMail>(EntTestSendtaskMail.class);
|
return util.exportExcel(list, "mail");
|
}
|
|
/**
|
* 新增邮箱退信记录
|
*/
|
@GetMapping("/add")
|
public String add()
|
{
|
return prefix + "/add";
|
}
|
|
/**
|
* 新增保存邮箱退信记录
|
*/
|
@RequiresPermissions("exam:mail:add")
|
@Log(title = "邮箱退信记录", businessType = BusinessType.INSERT)
|
@PostMapping("/add")
|
@ResponseBody
|
public AjaxResult addSave(EntTestSendtaskMail entTestSendtaskMail)
|
{
|
return toAjax(entTestSendtaskMailService.insertEntTestSendtaskMail(entTestSendtaskMail));
|
}
|
|
/**
|
* 修改邮箱退信记录
|
*/
|
@GetMapping("/edit/{id}")
|
public String edit(@PathVariable("id") Long id, ModelMap mmap)
|
{
|
EntTestSendtaskMail entTestSendtaskMail = entTestSendtaskMailService.selectEntTestSendtaskMailById(id);
|
mmap.put("entTestSendtaskMail", entTestSendtaskMail);
|
return prefix + "/edit";
|
}
|
|
/**
|
* 修改保存邮箱退信记录
|
*/
|
@RequiresPermissions("exam:mail:edit")
|
@Log(title = "邮箱退信记录", businessType = BusinessType.UPDATE)
|
@PostMapping("/edit")
|
@ResponseBody
|
public AjaxResult editSave(EntTestSendtaskMail entTestSendtaskMail)
|
{
|
return toAjax(entTestSendtaskMailService.updateEntTestSendtaskMail(entTestSendtaskMail));
|
}
|
|
/**
|
* 删除邮箱退信记录
|
*/
|
@RequiresPermissions("exam:mail:remove")
|
@Log(title = "邮箱退信记录", businessType = BusinessType.DELETE)
|
@PostMapping( "/remove")
|
@ResponseBody
|
public AjaxResult remove(String ids)
|
{
|
return toAjax(entTestSendtaskMailService.deleteEntTestSendtaskMailByIds(ids));
|
}
|
}
|