|
@@ -0,0 +1,110 @@
|
|
|
+package com.miaxis.app.controller.feed;
|
|
|
+
|
|
|
+import com.miaxis.common.annotation.Log;
|
|
|
+import com.miaxis.common.constant.Constants;
|
|
|
+import com.miaxis.common.core.controller.BaseController;
|
|
|
+import com.miaxis.common.core.domain.Response;
|
|
|
+import com.miaxis.common.core.page.ResponsePageInfo;
|
|
|
+import com.miaxis.common.enums.BusinessTypeEnum;
|
|
|
+import com.miaxis.common.utils.poi.ExcelUtil;
|
|
|
+import com.miaxis.feed.domain.FeedBack;
|
|
|
+import com.miaxis.feed.service.IFeedBackService;
|
|
|
+import io.swagger.annotations.*;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.Arrays;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 【意见反馈】Controller
|
|
|
+ *
|
|
|
+ * @author miaxis
|
|
|
+ * @date 2023-05-08
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping(Constants.STUDENT_PREFIX +"/feed/back")
|
|
|
+@Api(tags={"【app-意见反馈】"})
|
|
|
+public class FeedBackController extends BaseController{
|
|
|
+ @Autowired
|
|
|
+ private IFeedBackService feedBackService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询意见反馈列表
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('feed:back:list')")
|
|
|
+ @GetMapping("/list")
|
|
|
+ @ApiOperation("查询意见反馈列表")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(name = "pageNum",value = "当前页码" ,dataType = "int", paramType = "query", required = false),
|
|
|
+ @ApiImplicitParam(name = "pageSize",value = "每页数据量" , dataType = "int", paramType = "query", required = false),
|
|
|
+ })
|
|
|
+ public ResponsePageInfo<FeedBack> list(@ModelAttribute FeedBack feedBack){
|
|
|
+ startPage();
|
|
|
+ List<FeedBack> list = feedBackService.selectFeedBackList(feedBack);
|
|
|
+ return toResponsePageInfo(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 导出意见反馈列表
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('feed:back:export')")
|
|
|
+ @Log(title = "意见反馈", businessType = BusinessTypeEnum.EXPORT)
|
|
|
+ @GetMapping("/export")
|
|
|
+ @ApiOperation("导出意见反馈列表Excel")
|
|
|
+ public Response<String> export(@ModelAttribute FeedBack feedBack){
|
|
|
+ List<FeedBack> list = feedBackService.selectFeedBackList(feedBack);
|
|
|
+ ExcelUtil<FeedBack> util = new ExcelUtil<FeedBack>(FeedBack.class);
|
|
|
+ return util.exportExcel(list, "back");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取意见反馈详细信息
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('feed:back:query')")
|
|
|
+ @GetMapping(value = "/{id}")
|
|
|
+ @ApiOperation("获取意见反馈详细信息")
|
|
|
+ public Response<FeedBack> getInfo(
|
|
|
+ @ApiParam(name = "id", value = "意见反馈参数", required = true)
|
|
|
+ @PathVariable("id") Long id
|
|
|
+ ){
|
|
|
+ return Response.success(feedBackService.getById(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增意见反馈
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('feed:back:add')")
|
|
|
+ @Log(title = "意见反馈", businessType = BusinessTypeEnum.INSERT)
|
|
|
+ @PostMapping
|
|
|
+ @ApiOperation("新增意见反馈")
|
|
|
+ public Response<Integer> add(@RequestBody FeedBack feedBack){
|
|
|
+ return toResponse(feedBackService.save(feedBack) ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改意见反馈
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('feed:back:edit')")
|
|
|
+ @Log(title = "意见反馈", businessType = BusinessTypeEnum.UPDATE)
|
|
|
+ @PutMapping
|
|
|
+ @ApiOperation("修改意见反馈")
|
|
|
+ public Response<Integer> edit(@RequestBody FeedBack feedBack){
|
|
|
+ return toResponse(feedBackService.updateById(feedBack) ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除意见反馈
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('feed:back:remove')")
|
|
|
+ @Log(title = "意见反馈", businessType = BusinessTypeEnum.DELETE)
|
|
|
+ @DeleteMapping("/{ids}")
|
|
|
+ @ApiOperation("删除意见反馈")
|
|
|
+ public Response<Integer> remove(
|
|
|
+ @ApiParam(name = "ids", value = "意见反馈ids参数", required = true)
|
|
|
+ @PathVariable Long[] ids
|
|
|
+ ){
|
|
|
+ return toResponse(feedBackService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
|
|
|
+ }
|
|
|
+}
|