index.ts 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import request from '@/config/axios'
  2. // AI 聊天角色 VO
  3. export interface ChatRoleVO {
  4. id: number // 角色编号
  5. modelId: number // 模型编号
  6. name: string // 角色名称
  7. avatar: string // 角色头像
  8. category: string // 角色类别
  9. sort: number // 角色排序
  10. description: string // 角色描述
  11. welcomeMessage: string // 角色欢迎语
  12. systemMessage: string // 角色上下文
  13. publicStatus: boolean // 是否公开
  14. status: number // 状态
  15. }
  16. // AI 聊天角色 API
  17. export const ChatRoleApi = {
  18. // 查询聊天角色分页
  19. getChatRolePage: async (params: any) => {
  20. return await request.get({ url: `/ai/chat-role/page`, params })
  21. },
  22. // 查询聊天角色详情
  23. getChatRole: async (id: number) => {
  24. return await request.get({ url: `/ai/chat-role/get?id=` + id })
  25. },
  26. // 新增聊天角色
  27. createChatRole: async (data: ChatRoleVO) => {
  28. return await request.post({ url: `/ai/chat-role/create`, data })
  29. },
  30. // 修改聊天角色
  31. updateChatRole: async (data: ChatRoleVO) => {
  32. return await request.put({ url: `/ai/chat-role/update`, data })
  33. },
  34. // 删除聊天角色
  35. deleteChatRole: async (id: number) => {
  36. return await request.delete({ url: `/ai/chat-role/delete?id=` + id })
  37. }
  38. }