let lineData = []
function random(m,n) {
  return Math.round(Math.random()*(m-n)+n)
}
export default [
  {
    url: '/cc/g2plot/getLineData',
    type: 'get',
    response: (req, res) => {
      const time = new Date().getTime()
      const data = [
        ...lineData,
        { time: time, value: random(20,6) }
      ]
      lineData = [...data]
      return {
        "code": 200,
        "message": "success",
        "responseTime": 1593321094037,
        "data": lineData
      }
    }
  },
  {
    url: '/cc/g2plot/getOverviewData',
    type: 'get',
    response: (req, res) => {
      return {
        "code": 200,
        "message": "success",
        "responseTime": 1593321094037,
        "data": {
          temperature: random(70,55),
          pressure: random(80,40),
          power: random(90,75)
        }
      }
    }
  }
]

