import ajax from '../utils/request.js';

/**
 * 词典
 * @param {object} params
 * @returns
 */
export function getVocabularyInfo(params) {
  return ajax({
    api: '/html/getVocabularyInfo',
    data: params.data,
    base: 'xzMao',
    noload: params.noload,
    noJY: true,
    method: 'GET',
  });
}
/**
 * 图片
 * @param {object} params
 * @returns
 */
export function textImageMatch(params) {
  return ajax({
    api: '/html/textImageMatch?isSampleDocument=false',
    data: params.data,
    noload: params.noload,
    base: 'xzMao',
    noJY: true,
    method: 'POST',
  });
}
/**
 * 校阅
 * @param {object} params
 * @returns
 */
export function checkContent(params) {
  return ajax({
    api: '/html/checkContent?isSampleDocument=false',
    data: params.data,
    noload: params.noload,
    base: 'xzMao',
    noJY: true,
    method: 'POST',
  });
}

/**
 * 全文写作
 * @param {object} params
 * @returns
 */
export function commit(params) {
  return ajax({
    api: '/html/generate/pc/commit?isSampleDocument=false',
    data: params.data,
    noload: params.noload,
    base: 'xzMao',
    noJY: true,
    method: 'POST',
  });
}
export function generate_pc_get(params) {
  return ajax({
    api: '/html/generate/pc/get?isSampleDocument=false',
    data: params.data,
    noload: params.noload,
    base: 'xzMao',
    noJY: true,
    method: 'POST',
  });
}

/**
 * 广告语
 * @param {object} params
 * @returns
 */
export function advertisement(params) {
  return ajax({
    api: '/html/generate/pc/text?isSampleDocument=false',
    data: params.data,
    noload: params.noload,
    base: 'xzMao',
    noJY: true,
    method: 'POST',
  });
}

/**
 * 文献推荐
 * @param {object} params
 * @returns
 */
export function recommendation(params) {
  return ajax({
    api: '/html/literature-recommendation?isSampleDocument=false',
    data: params.data,
    noload: params.noload,
    base: 'xzMao',
    noJY: true,
    method: 'POST',
  });
}

/**
 * AI绘图
 * @param {object} params
 * @returns
 */
export function generate(params) {
  return ajax({
    api: '/html/drawdraw/internal-generate?isSampleDocument=false',
    data: params.data,
    noload: params.noload,
    base: 'xzMao',
    noJY: true,
    method: 'POST',
  });
}
export function imgTask(params) {
  return ajax({
    api: '/html/drawdraw/task/' + params.data.id + '?' + Date.now(),
    noload: params.noload,
    base: 'xzMao',
    noJY: true,
    method: 'POST',
  });
}
export function getBase64(params) {
  return ajax({
    api:  `/html/${params.data.docId}/base64/${params.data.id}?isSampleDocument=false`,
    noload: params.noload,
    base: 'xzMao',
    noJY: true,
    method: 'POST',
  });
}

/**
 * AI绘图
 * @returns ajax
 */
export function getSID() {
    return ajax({
      api: '/sid',
      noload: true,
      base: 'xzMao',
      noJY: true,
      method: 'POST',
    });
  }
