live.ts 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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 = '/basic-api/brand/brandBindList',
  14. bindAnchorList = '/zfb-api/zfb/shop/sys/user/bindList',
  15. olderBindAnchorList = '/basic-api/sys/user/bindList',
  16. // brandTypeList = '/zfb-api/zfb/shop/brand/brandTypeList',
  17. brandTypeList = '/basic-api/brand/brandTypeList',
  18. // bindUser = '/zfb-api/zfb/shop/sys/brand/bindUser',
  19. bindUser = '/basic-api/brand/bindUser',
  20. brandUpdate = '/basic-api/brand/update',
  21. brandDelete = '/basic-api/brand/delete',
  22. upload = '/basic-api/sys/oss/upload',
  23. uploadVideo = '/basic-api/sys/oss/upLoadVideo',
  24. getAllScene = '/zfb-api/zfb/scene/list',
  25. getBrandInfo = '/basic-api/brand/info',
  26. addSave = '/basic-api/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: bindAnchorListParam[]) =>
  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. };
  133. export const LiveSceneAddApi = (params: SceneLiveItem) => {
  134. defHttp.post<GetAllSceneModel>({
  135. url: Api.brandDelete,
  136. params,
  137. headers: {
  138. // @ts-ignore
  139. ignoreCancelToken: true,
  140. },
  141. });
  142. };
  143. export const LiveSceneDeleteApi = (params: string[]) => {
  144. defHttp.post<GetAllSceneModel>({
  145. url: Api.brandDelete,
  146. params,
  147. headers: {
  148. // @ts-ignore
  149. ignoreCancelToken: true,
  150. },
  151. });
  152. };
  153. export const addSave = (params: SceneLiveItem) =>
  154. defHttp.post<RentListGetResultModel>({
  155. url: Api.addSave,
  156. params,
  157. headers: {
  158. // @ts-ignore
  159. ignoreCancelToken: true,
  160. },
  161. });