api.ts 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import { request } from '/@/utils/service';
  2. import { UserPageQuery, AddReq, DelReq, EditReq, InfoReq } from '@fast-crud/fast-crud';
  3. export const apiPrefix = '/api/system/digital_human/';
  4. export function GetList(query: UserPageQuery) {
  5. return request({
  6. url: apiPrefix,
  7. method: 'get',
  8. params: {...query,tenant_id:1},
  9. });
  10. }
  11. export function GetObj(id: InfoReq) {
  12. return request({
  13. url: apiPrefix + id,
  14. method: 'get',
  15. });
  16. }
  17. export function AddObj(obj: AddReq) {
  18. return request({
  19. url: '/api/system/digital_human/create',
  20. method: 'post',
  21. data: {...obj,tenant_id:1},
  22. });
  23. }
  24. export function UpdateObj(obj: EditReq) {
  25. return request({
  26. url:"/api/system/digital_human/update",// apiPrefix + obj.id + '/',
  27. method: 'post',
  28. data: {...obj,tenant_id:1},
  29. });
  30. }
  31. export function DelObj(id: DelReq) {
  32. return request({
  33. url: apiPrefix + id + '/',
  34. method: 'delete',
  35. data: { id, tenant_id: 1 },
  36. });
  37. }
  38. export function GetPermission() {
  39. return request({
  40. url: apiPrefix,
  41. method: 'get',
  42. });
  43. }
  44. /* 获取语音列表 */
  45. export function GetVoiceList() {
  46. return request({
  47. url: '/api/system/digital_human/voice_types',
  48. method: 'get',
  49. });
  50. }
  51. /* 生成预览数字人 */
  52. export function createDemo(obj:any) {
  53. return request({
  54. url: '/api/system/digital_human/generate_demo',
  55. method: 'post',
  56. data: {...obj,tenant_id:1},
  57. });
  58. }