sevenLee
1/24/2018 - 2:18 AM

Mock data in Action

const makeMock = (num) => {
  let data = []
  while (num){
      data.push({
          "id": parseInt(Math.random()*1000) + '',
          "partnerCode": "Company",
          "name": `jackpotName_${num}`,
          "amount": parseInt(Math.random()*1000000) + '',
          "type": `jackpotType_${parseInt(Math.random()*10)}`,
          "currency": "CNY",
          "status": "ACTIVE",
          "updatedBy": "Company",
          "updatedDate": "2017-09-11T11:45:23.606",
          "initialDate": "2017-09-11T11:45:23.606"
      })
      num --
  }

  return data
}

const mockData = {
    "message": "jackpot list",
    "data": {
        "payload": makeMock(50),
        "query": {
            "pageNumber": 1,
            "pageSize": 0,
            "totalCount": 50,
            "serverTime": 1511322963859
        },
        "summary": null
    }
}

let promise = delay(mockData)