小么熊🐻 1 year ago
parent
commit
19cbdce235

+ 90 - 0
nbjk-admin/src/main/java/com/miaxis/pc/controller/PcFeedBackController.java

@@ -0,0 +1,90 @@
+package com.miaxis.pc.controller;
+
+import com.miaxis.common.annotation.Log;
+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.feed.domain.FeedBack;
+import com.miaxis.feed.service.IFeedBackService;
+import io.swagger.annotations.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 【意见反馈】Controller
+ *
+ * @author miaxis
+ * @date 2023-05-08
+ */
+@RestController
+@RequestMapping("/feed/back")
+@Api(tags={"【PC-意见反馈】"})
+public class PcFeedBackController extends BaseController{
+    @Autowired
+    private IFeedBackService feedBackService;
+
+    /**
+     * 查询意见反馈列表
+     */
+    @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);
+    }
+    
+
+    /**
+     * 获取意见反馈详细信息
+     */
+    @GetMapping(value = "/{id}")
+    @ApiOperation("获取意见反馈详细信息")
+    public Response<FeedBack> getInfo(
+            @ApiParam(name = "id", value = "意见反馈参数", required = true)
+            @PathVariable("id") Long id
+    ){
+        return Response.success(feedBackService.getById(id));
+    }
+
+    /**
+     * 新增意见反馈
+     */
+    @Log(title = "意见反馈", businessType = BusinessTypeEnum.INSERT)
+    @PostMapping
+    @ApiOperation("新增意见反馈")
+    public Response<Integer> add(@RequestBody FeedBack feedBack){
+        return toResponse(feedBackService.save(feedBack) ? 1 : 0);
+    }
+
+    /**
+     * 修改意见反馈
+     */
+    @Log(title = "意见反馈", businessType = BusinessTypeEnum.UPDATE)
+    @PutMapping
+    @ApiOperation("修改意见反馈")
+    public Response<Integer> edit(@RequestBody FeedBack feedBack){
+        return toResponse(feedBackService.updateById(feedBack) ? 1 : 0);
+    }
+
+    /**
+     * 删除意见反馈
+     */
+    @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);
+    }
+}