package com.ltkj.web.controller.system; import java.util.List; import javax.servlet.http.HttpServletResponse; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.ltkj.common.annotation.Log; import com.ltkj.common.core.controller.BaseController; import com.ltkj.common.core.domain.AjaxResult; import com.ltkj.common.enums.BusinessType; import com.ltkj.hosp.domain.TjSendTemplate; import com.ltkj.hosp.service.ITjSendTemplateService; import com.ltkj.common.utils.poi.ExcelUtil; import com.ltkj.common.core.page.TableDataInfo; /** * 邮件短信模板Controller * * @author ltkj_赵佳豪&李格 * @date 2023-05-15 */ @RestController @RequestMapping("/hosp/sendTemplate") public class TjSendTemplateController extends BaseController { @Autowired private ITjSendTemplateService tjSendTemplateService; /** * 查询邮件短信模板列表 */ //@PreAuthorize("@ss.hasPermi('hosp:sendTemplate:list')") @GetMapping("/list") public TableDataInfo list(TjSendTemplate tjSendTemplate) { startPage(); List list = tjSendTemplateService.selectTjSendTemplateList(tjSendTemplate); return getDataTable(list); } /** * 导出邮件短信模板列表 */ //@PreAuthorize("@ss.hasPermi('hosp:sendTemplate:export')") @Log(title = "邮件短信模板", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, TjSendTemplate tjSendTemplate) { List list = tjSendTemplateService.selectTjSendTemplateList(tjSendTemplate); ExcelUtil util = new ExcelUtil(TjSendTemplate.class); util.exportExcel(response, list, "邮件短信模板数据"); } /** * 获取邮件短信模板详细信息 */ //@PreAuthorize("@ss.hasPermi('hosp:sendTemplate:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return success(tjSendTemplateService.selectTjSendTemplateById(id)); } /** * 新增邮件短信模板 */ //@PreAuthorize("@ss.hasPermi('hosp:sendTemplate:add')") @Log(title = "邮件短信模板", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody TjSendTemplate tjSendTemplate) { return toAjax(tjSendTemplateService.insertTjSendTemplate(tjSendTemplate)); } /** * 修改邮件短信模板 */ //@PreAuthorize("@ss.hasPermi('hosp:sendTemplate:edit')") @Log(title = "邮件短信模板", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody TjSendTemplate tjSendTemplate) { return toAjax(tjSendTemplateService.updateTjSendTemplate(tjSendTemplate)); } /** * 删除邮件短信模板 */ //@PreAuthorize("@ss.hasPermi('hosp:sendTemplate:remove')") @Log(title = "邮件短信模板", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(tjSendTemplateService.deleteTjSendTemplateByIds(ids)); } }