package com.ruoyi.web.controller.smartor; 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.SmsRecords; import com.smartor.service.ISmsRecordsService; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; /** * 短信记录Controller * * @author smartor * @date 2023-03-06 */ @RestController @RequestMapping("/smartor/smsrecords") public class SmsRecordsController extends BaseController { @Autowired private ISmsRecordsService smsRecordsService; /** * 查询短信记录列表 */ //@PreAuthorize("@ss.hasPermi('smartor:smsrecords:list')") @PostMapping("/list") public TableDataInfo list(@RequestBody SmsRecords smsRecords) { startPage(); List list = smsRecordsService.selectSmsRecordsList(smsRecords); return getDataTable(list); } /** * 导出短信记录列表 */ //@PreAuthorize("@ss.hasPermi('smartor:smsrecords:export')") @Log(title = "短信记录", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, SmsRecords smsRecords) { List list = smsRecordsService.selectSmsRecordsList(smsRecords); ExcelUtil util = new ExcelUtil(SmsRecords.class); util.exportExcel(response, list, "短信记录数据"); } /** * 获取短信记录详细信息 */ //@PreAuthorize("@ss.hasPermi('smartor:smsrecords:query')") @GetMapping(value = "/{recordid}") public AjaxResult getInfo(@PathVariable("recordid") Long recordid) { return success(smsRecordsService.selectSmsRecordsByRecordid(recordid)); } /** * 新增短信记录 */ //@PreAuthorize("@ss.hasPermi('smartor:smsrecords:add')") @Log(title = "短信记录", businessType = BusinessType.INSERT) @PostMapping("/add") public AjaxResult add(@RequestBody SmsRecords smsRecords) { return toAjax(smsRecordsService.insertSmsRecords(smsRecords)); } /** * 修改短信记录 */ //@PreAuthorize("@ss.hasPermi('smartor:smsrecords:edit')") @Log(title = "短信记录", businessType = BusinessType.UPDATE) @PostMapping("/edit") public AjaxResult edit(@RequestBody SmsRecords smsRecords) { return toAjax(smsRecordsService.updateSmsRecords(smsRecords)); } /** * 删除短信记录 */ //@PreAuthorize("@ss.hasPermi('smartor:smsrecords:remove')") @Log(title = "短信记录", businessType = BusinessType.DELETE) @GetMapping("/remove/{recordids}") public AjaxResult remove(@PathVariable Long[] recordids) { return toAjax(smsRecordsService.deleteSmsRecordsByRecordids(recordids)); } }