import { request } from 'umi';
import { api } from '../api';

/**
 * 获取广告组列表
 * @param adgroupName 广告名称
 * @param promotedObjectType 广告类型
 */
export async function getsysTargetingList(params: {
  pageNum: number;
  pageSize: number;
  targetingName?: string;
  promotedObjectType?: string;
}){
  return request(api + '/adq/sysTargeting/list', {
    method: 'POST',
    data: params,
  })
}
/**
 * 获取广告详情
 * @param AdcreativeId 广告ID
 */ 
 export async function getsysTargetingInfo(AdcreativeId: string){
    return request(api + `/adq/sysTargeting/${AdcreativeId}`)
  }
/**
 * 新增广告
 * */ 
export async function createsysTargeting(params:any){
    return request(api+`/adq/sysTargeting`,{
        method:'POST',
        data:params
    })
}
/**
 * 编辑广告
 * */ 
export async function editsysTargeting(AdcreativeId:string,params:any){
    return request(api+`/adq/sysTargeting/${AdcreativeId}`,{
        method:'PUT',
        data:params
    })
}
/**
 * 删除广告
 * */ 
export async function delsysTargeting(AdcreativeId:string){
    return request(api+`/adq/sysTargeting/${AdcreativeId}`,{
        method:'DELETE',
    })
}
