live.ts 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. import { defHttp } from '/@/utils/http/axios';
  2. import {
  3. PageParams,
  4. InfoParams,
  5. RentListGetResultModel,
  6. SceneLiveItem,
  7. bindAnchorListParam,
  8. GetAllSceneModel,
  9. // SceneLiveModel,
  10. } from './model';
  11. import { Result, UploadFileParams } from '/#/axios';
  12. enum Api {
  13. pageList = '/zfb-api/zfb/brand/brandBindList',
  14. bindAnchorList = '/zfb-api/zfb/shop/sys/user/bindList',
  15. olderBindAnchorList = '/zfb-api/zfb/sys/user/bindList',
  16. // brandTypeList = '/zfb-api/zfb/shop/brand/brandTypeList',
  17. brandTypeList = '/zfb-api/zfb/brand/brandTypeList',
  18. // bindUser = '/zfb-api/zfb/shop/sys/brand/bindUser',
  19. bindUser = '/zfb-api/zfb/brand/bindUser',
  20. brandUpdate = '/zfb-api/zfb/brand/update',
  21. brandDelete = '/zfb-api/zfb/brand/delete',
  22. upload = '/zfb-api/zfb/sys/oss/upload',
  23. uploadVideo = '/zfb-api/zfb/sys/oss/upLoadVideo',
  24. getAllScene = '/zfb-api/zfb/scene/list',
  25. getBrandInfo = '/zfb-api/zfb/brand/info',
  26. addSave = '/zfb-api/zfb/brand/save',
  27. }
  28. export type SceneLiveItemResult = SceneLiveItem;
  29. /**
  30. * @description: Get sample list value
  31. */
  32. export const ListApi = (params: PageParams) =>
  33. defHttp.get<RentListGetResultModel>({
  34. url: Api.pageList,
  35. params,
  36. headers: {
  37. // @ts-ignore
  38. ignoreCancelToken: true,
  39. },
  40. });
  41. export const bindOldAnchorListApi = (params: bindAnchorListParam) =>
  42. defHttp.post<RentListGetResultModel>({
  43. url: Api.olderBindAnchorList,
  44. params: params,
  45. data: params,
  46. headers: {
  47. // @ts-ignore
  48. ignoreCancelToken: true,
  49. },
  50. });
  51. export const bindAnchorListApi = (params: bindAnchorListParam) =>
  52. defHttp.post<RentListGetResultModel>({
  53. url: Api.bindAnchorList,
  54. params: params,
  55. data: params,
  56. headers: {
  57. // @ts-ignore
  58. ignoreCancelToken: true,
  59. },
  60. });
  61. export const bindUserApi = (params: any) =>
  62. defHttp.post<RentListGetResultModel>({
  63. url: Api.bindUser,
  64. params: params,
  65. // data: params,
  66. headers: {
  67. // @ts-ignore
  68. ignoreCancelToken: true,
  69. },
  70. });
  71. export const brandTypeListApi = (params: PageParams) =>
  72. defHttp.get<RentListGetResultModel>({
  73. url: Api.brandTypeList,
  74. params,
  75. headers: {
  76. // @ts-ignore
  77. ignoreCancelToken: true,
  78. },
  79. });
  80. export function uploadLiveApi(
  81. params: UploadFileParams,
  82. // onUploadProgress: (progressEvent: ProgressEvent) => void,
  83. ) {
  84. return defHttp.uploadFile<Result>(
  85. {
  86. url: Api.upload,
  87. // onUploadProgress,
  88. },
  89. params,
  90. );
  91. }
  92. export function uploadLiveVideoApi(
  93. params: UploadFileParams,
  94. // onUploadProgress: (progressEvent: ProgressEvent) => void,
  95. ) {
  96. return defHttp.uploadFile<Result>(
  97. {
  98. url: Api.uploadVideo,
  99. // onUploadProgress,
  100. },
  101. params,
  102. );
  103. }
  104. export const getAllSceneApi = (params: PageParams) =>
  105. defHttp.post<RentListGetResultModel>({
  106. url: Api.getAllScene,
  107. params,
  108. headers: {
  109. // @ts-ignore
  110. ignoreCancelToken: true,
  111. },
  112. });
  113. export const getLiveInfoApi = (params: InfoParams) => {
  114. return defHttp.post<SceneLiveItem>({
  115. url: Api.getBrandInfo,
  116. params,
  117. headers: {
  118. // @ts-ignore
  119. ignoreCancelToken: true,
  120. },
  121. });
  122. };
  123. export const brandUpdateApi = (params: SceneLiveItem) =>
  124. defHttp.post<GetAllSceneModel>({
  125. url: Api.brandUpdate,
  126. params,
  127. headers: {
  128. // @ts-ignore
  129. ignoreCancelToken: true,
  130. },
  131. });
  132. export const LiveSceneAddApi = (params: SceneLiveItem) =>
  133. defHttp.post<GetAllSceneModel>({
  134. url: Api.brandDelete,
  135. params,
  136. headers: {
  137. // @ts-ignore
  138. ignoreCancelToken: true,
  139. },
  140. });
  141. export const LiveSceneDeleteApi = (params: string[]) =>
  142. defHttp.post<GetAllSceneModel>({
  143. url: Api.brandDelete,
  144. params,
  145. headers: {
  146. // @ts-ignore
  147. ignoreCancelToken: true,
  148. },
  149. });
  150. export const addSave = (params: SceneLiveItem) =>
  151. defHttp.post<RentListGetResultModel>({
  152. url: Api.addSave,
  153. params,
  154. headers: {
  155. // @ts-ignore
  156. ignoreCancelToken: true,
  157. },
  158. });