import BaseStore from '@src/stores/base';

export default class SystemStore extends BaseStore {
  listManager(params) {
    return this.apiGet('/manager/list', params);
  }

  addManager(params) {
    return this.apiPost('/manager/add', params);
  }

  getManager(params) {
    return this.apiGet('/manager/detail', params);
  }

  putManager(params) {
    return this.apiPut('/manager/edit', params);
  }

  delManager(params) {
    return this.apiDel('/manager/delete', params);
  }

  getIndex() {
    return this.apiGet('/setting/index');
  }

  setIndex(params) {
    return this.apiPut('/setting/index', params);
  }

  getPlace() {
    return this.apiGet('/setting/place');
  }

  setPlace(params) {
    return this.apiPut('/setting/place', params);
  }

  getSentence() {
    return this.apiGet('/setting/sentence');
  }

  setSentence(params) {
    return this.apiPut('/setting/sentence', params);
  }

  getFilterTime() {
    return this.apiGet('/setting/filter_time');
  }

  setFilterTime(params) {
    return this.apiPut('/setting/filter_time', params);
  }

  getExerciseTime() {
    return this.apiGet('/setting/exercise_time');
  }

  setExerciseTime(params) {
    return this.apiPut('/setting/exercise_time', params);
  }

  getExaminationTime() {
    return this.apiGet('/setting/examination_time');
  }

  setExaminationTime(params) {
    return this.apiPut('/setting/examination_time', params);
  }

  getTips() {
    return this.apiGet('/setting/tips');
  }

  setTips(params) {
    return this.apiPut('/setting/tips', params);
  }

  listRank(params) {
    return this.apiGet('/rank/list', params);
  }

  addRank(params) {
    return this.apiPost('/rank/add', params);
  }

  editRank(params) {
    return this.apiPut('/rank/edit', params);
  }

  delRank(params) {
    return this.apiDel('/rank/delete', params);
  }

  uploadImage(file) {
    return this.apiForm('/common/upload/image', { file });
  }

  uploadVideo(file) {
    return this.apiForm('/common/upload/video', { file });
  }
}

export const System = new SystemStore({ key: 'system' });
