index.ts 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. systemMessage: string // 角色设定
  12. publicStatus: boolean // 是否公开
  13. status: number // 状态
  14. }
  15. // AI 聊天角色 分页请求 vo
  16. export interface ChatRolePageReqVO {
  17. name?: string // 角色名称
  18. category?: string // 角色类别
  19. publicStatus: boolean // 是否公开
  20. pageNo: number // 是否公开
  21. pageSize: number // 是否公开
  22. }
  23. // AI 聊天角色 API
  24. export const ChatRoleApi = {
  25. // 查询聊天角色分页
  26. getChatRolePage: async (params: any) => {
  27. return await request.get({ url: `/ai/chat-role/page`, params })
  28. },
  29. // 查询聊天角色详情
  30. getChatRole: async (id: number) => {
  31. return await request.get({ url: `/ai/chat-role/get?id=` + id })
  32. },
  33. // 新增聊天角色
  34. createChatRole: async (data: ChatRoleVO) => {
  35. return await request.post({ url: `/ai/chat-role/create`, data })
  36. },
  37. // 修改聊天角色
  38. updateChatRole: async (data: ChatRoleVO) => {
  39. return await request.put({ url: `/ai/chat-role/update`, data })
  40. },
  41. // 删除聊天角色
  42. deleteChatRole: async (id: number) => {
  43. return await request.delete({ url: `/ai/chat-role/delete?id=` + id })
  44. },
  45. // 获取 my role
  46. getMyPage: async (params: ChatRolePageReqVO) => {
  47. return await request.get({ url: `/ai/chat-role/my-page`, params})
  48. },
  49. // 获取角色分类
  50. getCategoryList: async () => {
  51. return await request.get({ url: `/ai/chat-role/category-list`})
  52. }
  53. }