import Mock from 'mockjs'

// worldDetail
let worldDetail = function () {
    let item = [];
    for (var i = 0; i < 30; i++) {
        item.push({
            "id": "@guid",
            "name": "@region",
            "Confirmed": "@integer(36844, 368449)",
            "Deaths": "@integer(1099, 10993)",
            "Recovered": "@integer(1986, 19865)",
        })
    }

    let res = {
        Rs: item,
        Code: 0,
        Memo: ''
    };
    return res;
};

let SignIn = function () {

    let Rs = {
        token: "@guid"
    };
    let res = {
        Rs: Rs,
        Code: 0,
        Memo: '登陆成功'
    };
    return res;
};

let editbasicinfo = function () {

    let res = {
        Code: 0,
        Memo: '修改成功'
    };
    return res;
};

let modPwd = function () {
    let res = {
        Code: 0,
        Memo: '修改成功'
    };
    return res;
};

let logout = function () {
    let res = {
        Code: 0,
        Memo: '退出成功'
    };
    return res;
};

let getLoftInfo = function () {
    let item = [];
    for (var i = 0; i < 6; i++) {
        item.push({
            loftId: "@id",
            name: "@county",
        })
    }

    let res = {
        Rs: item,
        Code: 0,
        Memo: '登陆成功'
    };
    return res;
};
let wifiSingle = function () {
    let item = [];
    let t =0;
    for (var i = 0; i < 13; i++) {
        t = i+1;
        item.push({
            '页面': "信道" + t,
            '访问量': "@integer(301,600)",
        })
    }

    let res = {
        Rs: item,
        Code: 0,
        Memo: '登陆成功'
    };
    return res;
};
let Scan = function () {
    let item = [];
    let t =0;
    for (var i = 0; i < 13; i++) {
        t = i+1;
        item.push({
            '页面': t + ".0M",
            '访问量': "@integer(301,600)",
        })
    }

    let res = {
        Rs: item,
        Code: 0,
        Memo: '登陆成功'
    };
    return res;
};
let Watching = function () {
    let item = [];
    let t =0;
    for (var i = 0; i < 9; i++) {
        t = i+1;
        item.push({
            'time': "@date",
            'checkRs': "Signal设备03@integer(301,600)检测完成，206会议室安全",
        })
    }

    let res = {
        Rs: item,
        Code: 0,
        Memo: '登陆成功'
    };
    return res;
};

// Mock.mock('/api/worldDetail', 'post', worldDetail());
// Mock.mock('/api/SignIn', 'post', SignIn());//用户登录
// Mock.mock('/api/editbasicinfo', 'post', editbasicinfo());//用户设置修改
// Mock.mock('/api/modPwd', 'post', modPwd());//密码修改
// Mock.mock('/api/logout', 'post', logout());//退出登陆
// Mock.mock('/api/getLoftInfo', 'post', getLoftInfo());//楼层获取
// Mock.mock('/api/wifiSingle', 'post', wifiSingle());//
// Mock.mock('/api/Scan', 'post', Scan());//
// Mock.mock('/api/Watching', 'post', Watching());//

// 业务类

export default Mock;
