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

const route = {
  path: 'content',
  name: 'shop.admin.content',
  component: Content,
  meta: {
    title: '内容',
  },
  children: [
    {
      path: 'banner',
      name: 'shop.admin.content.banner',
      component: () => import('./banner/index.vue'),
      meta: {
        title: '广告位',
      },
    },
    {
      path: 'notification',
      name: 'shop.admin.content.notification',
      component: () => import('./notification/index.vue'),
      meta: {
        title: '消息推送',
      },
    },
    {
      path: 'sms',
      name: 'shop.admin.content.sms',
      component: () => import('./sms/index.vue'),
      meta: {
        title: '短信',
      },
    },
  ],
};

const api = {
  // 广告位相关 API
  banner: {
    ...CRUD('shop/admin/banner'),
    select: (params) => SELECT('shop/admin/banner', params),
  },

  // 消息推送相关 API
  notification: {
    ...CRUD('shop/admin/notification'),
    select: (params) => SELECT('shop/admin/notification', params),
  },

  // 短信相关 API
  sms: {
    ...CRUD('shop/admin/sms_template'),
    select: (params) => SELECT('shop/admin/sms_template', params),
  },
};

export { route, api };
