import request from '@/utils/request'

/**
 * 同步短剧资产到数据库
 * @param {Number} orgAccountId 组织账户ID
 * @param {String} phone 手机号
 * @param {Number} accountId 推广账号ID
 */
export function syncDrama(accountId) {
  return request({
    url: '/api/gdt/asset/drama/sync',
    method: 'post',
    params: { accountId }
  })
}

/**
 * 分页查询短剧资产列表
 * @param {Number} page 页码
 * @param {Number} pageSize 每页数量
 */
export function getDramaList(page = 1, pageSize = 20, dramaName = '') {
  return request({
    url: '/api/gdt/asset/drama/list',
    method: 'get',
    params: {dramaName, page, pageSize }
  })
}

/**
 * 查询短剧资产详情
 * @param {Number} id 短剧资产ID
 */
export function getDramaDetail(id) {
  return request({
    url: '/api/gdt/asset/drama/detail',
    method: 'get',
    params: { id }
  })
}


export function myDramaAssetList(dramaName) {
  return request({
    url: '/api/gdt/asset/drama/myDramaAssets',
    method: 'get',
    params: { dramaName }
  })
}

export function myConfList() {
  return request({
    url: '/api/gdt/asset/drama/sync/conf/myConf',
    method: 'get'
  })
}

export function addConf (data) {
  return request({
    url: '/api/gdt/asset/drama/sync/conf/add',
    method: 'post',
    data
  })
}

export function delConf (id) {
  return request({
    url: '/api/gdt/asset/drama/sync/conf/delete',
    method: 'post',
    params: { id }
  })
}
