import Content from '@/sheep/layouts/content.vue';
import { request } from '@/sheep/request';
import { CRUD } from '@/sheep/request/crud';
import { EXPORT } from '@/sheep/request/export';

const route = {
  path: 'trade',
  name: 'shop.admin.trade',
  component: Content,
  meta: {
    title: '订单',
  },
  children: [
    {
      path: 'order',
      name: 'shop.admin.trade.order',
      component: () => import('@/app/shop/admin/trade/order/index.vue'),
      meta: {
        title: '充值订单',
      },
    },
  ],
};

const api = {
  order: {
    ...CRUD('shop/admin/trade/order', ['list', 'detail']),
    getType: () =>
      request({
        url: '/shop/admin/trade/order/getType',
        method: 'GET',
      }),
    export: (type, params) => EXPORT(`/shop/admin/trade/order/${type}`, params),
  },
};

export { route, api };
