import { resultSuccess } from '../_util';

const noticeTable = (_pageSize) => {
  return [
    {
      key: '1ea9d46db3f218c93dff07ef52431417',
      type: 'stopServerNotice',
      content: '尊敬的玩家，服务器将在今日11：00，进行停服维护，预计30分钟，请注意下线。',
      create_at: 1656643872,
      update_at: 0,
      start_at: 1656643696,
      end_at: 1656644116,
      interval: 1,
    },
    {
      key: 'cbdb4068dff9e7493886b569fa32e3df',
      type: 'stopServerNotice',
      content: '尊敬的玩家，服务器将在今日15：00，进行停服维护，预计30分钟，请注意下线。',
      create_at: 0,
      update_at: 1647344531,
      start_at: 1647327030,
      end_at: 1647327600,
      interval: 2,
    },
  ];
};

export default [
  {
    url: '/api/echarts/noticeTable',
    timeout: 1,
    method: 'get',
    response: ({ query }) => {
      const { page = 1, pageSize = 10 } = query;
      const list = noticeTable(Number(pageSize));
      return resultSuccess({
        page: Number(page),
        pageSize: Number(pageSize),
        pageCount: 1,
        list,
      });
    },
  },
];
