package com.ruoyi.mall.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.ruoyi.mall.domain.QuestionFeedback; import com.ruoyi.mall.service.IQuestionFeedbackService; import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.core.page.TableDataInfo; /** * 问题反馈Controller * * @author ruoyi * @date 2023-10-25 */ @RestController @RequestMapping("/mall/feedback") public class QuestionFeedbackController extends BaseController { @Autowired private IQuestionFeedbackService questionFeedbackService; /** * 查询问题反馈列表 */ @PreAuthorize("@ss.hasPermi('mall:feedback:list')") @GetMapping("/list") public TableDataInfo list(QuestionFeedback questionFeedback) { startPage(); List list = questionFeedbackService.selectQuestionFeedbackList(questionFeedback); return getDataTable(list); } /** * 导出问题反馈列表 */ @PreAuthorize("@ss.hasPermi('mall:feedback:export')") @Log(title = "问题反馈", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, QuestionFeedback questionFeedback) { List list = questionFeedbackService.selectQuestionFeedbackList(questionFeedback); ExcelUtil util = new ExcelUtil(QuestionFeedback.class); util.exportExcel(response, list, "问题反馈数据"); } /** * 获取问题反馈详细信息 */ @PreAuthorize("@ss.hasPermi('mall:feedback:query')") @GetMapping(value = "/{feedbackId}") public AjaxResult getInfo(@PathVariable("feedbackId") Long feedbackId) { return AjaxResult.success(questionFeedbackService.selectQuestionFeedbackByFeedbackId(feedbackId)); } /** * 新增问题反馈 */ @PreAuthorize("@ss.hasPermi('mall:feedback:add')") @Log(title = "问题反馈", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody QuestionFeedback questionFeedback) { return toAjax(questionFeedbackService.insertQuestionFeedback(questionFeedback)); } /** * 修改问题反馈 */ @PreAuthorize("@ss.hasPermi('mall:feedback:edit')") @Log(title = "问题反馈", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody QuestionFeedback questionFeedback) { return toAjax(questionFeedbackService.updateQuestionFeedback(questionFeedback)); } /** * 删除问题反馈 */ @PreAuthorize("@ss.hasPermi('mall:feedback:remove')") @Log(title = "问题反馈", businessType = BusinessType.DELETE) @DeleteMapping("/{feedbackIds}") public AjaxResult remove(@PathVariable Long[] feedbackIds) { return toAjax(questionFeedbackService.deleteQuestionFeedbackByFeedbackIds(feedbackIds)); } }