global.ts 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252
  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: { wechatId: string, wechatName: string }) {
  527. return request(api + `/adq/v3/corpWechat/add`, {
  528. method: 'POST',
  529. data
  530. })
  531. }
  532. /**
  533. * 查询本地企业微信列表
  534. * @param data
  535. * @returns
  536. */
  537. export async function getCorpWechatApi(data: { pageNum: number, pageSize: number, wechatName?: string, wechatIdList?: string[] }) {
  538. return request(api + `/adq/v3/corpWechat/list`, {
  539. method: 'POST',
  540. data
  541. })
  542. }
  543. /**
  544. * 删除本地企业微信信息
  545. * @param data
  546. * @returns
  547. */
  548. export async function delCorpWechatApi(id: number) {
  549. return request(api + `/adq/v3/corpWechat/delById/${id}`, {
  550. method: 'DELETE'
  551. })
  552. }
  553. /**
  554. * 获取所有微信小程序列表
  555. * @param data
  556. * @returns
  557. */
  558. export async function getCorpWechatAllApi(data: { wechatName?: string, wechatIdList?: string[] }) {
  559. return request(api + `/adq/v3/corpWechat/listAll`, {
  560. method: 'POST',
  561. data
  562. })
  563. }
  564. /**
  565. * 获取详情
  566. * @param id
  567. * @returns
  568. */
  569. export async function getCorpWechatDetailApi(id: number) {
  570. return request(api + `/adq/v3/corpWechat/getById/${id}`, {
  571. method: 'GET'
  572. })
  573. }
  574. /**
  575. * 获取广告标签
  576. * @param data
  577. * @returns
  578. */
  579. export async function getAdLabelApi(data: { accountId?: number }) {
  580. return request(api + `/adq/v3/launch/tools/getAdLabel`, {
  581. method: 'POST',
  582. data
  583. })
  584. }
  585. /**
  586. * 获取游戏列表
  587. * @param data
  588. * @returns
  589. */
  590. export async function getGameLibraryListApi(data: { pageNum: number, pageSize: number, gameName?: string, idList?: number[], gameType?: string }) {
  591. return request(api + `/adq/v3/gameLibrary/pageList`, {
  592. method: 'POST',
  593. data
  594. })
  595. }
  596. /**
  597. * 所有游戏列表
  598. * @param data
  599. * @returns
  600. */
  601. export async function getGameLibraryApi(data: { gameName?: string, idList?: number[], gameType?: string }) {
  602. return request(api + `/adq/v3/gameLibrary/listAll`, {
  603. method: 'POST',
  604. data
  605. })
  606. }
  607. /**
  608. * 新增游戏
  609. * @param data
  610. * @returns
  611. */
  612. export async function addGameApi(data: { appId: string, gameName: string, gameType: string, id?: number }) {
  613. return request(api + `/adq/v3/gameLibrary/add`, {
  614. method: 'POST',
  615. data
  616. })
  617. }
  618. /**
  619. * 删除游戏
  620. * @param id
  621. * @returns
  622. */
  623. export async function delGameApi(id: number) {
  624. return request(api + `/adq/v3/gameLibrary/delById/${id}`, {
  625. method: 'DELETE'
  626. })
  627. }
  628. /**
  629. * 获取游戏详情
  630. * @param id
  631. * @returns
  632. */
  633. export async function getGameLibraryDetailApi(id: number) {
  634. return request(api + `/adq/v3/gameLibrary/getById/${id}`, {
  635. method: 'GET'
  636. })
  637. }
  638. /**
  639. * 获取游戏详情
  640. * @param wxGameAppId
  641. * @returns
  642. */
  643. export async function getGameLibraryAppIdDetailApi(wxGameAppId: number) {
  644. return request(api + `/adq/v3/gameLibrary/getByAppId/${wxGameAppId}`, {
  645. method: 'GET'
  646. })
  647. }
  648. /**
  649. * 获取弹幕
  650. * @param data
  651. * @returns
  652. */
  653. export async function getBarrageRecommendListApi(params: { adAccountId?: number, taskType?: 'GAME' | 'NOVEL' }) {
  654. // return request(api + `/adq/v3/launch/tools/creative/tools/barrage`, {
  655. return request(api + `/adq/v3/launch/tools/creative/tools/barrageRecommend`, {
  656. method: 'GET',
  657. params
  658. })
  659. }
  660. /**
  661. * 账户资产组分页查询
  662. * @param params
  663. * @returns
  664. */
  665. export async function getAccountAssetsGroupListApi(data: { accountGroupName?: string, authMainAccountIds?: number[], authType?: string, pageNum: number, pageSize: number }) {
  666. return request(api + `/adq/v3/marketingAssets/accountAssetsGroup/pageList`, {
  667. method: 'POST',
  668. data
  669. })
  670. }
  671. /**
  672. * 所有账户资产共享组
  673. * @param data
  674. * @returns
  675. */
  676. export async function getAccountAssetsGroupListAllApi(data: { accountGroupName?: string, authMainAccountIds?: number[] }) {
  677. return request(api + `/adq/v3/marketingAssets/accountAssetsGroup/ListAll`, {
  678. method: 'POST',
  679. data
  680. })
  681. }
  682. /**
  683. * 账户资产组修改(只能改名字)
  684. * @param data
  685. * @returns
  686. */
  687. export async function updateAccountAssetsGroupApi(data: { accountGroupId: number, accountGroupName: string }) {
  688. return request(api + `/adq/v3/marketingAssets/accountAssetsGroup/update`, {
  689. method: 'POST',
  690. data
  691. })
  692. }
  693. /**
  694. * 账户资产组取消授权
  695. * @param data
  696. * @returns
  697. */
  698. export async function revokeAuthAccountAssetsGroupApi(data: { accountAssetsGroupId: number, accountId: number[], assetId?: number }) {
  699. return request(api + `/adq/v3/marketingAssets/accountAssetsGroup/revokeAuth`, {
  700. method: 'POST',
  701. data
  702. })
  703. }
  704. /**
  705. * 删除账户组
  706. * @param data
  707. * @returns
  708. */
  709. export async function delAuthAccountAssetsGroupApi(data: { id: number }) {
  710. return request(api + `/adq/v3/marketingAssets/accountAssetsGroup/delete/${data.id}`, {
  711. method: 'DELETE',
  712. })
  713. }
  714. /**
  715. * 账户资产组创建
  716. * @param data
  717. * @returns
  718. */
  719. export async function createAccountAssetsGroupApi(data: { accountGroupId?: number, accountGroupName: string, authMainAccountId: number, authType: string }) {
  720. return request(api + `/adq/v3/marketingAssets/accountAssetsGroup/create`, {
  721. method: 'POST',
  722. data
  723. })
  724. }
  725. /**
  726. * 查询被授权的账户
  727. * @param data
  728. * @returns
  729. */
  730. export async function getAccountAssetsGroupAccountListApi(data: { groupId: number }) {
  731. return request(api + `/adq/v3/marketingAssets/accountAssetsGroup/authAccountList/${data.groupId}`, {
  732. method: 'GET'
  733. })
  734. }
  735. /**
  736. * 账户资产授权
  737. * @param data
  738. * @returns
  739. */
  740. export async function authAccountAssetsGroupAccountApi(data: { accountAssetsGroupId: number, accountId: number[], assetId?: number, assetName?: string }) {
  741. return request(api + `/adq/v3/marketingAssets/accountAssetsGroup/auth`, {
  742. method: 'POST',
  743. data
  744. })
  745. }
  746. /**
  747. * 批量授权
  748. * @param data
  749. * @returns
  750. */
  751. export async function batchAuthAccountAssetsGroupAccountApi(data: { accountAssetsGroupId: number, accountId: number[], assetsDTOS: { assetId: number, assetName: string }[] }) {
  752. return request(api + `/adq/v3/marketingAssets/accountAssetsGroup/batchAuth`, {
  753. method: 'POST',
  754. data
  755. })
  756. }
  757. /**
  758. * 同步素材
  759. * @param data
  760. * @returns
  761. */
  762. export async function syncMediaImageApi({ type, ...data }: { accountIds: number[], createTimeMin: string, createTimeMax: string, type: 'image' | 'video' }) {
  763. if (type === 'image') {
  764. return request(api + `/adq/v3/mediaImage/syncImage`, {
  765. method: 'POST',
  766. data
  767. })
  768. }
  769. return request(api + `/adq/v3/mediaVideo/syncVideo`, {
  770. method: 'POST',
  771. data
  772. })
  773. }
  774. /**
  775. * 获取文案库列表
  776. * @param data
  777. * @returns
  778. */
  779. export async function getCopyWritingListApi(data: { category?: string, content?: string, createBy?: number, pageNum: number, pageSize: number }) {
  780. return request(api + `/adq/copyWriting/pageList`, {
  781. method: 'POST',
  782. data
  783. })
  784. }
  785. /**
  786. * 新增修改文案
  787. * @param data
  788. * @returns
  789. */
  790. export async function copyWritingApi(data: { category: string, contentList?: string[], content?: string, id?: number }) {
  791. if (data?.id) {
  792. return request(api + `/adq/copyWriting/update`, {
  793. method: 'POST',
  794. data
  795. })
  796. }
  797. return request(api + `/adq/copyWriting/addBatch`, {
  798. method: 'POST',
  799. data
  800. })
  801. }
  802. /**
  803. * 删除
  804. * @param id
  805. * @returns
  806. */
  807. export async function delCopyWritingApi(id: number) {
  808. return request(api + `/adq/copyWriting/delById/${id}`, {
  809. method: 'DELETE',
  810. })
  811. }
  812. /**
  813. * 批量删除
  814. * @param ids
  815. * @returns
  816. */
  817. export async function delsCopyWritingApi(ids: number[]) {
  818. return request(api + `/adq/copyWriting/batchDelByIds`, {
  819. method: 'DELETE',
  820. data: ids
  821. })
  822. }
  823. export type ApplicationTypeProps = 'IOS' | 'ANDROID'
  824. export interface GetApplicationListProps {
  825. pageNum: number,
  826. pageSize: number,
  827. createBy?: number,
  828. applicationId?: string
  829. name?: string
  830. type?: ApplicationTypeProps
  831. }
  832. /**
  833. * 查询本地推广应用列表
  834. * @param data
  835. * @returns
  836. */
  837. export async function getApplicationListApi(data: GetApplicationListProps) {
  838. return request(api + `/adq/promote/application/list`, {
  839. method: 'POST',
  840. data
  841. })
  842. }
  843. /**
  844. * 查询本地推广全部应用列表
  845. * @param data
  846. * @returns
  847. */
  848. export async function getApplicationAllApi(data: Omit<GetApplicationListProps, 'pageNum' | 'pageSize'>) {
  849. return request(api + `/adq/promote/application/listAll`, {
  850. method: 'POST',
  851. data
  852. })
  853. }
  854. export interface AddApplicationProps {
  855. applicationId: number,
  856. name: string,
  857. type: ApplicationTypeProps
  858. id?: number
  859. }
  860. /**
  861. * 新增推广应用
  862. * @param data
  863. * @returns
  864. */
  865. export async function addApplicationApi(data: AddApplicationProps) {
  866. return request(api + `/adq/promote/application/add`, {
  867. method: 'POST',
  868. data
  869. })
  870. }
  871. /**
  872. * 修改推广应用
  873. * @param data
  874. * @returns
  875. */
  876. export async function updateApplicationApi(data: Required<AddApplicationProps>) {
  877. return request(api + `/adq/promote/application/update`, {
  878. method: 'POST',
  879. data
  880. })
  881. }
  882. /**
  883. * 删除本地推广应用
  884. * @param id
  885. * @returns
  886. */
  887. export async function delApplicationApi(id: number) {
  888. return request(api + `/adq/promote/application/delById/${id}`, {
  889. method: 'DELETE',
  890. })
  891. }
  892. /**
  893. * 应用详情
  894. * @param id
  895. * @returns
  896. */
  897. export async function getApplicationDetailApi(id: number) {
  898. return request(api + `/adq/promote/application/getById/${id}`, {
  899. method: 'GET'
  900. })
  901. }
  902. /**
  903. * 查询企业微信组件客服组
  904. * @param data
  905. * @returns
  906. */
  907. export async function getCustomerServiceGroupListApi(data: { adAccountId: number, pageNum: number, pageSize: number, tencentCorpId?: string }) {
  908. return request(api + `/adq/v3/launch/tools/selectCustomerServiceGroup`, {
  909. method: 'POST',
  910. data
  911. })
  912. }
  913. export interface updateCustomerServiceGroupProps {
  914. adAccountId: number,
  915. tencentCorpId: string,
  916. groupId: number,
  917. groupName: string,
  918. userIdList: string[]
  919. }
  920. /**
  921. * 修改企业微信组件客服组
  922. * @param data
  923. * @returns
  924. */
  925. export async function updateCustomerServiceGroupApi(data: updateCustomerServiceGroupProps) {
  926. return request(api + `/adq/v3/launch/tools/updateCustomerServiceGroup`, {
  927. method: 'POST',
  928. data
  929. })
  930. }
  931. export interface getWechatPagesCsgroupUserProps {
  932. adAccountId: number,
  933. tencentCorpId: string,
  934. corpName: string,
  935. departmentId?: number
  936. }
  937. /**
  938. * 获取企业微信组件客服组成员
  939. * @param data
  940. * @returns
  941. */
  942. export async function getWechatPagesCsgroupUserApi(data: getWechatPagesCsgroupUserProps) {
  943. return request(api + `/adq/v3/launch/tools/wechatPagesCsgroupUser/get`, {
  944. method: 'POST',
  945. data
  946. })
  947. }
  948. /**
  949. * 获取企业部门列表
  950. * @param data
  951. * @returns
  952. */
  953. export async function getCorpDepartmentListApi(params: { corpName: string }) {
  954. return request(api + `/adq/v3/launch/tools/corpDepartmentList/get`, {
  955. method: 'POST',
  956. params
  957. })
  958. }
  959. /**
  960. * 查询企微关系列表
  961. * @param params
  962. * @returns
  963. */
  964. export async function getCorpRelationListApi(data: { adAccountId: number }) {
  965. return request(api + `/adq/corpRelation/listOfPage`, {
  966. method: 'POST',
  967. data
  968. })
  969. }
  970. /**
  971. * 查询所有企微关系
  972. * @param data
  973. * @returns
  974. */
  975. export async function getCorpRelationAllApi(data: { adAccountId: number }) {
  976. return request(api + `/adq/corpRelation/listAll`, {
  977. method: 'POST',
  978. data
  979. })
  980. }
  981. /**
  982. * 删除企微关系
  983. * @param id
  984. * @returns
  985. */
  986. export async function delCorpRelationApi(id: number) {
  987. return request(api + `/adq/corpRelation/delById/${id}`, {
  988. method: 'DELETE'
  989. })
  990. }
  991. /**
  992. * 新增企微关系
  993. * @param params
  994. * @returns
  995. */
  996. export async function addCorpRelationListApi(data: { adAccountId: number, corpId: string, corpName: string, tencentCorpId: string }) {
  997. return request(api + `/adq/corpRelation/add`, {
  998. method: 'POST',
  999. data
  1000. })
  1001. }
  1002. /**
  1003. * 获取所有企微列表
  1004. * @returns
  1005. */
  1006. export async function getCorpListAllApi() {
  1007. return request(api + `/adq/corpRelation/corpListAll`, {
  1008. method: 'GET',
  1009. })
  1010. }
  1011. export interface AddPageCustomerGroupProps {
  1012. adAccountId: number,
  1013. customerGroupId: number,
  1014. customerGroupName: string,
  1015. pageId: number,
  1016. pageName: string,
  1017. tencentCorpId: string
  1018. }
  1019. /**
  1020. * 新增落地页客服关系
  1021. * @param data
  1022. * @returns
  1023. */
  1024. export async function addPageCustomerGroupApi(data: AddPageCustomerGroupProps) {
  1025. return request(api + `/adq/pageCustomerGroup/relation/add`, {
  1026. method: 'POST',
  1027. data
  1028. })
  1029. }
  1030. /**
  1031. * 删除落地页客服关系
  1032. * @param id
  1033. * @returns
  1034. */
  1035. export async function delPageCustomerGroupApi(id: number) {
  1036. return request(api + `/adq/pageCustomerGroup/relation/delById/${id}`, {
  1037. method: 'DELETE'
  1038. })
  1039. }
  1040. export interface GetPageCustomerGroupListProps {
  1041. adAccountId: number,
  1042. pageNum: number,
  1043. pageSize: number,
  1044. pageId?: number,
  1045. customerGroupId?: number,
  1046. customerGroupName?: string,
  1047. pageName?: string,
  1048. tencentCorpId?: string
  1049. }
  1050. /**
  1051. * 查询落地页客服关系
  1052. * @param data
  1053. * @returns
  1054. */
  1055. export async function getPageCustomerGroupListApi(data: GetPageCustomerGroupListProps) {
  1056. return request(api + `/adq/pageCustomerGroup/relation/listOfPage`, {
  1057. method: 'POST',
  1058. data
  1059. })
  1060. }
  1061. export interface GetCreativeComponentProps {
  1062. pageNum: number,
  1063. pageSize: number,
  1064. adAccountId?: number,
  1065. componentId?: string[],
  1066. componentSubType?: string[]
  1067. componentType?: string[]
  1068. createTimeMin?: string
  1069. createTimeMax?: string
  1070. generationType?: string[]
  1071. imageId?: string[]
  1072. videoId?: string[]
  1073. isDeleted?: boolean
  1074. potentialStatus?: string
  1075. activeKey?: string
  1076. }
  1077. /**
  1078. * 分页查询创意组件
  1079. * @param data
  1080. * @returns
  1081. */
  1082. export async function getCreativeComponentListApi(data: GetCreativeComponentProps) {
  1083. return request(api + `/adq/creative/component/listOfPage`, {
  1084. method: 'POST',
  1085. data
  1086. })
  1087. }
  1088. export interface CreativeComponentDetailDTOS {
  1089. materialId?: string,
  1090. componentSubType: string
  1091. componentType?: string, //'image' | 'imageList' | 'video' | 'videoList' | 'description',
  1092. materialIdList?: string[]
  1093. coverUrl?: string
  1094. text?: string
  1095. }
  1096. export interface AddBatchCreativeComponent {
  1097. adAccountId: number,
  1098. creativeComponentDetailDTOS: CreativeComponentDetailDTOS[]
  1099. }
  1100. /**
  1101. * 批量创建创意组件
  1102. * @param data
  1103. * @returns
  1104. */
  1105. export async function addBatchCreativeComponentApi(data: AddBatchCreativeComponent) {
  1106. return request(api + `/adq/creative/component/addBatch`, {
  1107. method: 'POST',
  1108. data
  1109. })
  1110. }
  1111. /**
  1112. * 查询业务单元共享状态
  1113. * @returns
  1114. */
  1115. export async function getDefaultSharingApi(params: { adAccountId: number }) {
  1116. return request(api + `/adq/creative/component/getDefaultSharing/${params.adAccountId}`, {
  1117. method: 'GET'
  1118. })
  1119. }
  1120. /**
  1121. * 修改业务单元组件共享状态
  1122. * @param params
  1123. * @returns
  1124. */
  1125. export async function updateDefaultSharingApi(params: { adAccountId: number, type: string }) {
  1126. return request(api + `/adq/creative/component/updateDefaultSharing`, {
  1127. method: 'POST',
  1128. params
  1129. })
  1130. }