unifiedKnowledge.js 958 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import request from '@/utils/request'
  2. // 统一知识库 API(knowledge_base_section 各模块概览 / 查看 / 保存 / 重置)
  3. // 模块概览:返回 [{ moduleKey, moduleName, size, updatedAt, version }]
  4. export function getUnifiedOverview() {
  5. return request({
  6. url: '/api/admin/knowledge-base/unified/overview',
  7. method: 'post'
  8. })
  9. }
  10. // 查看单个模块原始 JSON 内容
  11. export function getUnifiedSection(moduleKey) {
  12. return request({
  13. url: '/api/admin/knowledge-base/unified/section',
  14. method: 'post',
  15. data: { moduleKey }
  16. })
  17. }
  18. // 保存模块内容并热重载
  19. export function updateUnifiedModule(data) {
  20. return request({
  21. url: '/api/admin/knowledge-base/unified/update',
  22. method: 'post',
  23. data
  24. })
  25. }
  26. // 从 classpath 种子重置模块
  27. export function resetUnifiedModule(moduleKey) {
  28. return request({
  29. url: '/api/admin/knowledge-base/unified/reset',
  30. method: 'post',
  31. data: { moduleKey }
  32. })
  33. }