global.ts 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636
  1. import { request } from 'umi';
  2. import { api } from '../api';
  3. /**
  4. * 查询优化目标权限
  5. * @param data
  6. * @returns
  7. */
  8. export async function getOptimizationGoalPermissionsV3Api(data: any) {
  9. return request(api + `/adq/v3/launch/tools/getOptimizationGoalPermissions`, {
  10. method: 'POST',
  11. data
  12. })
  13. }
  14. /**
  15. * 获取地理位置
  16. * @param data
  17. * @returns
  18. */
  19. export async function getTargetingGagsApi(data: any) {
  20. return request(api + `/adq/v3/launch/tools/getTargetingGags`, {
  21. method: 'POST',
  22. data
  23. })
  24. }
  25. /**
  26. * 获取小说列表
  27. * @param data
  28. * @returns
  29. */
  30. export async function getmarketingAssetContentApi(data: {
  31. marketingAssetType?: string,
  32. marketingAssetName?: string,
  33. accountId: number,
  34. pageNum: number,
  35. pageSize: number,
  36. marketingAssetNameList: string[]
  37. }) {
  38. return request(api + `/adq/v3/marketingAssets/marketingAssetContent/get`, {
  39. method: 'POST',
  40. data,
  41. });
  42. }
  43. /**
  44. * 远程小说接口
  45. * @param data
  46. * @returns
  47. */
  48. export async function getByRemotemarketingAssetContentApi(data: {
  49. marketingAssetType?: string,
  50. marketingAssetName?: string,
  51. accountId: number,
  52. pageNum: number,
  53. pageSize: number,
  54. marketingIdList: number[]
  55. }) {
  56. return request(api + `/adq/v3/marketingAssets/marketingAssetContent/getByRemote`, {
  57. method: 'POST',
  58. data,
  59. });
  60. }
  61. /**
  62. * 同步小说
  63. * @param data
  64. * @returns
  65. */
  66. export async function synMarketingAssetContentApi(data: { accountId: number }) {
  67. return request(api + `/adq/v3/marketingAssets/marketingAssetContent/sync`, {
  68. method: 'POST',
  69. data,
  70. });
  71. }
  72. /**
  73. * 获取公众号
  74. * @param data
  75. * @returns
  76. */
  77. export async function getWechatOfficialAccountApi(data: { accountId: number }) {
  78. return request(api + `/adq/v3/marketingAssets/getWechatOfficialAccounts`, {
  79. method: 'POST',
  80. data,
  81. });
  82. }
  83. /**
  84. * 批量获取公众号
  85. * @param data
  86. * @returns
  87. */
  88. export async function getWechatOfficialAccountsApi(data: { accountIdList: number[] }) {
  89. return request(api + `/adq/v3/marketingAssets/getWechatOfficialAccountsBatch`, {
  90. method: 'POST',
  91. data,
  92. });
  93. }
  94. /**
  95. * 获取视频号
  96. * @param data
  97. * @returns
  98. */
  99. export async function getVideoChannelInfoApi(data: { accountIdList?: number[], accountId?: number }) {
  100. return request(api + `/adq/v3/marketingAssets/getVideoChannelInfo`, {
  101. method: 'POST',
  102. data,
  103. });
  104. }
  105. /**
  106. * 批量获取视频号
  107. * @param data
  108. * @returns
  109. */
  110. export async function getVideoChannelInfoBatchApi(data: { accountIdList?: number[], accountId?: number }) {
  111. return request(api + `/adq/v3/marketingAssets/getVideoChannelInfoBatch`, {
  112. method: 'POST',
  113. data,
  114. });
  115. }
  116. /**
  117. * 获取转化归因
  118. * @param data
  119. * @returns
  120. */
  121. export async function getConversionInfoApi(data: {
  122. accountId: number,
  123. pageNum: number,
  124. pageSize: number,
  125. accessStatus?: string[] // ACCESS_STATUS_COMPLETED 已接入 ACCESS_STATUS_PENDING 待接入
  126. conversionId?: number,
  127. conversionName?: string,
  128. conversionType?: string, // 扣费类型(ID_TYPE_CPC, BID_TYPE_CPA, BID_TYPE_CPS, BID_TYPE_CPM, BID_TYPE_CPD)
  129. createSourceType?: string, // 转化创建来源,如 (SELF_CREATED 自建转化),(PLATFORM 平台类转化)
  130. deepBehaviorOptimizationGoal?: string,
  131. deepWorthAdvancedGoal?: string,
  132. deepWorthOptimizationGoal?: string,
  133. marketingScene?: string,
  134. optimizationGoal?: string,
  135. siteSet?: string,
  136. }) {
  137. return request(api + `/adq/v3/launch/tools/getConversionInfo`, {
  138. method: 'POST',
  139. data,
  140. });
  141. }
  142. /**
  143. * 获取数据源
  144. * @param data
  145. * @returns
  146. */
  147. export async function getDataSourceV3Api(data: { accountIds: number[], promotedObjectType?: string }) {
  148. return request(api + `/adq/v3/userActionSets/allByAccount`, {
  149. method: 'POST',
  150. data
  151. })
  152. }
  153. /**
  154. * 同步数据源
  155. * @param data
  156. * @returns
  157. */
  158. export async function sysDataSourceV3Api(data: number[]) {
  159. return request(api + `/adq/v3/userActionSets/syncByAdAccountId`, {
  160. method: 'PATCH',
  161. data,
  162. });
  163. }
  164. /**
  165. * 获取创意规格详情
  166. * @param data
  167. * @returns
  168. */
  169. export async function getCreativeDetailsApi(data: any) {
  170. return request(api + `/adq/v3/launch/tools/getCreativeDetails`, {
  171. method: 'POST',
  172. data
  173. })
  174. }
  175. /**
  176. * 获取流量包
  177. * @param data
  178. * @returns
  179. */
  180. export async function getBatchUnionPositionPackagesApi(data: { unionPackageType: 'UNION_PACKAGE_TYPE_INCLUDE' | 'UNION_PACKAGE_TYPE_EXCLUDE', accountId?: number, accountIds?: number[] }) {
  181. return request(api + `/adq/v3/marketingAssets/getBatchUnionPositionPackages`, {
  182. method: 'POST',
  183. data,
  184. });
  185. }
  186. /**
  187. * 获取创意规格列表
  188. * @param data
  189. * @returns
  190. */
  191. export async function getCreativeTemplateListApi(data: any) {
  192. return request(api + `/adq/v3/launch/tools/getCreativeTemplateList`, {
  193. method: 'POST',
  194. data
  195. })
  196. }
  197. /**
  198. * 文案助手
  199. * @param params
  200. * @returns
  201. */
  202. export async function getTextApi(params: { maxTextLength: number, adAccountId: number }) {
  203. return request(api + `/adq/v3/launch/tools/creative/tools/text`, {
  204. method: 'GET',
  205. params
  206. })
  207. }
  208. /**
  209. * 获取原生页授权方信息
  210. * @param accountId
  211. * @returns
  212. */
  213. export async function getWXDownPageAuthInfoListApi(accountId: number) {
  214. return request(api + `/adq/v3/marketingAssets/listWXDownPageAuthInfo/${accountId}`, {
  215. method: 'GET'
  216. });
  217. }
  218. /**
  219. * 获取ADQ落地页列表
  220. * @param adgroupName 广告名称
  221. * @param promotedObjectType 广告类型
  222. * @param accountId 账户ID
  223. */
  224. export async function getAdqLandingPageListApi(params: {
  225. pageNum: number;
  226. pageSize: number;
  227. accountId?: number;
  228. pageName?: string;
  229. pageType?: string;
  230. pageTemplateId?: string;
  231. pageStatus?: string;
  232. ownerUid?: number;
  233. creativeTemplateId?: number,
  234. marketingCarrierId?: string,
  235. marketingCarrierType?: string
  236. marketingGoal?: string,
  237. marketingSubGoal?: string,
  238. marketingTargetType?: string,
  239. siteSet?: string[],
  240. }) {
  241. Object.keys(params).forEach(key => {
  242. if (!params[key as keyof typeof params]) {
  243. delete params[key as keyof typeof params]
  244. }
  245. })
  246. return request(api + '/adq/v3/marketingAssets/listWXDownPageToRemote', {
  247. method: 'POST',
  248. data: params,
  249. });
  250. }
  251. /**
  252. * 删除落地页
  253. * @param data
  254. * @returns
  255. */
  256. export async function delPageApi(data: { accountId: number, pageIds: number[] }) {
  257. return request(api + `/adq/v3/marketingAssets/batchDelWXDownPage`, {
  258. method: 'DELETE',
  259. data
  260. });
  261. }
  262. /**
  263. * 灵鹊落地页
  264. * @param params
  265. * @returns
  266. */
  267. export async function getAdqLandingPageOfficialListApi(params: {
  268. pageNum: number;
  269. pageSize: number;
  270. accountId?: number;
  271. creativeTemplateId?: number,
  272. marketingCarrierId?: string,
  273. marketingCarrierType?: string
  274. marketingGoal?: string,
  275. marketingSubGoal?: string,
  276. marketingTargetType?: string,
  277. siteSet?: string[],
  278. ownerUid?: number,
  279. pageIds?: number[],
  280. pageName?: string,
  281. pageStatus?: string,
  282. pageType?: string,
  283. userId?: number
  284. }) {
  285. Object.keys(params).forEach(key => {
  286. if (!params[key as keyof typeof params]) {
  287. delete params[key as keyof typeof params]
  288. }
  289. })
  290. return request(api + '/adq/v3/marketingAssets/listDownPageToRemote', {
  291. method: 'POST',
  292. data: params,
  293. });
  294. }
  295. /**
  296. * 按账号同步落地页
  297. * @param adAccountId 本地ID
  298. */
  299. export async function putAdqLandingPageApi(data: any) {
  300. return request(api + `/adq/v3/marketingAssets/syncAllWXDownPage`, {
  301. method: 'PUT',
  302. data
  303. });
  304. }
  305. /**
  306. * 获取品牌形象列表
  307. * @returns
  308. */
  309. export async function getSysBrandApi() {
  310. return request(api + `/adq/sysBrand/allOfUser`, {
  311. method: 'GET'
  312. })
  313. }
  314. /**
  315. * 新增品牌形象
  316. * @param data
  317. * @returns
  318. */
  319. export async function addSysBrandApi(data: { name: string, brandImgUrl: string }) {
  320. return request(api + `/adq/sysBrand`, {
  321. method: 'POST',
  322. data
  323. })
  324. }
  325. /**
  326. * 修改品牌形象
  327. * @param data
  328. * @returns
  329. */
  330. export async function editSysBrandApi(data: { name: string, brandImgUrl: string, sysBrandId: number }) {
  331. const { sysBrandId, ...params } = data
  332. return request(api + `/adq/sysBrand/${sysBrandId}`, {
  333. method: 'PUT',
  334. data: params
  335. })
  336. }
  337. /**
  338. * 删除品牌形象
  339. * @param data
  340. * @returns
  341. */
  342. export async function delSysBrandApi(data: { sysBrandId: number }) {
  343. const { sysBrandId } = data
  344. return request(api + `/adq/sysBrand/${sysBrandId}`, {
  345. method: 'DELETE'
  346. })
  347. }
  348. /**
  349. * 新增头像昵称跳转页
  350. * @param data
  351. * @returns
  352. */
  353. export async function addProfilesApi(data: { profileName: string, imageUrl: string, description: string }) {
  354. return request(api + `/adq/v3/marketingAssets/profiles/add`, {
  355. method: 'POST',
  356. data
  357. })
  358. }
  359. /**
  360. * 获取头像昵称跳转页
  361. * @param data
  362. * @returns
  363. */
  364. export async function getProfilesApi(data: { profileName?: string }) {
  365. return request(api + `/adq/v3/marketingAssets/profiles/get`, {
  366. method: 'POST',
  367. data
  368. })
  369. }
  370. /**
  371. * 删除头像昵称跳转页
  372. * @param data
  373. * @returns
  374. */
  375. export async function delProfilesApi(params: { id: number }) {
  376. return request(api + `/adq/v3/marketingAssets/deleteSysProfiles`, {
  377. method: 'DELETE',
  378. params
  379. })
  380. }
  381. /**
  382. * 获取创意审核详情
  383. * @param data
  384. * @returns
  385. */
  386. export async function getCreativeReviewDetailApi({ accountId, dynamicCreativeIds }: { accountId: number, dynamicCreativeIds: number[] }) {
  387. return request(api + `/adq/adgroup/creativeReviewDetail`, {
  388. method: 'POST',
  389. data: dynamicCreativeIds,
  390. params: { accountId }
  391. })
  392. }
  393. /**
  394. * 查询元素组件申诉复审结果
  395. * @param data
  396. * @returns
  397. */
  398. export async function getFsResultApi(data: { accountId: number, componentId: number, dynamicCreativeId: number, elementFingerPrint: string, elementId: number }) {
  399. return request(api + `/adq/adgroup/getResult`, {
  400. method: 'POST',
  401. data
  402. })
  403. }
  404. /**
  405. * 同步广告
  406. * @param data
  407. * @returns
  408. */
  409. export async function syncAdInfoApi(data: { accountAdgroupMaps: string[], adgroupCreateLogId: number }) {
  410. return request(api + `/adq/syncAdInfo/syncByAdgroupIds`, {
  411. method: 'POST',
  412. data
  413. })
  414. }
  415. /**
  416. * 获取图片信息
  417. * @param data
  418. * @returns
  419. */
  420. export async function getImagesInfoApi(data: { adAccountId: number, imageIds: number[], pageNum: number, pageSize: number }) {
  421. return request(api + `/adq/v3/marketingAssets/getImages`, {
  422. method: 'POST',
  423. data
  424. })
  425. }
  426. /**
  427. * 获取视频信息
  428. * @param data
  429. * @returns
  430. */
  431. export async function getVideosInfoApi(data: { adAccountId: number, videoIds: number[] }) {
  432. return request(api + `/adq/v3/marketingAssets/getVideos`, {
  433. method: 'POST',
  434. data
  435. })
  436. }
  437. /**
  438. * 新增微信小程序
  439. * @param data
  440. * @returns
  441. */
  442. export async function addWechatAppletApi(data: { appletId: string, appletName: string, appletLink: string, description: string }) {
  443. return request(api + `/adq/v3/wechatApplet/add`, {
  444. method: 'POST',
  445. data
  446. })
  447. }
  448. /**
  449. * 查询本地微信小程序列表
  450. * @param data
  451. * @returns
  452. */
  453. export async function getWechatAppletApi(data: { pageNum: number, pageSize: number, appletName?: string, appletIdList?: string[], createBy?: number }) {
  454. return request(api + `/adq/v3/wechatApplet/list`, {
  455. method: 'POST',
  456. data
  457. })
  458. }
  459. /**
  460. * 删除微信小程序
  461. * @param data
  462. * @returns
  463. */
  464. export async function delWechatAppletApi(id: number) {
  465. return request(api + `/adq/v3/wechatApplet/delById/${id}`, {
  466. method: 'DELETE'
  467. })
  468. }
  469. /**
  470. * 下载小程序上传模板
  471. * @returns
  472. */
  473. export async function downloadTemplateApi() {
  474. return request(api + `/adq/v3/wechatApplet/downloadTemplate`, {
  475. method: 'POST',
  476. responseType: 'blob'
  477. })
  478. }
  479. /**
  480. * 上传
  481. * @returns
  482. */
  483. export async function importExcelApi(data: any) {
  484. return request(api + `/adq/v3/wechatApplet/importExcel`, {
  485. method: 'POST',
  486. data
  487. })
  488. }
  489. /**
  490. * 修改微信小程序
  491. * @param data
  492. * @returns
  493. */
  494. export async function updateWechatAppletApi(data: { appletId: string, appletName: string, appletLink: string, description: string, id: number }) {
  495. return request(api + `/adq/v3/wechatApplet/update`, {
  496. method: 'POST',
  497. data
  498. })
  499. }
  500. /**
  501. * 获取所有微信小程序列表
  502. * @param data
  503. * @returns
  504. */
  505. export async function getWechatAppletAllApi(data: { appletName?: string, appletIdList?: string[] }) {
  506. return request(api + `/adq/v3/wechatApplet/listAll`, {
  507. method: 'POST',
  508. data
  509. })
  510. }
  511. /**
  512. * 获取详情
  513. * @param id
  514. * @returns
  515. */
  516. export async function getWechatAppletDetailApi(id: number) {
  517. return request(api + `/adq/v3/wechatApplet/getById/${id}`, {
  518. method: 'GET'
  519. })
  520. }
  521. /**
  522. * 新增本地企微微信信息
  523. * @param data
  524. * @returns
  525. */
  526. export async function addCorpWechatApi(data: { agentId: number, corpName: string, localCorpId: string, tencentCorpId: string }) {
  527. return request(api + `/adq/v3/tencentCorp/add`, {
  528. method: 'POST',
  529. data
  530. })
  531. }
  532. /**
  533. * 修改本地企微微信信息
  534. * @param data
  535. * @returns
  536. */
  537. export async function modifyCorpWechatApi(data: { agentId: number, corpName: string, localCorpId: string, tencentCorpId: string }) {
  538. return request(api + `/adq/v3/tencentCorp/modify`, {
  539. method: 'PUT',
  540. data
  541. })
  542. }
  543. /**
  544. * 查询企微列表
  545. * @returns
  546. */
  547. export async function getLocalCorpListApi() {
  548. return request(api + `/adq/v3/tencentCorp/localCorpList`, {
  549. method: 'GET'
  550. })
  551. }
  552. /**
  553. * 查询本地企业微信列表
  554. * @param data
  555. * @returns
  556. */
  557. export async function getCorpWechatApi(data: { pageNum: number, pageSize: number, corpName?: string, wechatIdList?: string[] }) {
  558. return request(api + `/adq/v3/tencentCorp/list`, {
  559. method: 'POST',
  560. data
  561. })
  562. }
  563. /**
  564. * 删除本地企业微信信息
  565. * @param data
  566. * @returns
  567. */
  568. export async function delCorpWechatApi(id: number) {
  569. return request(api + `/adq/v3/corpWechat/delById/${id}`, {
  570. method: 'DELETE'
  571. })
  572. }
  573. /**
  574. * 获取填写所有企微列表 投放
  575. * @param data
  576. * @returns
  577. */
  578. export async function getCorpWechatAllApi(data: { corpName?: string }) {
  579. return request(api + `/adq/v3/tencentCorp/listAll`, {
  580. method: 'POST',
  581. data
  582. })
  583. }
  584. /**
  585. * 获取企微详情
  586. * @param id
  587. * @returns
  588. */
  589. export async function getCorpWechatDetailApi(params: { tencentCorpId: string }) {
  590. return request(api + `/adq/v3/tencentCorp/getByTencentCorpId`, {
  591. method: 'GET',
  592. params
  593. })
  594. }
  595. /**
  596. * 获取广告标签
  597. * @param data
  598. * @returns
  599. */
  600. export async function getAdLabelApi(data: { accountId?: number }) {
  601. return request(api + `/adq/v3/launch/tools/getAdLabel`, {
  602. method: 'POST',
  603. data
  604. })
  605. }
  606. /**
  607. * 获取游戏列表
  608. * @param data
  609. * @returns
  610. */
  611. export async function getGameLibraryListApi(data: { pageNum: number, pageSize: number, gameName?: string, idList?: number[], gameType?: string }) {
  612. return request(api + `/adq/v3/gameLibrary/pageList`, {
  613. method: 'POST',
  614. data
  615. })
  616. }
  617. /**
  618. * 所有游戏列表
  619. * @param data
  620. * @returns
  621. */
  622. export async function getGameLibraryApi(data: { gameName?: string, idList?: number[], gameType?: string }) {
  623. return request(api + `/adq/v3/gameLibrary/listAll`, {
  624. method: 'POST',
  625. data
  626. })
  627. }
  628. /**
  629. * 新增游戏
  630. * @param data
  631. * @returns
  632. */
  633. export async function addGameApi(data: { appId: string, gameName: string, gameType: string, id?: number }) {
  634. return request(api + `/adq/v3/gameLibrary/add`, {
  635. method: 'POST',
  636. data
  637. })
  638. }
  639. /**
  640. * 删除游戏
  641. * @param id
  642. * @returns
  643. */
  644. export async function delGameApi(id: number) {
  645. return request(api + `/adq/v3/gameLibrary/delById/${id}`, {
  646. method: 'DELETE'
  647. })
  648. }
  649. /**
  650. * 获取游戏详情
  651. * @param id
  652. * @returns
  653. */
  654. export async function getGameLibraryDetailApi(id: number) {
  655. return request(api + `/adq/v3/gameLibrary/getById/${id}`, {
  656. method: 'GET'
  657. })
  658. }
  659. /**
  660. * 获取游戏详情
  661. * @param wxGameAppId
  662. * @returns
  663. */
  664. export async function getGameLibraryAppIdDetailApi(wxGameAppId: number) {
  665. return request(api + `/adq/v3/gameLibrary/getByAppId/${wxGameAppId}`, {
  666. method: 'GET'
  667. })
  668. }
  669. /**
  670. * 获取弹幕
  671. * @param data
  672. * @returns
  673. */
  674. export async function getBarrageRecommendListApi(params: { adAccountId?: number, taskType?: 'GAME' | 'NOVEL' }) {
  675. // return request(api + `/adq/v3/launch/tools/creative/tools/barrage`, {
  676. return request(api + `/adq/v3/launch/tools/creative/tools/barrageRecommend`, {
  677. method: 'GET',
  678. params
  679. })
  680. }
  681. /**
  682. * 账户资产组分页查询
  683. * @param params
  684. * @returns
  685. */
  686. export async function getAccountAssetsGroupListApi(data: { accountGroupName?: string, authMainAccountIds?: number[], authType?: string, pageNum: number, pageSize: number }) {
  687. return request(api + `/adq/v3/marketingAssets/accountAssetsGroup/pageList`, {
  688. method: 'POST',
  689. data
  690. })
  691. }
  692. /**
  693. * 所有账户资产共享组
  694. * @param data
  695. * @returns
  696. */
  697. export async function getAccountAssetsGroupListAllApi(data: { accountGroupName?: string, authMainAccountIds?: number[] }) {
  698. return request(api + `/adq/v3/marketingAssets/accountAssetsGroup/ListAll`, {
  699. method: 'POST',
  700. data
  701. })
  702. }
  703. /**
  704. * 账户资产组修改(只能改名字)
  705. * @param data
  706. * @returns
  707. */
  708. export async function updateAccountAssetsGroupApi(data: { accountGroupId: number, accountGroupName: string }) {
  709. return request(api + `/adq/v3/marketingAssets/accountAssetsGroup/update`, {
  710. method: 'POST',
  711. data
  712. })
  713. }
  714. /**
  715. * 账户资产组取消授权
  716. * @param data
  717. * @returns
  718. */
  719. export async function revokeAuthAccountAssetsGroupApi(data: { accountAssetsGroupId: number, accountId: number[], assetId?: number }) {
  720. return request(api + `/adq/v3/marketingAssets/accountAssetsGroup/revokeAuth`, {
  721. method: 'POST',
  722. data
  723. })
  724. }
  725. /**
  726. * 删除账户组
  727. * @param data
  728. * @returns
  729. */
  730. export async function delAuthAccountAssetsGroupApi(data: { id: number }) {
  731. return request(api + `/adq/v3/marketingAssets/accountAssetsGroup/delete/${data.id}`, {
  732. method: 'DELETE',
  733. })
  734. }
  735. /**
  736. * 账户资产组创建
  737. * @param data
  738. * @returns
  739. */
  740. export async function createAccountAssetsGroupApi(data: { accountGroupId?: number, accountGroupName: string, authMainAccountId: number, authType: string }) {
  741. return request(api + `/adq/v3/marketingAssets/accountAssetsGroup/create`, {
  742. method: 'POST',
  743. data
  744. })
  745. }
  746. /**
  747. * 查询被授权的账户
  748. * @param data
  749. * @returns
  750. */
  751. export async function getAccountAssetsGroupAccountListApi(data: { groupId: number }) {
  752. return request(api + `/adq/v3/marketingAssets/accountAssetsGroup/authAccountList/${data.groupId}`, {
  753. method: 'GET'
  754. })
  755. }
  756. /**
  757. * 账户资产授权
  758. * @param data
  759. * @returns
  760. */
  761. export async function authAccountAssetsGroupAccountApi(data: { accountAssetsGroupId: number, accountId: number[], assetId?: number, assetName?: string }) {
  762. return request(api + `/adq/v3/marketingAssets/accountAssetsGroup/auth`, {
  763. method: 'POST',
  764. data
  765. })
  766. }
  767. /**
  768. * 批量授权
  769. * @param data
  770. * @returns
  771. */
  772. export async function batchAuthAccountAssetsGroupAccountApi(data: { accountAssetsGroupId: number, accountId: number[], assetsDTOS: { assetId: number, assetName: string }[] }) {
  773. return request(api + `/adq/v3/marketingAssets/accountAssetsGroup/batchAuth`, {
  774. method: 'POST',
  775. data
  776. })
  777. }
  778. /**
  779. * 同步素材
  780. * @param data
  781. * @returns
  782. */
  783. export async function syncMediaImageApi({ type, ...data }: { accountIds: number[], createTimeMin: string, createTimeMax: string, type: 'image' | 'video' }) {
  784. if (type === 'image') {
  785. return request(api + `/adq/v3/mediaImage/syncImage`, {
  786. method: 'POST',
  787. data
  788. })
  789. }
  790. return request(api + `/adq/v3/mediaVideo/syncVideo`, {
  791. method: 'POST',
  792. data
  793. })
  794. }
  795. /**
  796. * 获取文案库列表
  797. * @param data
  798. * @returns
  799. */
  800. export async function getCopyWritingListApi(data: { category?: string, content?: string, createBy?: number, pageNum: number, pageSize: number }) {
  801. return request(api + `/adq/copyWriting/pageList`, {
  802. method: 'POST',
  803. data
  804. })
  805. }
  806. /**
  807. * 新增修改文案
  808. * @param data
  809. * @returns
  810. */
  811. export async function copyWritingApi(data: { category: string, contentList?: string[], content?: string, id?: number }) {
  812. if (data?.id) {
  813. return request(api + `/adq/copyWriting/update`, {
  814. method: 'POST',
  815. data
  816. })
  817. }
  818. return request(api + `/adq/copyWriting/addBatch`, {
  819. method: 'POST',
  820. data
  821. })
  822. }
  823. /**
  824. * 删除
  825. * @param id
  826. * @returns
  827. */
  828. export async function delCopyWritingApi(id: number) {
  829. return request(api + `/adq/copyWriting/delById/${id}`, {
  830. method: 'DELETE',
  831. })
  832. }
  833. /**
  834. * 批量删除
  835. * @param ids
  836. * @returns
  837. */
  838. export async function delsCopyWritingApi(ids: number[]) {
  839. return request(api + `/adq/copyWriting/batchDelByIds`, {
  840. method: 'DELETE',
  841. data: ids
  842. })
  843. }
  844. export type ApplicationTypeProps = 'IOS' | 'ANDROID'
  845. export interface GetApplicationListProps {
  846. pageNum: number,
  847. pageSize: number,
  848. createBy?: number,
  849. applicationId?: string
  850. name?: string
  851. type?: ApplicationTypeProps
  852. }
  853. /**
  854. * 查询本地推广应用列表
  855. * @param data
  856. * @returns
  857. */
  858. export async function getApplicationListApi(data: GetApplicationListProps) {
  859. return request(api + `/adq/promote/application/list`, {
  860. method: 'POST',
  861. data
  862. })
  863. }
  864. /**
  865. * 查询本地推广全部应用列表
  866. * @param data
  867. * @returns
  868. */
  869. export async function getApplicationAllApi(data: Omit<GetApplicationListProps, 'pageNum' | 'pageSize'>) {
  870. return request(api + `/adq/promote/application/listAll`, {
  871. method: 'POST',
  872. data
  873. })
  874. }
  875. export interface AddApplicationProps {
  876. applicationId: number,
  877. name: string,
  878. type: ApplicationTypeProps
  879. id?: number
  880. }
  881. /**
  882. * 新增推广应用
  883. * @param data
  884. * @returns
  885. */
  886. export async function addApplicationApi(data: AddApplicationProps) {
  887. return request(api + `/adq/promote/application/add`, {
  888. method: 'POST',
  889. data
  890. })
  891. }
  892. /**
  893. * 修改推广应用
  894. * @param data
  895. * @returns
  896. */
  897. export async function updateApplicationApi(data: Required<AddApplicationProps>) {
  898. return request(api + `/adq/promote/application/update`, {
  899. method: 'POST',
  900. data
  901. })
  902. }
  903. /**
  904. * 删除本地推广应用
  905. * @param id
  906. * @returns
  907. */
  908. export async function delApplicationApi(id: number) {
  909. return request(api + `/adq/promote/application/delById/${id}`, {
  910. method: 'DELETE',
  911. })
  912. }
  913. /**
  914. * 应用详情
  915. * @param id
  916. * @returns
  917. */
  918. export async function getApplicationDetailApi(id: number) {
  919. return request(api + `/adq/promote/application/getById/${id}`, {
  920. method: 'GET'
  921. })
  922. }
  923. export interface GetCustomerServiceGroupListProps {
  924. pageNum: number,
  925. pageSize: number,
  926. accountId?: string,
  927. csgroupName?: string, // 客服组名称
  928. tencentCorpId?: string, // 企业微信ID
  929. parentId?: number, // 父级ID
  930. type?: 0 | 1, // 类型 0:客服组集,1:客服组,
  931. policyId?: number, // 轮换策略ID
  932. }
  933. /**
  934. * 查询企业微信组件客服组
  935. * @param data
  936. * @returns
  937. */
  938. export async function getCustomerServiceGroupListApi(data: GetCustomerServiceGroupListProps) {
  939. return request(api + `/adq/localCorpCsgroup/listOfPage`, {
  940. method: 'POST',
  941. data
  942. })
  943. }
  944. /**
  945. * 客服组-按类型查询(不分页, 类型非必传, 下拉筛选框使用)
  946. * @param params
  947. * @returns
  948. */
  949. export async function getLocalCorpCsgroupListAllApi(params: { accountId?: number, type?: 0 | 1 }) {
  950. return request(api + `/adq/localCorpCsgroup/listOfType`, {
  951. method: 'GET',
  952. params
  953. })
  954. }
  955. export interface GetCustomerServiceGroupUserListProps {
  956. localCsgroupId: number, // 企业微信ID
  957. pageNum: number, // 页码
  958. pageSize: number, // 页大小
  959. localCorpUserName?: string, // 客服组成员名称
  960. poolType?: 'BLOCKLIST' | 'OFFLINE' | 'ONLINE' | 'WAITING' | 'WARRING', // 客服组成员状态
  961. }
  962. /**
  963. * 客服组成员-分页查询
  964. * @param data
  965. * @returns
  966. */
  967. export async function getLocalCorpCsgroupUserListApi(data: GetCustomerServiceGroupUserListProps) {
  968. return request(api + `/adq/localCorpCsgroup/user/listOfPage`, {
  969. method: 'POST',
  970. data
  971. })
  972. }
  973. /**
  974. * 用户日志
  975. * @param data
  976. * @returns
  977. */
  978. export async function getUserlogListApi(data: { pageNum: number, pageSize: number, id: number }) {
  979. return request(api + `/adq/localCorpCsgroup/userLog/listOfPage`, {
  980. method: 'POST',
  981. data
  982. })
  983. }
  984. /**
  985. * 所有成员
  986. * @param data
  987. * @returns
  988. */
  989. export async function getLocalCorpCsgroupUserAllListApi(data: { poolType?: 'BLOCKLIST' | 'OFFLINE' | 'ONLINE' | 'WAITING' | 'WARRING', localCsgroupId: number, localCorpUserName?: string }) {
  990. return request(api + `/adq/localCorpCsgroup/user/all`, {
  991. method: 'POST',
  992. data
  993. })
  994. }
  995. export interface AddLocalCorpCsgroupUserListProps {
  996. localCsgroupId: number,
  997. tencentCorpId: string,
  998. tencentCorpUserIdList: string[]
  999. }
  1000. /**
  1001. * 新增客服组成员
  1002. * @param data
  1003. * @returns
  1004. */
  1005. export async function addLocalCorpCsgroupUserListApi(data: AddLocalCorpCsgroupUserListProps) {
  1006. return request(api + `/adq/localCorpCsgroup/user/add`, {
  1007. method: 'POST',
  1008. data
  1009. })
  1010. }
  1011. /**
  1012. * 删除客服组成员
  1013. * @param data
  1014. * @returns
  1015. */
  1016. export async function delLocalCorpCsgroupUserApi(data: { idList: number[] }) {
  1017. return request(api + `/adq/localCorpCsgroup/user/deleteBatch`, {
  1018. method: 'DELETE',
  1019. data
  1020. })
  1021. }
  1022. /**
  1023. * 修改客服号
  1024. * @param data
  1025. * @returns
  1026. */
  1027. export async function modifyLocalCorpCsgroupUserApi(data: { idList: number[], limitAddFansOfDay: number, poolType?: 'BLOCKLIST' | 'OFFLINE' | 'ONLINE' | 'WAITING' | 'WARRING' }) {
  1028. return request(api + `/adq/localCorpCsgroup/user/modifyBatch`, {
  1029. method: 'PATCH',
  1030. data
  1031. })
  1032. }
  1033. export interface updateCustomerServiceGroupProps {
  1034. adAccountId: number,
  1035. tencentCorpId: string,
  1036. groupId: number,
  1037. groupName: string,
  1038. userIdList: string[]
  1039. }
  1040. export interface AddLocalCorpCsgroupProps {
  1041. csgroupName: string, // 客服组名称
  1042. tencentCorpId: string,
  1043. type: 0 | 1, // 类型 0:客服组集,1:客服组,
  1044. parentId?: number, // 父级ID
  1045. policyId?: number, // 轮换策略ID
  1046. }
  1047. /**
  1048. * 新增客服组
  1049. * @param data
  1050. * @returns
  1051. */
  1052. export async function addLocalCorpCsgroupApi(data: AddLocalCorpCsgroupProps) {
  1053. return request(api + `/adq/localCorpCsgroup/add`, {
  1054. method: 'POST',
  1055. data
  1056. })
  1057. }
  1058. /**
  1059. * 修改客服组
  1060. * @param data
  1061. * @returns
  1062. */
  1063. export async function modifyLocalCorpCsgroupApi(data: AddLocalCorpCsgroupProps) {
  1064. return request(api + `/adq/localCorpCsgroup/modifyById`, {
  1065. method: 'PATCH',
  1066. data
  1067. })
  1068. }
  1069. export interface getWechatPagesCsgroupUserProps {
  1070. adAccountId: number,
  1071. tencentCorpId: string,
  1072. corpName: string,
  1073. departmentId?: number
  1074. }
  1075. /**
  1076. * 获取企业微信组件客服组成员
  1077. * @param data
  1078. * @returns
  1079. */
  1080. export async function getWechatPagesCsgroupUserApi(data: getWechatPagesCsgroupUserProps) {
  1081. return request(api + `/adq/v3/launch/tools/wechatPagesCsgroupUser/get`, {
  1082. method: 'POST',
  1083. data
  1084. })
  1085. }
  1086. /**
  1087. * 获取企业部门列表
  1088. * @param data
  1089. * @returns
  1090. */
  1091. export async function getCorpDepartmentListApi(params: { corpName: string }) {
  1092. return request(api + `/adq/v3/launch/tools/corpDepartmentList/get`, {
  1093. method: 'POST',
  1094. params
  1095. })
  1096. }
  1097. export interface GetTencentCorpCsgroupListProps {
  1098. groupName?: string, // 客服组名称
  1099. tencentCorpId?: string,
  1100. pageNum: number, // 页码
  1101. pageSize: number, // 页大小
  1102. }
  1103. /**
  1104. * 腾讯客服组列表查询
  1105. * @param data
  1106. * @returns
  1107. */
  1108. export async function getTencentCorpCsgroupListApi(data: GetTencentCorpCsgroupListProps) {
  1109. return request(api + `/adq/tencentCorpCsgroup/listOfPage`, {
  1110. method: 'POST',
  1111. data
  1112. })
  1113. }
  1114. /**
  1115. * 同步腾讯客服组
  1116. * @param data
  1117. * @returns
  1118. */
  1119. export async function syncencentCorpCsgroupApi(data: { tencentCorpId: string, accountId: number, groupId: number }) {
  1120. return request(api + `/adq/tencentCorpCsgroup/sync`, {
  1121. method: 'POST',
  1122. data
  1123. })
  1124. }
  1125. /**
  1126. * 腾讯客服组-查询组内成员
  1127. * @param params
  1128. * @returns
  1129. */
  1130. export async function getUserListListApi(params: { groupId: number }) {
  1131. return request(api + `/adq/tencentCorpCsgroup/userList`, {
  1132. method: 'GET',
  1133. params
  1134. })
  1135. }
  1136. export interface AddTencentCorpCsgroupProps {
  1137. accountId: number, // 账户ID
  1138. tencentCorpId: string, // 企业微信ID
  1139. groupName: string, // 客服组名称
  1140. tencentCorpUserIds: string[], // 企业微信成员ID
  1141. }
  1142. /**
  1143. * 腾讯客服组-新增
  1144. * @param data
  1145. * @returns
  1146. */
  1147. export async function addTencentCorpCsgroupApi(data: GetTencentCorpCsgroupListProps) {
  1148. return request(api + `/adq/tencentCorpCsgroup/add`, {
  1149. method: 'POST',
  1150. data
  1151. })
  1152. }
  1153. /**
  1154. * 绑定本地客服组
  1155. * @param data
  1156. * @returns
  1157. */
  1158. export async function bandTencentCorpCsgroupApi(data: { groupId: number, localCsgroupId?: number }) {
  1159. return request(api + `/adq/tencentCorpCsgroup/modifyById`, {
  1160. method: 'PATCH',
  1161. data
  1162. })
  1163. }
  1164. /**
  1165. * 查询企微关系列表
  1166. * @param params
  1167. * @returns
  1168. */
  1169. export async function getCorpRelationListApi(data: { adAccountId: number }) {
  1170. return request(api + `/adq/corpRelation/listOfPage`, {
  1171. method: 'POST',
  1172. data
  1173. })
  1174. }
  1175. /**
  1176. * 删除企微关系
  1177. * @param id
  1178. * @returns
  1179. */
  1180. export async function delCorpRelationApi(id: number) {
  1181. return request(api + `/adq/corpRelation/delById/${id}`, {
  1182. method: 'DELETE'
  1183. })
  1184. }
  1185. /**
  1186. * 新增企微关系
  1187. * @param params
  1188. * @returns
  1189. */
  1190. export async function addCorpRelationListApi(data: { adAccountId: number, corpId: string, corpName: string, tencentCorpId: string }) {
  1191. return request(api + `/adq/corpRelation/add`, {
  1192. method: 'POST',
  1193. data
  1194. })
  1195. }
  1196. export interface AddUserRotatePolicyProps {
  1197. policyName: string // 策略名称
  1198. addCostCalculationCycle?: number // 加粉成本的计算周期(/分钟,必须 >= 20,且必须是 10 的整数倍数)
  1199. addCostException?: number // 加粉成本异常值 (单位:/分)
  1200. maxAddFansCount?: number // 单号单日最大加粉数量
  1201. minAddFansCount?: number // 单号单日最大加粉数量,默认 20,加粉数少于该值永远不触发风控
  1202. onlineCount?: number // 组内客服号在线数量
  1203. rollingCustomerTime?: number // 客服组内滚动客服号的周期(/分钟,必须 >= 10)
  1204. id?: number
  1205. }
  1206. /**
  1207. * 客服组成员轮换策略-新增
  1208. * @param params
  1209. * @returns
  1210. */
  1211. export async function addUserRotatePolicyApi(data: AddUserRotatePolicyProps) {
  1212. return request(api + `/adq/localCorpCsgroup/userRotatePolicy/add`, {
  1213. method: 'POST',
  1214. data
  1215. })
  1216. }
  1217. /**
  1218. * 修改策略
  1219. * @param data
  1220. * @returns
  1221. */
  1222. export async function modifyUserRotatePolicyApi(data: AddUserRotatePolicyProps) {
  1223. return request(api + `/adq/localCorpCsgroup/userRotatePolicy/modifyById`, {
  1224. method: 'PATCH',
  1225. data
  1226. })
  1227. }
  1228. /**
  1229. * 客服组成员轮换策略-分页查询
  1230. * @param data
  1231. * @returns
  1232. */
  1233. export async function getUserRotatePolicyListApi(data: { pageNum: number, pageSize: number, policyName?: string }) {
  1234. return request(api + `/adq/localCorpCsgroup/userRotatePolicy/listOfPage`, {
  1235. method: 'POST',
  1236. data
  1237. })
  1238. }
  1239. /**
  1240. * 所有客服组成员轮换策略
  1241. * @param data
  1242. * @returns
  1243. */
  1244. export async function getUserRotatePolicyAllListApi(data: { policyName?: string }) {
  1245. return request(api + `/adq/localCorpCsgroup/userRotatePolicy/all`, {
  1246. method: 'POST',
  1247. data
  1248. })
  1249. }
  1250. /**
  1251. * 获取所有企微列表
  1252. * @returns
  1253. */
  1254. export async function getCorpListAllApi() {
  1255. return request(api + `/adq/corpRelation/corpListAll`, {
  1256. method: 'GET',
  1257. })
  1258. }
  1259. export interface AddPageCustomerGroupProps {
  1260. landingPageList: { [x: string]: any }[], // 落地页
  1261. localCsgroupId: string
  1262. }
  1263. /**
  1264. * 新增落地页客服关系
  1265. * @param data
  1266. * @returns
  1267. */
  1268. export async function addPageCustomerGroupApi(data: AddPageCustomerGroupProps) {
  1269. return request(api + `/adq/localCorpCsgroup/landingPage/add`, {
  1270. method: 'POST',
  1271. data
  1272. })
  1273. }
  1274. /**
  1275. * 修改落地页客服关系
  1276. * @param data
  1277. * @returns
  1278. */
  1279. export async function modifyPageCustomerGroupApi(data: { localCsgroupId: number, pageId: number, pageType: string }) {
  1280. return request(api + `/adq/localCorpCsgroup/landingPage/modifyById`, {
  1281. method: 'PATCH',
  1282. data
  1283. })
  1284. }
  1285. /**
  1286. * 新增原生落地页客服关系
  1287. * @param data
  1288. * @returns
  1289. */
  1290. export async function addLandingPageCustomerGroupApi(data: AddPageCustomerGroupProps) {
  1291. return request(api + `/adq/localCorpCsgroup/wechat/landingPage/add`, {
  1292. method: 'POST',
  1293. data
  1294. })
  1295. }
  1296. /**
  1297. * 修改落地页客服关系
  1298. * @param data
  1299. * @returns
  1300. */
  1301. export async function modifyLandingPageCustomerGroupApi(data: { localCsgroupId: number, pageId: number }) {
  1302. return request(api + `/adq/localCorpCsgroup/wechat/landingPage/modifyById`, {
  1303. method: 'PATCH',
  1304. data
  1305. })
  1306. }
  1307. export interface GetPageCustomerGroupListProps {
  1308. pageNum: number,
  1309. pageSize: number,
  1310. pageId?: string,
  1311. pageName?: string
  1312. }
  1313. /**
  1314. * 查询落地页客服关系
  1315. * @param data
  1316. * @returns
  1317. */
  1318. export async function getPageCustomerGroupListApi(data: GetPageCustomerGroupListProps) {
  1319. return request(api + `/adq/localCorpCsgroup/landingPage/listOfPage`, {
  1320. method: 'POST',
  1321. data
  1322. })
  1323. }
  1324. /**
  1325. * 原生落地页客服关系
  1326. * @param data
  1327. * @returns
  1328. */
  1329. export async function getLandingPageCustomerGroupListApi(data: GetPageCustomerGroupListProps) {
  1330. return request(api + `/adq/localCorpCsgroup/wechat/landingPage/listOfPage`, {
  1331. method: 'POST',
  1332. data
  1333. })
  1334. }
  1335. export interface GetCreativeComponentProps {
  1336. pageNum: number,
  1337. pageSize: number,
  1338. adAccountId?: number,
  1339. componentId?: string[],
  1340. componentSubType?: string[]
  1341. componentType?: string[]
  1342. createTimeMin?: string
  1343. createTimeMax?: string
  1344. generationType?: string[]
  1345. imageId?: string[]
  1346. videoId?: string[]
  1347. isDeleted?: boolean
  1348. potentialStatus?: string
  1349. activeKey?: string
  1350. componentCustomName?: string
  1351. sortColumn?: string
  1352. sortAsc?: boolean
  1353. costStartTime?: string
  1354. costEndTime?: string
  1355. }
  1356. /**
  1357. * 分页查询创意组件
  1358. * @param data
  1359. * @returns
  1360. */
  1361. export async function getCreativeComponentListApi(data: GetCreativeComponentProps) {
  1362. return request(api + `/adq/creative/component/listOfPage`, {
  1363. method: 'POST',
  1364. data
  1365. })
  1366. }
  1367. /**
  1368. * 分页查询创意组件 + 数据
  1369. * @param data
  1370. * @returns
  1371. */
  1372. export async function getCreativeComponentDataListApi(data: GetCreativeComponentProps) {
  1373. return request(api + `/material/componentData/listOfPage`, {
  1374. method: 'POST',
  1375. data
  1376. })
  1377. }
  1378. interface GetComponentSharingProps {
  1379. adAccountId: number
  1380. componentId: number
  1381. pageNum: number,
  1382. pageSize: number,
  1383. isDeleted?: boolean
  1384. }
  1385. /**
  1386. * 查询组件共享账号
  1387. * @param data
  1388. * @returns
  1389. */
  1390. export async function getComponentSharingApi(data: GetComponentSharingProps) {
  1391. return request(api + `/adq/creative/component/getComponentSharing`, {
  1392. method: 'POST',
  1393. data
  1394. })
  1395. }
  1396. interface UpdateComponentSharingProps {
  1397. adAccountId: number
  1398. componentId: number
  1399. sharingAccountIds: number[]
  1400. sharedAccountType: string // ADVERTISER 部分共享、ORGANIZATION 全部共享
  1401. }
  1402. /**
  1403. * 修改共享状态
  1404. * @param data
  1405. * @returns
  1406. */
  1407. export async function updateComponentSharingApi(data: UpdateComponentSharingProps) {
  1408. return request(api + `/adq/creative/component/updateComponentSharing`, {
  1409. method: 'POST',
  1410. data
  1411. })
  1412. }
  1413. export interface CreativeComponentDetailDTOS {
  1414. materialId?: string,
  1415. componentSubType: string
  1416. componentType?: string, //'image' | 'imageList' | 'video' | 'videoList' | 'description',
  1417. materialIdList?: string[]
  1418. coverUrl?: string
  1419. text?: string
  1420. }
  1421. export interface AddBatchCreativeComponent {
  1422. adAccountId: number,
  1423. creativeComponentDetailDTOS: CreativeComponentDetailDTOS[]
  1424. }
  1425. /**
  1426. * 批量创建创意组件
  1427. * @param data
  1428. * @returns
  1429. */
  1430. export async function addBatchCreativeComponentApi(data: AddBatchCreativeComponent) {
  1431. return request(api + `/adq/creative/component/addBatch`, {
  1432. method: 'POST',
  1433. data
  1434. })
  1435. }
  1436. /**
  1437. * 查询业务单元共享状态
  1438. * @returns
  1439. */
  1440. export async function getDefaultSharingApi(params: { adAccountId: number }) {
  1441. return request(api + `/adq/creative/component/getDefaultSharing/${params.adAccountId}`, {
  1442. method: 'GET'
  1443. })
  1444. }
  1445. /**
  1446. * 修改业务单元组件共享状态
  1447. * @param params
  1448. * @returns
  1449. */
  1450. export async function updateDefaultSharingApi(params: { adAccountId: number, type: string }) {
  1451. return request(api + `/adq/creative/component/updateDefaultSharing`, {
  1452. method: 'POST',
  1453. params
  1454. })
  1455. }
  1456. /**
  1457. * 删除组件
  1458. * @param params
  1459. * @returns
  1460. */
  1461. export async function delComponentApi({ componentId, ...params }: { adAccountId: number, componentId: number[] }) {
  1462. return request(api + `/adq/creative/component/deleteBatch`, {
  1463. method: 'DELETE',
  1464. params,
  1465. data: componentId
  1466. })
  1467. }
  1468. /**
  1469. * 同步组件
  1470. * @param param0
  1471. * @returns
  1472. */
  1473. export async function syncComponentApi(data: { accountIds: number[], startTime: string, endTime: string }) {
  1474. return request(api + `/adq/creative/component/syncBatch`, {
  1475. method: 'PUT',
  1476. data
  1477. })
  1478. }