linzhijie
2021-04-12 3a8e1524dcf0eeb610d38123d5f0a3ef838379cd
src/main/java/com/ots/project/exam/controller/TReportTemplateController.java
@@ -6,7 +6,9 @@
import com.ots.framework.web.controller.BaseController;
import com.ots.framework.web.domain.AjaxResult;
import com.ots.framework.web.page.TableDataInfo;
import com.ots.project.exam.domain.EntEmailTemplate;
import com.ots.project.exam.domain.TReportTemplate;
import com.ots.project.exam.service.IEntEmailTemplateService;
import com.ots.project.exam.service.ITReportTemplateService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
@@ -30,6 +32,9 @@
    @Autowired
    private ITReportTemplateService tReportTemplateService;
    @Autowired
    private IEntEmailTemplateService entEmailTemplateService;
    @RequiresPermissions("exam:template:view")
    @GetMapping()
@@ -115,4 +120,31 @@
    public AjaxResult remove(String ids) {
        return toAjax(tReportTemplateService.deleteTReportTemplateByIds(ids));
    }
    /**
     * 邮件模板配置
     * @return
     */
    @RequiresPermissions("exam:email:edit")
    @GetMapping("/emailEdit")
    public String emailEdit(ModelMap mmap) {
        EntEmailTemplate eet = entEmailTemplateService.getOnly();
        mmap.put("emailTemplate",eet);
        return prefix + "/emailEdit";
    }
    /**
     * 新增保存邮件模板配置
     */
    @RequiresPermissions("exam:email:edit")
    @Log(title = "邮件模板配置", businessType = BusinessType.INSERT)
    @PostMapping("/emailEdit")
    @ResponseBody
    public AjaxResult emailEdit(EntEmailTemplate entEmailTemplate) {
        if(entEmailTemplate.getId() == null){
            return error("未初始化模板,联系管理员!");
        }
        return toAjax(entEmailTemplateService.insertEntEmailTemplate(entEmailTemplate));
    }
}