adq.ts 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. import { request } from 'umi';
  2. import { api } from '../api';
  3. /**
  4. * 获取组员及组员账号列表
  5. */
  6. export async function getAdAccountAllOfMember() {
  7. return request(api + '/adq/adAccount/allOfMember');
  8. }
  9. // export async function get_allOfMember() {
  10. // return fetch(api + '/adq/adAccount/allOfMember',{
  11. // headers:{
  12. // "content-Type":"application/json;charset=UTF-8",
  13. // "Authorization": `Bearer ${sessionStorage.getItem("Admin-Token")}`
  14. // }
  15. // }).then(res=>res.json())
  16. // }
  17. /**
  18. * 获取ADQ账号列表
  19. * @param adgroupName 广告名称
  20. * @param promotedObjectType 广告类型
  21. * @param accountId 账户ID
  22. * @param adgroupName 广告名称
  23. */
  24. export async function getAdqAdAccountList(params: {
  25. pageNum: number;
  26. pageSize: number;
  27. userId?:string;//用户ID
  28. accountIds?: string[];//账号本地ID
  29. }) {
  30. return request(api + '/adq/adAccount/list', {
  31. method: 'POST',
  32. data: params,
  33. });
  34. }
  35. /**
  36. * 按账号同步计划
  37. * @param adAccountId 本地ID
  38. */
  39. export async function putAdqAdAccountSyncByIds(data:any) {
  40. return request(api + `/adq/adAccount/syncByIds`, {
  41. method: 'PUT',
  42. data
  43. });
  44. }
  45. /**
  46. * 获取ADQ计划列表
  47. * @param adgroupName 广告名称
  48. * @param promotedObjectType 广告类型
  49. * @param accountId 账户ID
  50. * @param adgroupName 广告名称
  51. */
  52. export async function getAdqCampaignList(params: {
  53. pageNum: number;
  54. pageSize: number;
  55. userId?:string;//用户ID
  56. accountId?: string;//账号本地ID
  57. campaignName?:string;//计划名称
  58. configuredStatus?:string;//计划状态
  59. campaignType?:string;//计划类型
  60. promotedObjectType?:string;//推广目标类型
  61. }) {
  62. return request(api + '/adq/campaign/list', {
  63. method: 'POST',
  64. data: params,
  65. });
  66. }
  67. /**
  68. * 按账号同步计划
  69. * @param adAccountId 本地ID
  70. */
  71. export async function putAdqCampaignPage(adAccountId: any) {
  72. return request(api + `/adq/campaign/syncAll/${adAccountId} `, {
  73. method: 'PUT',
  74. });
  75. }
  76. /**
  77. * 获取ADQ广告列表
  78. * @param adgroupName 广告名称
  79. * @param promotedObjectType 广告类型
  80. * @param accountId 账户ID
  81. * @param adgroupName 广告名称
  82. */
  83. export async function getAdqAdgroupsList(params: {
  84. pageNum: number;
  85. pageSize: number;
  86. accountId: string;
  87. adgroupName?:string
  88. }) {
  89. return request(api + '/adq/adgroups/list', {
  90. method: 'POST',
  91. data: params,
  92. });
  93. }
  94. /**
  95. * 同步ADQ广告列表
  96. *@param adAccountId 本地ID
  97. */
  98. export async function putAdqAdgroupsSync(data: any) {
  99. return request(api + `/adq/adgroups/sync`, {
  100. method: 'PUT',
  101. data
  102. });
  103. }
  104. /**
  105. * 获取ADQ创意列表
  106. * @param adgroupName 广告名称
  107. * @param promotedObjectType 广告类型
  108. * @param accountId 账户ID
  109. * @param adcreativeName
  110. */
  111. export async function getAdqAdcreativeList(params: {
  112. pageNum: number;
  113. pageSize: number;
  114. accountId: string;
  115. adcreativeName?:string
  116. }) {
  117. return request(api + '/adq/adcreative/list', {
  118. method: 'POST',
  119. data: params,
  120. });
  121. }
  122. /**
  123. * 获取ADQ落地页列表
  124. * @param adgroupName 广告名称
  125. * @param promotedObjectType 广告类型
  126. * @param accountId 账户ID
  127. */
  128. export async function getAdqLandingPageList(params: {
  129. pageNum: number;
  130. pageSize: number;
  131. accountId: string;
  132. pageName: string;
  133. pageType: string;
  134. pageTemplateId: string;
  135. pageStatus: string;
  136. }) {
  137. return request(api + '/adq/landingPageWechat/list ', {
  138. method: 'POST',
  139. data: params,
  140. });
  141. }
  142. /**
  143. * 按账号同步落地页
  144. * @param adAccountId 本地ID
  145. */
  146. export async function putAdqLandingPage(adAccountId: any) {
  147. return request(api + `/adq/landingPageWechat/syncAll/${adAccountId} `, {
  148. method: 'PUT',
  149. });
  150. }
  151. /**
  152. * 获取ADQ定向列表
  153. * @param adgroupName 广告名称
  154. * @param promotedObjectType 广告类型
  155. * @param accountId 账户ID
  156. */
  157. export async function getAdqTargetingList(params: {
  158. pageNum: number;
  159. pageSize: number;
  160. accountId: string;
  161. pageName: string;
  162. pageType: string;
  163. pageTemplateId: string;
  164. pageStatus: string;
  165. }) {
  166. return request(api + '/adq/targeting/list ', {
  167. method: 'POST',
  168. data: params,
  169. });
  170. }
  171. /**
  172. * 按账号同步ADQ定向列表
  173. * @param adAccountId 本地ID
  174. */
  175. export async function putAdqTargetingSyncAll(adAccountId: any) {
  176. return request(api + `/adq/targeting/syncAll/${adAccountId} `, {
  177. method: 'PUT',
  178. });
  179. }
  180. /**
  181. * 计划启停
  182. * @param adAccountId 本地ID
  183. */
  184. export async function putAdqCampaignConfigStatus(params: any) {
  185. let {accountId,campaignId,configuredStatus}=params
  186. return request(api + `/adq/campaign/configStatus/${accountId}/${campaignId}/${configuredStatus}`, {
  187. method: 'PUT',
  188. });
  189. }
  190. /**
  191. * 广告启停
  192. * @param adAccountId 本地ID
  193. */
  194. export async function putAdqAdgroupsConfigStatus(params: any) {
  195. let {accountId,adgroupId,configuredStatus}=params
  196. return request(api + `/adq/campaign/configStatus/${accountId}/${adgroupId}/${configuredStatus}`, {
  197. method: 'PUT',
  198. });
  199. }