import Mock from "mockjs";

const data = Mock.mock({
  "items|4": [
    {
      "date|+1": ["1月", "2月", "3月", "4月"],
      income: "@integer(50, 500)",
      expend: "@integer(-500, 300)",
      profit: "@integer(-200, 500)",
    },
  ],
});
export default [
  {
    url: `/condition-data`,
    type: "post",
    response: (req, res, next) => {
      // req.body 可获取post参数
      // req.query 可获取get参数
      const items = data.items;
      return {
        body: {
          total: items.length,
          items: items,
        },
        head: {
          errorCode: "0",
          data: null,
        },
      };
    },
  },
];
