package com.smartor.controller; 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.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.enums.BusinessType; import com.smartor.domain.SmsTemplet; import com.smartor.service.ISmsTempletService; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; /** * 短信模板Controller * * @author smartor * @date 2023-03-06 */ @RestController @RequestMapping("/smartor/smstemplet") public class SmsTempletController extends BaseController { @Autowired private ISmsTempletService smsTempletService; /** * 查询短信模板列表 */ //@PreAuthorize("@ss.hasPermi('smartor:smstemplet:list')") @PostMapping("/list") public TableDataInfo list(@RequestBody SmsTemplet smsTemplet) { startPage(); List list = smsTempletService.selectSmsTempletList(smsTemplet); return getDataTable(list); } /** * 导出短信模板列表 */ //@PreAuthorize("@ss.hasPermi('smartor:smstemplet:export')") @Log(title = "短信模板", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, SmsTemplet smsTemplet) { List list = smsTempletService.selectSmsTempletList(smsTemplet); ExcelUtil util = new ExcelUtil(SmsTemplet.class); util.exportExcel(response, list, "短信模板数据"); } /** * 获取短信模板详细信息 */ //@PreAuthorize("@ss.hasPermi('smartor:smstemplet:query')") @GetMapping(value = "/{templetid}") public AjaxResult getInfo(@PathVariable("templetid") Long templetid) { return success(smsTempletService.selectSmsTempletByTempletid(templetid)); } /** * 新增短信模板 */ //@PreAuthorize("@ss.hasPermi('smartor:smstemplet:add')") @Log(title = "短信模板", businessType = BusinessType.INSERT) @PostMapping("/add") public AjaxResult add(@RequestBody SmsTemplet smsTemplet) { return toAjax(smsTempletService.insertSmsTemplet(smsTemplet)); } /** * 修改短信模板 */ //@PreAuthorize("@ss.hasPermi('smartor:smstemplet:edit')") @Log(title = "短信模板", businessType = BusinessType.UPDATE) @PostMapping("/edit") public AjaxResult edit(@RequestBody SmsTemplet smsTemplet) { return toAjax(smsTempletService.updateSmsTemplet(smsTemplet)); } /** * 删除短信模板 */ //@PreAuthorize("@ss.hasPermi('smartor:smstemplet:remove')") @Log(title = "短信模板", businessType = BusinessType.DELETE) @GetMapping("/remove/{templetids}") public AjaxResult remove(@PathVariable Long[] templetids) { return toAjax(smsTempletService.deleteSmsTempletByTempletids(templetids)); } }