| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- package com.xunmei.system.controller;
- import java.util.List;
- import java.io.IOException;
- import javax.servlet.http.HttpServletResponse;
- 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.xunmei.common.log.annotation.Log;
- import com.xunmei.common.log.enums.BusinessType;
- import com.xunmei.common.security.annotation.RequiresPermissions;
- import com.xunmei.system.domain.SysKnowledge;
- import com.xunmei.system.service.ISysKnowledgeService;
- import com.xunmei.common.core.web.controller.BaseController;
- import com.xunmei.common.core.web.domain.AjaxResult;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
- import com.xunmei.common.core.web.page.TableDataInfo;
- /**
- * 知识库标签Controller
- *
- * @author xunmei
- * @date 2023-08-21
- */
- @Api(tags = {"SysKnowledge" })
- @RestController
- @RequestMapping("/knowledge")
- public class SysKnowledgeController extends BaseController {
- @Autowired
- private ISysKnowledgeService sysKnowledgeService;
- /**
- * 查询知识库标签列表
- */
- @ApiOperation(value = "查询SysKnowledge列表")
- @RequiresPermissions("system:knowledge:list")
- @GetMapping("/list")
- public TableDataInfo list(SysKnowledge sysKnowledge) {
- return sysKnowledgeService.selectPage( sysKnowledge);
- }
- /**
- * 获取知识库标签详细信息
- */
- @ApiOperation(value = "获取SysKnowledge详细信息")
- @RequiresPermissions("system:knowledge:query")
- @GetMapping(value = "/{id}")
- public AjaxResult getInfo(@PathVariable("id") Long id) {
- return success(sysKnowledgeService.selectSysKnowledgeById(id));
- }
- /**
- * 新增知识库标签
- */
- @ApiOperation(value = "新增SysKnowledge")
- @RequiresPermissions("system:knowledge:add")
- @Log(title = "知识库标签" , businessType = BusinessType.INSERT)
- @PostMapping
- public AjaxResult add(@RequestBody SysKnowledge sysKnowledge) {
- return toAjax(sysKnowledgeService.insertSysKnowledge(sysKnowledge));
- }
- /**
- * 修改知识库标签
- */
- @ApiOperation(value = "修改SysKnowledge")
- @RequiresPermissions("system:knowledge:edit")
- @Log(title = "知识库标签" , businessType = BusinessType.UPDATE)
- @PutMapping
- public AjaxResult edit(@RequestBody SysKnowledge sysKnowledge) {
- return toAjax(sysKnowledgeService.updateSysKnowledge(sysKnowledge));
- }
- /**
- * 删除知识库标签
- */
- @ApiOperation(value = "删除SysKnowledge")
- @RequiresPermissions("system:knowledge:remove")
- @Log(title = "知识库标签" , businessType = BusinessType.DELETE)
- @DeleteMapping("/{ids}")
- public AjaxResult remove(@PathVariable Long[] ids) {
- return toAjax(sysKnowledgeService.deleteSysKnowledgeByIds(ids));
- }
- }
|