import { Service } from '@zenview/micro-basic-library';
import { cache } from '@zenview/micro-utils';
const getHeaders = () => {
  return {
    Authorization: cache.getCache('token', 'session')
  }
}


class AppFunListService {
  queryFunctionByCondition(data) {
    return Service.$http({
      data,
      headers:getHeaders(),
      url: `/micro/function/v1/queryFunctionByCondition`,
      method: 'post',
      requestId: 'adminManager'
    })
      .then((res) => {
        return res;
      })
      .catch((e) => {
        return Promise.reject(e);
      });
  }

  queryMicroApplicationList() {
    return Service.$http({ 
      headers:getHeaders(),
      url: `/micro/microApplication/v1/queryMicroApplicationList`,
      method: 'get',
      requestId: 'adminManager'
    })
      .then((res) => {
        return res;
      })
      .catch((e) => {
        return Promise.reject(e);
      });
  }
}

export default new AppFunListService();
