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

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