package com.zc.business.controller; import java.util.List; import javax.servlet.http.HttpServletResponse; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; 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.zc.business.domain.DcPublishInfo; import com.zc.business.service.IDcPublishInfoService; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; /** * 信息发布记录Controller * * @author ruoyi * @date 2024-01-04 */ @Api(value = "信息发布记录",tags = {"信息发布记录"}) @RestController @RequestMapping("/business/dcPublishInfo") public class DcPublishInfoController extends BaseController { @Autowired private IDcPublishInfoService dcPublishInfoService; /** * 查询 信息发布记录列表 */ @ApiOperation("查询信息发布记录列表") // @PreAuthorize("@ss.hasPermi('business:dcPublishInfo:list')") @GetMapping("/list") public TableDataInfo list(DcPublishInfo dcPublishInfo) { startPage(); List list = dcPublishInfoService.selectDcPublishInfoList(dcPublishInfo); return getDataTable(list); } /** * 导出 信息发布记录列表 */ @ApiOperation("导出信息发布记录") // @PreAuthorize("@ss.hasPermi('business:dcPublishInfo:export')") @Log(title = " 信息发布记录", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, DcPublishInfo dcPublishInfo) { List list = dcPublishInfoService.selectDcPublishInfoList(dcPublishInfo); ExcelUtil util = new ExcelUtil<>(DcPublishInfo.class); util.exportExcel(response, list, " 信息发布记录数据"); } /** * 获取 信息发布记录详细信息 */ @ApiOperation("获取 信息发布记录详细信息") // @PreAuthorize("@ss.hasPermi('business:dcPublishInfo:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") @ApiParam(name = "id", value = "id", required = true) Long id) { return AjaxResult.success(dcPublishInfoService.selectDcPublishInfoById(id)); } /** * 新增 信息发布记录 */ @ApiOperation("新增 信息发布记录") // @PreAuthorize("@ss.hasPermi('business:dcPublishInfo:add')") @Log(title = " 信息发布记录", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody DcPublishInfo dcPublishInfo) { return toAjax(dcPublishInfoService.insertDcPublishInfo(dcPublishInfo)); } /** * 修改 信息发布记录 */ @ApiOperation("修改 信息发布记录") // @PreAuthorize("@ss.hasPermi('business:dcPublishInfo:edit')") @Log(title = " 信息发布记录", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody DcPublishInfo dcPublishInfo) { return toAjax(dcPublishInfoService.updateDcPublishInfo(dcPublishInfo)); } /** * 删除 信息发布记录 */ @ApiOperation("删除 信息发布记录") // @PreAuthorize("@ss.hasPermi('business:dcPublishInfo:remove')") @Log(title = " 信息发布记录", businessType = BusinessType.DELETE) @DeleteMapping("/{id}") public AjaxResult remove(@PathVariable @ApiParam(name = "id", value = "id", required = true) Long id) { return toAjax(dcPublishInfoService.deleteDcPublishInfoById(id)); } }