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

export default class SentenceStore extends BaseStore {
  getStruct() {
    return this.apiGet('/setting/sentence');
  }

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

  listArticle(params) {
    return this.apiGet('/sentence/article/list', params);
  }

  getArticle(params) {
    return this.apiGet('/sentence/article/detail', params);
  }

  addArticle(params) {
    return this.apiPost('/sentence/article/add', params);
  }

  editArticle(params) {
    return this.apiPut('/sentence/article/edit', params);
  }

  delArticle(params) {
    return this.apiDel('/sentence/article/delete', params);
  }

  listQuestion(params) {
    return this.apiGet('/sentence/question/list', params);
  }

  getQuestion(params) {
    return this.apiGet('/sentence/question/detail', params);
  }

  addQuestion(params) {
    return this.apiPost('/sentence/question/add', params);
  }

  editQuestion(params) {
    return this.apiPut('/sentence/question/edit', params);
  }

  delQuestion(params) {
    return this.apiDel('/sentence/question/delete', params);
  }

  auto() {
    return this.apiPost('/sentence/paper/auto');
  }

  autoStatus() {
    return this.apiGet('/sentence/paper/auto');
  }
}

export const Sentence = new SentenceStore({ key: 'sentence' });
