1 changed files with 0 additions and 104 deletions
@ -1,104 +0,0 @@ |
|||||
package com.chenhai.web.controller.system; |
|
||||
|
|
||||
import java.util.List; |
|
||||
import jakarta.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.chenhai.common.annotation.Log; |
|
||||
import com.chenhai.common.core.controller.BaseController; |
|
||||
import com.chenhai.common.core.domain.AjaxResult; |
|
||||
import com.chenhai.common.enums.BusinessType; |
|
||||
import com.chenhai.system.domain.KnowledgeBase; |
|
||||
import com.chenhai.system.service.IKnowledgeBaseService; |
|
||||
import com.chenhai.common.utils.poi.ExcelUtil; |
|
||||
import com.chenhai.common.core.page.TableDataInfo; |
|
||||
|
|
||||
/** |
|
||||
* 知识库管理Controller |
|
||||
* |
|
||||
* @author ruoyi |
|
||||
* @date 2025-12-30 |
|
||||
*/ |
|
||||
@RestController |
|
||||
@RequestMapping("/system/base") |
|
||||
public class KnowledgeBaseController extends BaseController |
|
||||
{ |
|
||||
@Autowired |
|
||||
private IKnowledgeBaseService knowledgeBaseService; |
|
||||
|
|
||||
/** |
|
||||
* 查询知识库管理列表 |
|
||||
*/ |
|
||||
@PreAuthorize("@ss.hasPermi('system:base:list')") |
|
||||
@GetMapping("/list") |
|
||||
public TableDataInfo list(KnowledgeBase knowledgeBase) |
|
||||
{ |
|
||||
startPage(); |
|
||||
List<KnowledgeBase> list = knowledgeBaseService.selectKnowledgeBaseList(knowledgeBase); |
|
||||
return getDataTable(list); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 导出知识库管理列表 |
|
||||
*/ |
|
||||
@PreAuthorize("@ss.hasPermi('system:base:export')") |
|
||||
@Log(title = "知识库管理", businessType = BusinessType.EXPORT) |
|
||||
@PostMapping("/export") |
|
||||
public void export(HttpServletResponse response, KnowledgeBase knowledgeBase) |
|
||||
{ |
|
||||
List<KnowledgeBase> list = knowledgeBaseService.selectKnowledgeBaseList(knowledgeBase); |
|
||||
ExcelUtil<KnowledgeBase> util = new ExcelUtil<KnowledgeBase>(KnowledgeBase.class); |
|
||||
util.exportExcel(response, list, "知识库管理数据"); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 获取知识库管理详细信息 |
|
||||
*/ |
|
||||
@PreAuthorize("@ss.hasPermi('system:base:query')") |
|
||||
@GetMapping(value = "/{id}") |
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id) |
|
||||
{ |
|
||||
return success(knowledgeBaseService.selectKnowledgeBaseById(id)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 新增知识库管理 |
|
||||
*/ |
|
||||
@PreAuthorize("@ss.hasPermi('system:base:add')") |
|
||||
@Log(title = "知识库管理", businessType = BusinessType.INSERT) |
|
||||
@PostMapping |
|
||||
public AjaxResult add(@RequestBody KnowledgeBase knowledgeBase) |
|
||||
{ |
|
||||
return toAjax(knowledgeBaseService.insertKnowledgeBase(knowledgeBase)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 修改知识库管理 |
|
||||
*/ |
|
||||
@PreAuthorize("@ss.hasPermi('system:base:edit')") |
|
||||
@Log(title = "知识库管理", businessType = BusinessType.UPDATE) |
|
||||
@PutMapping |
|
||||
public AjaxResult edit(@RequestBody KnowledgeBase knowledgeBase) |
|
||||
{ |
|
||||
return toAjax(knowledgeBaseService.updateKnowledgeBase(knowledgeBase)); |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 删除知识库管理 |
|
||||
*/ |
|
||||
@PreAuthorize("@ss.hasPermi('system:base:remove')") |
|
||||
@Log(title = "知识库管理", businessType = BusinessType.DELETE) |
|
||||
@DeleteMapping("/{ids}") |
|
||||
public AjaxResult remove(@PathVariable Long[] ids) |
|
||||
{ |
|
||||
return toAjax(knowledgeBaseService.deleteKnowledgeBaseByIds(ids)); |
|
||||
} |
|
||||
} |
|
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue