知识库 下拉菜单

This commit is contained in:
ire 2024-12-31 10:43:26 +08:00
parent 9685fb9745
commit 23bc3d3190
3 changed files with 16 additions and 0 deletions

View File

@ -77,6 +77,14 @@ public class KnowledgeBaseController {
return success(BeanUtils.toBean(pageResult, KnowledgeBaseRespVO.class));
}
@GetMapping("/list")
@Operation(summary = "获得知识库分页")
@PreAuthorize("@ss.hasPermission('llm:knowledge-base:query')")
public CommonResult<List<KnowledgeBaseRespVO>> getKnowledgeBaseList() {
List<KnowledgeBaseDO> list = knowledgeBaseService.getKnowledgeBaseList();
return success(BeanUtils.toBean(list, KnowledgeBaseRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出知识库 Excel")
@PreAuthorize("@ss.hasPermission('llm:knowledge-base:export')")

View File

@ -6,6 +6,7 @@ import cn.iocoder.yudao.module.llm.controller.admin.knowledgebase.vo.KnowledgeBa
import cn.iocoder.yudao.module.llm.dal.dataobject.knowledgebase.KnowledgeBaseDO;
import javax.validation.Valid;
import java.util.List;
/**
* 知识库 Service 接口
@ -52,4 +53,5 @@ public interface KnowledgeBaseService {
*/
PageResult<KnowledgeBaseDO> getKnowledgeBasePage(KnowledgeBasePageReqVO pageReqVO);
List<KnowledgeBaseDO> getKnowledgeBaseList();
}

View File

@ -13,6 +13,7 @@ import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionU
import static cn.iocoder.yudao.module.llm.enums.ErrorCodeConstants.KNOWLEDGE_BASE_NOT_EXISTS;
import javax.annotation.Resource;
import java.util.List;
/**
* 知识库 Service 实现类
@ -68,4 +69,9 @@ public class KnowledgeBaseServiceImpl implements KnowledgeBaseService {
return knowledgeBaseMapper.selectPage(pageReqVO);
}
@Override
public List<KnowledgeBaseDO> getKnowledgeBaseList() {
return knowledgeBaseMapper.selectList();
}
}