global.ts 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. import { request } from 'umi';
  2. import { api } from '../api';
  3. /**
  4. * 定向标签获取
  5. *
  6. */
  7. export async function getTagsList(params: any) {
  8. return request(api + `/adq/launch/tools/targeting/tags/list`, {
  9. method: 'POST',
  10. data: params
  11. })
  12. }
  13. /**
  14. * 场景定向标签获取
  15. * */
  16. export async function getSceneTagsList(params: any) {
  17. return request(api + `/adq/launch/tools/scene/spec/tags/list`, {
  18. method: 'POST',
  19. data: params
  20. })
  21. }
  22. /**
  23. * 创意形式详细信息
  24. * @param promotedObjectType 推广目标
  25. * @param adcreativeTemplateId 创意形式ID
  26. * @param siteSet 数组版位
  27. * https://developers.e.qq.com/docs/api/tools/adcreative_template/adcreative_template_get?version=1.3&_preview=1
  28. * https://developers.e.qq.com/docs/tools/adcreative_template
  29. * */
  30. export async function get_adcreative_template(params: any) {
  31. return request(api + `/adq/launch/tools/adcreative/template`, {
  32. method: 'POST',
  33. data: params
  34. })
  35. }
  36. /**
  37. * 创意形式列表信息
  38. * @param promotedObjectType 推广目标
  39. * @param siteSet 数组版位
  40. * @param campaignType 投放位置
  41. * https://developers.e.qq.com/docs/api/tools/adcreative_template/adcreative_template_list_get?version=1.3&_preview=1
  42. * */
  43. export async function get_adcreative_template_list(params: any) {
  44. return request(api + `/adq/launch/tools/adcreative/template/list`, {
  45. method: 'POST',
  46. data: params
  47. })
  48. }
  49. /**
  50. * 文案助手
  51. * */
  52. export async function getText(params: {
  53. maxTextLength: number,
  54. adAccountId: number,
  55. }) {
  56. return request(api + `/adq/launch/tools/creative/tools/text`, {
  57. method: 'GET',
  58. params
  59. })
  60. }
  61. /**
  62. * 视频封面图生成
  63. * */
  64. export async function get_tools_video_capture(params: any) {
  65. return request(api + `/adq/launch/tools/video/maker/capture`, {
  66. method: 'POST',
  67. data: params
  68. })
  69. }
  70. /**
  71. * 获取品牌形象列表
  72. * @returns
  73. */
  74. export async function getSysBrandApi() {
  75. return request(api + `/adq/sysBrand/allOfUser`, {
  76. method: 'GET'
  77. })
  78. }
  79. /**
  80. * 新增品牌形象
  81. * @param data
  82. * @returns
  83. */
  84. export async function addSysBrandApi(data: { name: string, brandImgUrl: string }) {
  85. return request(api + `/adq/sysBrand`, {
  86. method: 'POST',
  87. data
  88. })
  89. }
  90. /**
  91. * 修改品牌形象
  92. * @param data
  93. * @returns
  94. */
  95. export async function editSysBrandApi(data: { name: string, brandImgUrl: string, sysBrandId: number }) {
  96. const { sysBrandId, ...params } = data
  97. return request(api + `/adq/sysBrand/${sysBrandId}`, {
  98. method: 'PUT',
  99. data: params
  100. })
  101. }
  102. /**
  103. * 删除品牌形象
  104. * @param data
  105. * @returns
  106. */
  107. export async function delSysBrandApi(data: { sysBrandId: number }) {
  108. const { sysBrandId } = data
  109. return request(api + `/adq/sysBrand/${sysBrandId}`, {
  110. method: 'DELETE'
  111. })
  112. }
  113. /**
  114. * 获取头像及昵称跳转页
  115. * @returns
  116. */
  117. export async function getSysProfileApi() {
  118. return request(api + `/adq/sysProfile/allOfUser`, {
  119. method: 'GET'
  120. })
  121. }
  122. /**
  123. * 新增头像及昵称跳转页
  124. * @param data
  125. * @returns
  126. */
  127. export async function addSysProfileApi(data: { name: string, brandImgUrl: string }) {
  128. return request(api + `/adq/sysProfile`, {
  129. method: 'POST',
  130. data
  131. })
  132. }
  133. /**
  134. * 修改头像及昵称跳转页
  135. * @param data
  136. * @returns
  137. */
  138. export async function editSysProfileApi(data: { name: string, brandImgUrl: string, sysProfileId: number }) {
  139. const { sysProfileId, ...params } = data
  140. return request(api + `/adq/sysProfile/${sysProfileId}`, {
  141. method: 'PUT',
  142. data: params
  143. })
  144. }
  145. /**
  146. * 删除头像及昵称跳转页
  147. * @param data
  148. * @returns
  149. */
  150. export async function delSysProfileApi(data: { sysProfileId: number }) {
  151. const { sysProfileId } = data
  152. return request(api + `/adq/sysProfile/${sysProfileId}`, {
  153. method: 'DELETE'
  154. })
  155. }
  156. /**查询优化目标权限*/
  157. export async function getOptimizationGoalPermissions(data: any) {
  158. return request(api + `/adq/launch/tools/getOptimizationGoalPermissions`, {
  159. method: 'POST',
  160. data
  161. })
  162. }
  163. /**
  164. * 广告预览二维码
  165. * @param param0
  166. * @returns
  167. */
  168. export async function getAdcreativePreviewsQrcodeApi({ accountId, adgroupId }: { accountId: number, adgroupId: number }) {
  169. return request(api + `/adq/launch/tools/getAdcreativePreviewsQrcode/${accountId}/${adgroupId}`, {
  170. method: 'GET'
  171. })
  172. }
  173. /**
  174. * 广告创意预览链接
  175. * @param param0
  176. * @returns
  177. */
  178. export async function getAdcreativeTemplatePreviewsApi({ accountId, adgroupId }: { accountId: number, adgroupId: number }) {
  179. return request(api + `/adq/launch/tools/adcreativeTemplatePreviews/${accountId}/${adgroupId}`, {
  180. method: 'GET'
  181. })
  182. }
  183. /**
  184. * 广告创意预览链接
  185. * @param param0
  186. * @returns
  187. */
  188. export async function getAdcreativeTemplatePreviews1Api({ adAccountId, adgroupId, adIdList }: { adAccountId: number, adgroupId: number, adIdList: any }) {
  189. return request(api + `/adq/launch/tools/adcreativeTemplatePreviews/${adAccountId}/${adgroupId}/${adIdList}`, {
  190. method: 'GET'
  191. })
  192. }