api.ts 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. import { request } from '/@/utils/service';
  2. import { PageQuery, AddReq, DelReq, EditReq, InfoReq } from '@fast-crud/fast-crud';
  3. import { Session } from '/@/utils/storage';
  4. export const apiPrefix = '/api/system/job/create';
  5. export function GetPermission() {
  6. return request({
  7. url: apiPrefix + 'field_permission/',
  8. method: 'get',
  9. });
  10. }
  11. export function GetList(query: PageQuery) {
  12. return request({
  13. url: '/api/system/job/list',
  14. method: 'get',
  15. params: {...query,tenant_id:'1'},/* :Session.get('tenant_id').tenant_id || */
  16. });
  17. }
  18. export function GetObj(id: InfoReq) {
  19. return request({
  20. url: "/api/system/job/detail?id=" + id+"&tenant_id=1",
  21. method: 'get',
  22. });
  23. }
  24. export function AddObj(obj: AddReq) {
  25. return request({
  26. url: "/api/system/job/create",
  27. method: 'post',
  28. data: {...obj,tenant_id: '1'},/* Session.get('tenant_id').tenant_id || */
  29. });
  30. }
  31. export function UpdateObj(obj: EditReq) {
  32. return request({
  33. url: "/api/system/job/update",/* + obj.id+'/' */
  34. method: 'post',
  35. data: {...obj,tenant_id: '1'},
  36. });
  37. }
  38. export function DelObj(id: DelReq) {
  39. return request({
  40. url: '/api/system/job/delete',/* + id + '/' */
  41. method: 'delete',
  42. data: { id,tenant_id: '1' },
  43. });
  44. }
  45. export function BatchUpdateTags(data: any) {
  46. return request({
  47. url: '/api/system/competency/batch_bind',
  48. method: 'post',
  49. data
  50. });
  51. }
  52. export function GetCompetencyList(query:any) {
  53. return request({
  54. url: '/api/system/competency/list',
  55. method: 'get',
  56. params: {...query,tenant_id:1},
  57. });
  58. }
  59. /* 发布职位 */
  60. export function PublishPosition(data:any) {
  61. return request({
  62. url: 'api/system/job/update_status',
  63. method: 'post',
  64. data: JSON.stringify(data),
  65. headers: {
  66. 'Content-Type': 'application/json'
  67. }
  68. });
  69. }
  70. /* 批量修改状态 */
  71. export function batch_publish(data:any) {
  72. return request({
  73. url: '/api/system/job/batch_publish',
  74. method: 'post',
  75. data: JSON.stringify(data),
  76. headers: {
  77. 'Content-Type': 'application/json'
  78. }
  79. });
  80. }
  81. /* AI生成职位描述 */
  82. export function GeneratePositionDescription(data:any) {
  83. return request({
  84. url: '/api/ai/generate_job_description',
  85. method: 'post',
  86. data: JSON.stringify(data),
  87. headers: {
  88. 'Content-Type': 'application/json',
  89. 'Authorization': 'JWT ' +Session.get('token')
  90. }
  91. });
  92. }
  93. /* 检测是否有题目可以发布 */
  94. export function CheckQuestionVideosStatus(data:any) {
  95. return request({
  96. url: 'api/system/job/question_videos_status',
  97. method: 'get',
  98. params: data,
  99. });
  100. }