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

export default class UserStore extends BaseStore {
  list(params) {
    return this.apiGet('/user/list', params);
  }

  token(params) {
    return this.apiGet('/user/token', params);
  }

  get(params) {
    return this.apiPost('/user/detail', params);
  }

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

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

  del(params) {
    return this.apiDel('/user/delete', params);
  }

  listAsk(params) {
    return this.apiGet('/user/ask/list', params);
  }

  editAsk(params) {
    return this.apiPut('/user/ask/edit', params);
  }

  getAsk(params) {
    return this.apiGet('/user/ask/detail', params);
  }

  listFeedbackError(params) {
    return this.apiGet('/user/feedback_error/list', params);
  }

  editFeedbackError(params) {
    return this.apiPut('/user/feedback_error/edit', params);
  }

  getFeedbackError(params) {
    return this.apiGet('/user/feedback_error/detail', params);
  }

  listPreview(params) {
    return this.apiGet('/user/preview/list', params);
  }

  listPay(params) {
    return this.apiGet('/user/pay/list', params);
  }
}

export const User = new UserStore({ key: 'users' });
