// 导入BoleMbti脚本

// 引用Parse JS SDK
const Parse = require("parse/node");
Parse.initialize("dev"); // 设置applicationId
Parse.serverURL = "http://web2023.fmode.cn:9999/parse"; // 设置serverURL

let outdoor= [
    {
        "name": "山峰探险",
        "detail": "踏上征服该地区最高峰的惊险之旅。",
        "rating": 9.5,
        "image": "https://tse4-mm.cn.bing.net/th/id/OIP-C.dGrXl6o9hr0kz0KlQz4jlQHaIn?w=148&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    },
    {
        "name": "森林小径探索",
        "detail": "在导游的带领下，发现森林的奇迹。",
        "rating": 8.7,
        "image": "https://tse4-mm.cn.bing.net/th/id/OIP-C.NCWkXvoIc5oA32AwUKHqmgHaE8?w=282&h=188&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    },
    {
        "name": "湖泊皮划艇远征",
        "detail": "划过宁静的湖水，探索隐藏的小海湾。",
        "rating": 9.0,
        "image": "https://tse1-mm.cn.bing.net/th/id/OIP-C.xkecIavHjYqmMQduou3KCgHaE7?w=277&h=185&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    },
    {
        "name": "峡谷徒步之旅",
        "detail": "徒步穿越壮丽的峡谷，感受大自然的壮丽。",
        "rating": 8.8,
        "image": "https://tse2-mm.cn.bing.net/th/id/OIP-C.vB75xl4nuaBndyljx2HvvAHaE7?w=287&h=190&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    },
    {
        "name": "野外露营体验",
        "detail": "在大自然中露营，享受星空下的宁静。",
        "rating": 9.2,
        "image": "https://tse3-mm.cn.bing.net/th/id/OIP-C.udqi-p0CBbBQ7TD5-wqONwHaE7?w=260&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    },
    {
        "name": "滑雪乐园",
        "detail": "在雪白的坡道上尽情滑行，体验冬日的乐趣。",
        "rating": 9.4,
        "image": "https://tse4-mm.cn.bing.net/th/id/OIP-C.k8N5Ay-WvhYNU4UEcJCwXgHaEU?w=247&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    },
    {
        "name": "海滩瑜伽课程",
        "detail": "在海滩上练习瑜伽，感受海风的清新。",
        "rating": 8.6,
        "image": "https://tse1-mm.cn.bing.net/th/id/OIP-C.V3IDawispNb-4s2PVIRcZwHaE7?w=269&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    },
    {
        "name": "悬崖跳水挑战",
        "detail": "勇敢地跳下悬崖，体验极限挑战的刺激。",
        "rating": 9.7,
        "image": "https://tse4-mm.cn.bing.net/th/id/OIP-C.QrQEHhAX1fEBSsHLtFT5HgHaEK?w=282&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    },
    {
        "name": "草原骑行之旅",
        "detail": "骑行穿越广阔的草原，感受自然的纯粹。",
        "rating": 8.9,
        "image": "https://tse2-mm.cn.bing.net/th/id/OIP-C.gi2axq_oLwjKo53dYGco8wHaE7?w=275&h=183&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    },
    {
        "name": "瀑布探险",
        "detail": "探索壮丽的瀑布，感受水流的力量。",
        "rating": 9.3,
        "image": "https://tse4-mm.cn.bing.net/th/id/OIP-C.8qEdlyCsHVUcIOi4ezi9PAHaE7?w=258&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    },
    {
        "name": "星空露营之旅",
        "detail": "在夜晚的星空下露营，感受宇宙的浩瀚。",
        "rating": 9.1,
        "image": "https://tse4-mm.cn.bing.net/th/id/OIP-C.sp2AKWdjpS7GnbaIBvB1rAHaE8?w=276&h=184&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    },
    {
        "name": "山谷骑行挑战",
        "detail": "挑战陡峭的山谷，体验骑行的刺激。",
        "rating": 8.8,
        "image": "https://tse1-mm.cn.bing.net/th/id/OIP-C.PZgmNq6uIWbgPZ7Unr1GSQHaE7?w=273&h=182&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    },
    {
        "name": "湖边瑜伽修行",
        "detail": "在湖畔练习瑜伽，感受大自然的宁静。",
        "rating": 9.0,
        "image": "https://tse1-mm.cn.bing.net/th/id/OIP-C.2MEM0U7fzvMRODVgR5oioQHaE7?w=269&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    },
    {
        "name": "沙漠骆驼旅行",
        "detail": "乘坐骆驼穿越沙漠，体验异国风情。",
        "rating": 9.4,
        "image": "https://tse2-mm.cn.bing.net/th/id/OIP-C.rWyaPzvTo8DeC8ZeHA4YpAHaE7?w=279&h=186&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    },
    {
        "name": "滑翔伞飞行体验",
        "detail": "在空中飞翔，俯瞰壮丽的风景。",
        "rating": 9.6,
        "image": "https://tse1-mm.cn.bing.net/th/id/OIP-C.wuCG9dbQ2tfdNzrDRS5XFQHaE7?w=237&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    },
    {
        "name": "雨林探险之旅",
        "detail": "深入雨林，探寻热带植物与动物的奥秘。",
        "rating": 9.2,
        "image": "https://tse1-mm.cn.bing.net/th/id/OIP-C.kMLud3xbouK7VshD9bfJcgHaE6?w=280&h=186&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    },
    {
        "name": "冰川徒步探险",
        "detail": "徒步穿越冰川，感受冰雪世界的壮美。",
        "rating": 9.7,
        "image": "https://tse4-mm.cn.bing.net/th/id/OIP-C.2c2164ElnNAUCsv1o3IEMwHaE7?w=269&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    },
    {
        "name": "荒野求生挑战",
        "detail": "在荒野中挑战求生技能，体验生存的艰辛。",
        "rating": 8.9,
        "image": "https://tse3-mm.cn.bing.net/th/id/OIP-C.xtQKp2vGO-jlZ1pYwDGljQHaE8?w=245&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    },
    {
        "name": "极地探险之旅",
        "detail": "前往极地，探索冰雪世界的神秘。",
        "rating": 9.5,
        "image": "https://tse2-mm.cn.bing.net/th/id/OIP-C.yzdTWlXaUJ_rs_ZhO9MfjAAAAA?w=258&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    },
    {
        "name": "火山探险之旅",
        "detail": "探索活火山，感受火山的狂暴与美丽。",
        "rating": 9.3,
        "image": "https://tse3-mm.cn.bing.net/th/id/OIP-C.ZLkJRGwlit-TCqse0_jFFgHaEo?w=260&h=181&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    },
    {
        "name": "海岛探险之旅",
        "detail": "前往孤岛，探寻海岛的奇迹与秘密。",
        "rating": 9.1,
        "image": "https://tse4-mm.cn.bing.net/th/id/OIP-C.GgTqWhlZXiJIM06ZZIteBAHaFj?w=182&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    },
    {
        "name": "瀑布跳水挑战",
        "detail": "勇敢地跳入瀑布池中，体验挑战的乐趣。",
        "rating": 8.8,
        "image": "https://tse1-mm.cn.bing.net/th/id/OIP-C.iDPPIEGczta8cVbIuvr-OwHaEX?w=284&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    },
    {
        "name": "河流漂流探险",
        "detail": "漂流在急流险滩间，感受河流的激情。",
        "rating": 9.0,
        "image": "https://tse3-mm.cn.bing.net/th/id/OIP-C.AxyxSeGemoM2v1qmWU0zVwHaFj?w=221&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    },
    {
        "name": "悬崖攀岩挑战",
        "detail": "攀登陡峭悬崖，挑战自己的极限。",
        "rating": 9.4,
        "image": "https://tse1-mm.cn.bing.net/th/id/OIP-C.zwHWNJeHhwleh0hI9IytiwHaE5?w=248&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    },
    {
        "name": "湖泊钓鱼之旅",
        "detail": "在宁静的湖泊垂钓，享受钓鱼的乐趣。",
        "rating": 9.6,
        "image": "https://tse2-mm.cn.bing.net/th/id/OIP-C.Weo_lcRTm1MaPcapiL39JgHaE8?w=258&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    },
    {
        "name": "草原露营之旅",
        "detail": "在广袤的草原露营，感受大自然的宁静。",
        "rating": 9.2,
        "image": "https://tse4-mm.cn.bing.net/th/id/OIP-C.FXcTJuScH_KZ2BlxgF3npgHaEN?w=302&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    },
    {
        "name": "雪地滑雪探险",
        "detail": "滑行在洁白的雪地，体验雪地探险的乐趣。",
        "rating": 9.7,
        "image": "https://tse4-mm.cn.bing.net/th/id/OIP-C.O5FvDNSHHx-X0t9T5d37oAHaEK?w=270&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    },
    {
        "name": "海岸徒步之旅",
        "detail": "沿着海岸线徒步，感受海风的清新。",
        "rating": 8.9,
        "image": "https://tse3-mm.cn.bing.net/th/id/OIP-C.sUJ42tvc75-18SMSX2XoQQHaE7?w=298&h=199&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    },
    {
        "name": "热气球飞行体验",
        "detail": "乘坐热气球飞翔，俯瞰大地的壮丽。",
        "rating": 9.3,
        "image": "https://tse2-mm.cn.bing.net/th/id/OIP-C.deBeVl9iqp5_Au2ePk_pewHaE7?w=249&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    },
    {
        "name": "林间露营之旅",
        "detail": "在郁郁葱葱的森林中露营，感受大自然的怀抱。",
        "rating": 9.5,
        "image": "https://tse2-mm.cn.bing.net/th/id/OIP-C.PoVh9HV97rrQK3aZNa-0LwHaEp?w=282&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    },
    {
        "name": "湖畔野餐活动",
        "detail": "在湖边享受美味的野餐，感受自然的宁静。",
        "rating": 9.1,
        "image": "https://tse3-mm.cn.bing.net/th/id/OIP-C.MffzoBs9glXk_C6dKaRZNAHaE7?w=225&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    },
    {
        "name": "森林生存挑战",
        "detail": "在茂密森林中挑战生存技能，体验野外生活。",
        "rating": 8.8,
        "image": "https://tse3-mm.cn.bing.net/th/id/OIP-C.V3jtZawqZdPm7Mzp5b6YKAHaEK?w=312&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    },
    {
        "name": "山谷露营之旅",
        "detail": "在幽静山谷中搭起帐篷，享受大自然的美好。",
        "rating": 9.0,
        "image": "https://tse3-mm.cn.bing.net/th/id/OIP-C._5dhDFNUtUAHEJ9VL99SNQHaC7?w=336&h=138&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    },
    {
        "name": "冰川探险之旅",
        "detail": "探索冰川脚下的壮丽景观，感受冰雪世界的奇迹。",
        "rating": 9.4,
        "image": "https://tse4-mm.cn.bing.net/th/id/OIP-C.2c2164ElnNAUCsv1o3IEMwHaE7?w=270&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    },
    {
        "name": "荒漠沙漠之旅",
        "detail": "穿越广袤的沙漠，体验沙漠风情。",
        "rating": 9.6,
        "image": "https://tse4-mm.cn.bing.net/th/id/OIP-C.vuiKOX8lYil7yjrg0Gwm1gHaEK?w=289&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    },
    {
        "name": "湖泊皮划艇漂流",
        "detail": "在湖泊上划船漂流，享受水上乐趣。",
        "rating": 9.2,
        "image": "https://tse1-mm.cn.bing.net/th/id/OIP-C.WN_Bm7Up75R11Y5oqeC6ogHaE7?w=270&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    },
    {
        "name": "山顶日出观赏",
        "detail": "登上山顶，欣赏日出美景，感受大自然的魅力。",
        "rating": 9.7,
        "image": "https://tse1-mm.cn.bing.net/th/id/OIP-C.vh89hngzt0X6b48Y939XpQHaE7?w=261&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    },
    {
        "name": "滑雪跳台挑战",
        "detail": "挑战滑雪跳台，体验滑雪的刺激与挑战。",
        "rating": 9.3,
        "image": "https://tse3-mm.cn.bing.net/th/id/OIP-C.WZfNkfIbFkSDbzGsVcYSjwHaE7?w=270&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    },
    {
        "name": "海底潜水探险",
        "detail": "潜入海底，探索神秘海洋世界的奥秘。",
        "rating": 9.5,
        "image": "https://tse3-mm.cn.bing.net/th/id/OIP-C.1MvDrB6cqRcuEJ33KlZPYgHaG6?w=159&h=180&c=7&r=0&o=5&dpr=1.8&pid=1.7"
    }
];

  

function importAll(){
    
    let LQLOutdoor= []
    Object.keys(outdoor).forEach(key=>{
        LQLOutdoor.push({
            // result:key,
            name:outdoor[key]?.name,
            detail:outdoor[key]?.detail,
            rating:outdoor[key]?.rating,
            image:outdoor[key]?.image,
        })
    })

    console.log(LQLOutdoor)
    LQLOutdoor.forEach(async mbti => {
        // 查重
        let exists = await checkExists(mbti)
        if(exists?.id) return;
        // 新增
        let LQLOutdoor = Parse.Object.extend("LQLOutdoor");
        let bm = new LQLOutdoor();
        bm.set(mbti);
        bm.save();
    });
}

async function checkExists(mbti){
    let query = new Parse.Query("LQLOutdoor");
    query.equalTo("result",mbti?.result);
    query.equalTo("name",mbti?.name);
    await query.first();
    return await query.first();
}

importAll()