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

const consumptionDetails = (pageSize) => {
  const data: any[] = [];
  doCustomTimes(pageSize, () => {
    data.push({
      id: '@integer(10,999999)',
      playerID: '@integer(10,999999)',
      coin: '@integer(10,999999)',
      coinSum: '@integer(10,999999)',
      diamond: '@integer(10,999999)',
      diamondSum: '@integer(10,999999)',
      createAt: `@time('HH:mm')`,
      'no|100000-10000000': 100000,
      'status|1': [true, false],
    });
  });
  return data;
};

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