|
@@ -0,0 +1,97 @@
|
|
|
+package com.miaxis.pc.controller.topic;
|
|
|
+
|
|
|
+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.topic.domain.TopicInfo;
|
|
|
+import com.miaxis.topic.dto.TopicInfoDto;
|
|
|
+import com.miaxis.topic.service.ITopicInfoService;
|
|
|
+import io.swagger.annotations.*;
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 【专题管理】Controller
|
|
|
+ *
|
|
|
+ * @author miaxis
|
|
|
+ * @date 2021-03-11
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequiredArgsConstructor
|
|
|
+@RequestMapping("/topic/info")
|
|
|
+@Api(tags={"【pc-专题管理】"})
|
|
|
+public class TopicInfoController extends BaseController{
|
|
|
+
|
|
|
+ private final ITopicInfoService topicInfoService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询专题列表
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('topic:info: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<TopicInfo> list(@ModelAttribute TopicInfo topicInfo){
|
|
|
+ startPage();
|
|
|
+ List<TopicInfo> list = topicInfoService.selectTopicInfoList(topicInfo);
|
|
|
+ return toResponsePageInfo(list);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取专题详细信息
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('topic:info:query')")
|
|
|
+ @GetMapping(value = "/{id}")
|
|
|
+ @ApiOperation("获取专题详细信息")
|
|
|
+ public Response<TopicInfo> getInfo(
|
|
|
+ @ApiParam(name = "id", value = "专题参数", required = true)
|
|
|
+ @PathVariable("id") Long id
|
|
|
+ ){
|
|
|
+ return Response.success(topicInfoService.getById(id));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增专题
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('topic:info:add')")
|
|
|
+ @Log(title = "专题", businessType = BusinessTypeEnum.INSERT)
|
|
|
+ @PostMapping
|
|
|
+ @ApiOperation("新增专题")
|
|
|
+ public Response<Integer> add(@RequestBody TopicInfoDto topicInfoDto){
|
|
|
+ return topicInfoService.addTopic(topicInfoDto);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改专题
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('topic:info:edit')")
|
|
|
+ @Log(title = "专题", businessType = BusinessTypeEnum.UPDATE)
|
|
|
+ @PutMapping
|
|
|
+ @ApiOperation("修改专题")
|
|
|
+ public Response<Integer> edit(@RequestBody TopicInfo topicInfo){
|
|
|
+ return toResponse(topicInfoService.updateById(topicInfo) ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除专题
|
|
|
+ */
|
|
|
+ @PreAuthorize("@ss.hasPermi('topic:info:remove')")
|
|
|
+ @Log(title = "专题", businessType = BusinessTypeEnum.DELETE)
|
|
|
+ @PutMapping("/{ids}")
|
|
|
+ @ApiOperation("删除专题")
|
|
|
+ public Response<Integer> remove(
|
|
|
+ @ApiParam(name = "ids", value = "专题ids参数", required = true)
|
|
|
+ @PathVariable Long[] ids
|
|
|
+ ){
|
|
|
+ return topicInfoService.removeTopicByIds(ids);
|
|
|
+ }
|
|
|
+}
|