liusheng
8 小时以前 732024c03df1d810b8f5a8a526066967f1bfbb5d
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/SmsTempletController.java
@@ -1,13 +1,13 @@
package com.smartor.controller;
package com.ruoyi.web.controller.smartor;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import cn.hutool.core.util.ObjectUtil;
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;
@@ -16,21 +16,20 @@
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;
@@ -38,12 +37,13 @@
     * 查询短信模板列表
     */
    //@PreAuthorize("@ss.hasPermi('smartor:smstemplet:list')")
   @PostMapping("/list")
    public TableDataInfo list(@RequestBody SmsTemplet smsTemplet)
    {
        startPage();
    @PostMapping("/list")
    public Map<String, Object> list(@RequestBody SmsTemplet smsTemplet) {
        //这个不需要分页,一个科室也不会有多少条短信模板
        smsTemplet.setPageNum(null);
        smsTemplet.setPageSize(null);
        List<SmsTemplet> list = smsTempletService.selectSmsTempletList(smsTemplet);
        return getDataTable(list);
        return getDataTable3(ObjectUtil.isNotEmpty(list)?list.size():0, list);
    }
    /**
@@ -52,8 +52,7 @@
    //@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, "短信模板数据");
@@ -64,8 +63,7 @@
     */
    //@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));
    }
@@ -75,8 +73,7 @@
    //@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));
    }
@@ -86,8 +83,7 @@
    //@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));
    }
@@ -96,9 +92,8 @@
     */
    //@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));
    }
}