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

const route = {
  path: 'data',
  name: 'shop.admin.data',
  component: Content,
  meta: {
    title: '数据',
  },
  children: [
    {
      path: 'report',
      name: 'shop.admin.data.report',
      component: () => import('@/app/shop/admin/data/report/index.vue'),
      meta: {
        title: '数据报表',
      },
    },
  ],
};

const api = {
  report: {
    ...CRUD('shop/admin/data/report', ['list']),
    getStats: () =>
      request({
        url: '/shop/admin/data/report/stats',
        method: 'GET',
      }),
  },
};

export { route, api };
