| | |
| | | |
| | | 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 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.system.domain.SmsTemplet; |
| | | import com.ruoyi.system.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 |
| | | { |
| | | public class SmsTempletController extends BaseController { |
| | | @Autowired |
| | | private ISmsTempletService smsTempletService; |
| | | |
| | |
| | | * 查询短信模板列表 |
| | | */ |
| | | //@PreAuthorize("@ss.hasPermi('smartor:smstemplet:list')") |
| | | @PostMapping("/list") |
| | | public TableDataInfo list(@RequestBody SmsTemplet smsTemplet) |
| | | { |
| | | @PostMapping("list") |
| | | public TableDataInfo list(@RequestBody SmsTemplet smsTemplet) { |
| | | startPage(); |
| | | List<SmsTemplet> 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) |
| | | { |
| | | public void export(HttpServletResponse response, SmsTemplet smsTemplet) { |
| | | List<SmsTemplet> list = smsTempletService.selectSmsTempletList(smsTemplet); |
| | | ExcelUtil<SmsTemplet> util = new ExcelUtil<SmsTemplet>(SmsTemplet.class); |
| | | util.exportExcel(response, list, "短信模板数据"); |
| | |
| | | */ |
| | | //@PreAuthorize("@ss.hasPermi('smartor:smstemplet:query')") |
| | | @GetMapping(value = "/{templetid}") |
| | | public AjaxResult getInfo(@PathVariable("templetid") Long 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) |
| | | { |
| | | 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) |
| | | { |
| | | 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) |
| | | { |
| | | @GetMapping("/remove/{templetids}") |
| | | public AjaxResult remove(@PathVariable Long[] templetids) { |
| | | return toAjax(smsTempletService.deleteSmsTempletByTempletids(templetids)); |
| | | } |
| | | } |