api.ts 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. import { request } from '/@/utils/service';
  2. import { UserPageQuery, AddReq, DelReq, EditReq, InfoReq,PageQuery } from '@fast-crud/fast-crud';
  3. /* 获取胜任力标签 */
  4. export function GetCompetencyList(query: UserPageQuery) {
  5. return request({
  6. url: '/api/system/competency/list',
  7. method: 'get',
  8. params: {...query,tenant_id:1},
  9. });
  10. }
  11. /* 获取题库列表 */
  12. export function GetQuestionList(query: PageQuery) {
  13. return request({
  14. url: '/api/system/interview_question/list',
  15. method: 'get',
  16. params: {...query,tenant_id:1},/* :Session.get('tenant_id').tenant_id || ,tenant_id:'1' */
  17. });
  18. }
  19. /* 根据职位及胜任力标签生成题目 */
  20. export function GenerateQuestions(obj: AddReq) {
  21. return request({
  22. url: '/api/system/interview_question/ai_generated',
  23. method: 'post',
  24. data: {...obj,tenant_id:1},
  25. timeout: 0
  26. });
  27. }
  28. /* 获取生成题目的列表 */
  29. export function GetDraftList(obj: EditReq) {
  30. return request({
  31. url: `/api/system/interview_question/draft_list?tenant_id=${obj.tenant_id}&position_id=${obj.position_id}`,
  32. method: 'get',
  33. });
  34. }
  35. /* 暂存生成的题目 */
  36. export function SaveDraft(obj: EditReq) {
  37. return request({
  38. url: `/api/system/interview_question/confirm_draft`,
  39. method: 'post',
  40. data: {...obj,tenant_id:1},
  41. });
  42. }
  43. /* 获取数字人列表 */
  44. export function GetDigitalList(obj: EditReq) {
  45. return request({
  46. url: `/api/system/digital_human/`,
  47. method: 'get',
  48. params: {...obj,tenant_id:1},
  49. });
  50. }
  51. /* 创建配置 */
  52. export function CreateConfig(data:any) {
  53. return request({
  54. url:`/api/system/job_config/list`,
  55. method: 'post',
  56. data: {...data,tenant_id:1},
  57. });
  58. }
  59. /* 更新配置 */
  60. export function UpdateConfig(data:any) {
  61. return request({
  62. url:`/api/system/job_config/detail/${data.id}`,
  63. method: 'put',
  64. data: {...data,tenant_id:1},
  65. });
  66. }
  67. /* 获取当前配置 */
  68. export function GetConfig(id:any) {
  69. return request({
  70. url:`/api/system/job_config/position/detail/${id}`,
  71. method: 'get',
  72. });
  73. }
  74. /* 绑定职位问题 */
  75. export function AddDocument(obj: AddReq) {
  76. return request({
  77. url: 'api/system/job/add_question',
  78. method: 'post',
  79. data: {...obj,tenant_id:"1"},
  80. });
  81. }
  82. /* 生成开场白 */
  83. export function GetOpeningSpeech(obj: AddReq) {
  84. return request({
  85. url: '/api/system/digital_human/generate_opening_video',
  86. method: 'post',
  87. data: {...obj,tenant_id:"1"},
  88. timeout: 0
  89. });
  90. }
  91. /* 生成视频 */
  92. export function GetVideo(obj: AddReq) {
  93. return request({
  94. url: '/api/system/digital_human/generate_question_videos',
  95. method: 'post',
  96. data: {...obj,tenant_id:"1",force_regenerate: true},
  97. timeout: 0
  98. });
  99. }
  100. /* 批量绑定 */
  101. export function BatchBind(obj: AddReq) {
  102. return request({
  103. url: 'api/system/job/add_question',
  104. method: 'post',
  105. data: {...obj,tenant_id:"1"},
  106. });
  107. }
  108. /* 批量取消绑定 */
  109. export function BatchUnbind(obj: AddReq) {
  110. return request({
  111. url: '/api/system/job/batch_delete_questions',
  112. method: 'post',
  113. data: {...obj,tenant_id:"1"},
  114. });
  115. }
  116. /* export function GetPermission(query: UserPageQuery) {
  117. return request({
  118. url: '/api/system/competency/list',
  119. method: 'get',
  120. params: {...query,tenant_id:1},
  121. });
  122. }
  123. */
  124. /* 更新为红线题 */
  125. export function UpdateObj(obj: EditReq) {
  126. return request({
  127. url: "/api/system/interview_question/update",/* + obj.id+'/' */
  128. method: 'put',
  129. data: {...obj,tenant_id: '1'},
  130. });
  131. }
  132. /* 生成胜任力标签 */
  133. export function GenerateCompetency(obj: AddReq) {
  134. return request({
  135. url: '/competency/generate_from_position/',
  136. method: 'post',
  137. data: {...obj,tenant_id:"1"},
  138. timeout: 0
  139. });
  140. }
  141. /* 保存胜任力标签 */
  142. export function SaveCompetency(obj: AddReq) {
  143. return request({
  144. url: '/competency/save_position_tags/',
  145. method: 'post',
  146. data: {...obj,tenant_id:"1"},
  147. });
  148. }
  149. export function GetcategoryList(query: UserPageQuery) {
  150. return request({
  151. url: '/api/system/question_category/list',
  152. method: 'get',
  153. params: {...query,tenant_id:1},
  154. });
  155. }
  156. export function GetPositionList(query: UserPageQuery) {
  157. return request({
  158. url: '/api/system/job/list',
  159. method: 'get',
  160. params: {...query,tenant_id:1},
  161. });
  162. }