resource-api.js 1.23 KB
import Api from './api';

class ResourceApi extends Api {
  constructor() {
    super();
  }

  list(params) {
    return this._post('/ufoPlatform/resource/getResources', params);
  }

  info(id) {
    return this._post('/ufoPlatform/resource/getResourceInfo', {
      id,
    });
  }

  getResourceListByCode(code) {
    return this._get('/ufoPlatform/resource/getResourcesByCode', {
      code
    })
  }

  updateResourceTime(data) {
    return this._post('/ufoPlatform/resource/editOrUpdateResourcesTime', data);
  }

  editResource(data) {
    return this._post('/ufoPlatform/resource/editResourceContentData', data);
  }

  editGoodsPool(data) {
    return this._post(
      '/ufoPlatform/resource/batchEditResourceGoodsPool',
      data,
      true,
    );
  }

  addResourceListItem(data) {
    // 添加资源位列表中的数据
    return this._post('/ufoPlatform/resource/addOrUpdateResource', data);
  }

  editResourceListItem(data) {
    // 编辑资源位列表中的某条数据
    return this._post('/ufoPlatform/resource/addOrUpdateResource', data);
  }

  addOrUpdateResourceDetail(data) {
    return this._post(
      '/ufoPlatform/resource/addOrUpdateResourceDeatil',
      data,
      true,
    );
  }
}

export default ResourceApi;