|
|
|
@ -4,11 +4,13 @@ import com.alops.chat.entity.KnowledgeEntity; |
|
|
|
import com.alops.chat.entity.UploadedFile; |
|
|
|
import com.alops.chat.entity.UploadedFile; |
|
|
|
import com.alops.chat.service.KnowledgeService; |
|
|
|
import com.alops.chat.service.KnowledgeService; |
|
|
|
import com.alops.chat.service.UploadedFileService; |
|
|
|
import com.alops.chat.service.UploadedFileService; |
|
|
|
|
|
|
|
import com.alops.common.annotation.Log; |
|
|
|
import com.alops.common.constant.HttpStatus; |
|
|
|
import com.alops.common.constant.HttpStatus; |
|
|
|
import com.alops.common.core.controller.BaseController; |
|
|
|
import com.alops.common.core.controller.BaseController; |
|
|
|
import com.alops.common.core.domain.AjaxResult; |
|
|
|
import com.alops.common.core.domain.AjaxResult; |
|
|
|
import com.alops.common.core.page.TableDataInfo; |
|
|
|
import com.alops.common.core.page.TableDataInfo; |
|
|
|
import com.alops.common.config.RuoYiConfig; |
|
|
|
import com.alops.common.config.RuoYiConfig; |
|
|
|
|
|
|
|
import com.alops.common.enums.BusinessType; |
|
|
|
import com.alops.common.utils.file.FileUploadUtils; |
|
|
|
import com.alops.common.utils.file.FileUploadUtils; |
|
|
|
import com.alops.common.utils.file.MimeTypeUtils; |
|
|
|
import com.alops.common.utils.file.MimeTypeUtils; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
@ -61,6 +63,7 @@ public class KnowLedgeController extends BaseController { |
|
|
|
|
|
|
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('QandA:knowledge:uploadfile')") |
|
|
|
@PreAuthorize("@ss.hasPermi('QandA:knowledge:uploadfile')") |
|
|
|
@PostMapping("/upload") |
|
|
|
@PostMapping("/upload") |
|
|
|
|
|
|
|
@Log(title = "上传并处理文本文档", businessType = BusinessType.INSERT) |
|
|
|
@ApiOperation("上传并处理文本文档") |
|
|
|
@ApiOperation("上传并处理文本文档") |
|
|
|
public AjaxResult uploadFile( |
|
|
|
public AjaxResult uploadFile( |
|
|
|
@RequestPart("file") |
|
|
|
@RequestPart("file") |
|
|
|
@ -168,6 +171,7 @@ public class KnowLedgeController extends BaseController { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@PreAuthorize("@ss.hasPermi('QandA:knowledge:upload')") |
|
|
|
@PreAuthorize("@ss.hasPermi('QandA:knowledge:upload')") |
|
|
|
@PostMapping("/add-knowledge") |
|
|
|
@PostMapping("/add-knowledge") |
|
|
|
|
|
|
|
@Log(title = "添加知识条目接口", businessType = BusinessType.INSERT) |
|
|
|
@ApiOperation("添加知识条目接口") |
|
|
|
@ApiOperation("添加知识条目接口") |
|
|
|
public AjaxResult addKnowledge( |
|
|
|
public AjaxResult addKnowledge( |
|
|
|
@RequestParam String content, |
|
|
|
@RequestParam String content, |
|
|
|
@ -189,6 +193,7 @@ public class KnowLedgeController extends BaseController { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@PreAuthorize("@ss.hasPermi('QandA:knowledge:permquery')") |
|
|
|
@PreAuthorize("@ss.hasPermi('QandA:knowledge:permquery')") |
|
|
|
@GetMapping("/permanent-knowledge") |
|
|
|
@GetMapping("/permanent-knowledge") |
|
|
|
|
|
|
|
@Log(title = "获取所有正式知识条目", businessType = BusinessType.SELECT) |
|
|
|
@ApiOperation("获取所有正式知识条目") |
|
|
|
@ApiOperation("获取所有正式知识条目") |
|
|
|
public TableDataInfo getPermanentKnowledge() { |
|
|
|
public TableDataInfo getPermanentKnowledge() { |
|
|
|
startPage(); // 开启分页
|
|
|
|
startPage(); // 开启分页
|
|
|
|
@ -203,6 +208,7 @@ public class KnowLedgeController extends BaseController { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@PreAuthorize("@ss.hasPermi('QandA:knowledge:filelist')") |
|
|
|
@PreAuthorize("@ss.hasPermi('QandA:knowledge:filelist')") |
|
|
|
@GetMapping("/uploaded-files") |
|
|
|
@GetMapping("/uploaded-files") |
|
|
|
|
|
|
|
@Log(title = "获取所有上传文档", businessType = BusinessType.SELECT) |
|
|
|
@ApiOperation("获取所有上传文档") |
|
|
|
@ApiOperation("获取所有上传文档") |
|
|
|
public TableDataInfo getUploadedFiles() { |
|
|
|
public TableDataInfo getUploadedFiles() { |
|
|
|
startPage(); // 开启分页
|
|
|
|
startPage(); // 开启分页
|
|
|
|
@ -220,6 +226,7 @@ public class KnowLedgeController extends BaseController { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@PreAuthorize("@ss.hasPermi('QandA:knowledge:update')") |
|
|
|
@PreAuthorize("@ss.hasPermi('QandA:knowledge:update')") |
|
|
|
@PutMapping("/update-knowledge") |
|
|
|
@PutMapping("/update-knowledge") |
|
|
|
|
|
|
|
@Log(title = "更新知识条目", businessType = BusinessType.INSERT) |
|
|
|
@ApiOperation("更新知识条目") |
|
|
|
@ApiOperation("更新知识条目") |
|
|
|
public AjaxResult updateKnowledge( |
|
|
|
public AjaxResult updateKnowledge( |
|
|
|
@RequestParam Long id, |
|
|
|
@RequestParam Long id, |
|
|
|
@ -246,6 +253,7 @@ public class KnowLedgeController extends BaseController { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@PreAuthorize("@ss.hasPermi('QandA:knowledge:del')") |
|
|
|
@PreAuthorize("@ss.hasPermi('QandA:knowledge:del')") |
|
|
|
@DeleteMapping("/knowledge/{id}") |
|
|
|
@DeleteMapping("/knowledge/{id}") |
|
|
|
|
|
|
|
@Log(title = "删除知识条目接口", businessType = BusinessType.DELETE) |
|
|
|
@ApiOperation("删除知识条目接口") |
|
|
|
@ApiOperation("删除知识条目接口") |
|
|
|
public AjaxResult deleteKnowledge(@PathVariable Long id) { |
|
|
|
public AjaxResult deleteKnowledge(@PathVariable Long id) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
@ -268,6 +276,7 @@ public class KnowLedgeController extends BaseController { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@ApiOperation("删除上传文件信息") |
|
|
|
@ApiOperation("删除上传文件信息") |
|
|
|
@PreAuthorize("@ss.hasPermi('QandA:knowledge:filedel')") |
|
|
|
@PreAuthorize("@ss.hasPermi('QandA:knowledge:filedel')") |
|
|
|
|
|
|
|
@Log(title = "删除上传文件信息", businessType = BusinessType.DELETE) |
|
|
|
@DeleteMapping("/uploaded-files/{id}") |
|
|
|
@DeleteMapping("/uploaded-files/{id}") |
|
|
|
public AjaxResult deleteUploadedFile(@PathVariable Long id) { |
|
|
|
public AjaxResult deleteUploadedFile(@PathVariable Long id) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
|