import axios from 'axios';
import { getToken } from '@/utils';
import requestUrl from '@/core/http/requestUrl.js';
export default class TuningRun {
  static list (sender, params, axiosOption, httpOption) {
    return sender.doUrl('/admin/app/tuningRun/list', 'post', params, axiosOption, httpOption);
  }
            
  static view (sender, params, axiosOption, httpOption) {
    return sender.doUrl('/admin/app/tuningRun/view', 'get', params, axiosOption, httpOption);
  }
            
  static export (sender, params, fileName) {
    return sender.download('/admin/app/tuningRun/export', params, fileName);
  }
            
  static add (sender, params, axiosOption, httpOption) {
    return sender.doUrl('/admin/app/tuningRun/add', 'post', params, axiosOption, httpOption);
  }
            
  static update (sender, params, axiosOption, httpOption) {
    return sender.doUrl('/admin/app/tuningRun/update', 'post', params, axiosOption, httpOption);
  }
            
  static delete (sender, params, axiosOption, httpOption) {
    return sender.doUrl('/admin/app/tuningRun/delete', 'post', params, axiosOption, httpOption);
  }

  static publish (sender, params, axiosOption, httpOption) {
    return sender.doUrl('/admin/app/tuningRun/publish', 'post', params, axiosOption, httpOption);
  }
  static listForTree (sender, params, axiosOption, httpOption) {
    return sender.doUrl('/admin/app/tuningRun/listForTree', 'post', params, axiosOption, httpOption);
  }
  static getPreviewCommand (sender, params, axiosOption, httpOption) {
    return sender.doUrl('/admin/app/tuningRun/getPreviewCommand', 'get', params, axiosOption, httpOption);
  }
  static getStatus (sender, params, axiosOption, httpOption) {
    return sender.doUrl('/admin/app/tuningRun/getStatus', 'get', params, axiosOption, httpOption);
  }
  static getLog (sender, params, options) {
    let token = getToken();
    var config = {
      method: 'get',
      url: requestUrl('/admin/app/tuningRun/getLog'),
      params: params,
      headers: {
        'Authorization': token
      }
    };
    return axios(config)
  }
}
