index.ts 897 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import request from '@/config/axios'
  2. // AI 工具 VO
  3. export interface ToolVO {
  4. id: number // 工具编号
  5. name: string // 工具名称
  6. description: string // 工具描述
  7. status: number // 状态
  8. }
  9. // AI 工具 API
  10. export const ToolApi = {
  11. // 查询工具分页
  12. getToolPage: async (params: any) => {
  13. return await request.get({ url: `/ai/tool/page`, params })
  14. },
  15. // 查询工具详情
  16. getTool: async (id: number) => {
  17. return await request.get({ url: `/ai/tool/get?id=` + id })
  18. },
  19. // 新增工具
  20. createTool: async (data: ToolVO) => {
  21. return await request.post({ url: `/ai/tool/create`, data })
  22. },
  23. // 修改工具
  24. updateTool: async (data: ToolVO) => {
  25. return await request.put({ url: `/ai/tool/update`, data })
  26. },
  27. // 删除工具
  28. deleteTool: async (id: number) => {
  29. return await request.delete({ url: `/ai/tool/delete?id=` + id })
  30. }
  31. }