├── .gitignore ├── .travis.yml ├── .vscode └── launch.json ├── IntelligentTourMap.sql ├── LICENSE ├── README.md ├── app.js ├── app ├── contract │ └── model.js ├── controller │ ├── base.js │ ├── common.js │ ├── home.js │ ├── school.js │ ├── spot.js │ └── user.js ├── public │ ├── css │ │ └── reset.css │ ├── images │ │ ├── offAuto.png │ │ ├── onAuto.png │ │ ├── play1.gif │ │ ├── play2.png │ │ └── play3.png │ ├── lib │ │ ├── jquery-3.3.1.js │ │ ├── layer_mobile │ │ │ ├── layer.js │ │ │ └── need │ │ │ │ └── layer.css │ │ └── rem.js │ └── resources │ │ ├── 145310719991586.MP3 │ │ ├── 145310840472829.MP3 │ │ ├── 145310888968796.MP3 │ │ ├── 146760428953461.mp3 │ │ ├── 146760430933865.MP3 │ │ ├── 146760433099419.mp3 │ │ ├── 146760435168442.mp3 │ │ ├── 146760445694678.MP3 │ │ ├── 146760447604428.MP3 │ │ ├── 146760450092576.MP3 │ │ ├── 146760452310052.MP3 │ │ ├── 146760454319615.MP3 │ │ ├── 146760457039390.MP3 │ │ ├── 146760458998454.MP3 │ │ ├── 146760461491347.MP3 │ │ ├── 146760463601146.MP3 │ │ ├── 146760465695561.MP3 │ │ ├── 146760468725947.MP3 │ │ ├── 146760471187985.MP3 │ │ ├── 146760471972484.MP3 │ │ ├── 146760477506177.MP3 │ │ ├── 146760480223848.mp3 │ │ ├── 146760487083088.MP3 │ │ ├── 146760493219527.MP3 │ │ ├── 146760498535789.MP3 │ │ ├── 146760505981511.MP3 │ │ ├── 146760511952111.mp3 │ │ ├── 146760517936856.MP3 │ │ ├── 146760526179865.MP3 │ │ ├── 146760533133935.MP3 │ │ ├── 146760539058245.MP3 │ │ ├── 146760553610144.mp3 │ │ ├── 146839493846644.mp3 │ │ ├── 146839497264347.mp3 │ │ ├── 146839500292142.mp3 │ │ ├── 146839502274113.mp3 │ │ ├── 146839507376995.mp3 │ │ ├── 146839510641626.mp3 │ │ ├── 146839513920020.mp3 │ │ ├── 146839517260830.mp3 │ │ ├── 146839519443960.mp3 │ │ ├── 146839525194754.mp3 │ │ ├── 1NNBundefinedundefinedU3.mp3 │ │ ├── 2Z3A34A9.mp3 │ │ ├── 3191undefinedAEP.mp3 │ │ ├── 6DundefinedCJ134.MP3 │ │ ├── 6WECQGIF.mp3 │ │ ├── 7MF8V2VQ.m4a │ │ ├── 7SJundefinedSRMH.mp3 │ │ ├── 85A9D77S.m4a │ │ ├── 89T8CUJT.m4a │ │ ├── 8ABundefinedTFXW.MP3 │ │ ├── 9OEX4M42.m4a │ │ ├── CZNIundefinedundefinedHX.mp3 │ │ ├── DRKVAMSD.mp3 │ │ ├── DXMK3YGV.m4a │ │ ├── FGLBJZW7.mp3 │ │ ├── GE8W5AN8.mp3 │ │ ├── HOAVS6SL.m4a │ │ ├── Hundefined85182J.mp3 │ │ ├── ICM9OGEP.mp3 │ │ ├── KBKQ2BAS.mp3 │ │ ├── KM237TNJ.MP3 │ │ ├── KQJ8V2IF.mp3 │ │ ├── L8JESKTT.m4a │ │ ├── LH8A3DG4.mp3 │ │ ├── LQ7CT1MT.mp3 │ │ ├── M99A3EIK.m4a │ │ ├── N4721QXM.mp3 │ │ ├── PK14XZZ9.mp3 │ │ ├── PZTI2X9K.m4a │ │ ├── QB5HWN8K.m4a │ │ ├── QFMPHSBM.mp3 │ │ ├── RAPTLXF6.m4a │ │ ├── RNI76969.m4a │ │ ├── RR7R7YVC.m4a │ │ ├── SSTP9undefinedIH.MP3 │ │ ├── STSCB2BH.MP3 │ │ ├── SZLM43ML.m4a │ │ ├── U8ZILLMO.mp3 │ │ ├── UIWQTK8I.MP3 │ │ ├── UVJNXYMI.m4a │ │ ├── UundefinedGQRWDN.mp3 │ │ ├── V3SUUX4K.m4a │ │ ├── VLRLRU6M.MP3 │ │ ├── WBEGIV67.mp3 │ │ ├── ZBLZUR9S.mp3 │ │ ├── ZCM9DGM7.m4a │ │ └── ZQACundefinedMAL.MP3 ├── router.js ├── service │ ├── base.js │ ├── school.js │ ├── spot.js │ └── user.js └── view │ └── map.html ├── appveyor.yml ├── config ├── config.default.js └── plugin.js ├── doc ├── p1.png ├── p2.png ├── p3.png └── swagger.png ├── jsconfig.json ├── package.json ├── test └── app │ └── controller │ └── home.test.js └── typings ├── app ├── controller │ └── index.d.ts ├── index.d.ts └── service │ └── index.d.ts └── config ├── index.d.ts └── plugin.d.ts /.gitignore: -------------------------------------------------------------------------------- 1 | logs/ 2 | npm-debug.log 3 | yarn-error.log 4 | node_modules/ 5 | package-lock.json 6 | yarn.lock 7 | coverage/ 8 | .idea/ 9 | run/ 10 | .DS_Store 11 | *.sw* 12 | *.un~ 13 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: node_js 3 | node_js: 4 | - '8' 5 | install: 6 | - npm i npminstall && npminstall 7 | script: 8 | - npm run ci 9 | after_script: 10 | - npminstall codecov && codecov 11 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // 使用 IntelliSense 了解相关属性。 3 | // 悬停以查看现有属性的描述。 4 | // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "node", 9 | "request": "launch", 10 | "name": "Egg Debug", 11 | "runtimeExecutable": "npm", 12 | "runtimeArgs": [ 13 | "run", 14 | "debug", 15 | ], 16 | "console": "integratedTerminal", 17 | "restart": true, 18 | "protocol": "auto", 19 | "port": 9229, 20 | "autoAttachChildProcesses": true 21 | }, 22 | { 23 | "type": "node", 24 | "request": "launch", 25 | "name": "Egg Test", 26 | "runtimeExecutable": "npm", 27 | "runtimeArgs": [ 28 | "run", 29 | "test-local", 30 | "--", 31 | ], 32 | "protocol": "auto", 33 | "port": 9229, 34 | "autoAttachChildProcesses": true 35 | }, 36 | { 37 | "type": "node", 38 | "request": "attach", 39 | "name": "Egg Attach to remote", 40 | "localRoot": "${workspaceRoot}", 41 | "remoteRoot": "/usr/src/app", 42 | "address": "localhost", 43 | "protocol": "auto", 44 | "port": 9999 45 | } 46 | ] 47 | } -------------------------------------------------------------------------------- /IntelligentTourMap.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MongoDB Data Transfer 3 | 4 | Source Server : 101.200.86.96 5 | Source Server Type : MongoDB 6 | Source Server Version : 40006 7 | Source Host : 101.200.86.96:27017 8 | Source Schema : IntelligentTourMap 9 | 10 | Target Server Type : MongoDB 11 | Target Server Version : 40006 12 | File Encoding : 65001 13 | 14 | Date: 28/04/2022 22:12:14 15 | */ 16 | 17 | 18 | // ---------------------------- 19 | // Collection structure for logs 20 | // ---------------------------- 21 | db.getCollection("logs").drop(); 22 | db.createCollection("logs"); 23 | 24 | // ---------------------------- 25 | // Documents of logs 26 | // ---------------------------- 27 | 28 | // ---------------------------- 29 | // Collection structure for school 30 | // ---------------------------- 31 | db.getCollection("school").drop(); 32 | db.createCollection("school"); 33 | 34 | // ---------------------------- 35 | // Documents of school 36 | // ---------------------------- 37 | db.getCollection("school").insert([ { 38 | _id: ObjectId("5c9e0c136630fd0fa457e47b"), 39 | gaoDeLon: 116.255044, 40 | gaoDeLat: 40.288202, 41 | name: "村庄", 42 | timestamp: 1619420989064, 43 | updateTime: ISODate("2021-04-26T07:09:49.244Z"), 44 | count: NumberInt("395") 45 | } ]); 46 | db.getCollection("school").insert([ { 47 | _id: ObjectId("5e795f7994c2746d76c42d57"), 48 | gaoDeLon: 116.46284, 49 | gaoDeLat: 39.777666, 50 | name: "法规和人工湖", 51 | timestamp: 1599812581207, 52 | updateTime: ISODate("2020-12-26T08:55:39.522Z"), 53 | count: NumberInt("27") 54 | } ]); 55 | db.getCollection("school").insert([ { 56 | _id: ObjectId("5e795f9894c2746d76c42d58"), 57 | gaoDeLon: 116.434773, 58 | gaoDeLat: 39.972353, 59 | name: "选中<<天津市蓟州区罗庄子镇天津市蓟州区罗庄子镇中心小学>>地址!", 60 | timestamp: 1635661311372, 61 | updateTime: ISODate("2021-10-31T06:21:51.413Z"), 62 | count: NumberInt("28") 63 | } ]); 64 | db.getCollection("school").insert([ { 65 | _id: ObjectId("5e7ac9a965260142fb34af3a"), 66 | gaoDeLon: 116.395715, 67 | gaoDeLat: 39.784016, 68 | name: "12313", 69 | timestamp: 1585105328996, 70 | updateTime: ISODate("2020-12-26T08:55:50.536Z"), 71 | count: NumberInt("6") 72 | } ]); 73 | db.getCollection("school").insert([ { 74 | _id: ObjectId("5e8886502a66ed047c2c883b"), 75 | gaoDeLon: 115.938333, 76 | gaoDeLat: 40.015337, 77 | name: "dsqwqwsa", 78 | timestamp: 1635661319360, 79 | updateTime: ISODate("2021-10-31T06:21:59.736Z"), 80 | count: NumberInt("4") 81 | } ]); 82 | db.getCollection("school").insert([ { 83 | _id: ObjectId("5e93d658fb4ca859f52131aa"), 84 | gaoDeLon: 116.400175, 85 | gaoDeLat: 39.906596, 86 | name: "1111", 87 | timestamp: 1586746970735, 88 | updateTime: ISODate("2020-04-13T03:02:48.717Z"), 89 | count: NumberInt("5") 90 | } ]); 91 | db.getCollection("school").insert([ { 92 | _id: ObjectId("5e93d683fb4ca859f52131ab"), 93 | gaoDeLon: 116.397374, 94 | gaoDeLat: 39.909043, 95 | name: "111111111111", 96 | timestamp: 1586747013390, 97 | updateTime: ISODate("2020-04-13T03:03:31.369Z"), 98 | count: NumberInt("5") 99 | } ]); 100 | db.getCollection("school").insert([ { 101 | _id: ObjectId("5ec6bbe0852e1b61e2582567"), 102 | gaoDeLon: 116.496778, 103 | gaoDeLat: 39.906761, 104 | name: "清华大学", 105 | timestamp: 1593407192142, 106 | updateTime: ISODate("2020-06-29T05:06:32.832Z"), 107 | count: NumberInt("13") 108 | } ]); 109 | db.getCollection("school").insert([ { 110 | _id: ObjectId("5eda3f1d845bac7262582b7e"), 111 | gaoDeLon: 116.427213, 112 | gaoDeLat: 39.904042, 113 | name: "北京站", 114 | timestamp: 1619421043700, 115 | updateTime: ISODate("2021-04-26T07:10:43.965Z"), 116 | count: NumberInt("2") 117 | } ]); 118 | db.getCollection("school").insert([ { 119 | _id: ObjectId("5ee5b1bc3b492c365670daec"), 120 | name: "111", 121 | gaoDeLon: "111", 122 | gaoDeLat: "111", 123 | updateTime: ISODate("2020-06-14T05:12:28.348Z"), 124 | count: NumberInt("1") 125 | } ]); 126 | db.getCollection("school").insert([ { 127 | _id: ObjectId("5ee5b1bd3b492c365670daed"), 128 | name: "111", 129 | gaoDeLon: "111", 130 | gaoDeLat: "111", 131 | updateTime: ISODate("2020-06-14T05:12:29.924Z") 132 | } ]); 133 | db.getCollection("school").insert([ { 134 | _id: ObjectId("5ee5b1be3b492c365670daee"), 135 | name: "111", 136 | gaoDeLon: "111", 137 | gaoDeLat: "111", 138 | updateTime: ISODate("2020-06-14T05:12:30.512Z") 139 | } ]); 140 | db.getCollection("school").insert([ { 141 | _id: ObjectId("5ee5b1be3b492c365670daef"), 142 | name: "111", 143 | gaoDeLon: "111", 144 | gaoDeLat: "111", 145 | updateTime: ISODate("2020-06-14T05:12:30.878Z") 146 | } ]); 147 | db.getCollection("school").insert([ { 148 | _id: ObjectId("5ee5b1ea3b492c365670daf0"), 149 | name: "111", 150 | gaoDeLon: "11", 151 | gaoDeLat: "11", 152 | updateTime: ISODate("2020-06-14T05:13:14.832Z") 153 | } ]); 154 | db.getCollection("school").insert([ { 155 | _id: ObjectId("5ee5b2513b492c365670daf1"), 156 | name: "22", 157 | gaoDeLon: "22", 158 | gaoDeLat: "22", 159 | updateTime: ISODate("2020-06-14T05:14:57.072Z") 160 | } ]); 161 | db.getCollection("school").insert([ { 162 | _id: ObjectId("5ee5b3613b492c365670daf2"), 163 | name: "11", 164 | gaoDeLon: "1", 165 | gaoDeLat: "1", 166 | updateTime: ISODate("2020-06-14T05:19:29.997Z") 167 | } ]); 168 | db.getCollection("school").insert([ { 169 | _id: ObjectId("5ee5b3fd3b492c365670daf3"), 170 | name: "1", 171 | gaoDeLon: "1", 172 | gaoDeLat: "1", 173 | updateTime: ISODate("2020-06-14T05:22:05.8Z") 174 | } ]); 175 | db.getCollection("school").insert([ { 176 | _id: ObjectId("5ee5d6633b492c365670daf4"), 177 | name: "11", 178 | gaoDeLon: "11", 179 | gaoDeLat: "22", 180 | updateTime: ISODate("2020-06-14T07:48:51.121Z") 181 | } ]); 182 | db.getCollection("school").insert([ { 183 | _id: ObjectId("5ee5d6a53b492c365670daf5"), 184 | name: "665", 185 | gaoDeLon: "665", 186 | gaoDeLat: "665", 187 | updateTime: ISODate("2020-06-14T08:19:17.194Z") 188 | } ]); 189 | db.getCollection("school").insert([ { 190 | _id: ObjectId("5ef081a1dc933112c37666c6"), 191 | name: "33", 192 | gaoDeLon: 116.457853, 193 | gaoDeLat: 39.911074, 194 | updateTime: ISODate("2020-06-22T10:02:35.315Z") 195 | } ]); 196 | db.getCollection("school").insert([ { 197 | _id: ObjectId("5ef08b4cdc933112c37666c7"), 198 | gaoDeLon: 116.332883, 199 | gaoDeLat: 39.931874, 200 | name: "322", 201 | timestamp: 1597126975614, 202 | updateTime: ISODate("2020-08-11T06:22:51.267Z"), 203 | count: NumberInt("1") 204 | } ]); 205 | db.getCollection("school").insert([ { 206 | _id: ObjectId("5ef41fc1dc933112c37666c8"), 207 | name: "css", 208 | gaoDeLon: 116.378202, 209 | gaoDeLat: 39.916867, 210 | updateTime: ISODate("2020-06-25T03:53:37.284Z") 211 | } ]); 212 | db.getCollection("school").insert([ { 213 | _id: ObjectId("5ef41ff1dc933112c37666c9"), 214 | name: "sad", 215 | gaoDeLon: 116.339063, 216 | gaoDeLat: 39.924766, 217 | updateTime: ISODate("2020-06-25T03:54:25.087Z"), 218 | count: NumberInt("1") 219 | } ]); 220 | db.getCollection("school").insert([ { 221 | _id: ObjectId("5ef54362dc933112c37666d7"), 222 | name: "1234532", 223 | gaoDeLon: 116.435537, 224 | gaoDeLat: 39.923186, 225 | updateTime: ISODate("2020-06-26T01:21:28.338Z") 226 | } ]); 227 | db.getCollection("school").insert([ { 228 | _id: ObjectId("5ef55ed4dc933112c37666f0"), 229 | name: "231", 230 | gaoDeLon: 116.385412, 231 | gaoDeLat: 39.91476, 232 | updateTime: ISODate("2020-06-26T02:35:10.158Z") 233 | } ]); 234 | db.getCollection("school").insert([ { 235 | _id: ObjectId("5fe6e8dc852ffe6f28efedcc"), 236 | updateTime: ISODate("2020-12-26T07:40:12.385Z") 237 | } ]); 238 | db.getCollection("school").insert([ { 239 | _id: ObjectId("5fe6fac5852ffe6f28efedcd"), 240 | name: "黑马程序员", 241 | gaoDeLon: "116.1", 242 | gaoDeLat: "116.2", 243 | updateTime: ISODate("2020-12-26T08:56:37.565Z") 244 | } ]); 245 | db.getCollection("school").insert([ { 246 | _id: ObjectId("6009685d0e8f082b15b4d8ef"), 247 | gaoDeLon: 116.980911, 248 | gaoDeLat: 37.763995, 249 | name: "测试", 250 | timestamp: 1611229278693, 251 | updateTime: ISODate("2021-01-21T11:41:17.948Z"), 252 | count: NumberInt("1") 253 | } ]); 254 | db.getCollection("school").insert([ { 255 | _id: ObjectId("60330dda394e1859cf51f7b3"), 256 | gaoDeLon: 116.355875, 257 | gaoDeLat: 39.961385, 258 | name: "地址!", 259 | timestamp: 1613958617467, 260 | updateTime: ISODate("2021-02-22T01:50:18.473Z") 261 | } ]); 262 | db.getCollection("school").insert([ { 263 | _id: ObjectId("604f61f74786563f9bdfb4dc"), 264 | gaoDeLon: 116.330518, 265 | gaoDeLat: 39.97917, 266 | name: "123456", 267 | timestamp: 1615815159473, 268 | updateTime: ISODate("2021-03-15T13:32:39.1Z") 269 | } ]); 270 | db.getCollection("school").insert([ { 271 | _id: ObjectId("609caa054b34451bf8ed0e97"), 272 | gaoDeLon: 116.301984, 273 | gaoDeLat: 39.927547, 274 | name: "123", 275 | timestamp: 1620880054195, 276 | updateTime: ISODate("2021-05-13T04:24:37.125Z") 277 | } ]); 278 | db.getCollection("school").insert([ { 279 | _id: ObjectId("61ea65264553480ea2216e13"), 280 | gaoDeLon: 116.364469, 281 | gaoDeLat: 39.911103, 282 | name: "百度", 283 | timestamp: 1642751270864, 284 | updateTime: ISODate("2022-01-21T07:47:50.849Z") 285 | } ]); 286 | 287 | // ---------------------------- 288 | // Collection structure for spot 289 | // ---------------------------- 290 | db.getCollection("spot").drop(); 291 | db.createCollection("spot"); 292 | 293 | // ---------------------------- 294 | // Documents of spot 295 | // ---------------------------- 296 | db.getCollection("spot").insert([ { 297 | _id: ObjectId("5c9e0c7b6630fd0fa457e47c"), 298 | name: "2", 299 | gaoDeLon: 116.396741, 300 | gaoDeLat: 39.893164, 301 | voiceUrl: "", 302 | distance: "2", 303 | pid: "", 304 | timestamp: 1557818835956, 305 | updateTime: ISODate("2020-06-25T09:12:46.656Z"), 306 | count: NumberInt("27") 307 | } ]); 308 | db.getCollection("spot").insert([ { 309 | _id: ObjectId("5ca0b4407a23531a40c41965"), 310 | name: "1233", 311 | gaoDeLon: 39.942135, 312 | gaoDeLat: 116.211127, 313 | voiceUrl: "/public/resources/SOO9217H.mp3", 314 | distance: "123", 315 | pid: "5c9e0c136630fd0fa457e47b", 316 | timestamp: 1609566366144, 317 | updateTime: ISODate("2021-01-02T09:21:43.967Z"), 318 | count: NumberInt("48") 319 | } ]); 320 | db.getCollection("spot").insert([ { 321 | _id: ObjectId("5ca0b4697a23531a40c41966"), 322 | name: "浩学楼", 323 | gaoDeLon: 116.206272, 324 | gaoDeLat: 39.930217, 325 | voiceUrl: "/public/resources/V3SUUX4K.m4a", 326 | distance: "50", 327 | pid: "5c9e0c136630fd0fa457e47b", 328 | timestamp: 1556092510545, 329 | updateTime: ISODate("2019-04-24T07:55:11.597Z"), 330 | count: NumberInt("37") 331 | } ]); 332 | db.getCollection("spot").insert([ { 333 | _id: ObjectId("5ca0b4907a23531a40c41967"), 334 | name: "清真食堂", 335 | gaoDeLon: 116.211219, 336 | gaoDeLat: 39.928452, 337 | voiceUrl: "/public/resources/QB5HWN8K.m4a", 338 | distance: "50", 339 | pid: "5c9e0c136630fd0fa457e47b", 340 | timestamp: 1556092530301, 341 | updateTime: ISODate("2019-04-24T07:55:30.347Z"), 342 | count: NumberInt("14") 343 | } ]); 344 | db.getCollection("spot").insert([ { 345 | _id: ObjectId("5cab1b54932dff183c694661"), 346 | name: "尚德餐厅 聚贤阁", 347 | gaoDeLon: 116.209721, 348 | gaoDeLat: 39.927074, 349 | voiceUrl: "/public/resources/7MF8V2VQ.m4a", 350 | distance: "50", 351 | pid: "5c9e0c136630fd0fa457e47b", 352 | timestamp: 1556092556943, 353 | updateTime: ISODate("2019-04-24T07:55:57.051Z"), 354 | count: NumberInt("17") 355 | } ]); 356 | db.getCollection("spot").insert([ { 357 | _id: ObjectId("5cab1b9f932dff183c694662"), 358 | name: "毓秀餐厅", 359 | gaoDeLon: 116.426503, 360 | gaoDeLat: 39.91296, 361 | voiceUrl: "/public/resources/LRBMREBK.mp3", 362 | distance: "50", 363 | pid: "5c9e0c136630fd0fa457e47b", 364 | timestamp: 1613960473321, 365 | updateTime: ISODate("2021-02-22T02:21:14.329Z"), 366 | count: NumberInt("25") 367 | } ]); 368 | db.getCollection("spot").insert([ { 369 | _id: ObjectId("5cab1bce932dff183c694663"), 370 | name: "信息学院", 371 | gaoDeLon: 116.207348, 372 | gaoDeLat: 39.927329, 373 | voiceUrl: "/public/resources/DXMK3YGV.m4a", 374 | distance: "10", 375 | pid: "5c9e0c136630fd0fa457e47b", 376 | timestamp: 1613960476793, 377 | updateTime: ISODate("2021-02-22T02:21:17.805Z"), 378 | count: NumberInt("16") 379 | } ]); 380 | db.getCollection("spot").insert([ { 381 | _id: ObjectId("5cc6bed0939d2e00c6847614"), 382 | name: "奥莱西门", 383 | gaoDeLon: 116.595173, 384 | gaoDeLat: 40.013689, 385 | voiceUrl: "/public/resources/LH8A3DG4.mp3", 386 | distance: "30", 387 | pid: "5cc6be70939d2e00c6847613", 388 | timestamp: 1556530703402, 389 | updateTime: ISODate("2019-04-29T09:38:23.448Z"), 390 | count: NumberInt("1") 391 | } ]); 392 | db.getCollection("spot").insert([ { 393 | _id: ObjectId("5cc6bf05939d2e00c6847615"), 394 | name: "中餐厅", 395 | gaoDeLon: 116.594749, 396 | gaoDeLat: 40.012314, 397 | voiceUrl: "/public/resources/KM237TNJ.MP3", 398 | distance: "30", 399 | pid: "5cc6be70939d2e00c6847613", 400 | timestamp: 1556530713922, 401 | updateTime: ISODate("2019-04-29T09:38:33.952Z"), 402 | count: NumberInt("7") 403 | } ]); 404 | db.getCollection("spot").insert([ { 405 | _id: ObjectId("5cc6bf2c939d2e00c6847616"), 406 | name: "正门", 407 | gaoDeLon: 116.594797, 408 | gaoDeLat: 40.012577, 409 | voiceUrl: "/public/resources/8ABundefinedTFXW.MP3", 410 | distance: "30", 411 | pid: "5cc6be70939d2e00c6847613", 412 | timestamp: 1556530720902, 413 | updateTime: ISODate("2019-04-29T09:38:41.155Z"), 414 | count: NumberInt("1") 415 | } ]); 416 | db.getCollection("spot").insert([ { 417 | _id: ObjectId("5cc6bffc939d2e00c6847617"), 418 | name: "西1门", 419 | gaoDeLon: 116.595135, 420 | gaoDeLat: 40.013183, 421 | voiceUrl: "/public/resources/ZBLZUR9S.mp3", 422 | distance: "30", 423 | pid: "5cc6be70939d2e00c6847613", 424 | timestamp: 1556530778694, 425 | updateTime: ISODate("2019-04-29T09:39:38.728Z"), 426 | count: NumberInt("1") 427 | } ]); 428 | db.getCollection("spot").insert([ { 429 | _id: ObjectId("5cc6c024939d2e00c6847618"), 430 | name: "家", 431 | gaoDeLon: 116.289588, 432 | gaoDeLat: 39.930828, 433 | voiceUrl: "/public/resources/VLRLRU6M.MP3", 434 | distance: "100", 435 | pid: "5cc6be70939d2e00c6847613", 436 | timestamp: 1556537481413, 437 | updateTime: ISODate("2019-04-29T11:31:21.476Z"), 438 | count: NumberInt("20") 439 | } ]); 440 | db.getCollection("spot").insert([ { 441 | _id: ObjectId("5cc6e0abbbfd4c07742132bb"), 442 | name: "学校", 443 | gaoDeLon: 116.290386, 444 | gaoDeLat: 39.930733, 445 | voiceUrl: "", 446 | distance: "30", 447 | pid: "5cc6be70939d2e00c6847613", 448 | timestamp: 1556537515439, 449 | updateTime: ISODate("2019-04-29T11:31:55.54Z"), 450 | count: NumberInt("2") 451 | } ]); 452 | db.getCollection("spot").insert([ { 453 | _id: ObjectId("5cda782b734a0a23ac1cfe89"), 454 | name: "广学楼", 455 | gaoDeLon: 116.205378, 456 | gaoDeLat: 39.927971, 457 | voiceUrl: "/public/resources/VRZWXYUM.mp3", 458 | distance: "50", 459 | pid: "5c9e0c136630fd0fa457e47b", 460 | timestamp: 1557821483531, 461 | updateTime: ISODate("2019-05-14T08:11:23.592Z"), 462 | count: NumberInt("6") 463 | } ]); 464 | db.getCollection("spot").insert([ { 465 | _id: ObjectId("5ec6bc81852e1b61e2582568"), 466 | name: "清华大学东南门", 467 | gaoDeLon: 116.33283, 468 | gaoDeLat: 39.996496, 469 | voiceUrl: "", 470 | distance: "150", 471 | pid: "5ec6bbe0852e1b61e2582567", 472 | timestamp: 1590082690056, 473 | updateTime: ISODate("2020-05-21T17:38:09.425Z"), 474 | count: NumberInt("3") 475 | } ]); 476 | db.getCollection("spot").insert([ { 477 | _id: ObjectId("5ece0a3ba420f7403ef4ad84"), 478 | name: "1", 479 | gaoDeLon: 116.139346, 480 | gaoDeLat: 39.901718, 481 | voiceUrl: "", 482 | distance: "1", 483 | pid: "5e795f7994c2746d76c42d57", 484 | timestamp: 1590561338235, 485 | updateTime: ISODate("2020-06-26T01:17:12.851Z"), 486 | count: NumberInt("1") 487 | } ]); 488 | db.getCollection("spot").insert([ { 489 | _id: ObjectId("5ef462dfdc933112c37666ca"), 490 | pid: "", 491 | name: "2", 492 | voiceUrl: "", 493 | gaoDeLon: 116.399145, 494 | gaoDeLat: 39.89053, 495 | distance: "2", 496 | updateTime: ISODate("2020-06-25T09:12:07.898Z") 497 | } ]); 498 | db.getCollection("spot").insert([ { 499 | _id: ObjectId("5ef4636fdc933112c37666cb"), 500 | pid: "5c9e0c136630fd0fa457e47b", 501 | name: "3666", 502 | voiceUrl: "", 503 | gaoDeLon: 116.364126, 504 | gaoDeLat: 39.925161, 505 | distance: "3666", 506 | updateTime: ISODate("2020-06-26T02:35:50.805Z"), 507 | count: NumberInt("2") 508 | } ]); 509 | db.getCollection("spot").insert([ { 510 | _id: ObjectId("5ef4638ddc933112c37666cc"), 511 | pid: "5c9e0c136630fd0fa457e47b", 512 | name: "2", 513 | voiceUrl: "", 514 | gaoDeLon: 116.370649, 515 | gaoDeLat: 39.925556, 516 | distance: "2", 517 | updateTime: ISODate("2020-06-25T08:42:53.425Z"), 518 | count: NumberInt("2") 519 | } ]); 520 | db.getCollection("spot").insert([ { 521 | _id: ObjectId("5ef463c2dc933112c37666cd"), 522 | pid: "5c9e0c136630fd0fa457e47b", 523 | name: "3", 524 | voiceUrl: "", 525 | gaoDeLon: 116.422271, 526 | gaoDeLat: 39.917093, 527 | distance: "3", 528 | updateTime: ISODate("2021-05-17T10:54:16.136Z"), 529 | count: NumberInt("1"), 530 | timestamp: 1621248856348 531 | } ]); 532 | db.getCollection("spot").insert([ { 533 | _id: ObjectId("5ef46c7adc933112c37666ce"), 534 | pid: "5c9e0c136630fd0fa457e47b", 535 | name: "1", 536 | voiceUrl: "", 537 | gaoDeLon: 116.352796, 538 | gaoDeLat: 39.902909, 539 | distance: "1", 540 | updateTime: ISODate("2020-06-25T09:20:58.771Z"), 541 | count: NumberInt("2") 542 | } ]); 543 | db.getCollection("spot").insert([ { 544 | _id: ObjectId("5ef46cdcdc933112c37666cf"), 545 | pid: "5c9e0c136630fd0fa457e47b", 546 | name: "1", 547 | voiceUrl: "", 548 | gaoDeLon: 116.34387, 549 | gaoDeLat: 39.925556, 550 | distance: "1", 551 | updateTime: ISODate("2020-06-25T09:22:36.94Z"), 552 | count: NumberInt("7") 553 | } ]); 554 | db.getCollection("spot").insert([ { 555 | _id: ObjectId("5ef46d15dc933112c37666d0"), 556 | pid: "5c9e0c136630fd0fa457e47b", 557 | name: "1", 558 | voiceUrl: "", 559 | gaoDeLon: 116.385068, 560 | gaoDeLat: 39.916604, 561 | distance: "1", 562 | updateTime: ISODate("2020-06-25T09:23:33.133Z"), 563 | count: NumberInt("3") 564 | } ]); 565 | db.getCollection("spot").insert([ { 566 | _id: ObjectId("5ef53150dc933112c37666d1"), 567 | pid: "5c9e0c136630fd0fa457e47b", 568 | name: "1", 569 | voiceUrl: "", 570 | gaoDeLon: 116.379232, 571 | gaoDeLat: 39.91239, 572 | distance: "1", 573 | updateTime: ISODate("2020-06-25T23:20:48.695Z"), 574 | count: NumberInt("2") 575 | } ]); 576 | db.getCollection("spot").insert([ { 577 | _id: ObjectId("5ef53198dc933112c37666d2"), 578 | pid: "5c9e0c136630fd0fa457e47b", 579 | name: "4", 580 | voiceUrl: "", 581 | gaoDeLon: 116.371421, 582 | gaoDeLat: 39.928545, 583 | distance: "4", 584 | updateTime: ISODate("2021-02-22T02:20:57.64Z"), 585 | timestamp: 1613960456621 586 | } ]); 587 | db.getCollection("spot").insert([ { 588 | _id: ObjectId("5ef531c3dc933112c37666d3"), 589 | pid: "5c9e0c136630fd0fa457e47b", 590 | name: "4", 591 | voiceUrl: "", 592 | gaoDeLon: 116.370992, 593 | gaoDeLat: 39.928715, 594 | distance: "4", 595 | updateTime: ISODate("2020-06-25T23:22:43.537Z") 596 | } ]); 597 | db.getCollection("spot").insert([ { 598 | _id: ObjectId("5ef531fedc933112c37666d4"), 599 | pid: "5c9e0c136630fd0fa457e47b", 600 | name: "4", 601 | voiceUrl: "", 602 | gaoDeLon: 116.370992, 603 | gaoDeLat: 39.928715, 604 | distance: "4", 605 | updateTime: ISODate("2020-06-25T23:23:42.735Z"), 606 | count: NumberInt("6") 607 | } ]); 608 | db.getCollection("spot").insert([ { 609 | _id: ObjectId("5ef532f5dc933112c37666d5"), 610 | pid: "5c9e0c136630fd0fa457e47b", 611 | name: "44", 612 | voiceUrl: "", 613 | gaoDeLon: 116.413908, 614 | gaoDeLat: 39.93477, 615 | distance: "44", 616 | updateTime: ISODate("2020-06-26T01:27:38.505Z"), 617 | count: NumberInt("1") 618 | } ]); 619 | db.getCollection("spot").insert([ { 620 | _id: ObjectId("5ef5467bdc933112c37666d8"), 621 | pid: "", 622 | name: "", 623 | voiceUrl: "", 624 | gaoDeLon: "", 625 | gaoDeLat: "", 626 | distance: "", 627 | updateTime: ISODate("2020-06-26T00:51:07.992Z") 628 | } ]); 629 | db.getCollection("spot").insert([ { 630 | _id: ObjectId("5ef5469edc933112c37666d9"), 631 | pid: "", 632 | name: "", 633 | voiceUrl: "", 634 | gaoDeLon: "", 635 | gaoDeLat: "", 636 | distance: "", 637 | updateTime: ISODate("2020-06-26T00:51:42.529Z") 638 | } ]); 639 | db.getCollection("spot").insert([ { 640 | _id: ObjectId("5ef548d7dc933112c37666da"), 641 | pid: "5e795f7994c2746d76c42d57", 642 | name: "1", 643 | voiceUrl: "", 644 | gaoDeLon: 116.139346, 645 | gaoDeLat: 39.901718, 646 | distance: "1", 647 | updateTime: ISODate("2020-06-26T01:06:48.762Z"), 648 | count: NumberInt("1") 649 | } ]); 650 | db.getCollection("spot").insert([ { 651 | _id: ObjectId("5ef548f2dc933112c37666db"), 652 | pid: "5e795f7994c2746d76c42d57", 653 | name: "1", 654 | voiceUrl: "", 655 | gaoDeLon: 116.139346, 656 | gaoDeLat: 39.901718, 657 | distance: "1", 658 | updateTime: ISODate("2020-06-26T01:01:38.813Z"), 659 | count: NumberInt("4") 660 | } ]); 661 | db.getCollection("spot").insert([ { 662 | _id: ObjectId("5ef549c7dc933112c37666dc"), 663 | pid: "5e795f7994c2746d76c42d57", 664 | name: "", 665 | voiceUrl: "", 666 | gaoDeLon: "", 667 | gaoDeLat: "", 668 | distance: "", 669 | updateTime: ISODate("2020-06-26T01:05:11.015Z") 670 | } ]); 671 | db.getCollection("spot").insert([ { 672 | _id: ObjectId("5ef54f70dc933112c37666dd"), 673 | pid: "5e93d658fb4ca859f52131aa", 674 | name: "", 675 | voiceUrl: "", 676 | gaoDeLon: "", 677 | gaoDeLat: "", 678 | distance: "", 679 | updateTime: ISODate("2020-06-26T01:29:20.215Z") 680 | } ]); 681 | db.getCollection("spot").insert([ { 682 | _id: ObjectId("5ef54fe7dc933112c37666de"), 683 | pid: "5e93d658fb4ca859f52131aa", 684 | name: "", 685 | voiceUrl: "", 686 | gaoDeLon: "", 687 | gaoDeLat: "", 688 | distance: "", 689 | updateTime: ISODate("2020-06-26T01:31:19.259Z") 690 | } ]); 691 | db.getCollection("spot").insert([ { 692 | _id: ObjectId("5ef5500ddc933112c37666df"), 693 | pid: "5e93d658fb4ca859f52131aa", 694 | name: "", 695 | voiceUrl: "", 696 | gaoDeLon: "", 697 | gaoDeLat: "", 698 | distance: "", 699 | updateTime: ISODate("2020-06-26T01:31:57.519Z") 700 | } ]); 701 | db.getCollection("spot").insert([ { 702 | _id: ObjectId("5ef55048dc933112c37666e0"), 703 | pid: "5e795f7994c2746d76c42d57", 704 | name: "", 705 | voiceUrl: "", 706 | gaoDeLon: "", 707 | gaoDeLat: "", 708 | distance: "", 709 | updateTime: ISODate("2020-06-26T01:32:56.318Z") 710 | } ]); 711 | db.getCollection("spot").insert([ { 712 | _id: ObjectId("5ef555c6dc933112c37666e1"), 713 | pid: "5c9e0c136630fd0fa457e47b", 714 | name: "", 715 | voiceUrl: "", 716 | gaoDeLon: "", 717 | gaoDeLat: "", 718 | distance: "", 719 | updateTime: ISODate("2020-06-26T01:56:22.371Z") 720 | } ]); 721 | db.getCollection("spot").insert([ { 722 | _id: ObjectId("5ef555ecdc933112c37666e2"), 723 | pid: "5e93d683fb4ca859f52131ab", 724 | name: "", 725 | voiceUrl: "", 726 | gaoDeLon: "", 727 | gaoDeLat: "", 728 | distance: "", 729 | updateTime: ISODate("2020-06-26T01:57:00.008Z") 730 | } ]); 731 | db.getCollection("spot").insert([ { 732 | _id: ObjectId("5ef5561edc933112c37666e3"), 733 | pid: "5e93d683fb4ca859f52131ab", 734 | name: "", 735 | voiceUrl: "", 736 | gaoDeLon: "", 737 | gaoDeLat: "", 738 | distance: "", 739 | updateTime: ISODate("2020-06-26T01:57:50.578Z") 740 | } ]); 741 | db.getCollection("spot").insert([ { 742 | _id: ObjectId("5ef55761dc933112c37666e4"), 743 | pid: "5c9e0c136630fd0fa457e47b", 744 | name: "", 745 | voiceUrl: "", 746 | gaoDeLon: "", 747 | gaoDeLat: "", 748 | distance: "", 749 | updateTime: ISODate("2020-06-26T02:03:13.697Z") 750 | } ]); 751 | db.getCollection("spot").insert([ { 752 | _id: ObjectId("5ef55792dc933112c37666e5"), 753 | pid: "5c9e0c136630fd0fa457e47b", 754 | name: "", 755 | voiceUrl: "", 756 | gaoDeLon: "", 757 | gaoDeLat: "", 758 | distance: "", 759 | updateTime: ISODate("2020-06-26T02:04:02.363Z") 760 | } ]); 761 | db.getCollection("spot").insert([ { 762 | _id: ObjectId("5ef5585ddc933112c37666e6"), 763 | pid: "5c9e0c136630fd0fa457e47b", 764 | name: "", 765 | voiceUrl: "", 766 | gaoDeLon: 116.383009, 767 | gaoDeLat: 39.919237, 768 | distance: "213", 769 | updateTime: ISODate("2020-06-26T02:07:25.611Z") 770 | } ]); 771 | db.getCollection("spot").insert([ { 772 | _id: ObjectId("5ef55885dc933112c37666e7"), 773 | pid: "5c9e0c136630fd0fa457e47b", 774 | name: "", 775 | voiceUrl: "", 776 | gaoDeLon: 116.383009, 777 | gaoDeLat: 39.919237, 778 | distance: "213", 779 | updateTime: ISODate("2020-06-26T02:08:05.984Z") 780 | } ]); 781 | db.getCollection("spot").insert([ { 782 | _id: ObjectId("5ef558bfdc933112c37666e8"), 783 | pid: "5c9e0c136630fd0fa457e47b", 784 | name: "", 785 | voiceUrl: "", 786 | gaoDeLon: "", 787 | gaoDeLat: "", 788 | distance: "", 789 | updateTime: ISODate("2020-06-26T02:09:03.205Z") 790 | } ]); 791 | db.getCollection("spot").insert([ { 792 | _id: ObjectId("5ef558e2dc933112c37666e9"), 793 | pid: "5c9e0c136630fd0fa457e47b", 794 | name: "", 795 | voiceUrl: "", 796 | gaoDeLon: "", 797 | gaoDeLat: "", 798 | distance: "", 799 | updateTime: ISODate("2020-06-26T02:09:38.158Z") 800 | } ]); 801 | db.getCollection("spot").insert([ { 802 | _id: ObjectId("5ef55b23dc933112c37666ea"), 803 | pid: "5c9e0c136630fd0fa457e47b", 804 | name: "", 805 | voiceUrl: "", 806 | gaoDeLon: "", 807 | gaoDeLat: "", 808 | distance: "", 809 | updateTime: ISODate("2020-06-26T02:19:15.695Z"), 810 | count: NumberInt("1") 811 | } ]); 812 | db.getCollection("spot").insert([ { 813 | _id: ObjectId("5ef55b78dc933112c37666eb"), 814 | pid: "5e795f7994c2746d76c42d57", 815 | name: "", 816 | voiceUrl: "", 817 | gaoDeLon: "", 818 | gaoDeLat: "", 819 | distance: "", 820 | updateTime: ISODate("2020-06-26T02:20:40.182Z") 821 | } ]); 822 | db.getCollection("spot").insert([ { 823 | _id: ObjectId("5ef55d89dc933112c37666ec"), 824 | pid: "5e795f7994c2746d76c42d57", 825 | name: "1", 826 | voiceUrl: "", 827 | gaoDeLon: 116.360349, 828 | gaoDeLat: 39.924898, 829 | distance: "1", 830 | updateTime: ISODate("2020-06-26T02:29:29.262Z"), 831 | count: NumberInt("9") 832 | } ]); 833 | db.getCollection("spot").insert([ { 834 | _id: ObjectId("5ef55dc0dc933112c37666ed"), 835 | pid: "5e795f7994c2746d76c42d57", 836 | name: "123", 837 | voiceUrl: "", 838 | gaoDeLon: 116.368589, 839 | gaoDeLat: 39.921475, 840 | distance: "123", 841 | updateTime: ISODate("2020-06-26T02:30:24.38Z"), 842 | count: NumberInt("5") 843 | } ]); 844 | db.getCollection("spot").insert([ { 845 | _id: ObjectId("5ef55e6bdc933112c37666ee"), 846 | pid: "5e795f7994c2746d76c42d57", 847 | name: "123", 848 | voiceUrl: "", 849 | gaoDeLon: 116.366926, 850 | gaoDeLat: 39.910038, 851 | distance: "123", 852 | updateTime: ISODate("2021-02-22T01:48:05.828Z"), 853 | count: NumberInt("7"), 854 | timestamp: 1613958484838 855 | } ]); 856 | db.getCollection("spot").insert([ { 857 | _id: ObjectId("5ef55e8bdc933112c37666ef"), 858 | pid: "5e795f9894c2746d76c42d58", 859 | name: "123", 860 | voiceUrl: "", 861 | gaoDeLon: 116.378202, 862 | gaoDeLat: 39.923055, 863 | distance: "213", 864 | updateTime: ISODate("2020-06-26T02:33:47.295Z"), 865 | count: NumberInt("9") 866 | } ]); 867 | db.getCollection("spot").insert([ { 868 | _id: ObjectId("5ef55f1cdc933112c37666f1"), 869 | pid: "5c9e0c136630fd0fa457e47b", 870 | name: "3223", 871 | voiceUrl: "", 872 | gaoDeLon: 116.367216, 873 | gaoDeLat: 39.922265, 874 | distance: "2323", 875 | updateTime: ISODate("2020-06-26T02:36:12.71Z"), 876 | count: NumberInt("18") 877 | } ]); 878 | db.getCollection("spot").insert([ { 879 | _id: ObjectId("604080b0fd64eb64e26d179a"), 880 | name: "是的", 881 | gaoDeLon: 116.331692, 882 | gaoDeLat: 39.956969, 883 | voiceUrl: "", 884 | distance: "100", 885 | pid: "5e8886502a66ed047c2c883b", 886 | timestamp: 1614839984906, 887 | updateTime: ISODate("2021-03-04T06:39:44.983Z") 888 | } ]); 889 | 890 | // ---------------------------- 891 | // Collection structure for user 892 | // ---------------------------- 893 | db.getCollection("user").drop(); 894 | db.createCollection("user"); 895 | 896 | // ---------------------------- 897 | // Documents of user 898 | // ---------------------------- 899 | db.getCollection("user").insert([ { 900 | _id: ObjectId("5c876ba7d623439c0e17d4c3"), 901 | username: "admin", 902 | password: "admin121", 903 | phone: "123131", 904 | timestamp: 1645953004255, 905 | updateTime: ISODate("2022-02-27T09:10:05.05Z") 906 | } ]); 907 | db.getCollection("user").insert([ { 908 | _id: ObjectId("5cd7c43268fc4921f4fc5e28"), 909 | username: "tianshi97021", 910 | phone: "189116432011", 911 | password: "lmh970211", 912 | timestamp: 1613960487587, 913 | updateTime: ISODate("2021-02-22T02:21:28.594Z") 914 | } ]); 915 | db.getCollection("user").insert([ { 916 | _id: ObjectId("5e88863d2a66ed047c2c883a"), 917 | username: "admin", 918 | phone: "15129048951", 919 | password: "123456", 920 | timestamp: 1619421084828, 921 | updateTime: ISODate("2021-04-26T07:11:25.005Z") 922 | } ]); 923 | db.getCollection("user").insert([ { 924 | _id: ObjectId("5e96991a2552a320d785cda8"), 925 | username: "115", 926 | phone: "2+006206+", 927 | password: "11515615615", 928 | timestamp: 1609722768812, 929 | updateTime: ISODate("2021-01-04T01:12:49.463Z") 930 | } ]); 931 | db.getCollection("user").insert([ { 932 | _id: ObjectId("5ea6a7d19c7a481854105597"), 933 | username: "ttttest", 934 | phone: "12345678900", 935 | password: "923jejslaa", 936 | timestamp: 1587980241108, 937 | updateTime: ISODate("2020-04-27T09:37:21.136Z") 938 | } ]); 939 | db.getCollection("user").insert([ { 940 | _id: ObjectId("5ed9adea85a8c6251682fb92"), 941 | username: "111", 942 | phone: "1231", 943 | password: "123", 944 | timestamp: 1597126819183, 945 | updateTime: ISODate("2020-08-11T06:20:14.383Z") 946 | } ]); 947 | db.getCollection("user").insert([ { 948 | _id: ObjectId("5ee574f23b492c365670dad5"), 949 | username: "1234", 950 | password: "1234", 951 | phone: "13888888888", 952 | updateTime: ISODate("2020-08-11T06:20:52.162Z"), 953 | timestamp: 1597126856707 954 | } ]); 955 | db.getCollection("user").insert([ { 956 | _id: ObjectId("5ee575473b492c365670dad6"), 957 | username: "1234", 958 | password: "1234", 959 | phone: "18988888888", 960 | updateTime: ISODate("2020-06-14T00:54:31.264Z") 961 | } ]); 962 | db.getCollection("user").insert([ { 963 | _id: ObjectId("5ee575d43b492c365670dad7"), 964 | username: "1234", 965 | password: "123456", 966 | phone: "13888886666", 967 | updateTime: ISODate("2020-10-18T11:06:53.442Z"), 968 | timestamp: 1603019213367 969 | } ]); 970 | db.getCollection("user").insert([ { 971 | _id: ObjectId("5ee575fd3b492c365670dad8"), 972 | username: "123", 973 | password: "1234", 974 | phone: "13866669999", 975 | updateTime: ISODate("2020-06-14T00:57:33.753Z") 976 | } ]); 977 | db.getCollection("user").insert([ { 978 | _id: ObjectId("5ee5761f3b492c365670dad9"), 979 | username: "1234", 980 | password: "12345", 981 | phone: "13866668888", 982 | updateTime: ISODate("2021-03-20T09:39:21.408Z"), 983 | timestamp: 1616233161647 984 | } ]); 985 | db.getCollection("user").insert([ { 986 | _id: ObjectId("5ee577a43b492c365670dada"), 987 | username: "123", 988 | password: "123", 989 | phone: "18866668888", 990 | updateTime: ISODate("2020-06-14T01:04:36.977Z") 991 | } ]); 992 | db.getCollection("user").insert([ { 993 | _id: ObjectId("5ee5951c3b492c365670dadb"), 994 | username: "123", 995 | password: "123", 996 | phone: "13866668888", 997 | updateTime: ISODate("2020-06-14T03:10:20.861Z") 998 | } ]); 999 | db.getCollection("user").insert([ { 1000 | _id: ObjectId("5ee5952b3b492c365670dadc"), 1001 | username: "1234", 1002 | password: "123", 1003 | phone: "13866668888", 1004 | updateTime: ISODate("2020-06-14T03:10:35.527Z") 1005 | } ]); 1006 | db.getCollection("user").insert([ { 1007 | _id: ObjectId("5ee595823b492c365670dadd"), 1008 | username: "12345", 1009 | password: "123", 1010 | phone: "13866668888", 1011 | updateTime: ISODate("2020-06-14T03:12:02.22Z") 1012 | } ]); 1013 | db.getCollection("user").insert([ { 1014 | _id: ObjectId("5ee596d93b492c365670dade"), 1015 | username: "111", 1016 | password: "111", 1017 | phone: "18866666999", 1018 | updateTime: ISODate("2020-06-14T08:30:17.663Z") 1019 | } ]); 1020 | db.getCollection("user").insert([ { 1021 | _id: ObjectId("5ee59b4d3b492c365670dadf"), 1022 | username: "admin", 1023 | password: "admin1234", 1024 | phone: "15210156268", 1025 | updateTime: ISODate("2020-06-14T03:36:45.027Z") 1026 | } ]); 1027 | db.getCollection("user").insert([ { 1028 | _id: ObjectId("5ee59b5a3b492c365670dae0"), 1029 | username: "admin1", 1030 | password: "admin1234", 1031 | phone: "15210156268", 1032 | updateTime: ISODate("2020-06-14T03:36:58.089Z") 1033 | } ]); 1034 | db.getCollection("user").insert([ { 1035 | _id: ObjectId("5ee59bbb3b492c365670dae1"), 1036 | username: "admin1", 1037 | password: "admin1234", 1038 | phone: "15210156268", 1039 | updateTime: ISODate("2020-06-14T03:38:35.659Z") 1040 | } ]); 1041 | db.getCollection("user").insert([ { 1042 | _id: ObjectId("5ee59c1a3b492c365670dae2"), 1043 | username: "admin1", 1044 | password: "admin1234", 1045 | phone: "15210156268", 1046 | updateTime: ISODate("2020-06-14T03:40:10.626Z") 1047 | } ]); 1048 | db.getCollection("user").insert([ { 1049 | _id: ObjectId("5ee59c9a3b492c365670dae3"), 1050 | username: "admin1231121212", 1051 | password: "admin1234", 1052 | phone: "15210156268", 1053 | updateTime: ISODate("2020-09-23T03:02:12.348Z"), 1054 | timestamp: 1600830130840 1055 | } ]); 1056 | db.getCollection("user").insert([ { 1057 | _id: ObjectId("5ee59ccb3b492c365670dae4"), 1058 | username: "admin12323", 1059 | password: "admin1234", 1060 | phone: "15210156268", 1061 | updateTime: ISODate("2020-06-14T03:43:07.66Z") 1062 | } ]); 1063 | db.getCollection("user").insert([ { 1064 | _id: ObjectId("5ee59df83b492c365670dae5"), 1065 | params: { 1066 | username: "admin12344", 1067 | password: "admin1234", 1068 | phone: "15210156268" 1069 | }, 1070 | updateTime: ISODate("2020-06-14T03:48:08.566Z") 1071 | } ]); 1072 | db.getCollection("user").insert([ { 1073 | _id: ObjectId("5ee59e573b492c365670dae6"), 1074 | username: "admin", 1075 | password: "admin1234", 1076 | phone: "15210156268", 1077 | updateTime: ISODate("2020-06-14T03:49:43.141Z") 1078 | } ]); 1079 | db.getCollection("user").insert([ { 1080 | _id: ObjectId("5ee59e5c3b492c365670dae7"), 1081 | username: "admin", 1082 | password: "admin1234", 1083 | phone: "15210156268", 1084 | updateTime: ISODate("2020-06-14T03:49:48.53Z") 1085 | } ]); 1086 | db.getCollection("user").insert([ { 1087 | _id: ObjectId("5ee59e6b3b492c365670dae8"), 1088 | username: "admin", 1089 | password: "admin1234", 1090 | phone: "15210156268", 1091 | updateTime: ISODate("2020-06-14T03:50:03.823Z") 1092 | } ]); 1093 | db.getCollection("user").insert([ { 1094 | _id: ObjectId("5ee59e863b492c365670dae9"), 1095 | username: "admin", 1096 | password: "admin1234", 1097 | phone: "15210156268", 1098 | updateTime: ISODate("2020-06-14T03:50:30.938Z") 1099 | } ]); 1100 | db.getCollection("user").insert([ { 1101 | _id: ObjectId("5ee59e8d3b492c365670daea"), 1102 | username: "admin", 1103 | password: "admin1234", 1104 | phone: "15210156268", 1105 | updateTime: ISODate("2020-06-14T03:50:37.444Z") 1106 | } ]); 1107 | db.getCollection("user").insert([ { 1108 | _id: ObjectId("5ee59eb43b492c365670daeb"), 1109 | username: "admin111", 1110 | password: "admin1234", 1111 | phone: "15210156268", 1112 | updateTime: ISODate("2020-06-14T03:52:47.713Z") 1113 | } ]); 1114 | db.getCollection("user").insert([ { 1115 | _id: ObjectId("5ef54272dc933112c37666d6"), 1116 | username: "343456", 1117 | password: "34343", 1118 | phone: "13888888888", 1119 | updateTime: ISODate("2020-06-26T00:34:00.854Z") 1120 | } ]); 1121 | db.getCollection("user").insert([ { 1122 | _id: ObjectId("5f5859a1beff3d441c8dbea0"), 1123 | username: "11", 1124 | phone: "33", 1125 | password: "22", 1126 | timestamp: 1599625632511, 1127 | updateTime: ISODate("2020-09-09T04:27:13.617Z") 1128 | } ]); 1129 | db.getCollection("user").insert([ { 1130 | _id: ObjectId("5f6d9aa92b87922ee8499983"), 1131 | username: "123", 1132 | phone: "123", 1133 | password: "123", 1134 | timestamp: 1601018537250, 1135 | updateTime: ISODate("2020-09-25T07:22:17.475Z") 1136 | } ]); 1137 | db.getCollection("user").insert([ { 1138 | _id: ObjectId("5f6d9ab02b87922ee8499984"), 1139 | username: "123", 1140 | phone: "123123123", 1141 | password: "412434", 1142 | timestamp: 1601018544854, 1143 | updateTime: ISODate("2020-09-25T07:22:24.911Z") 1144 | } ]); 1145 | db.getCollection("user").insert([ { 1146 | _id: ObjectId("5f6d9abc2b87922ee8499985"), 1147 | username: "12315124", 1148 | phone: "123123", 1149 | password: "123123", 1150 | timestamp: 1601018556374, 1151 | updateTime: ISODate("2020-09-25T07:22:36.618Z") 1152 | } ]); 1153 | db.getCollection("user").insert([ { 1154 | _id: ObjectId("5f7c4b07dc91da7085e806c0"), 1155 | username: "1", 1156 | phone: "1", 1157 | password: "1", 1158 | timestamp: 1601981191568, 1159 | updateTime: ISODate("2020-10-06T10:46:31.869Z") 1160 | } ]); 1161 | db.getCollection("user").insert([ { 1162 | _id: ObjectId("5f86ac3483b4062d16c5faaf"), 1163 | username: "清文", 1164 | phone: "清文222", 1165 | password: "额为全额", 1166 | timestamp: 1602661439374, 1167 | updateTime: ISODate("2020-10-14T07:44:00.863Z") 1168 | } ]); 1169 | db.getCollection("user").insert([ { 1170 | _id: ObjectId("5f9d0c709706d84275471fc2"), 1171 | username: "1", 1172 | phone: "1", 1173 | password: "1", 1174 | timestamp: 1604127856808, 1175 | updateTime: ISODate("2020-10-31T07:04:16.436Z") 1176 | } ]); 1177 | db.getCollection("user").insert([ { 1178 | _id: ObjectId("5fe49d3c4dc44a36b06ca9f6"), 1179 | updateTime: ISODate("2020-12-24T13:53:00.852Z") 1180 | } ]); 1181 | db.getCollection("user").insert([ { 1182 | _id: ObjectId("5fe49d7a4dc44a36b06ca9f7"), 1183 | updateTime: ISODate("2020-12-24T13:54:02.705Z") 1184 | } ]); 1185 | db.getCollection("user").insert([ { 1186 | _id: ObjectId("5fe49ddc4dc44a36b06ca9f8"), 1187 | updateTime: ISODate("2020-12-24T13:55:40.132Z") 1188 | } ]); 1189 | db.getCollection("user").insert([ { 1190 | _id: ObjectId("5fe49ddf4dc44a36b06ca9f9"), 1191 | updateTime: ISODate("2020-12-24T13:55:43.653Z") 1192 | } ]); 1193 | db.getCollection("user").insert([ { 1194 | _id: ObjectId("5fe49e044dc44a36b06ca9fa"), 1195 | updateTime: ISODate("2020-12-24T13:56:20.944Z") 1196 | } ]); 1197 | db.getCollection("user").insert([ { 1198 | _id: ObjectId("5fe49e7a4dc44a36b06ca9fb"), 1199 | updateTime: ISODate("2020-12-24T13:58:18.372Z") 1200 | } ]); 1201 | db.getCollection("user").insert([ { 1202 | _id: ObjectId("5fe49e844dc44a36b06ca9fc"), 1203 | updateTime: ISODate("2020-12-24T13:58:28.157Z") 1204 | } ]); 1205 | db.getCollection("user").insert([ { 1206 | _id: ObjectId("5fe4b22e4dc44a36b06ca9fd"), 1207 | updateTime: ISODate("2020-12-24T15:22:22.569Z") 1208 | } ]); 1209 | db.getCollection("user").insert([ { 1210 | _id: ObjectId("5fe4b25a4dc44a36b06ca9fe"), 1211 | username: "asd", 1212 | password: "asd", 1213 | phone: "asda", 1214 | updateTime: ISODate("2020-12-24T15:23:06.332Z") 1215 | } ]); 1216 | db.getCollection("user").insert([ { 1217 | _id: ObjectId("5fe4b45b4dc44a36b06ca9ff"), 1218 | updateTime: ISODate("2020-12-24T15:31:39.987Z") 1219 | } ]); 1220 | db.getCollection("user").insert([ { 1221 | _id: ObjectId("5fe4b7524dc44a36b06caa00"), 1222 | updateTime: ISODate("2020-12-24T15:44:18.231Z") 1223 | } ]); 1224 | db.getCollection("user").insert([ { 1225 | _id: ObjectId("5fe4b7884dc44a36b06caa01"), 1226 | updateTime: ISODate("2020-12-24T15:45:12.726Z") 1227 | } ]); 1228 | db.getCollection("user").insert([ { 1229 | _id: ObjectId("5fe4b7954dc44a36b06caa02"), 1230 | updateTime: ISODate("2020-12-24T15:45:25.832Z") 1231 | } ]); 1232 | db.getCollection("user").insert([ { 1233 | _id: ObjectId("5fe4bc554dc44a36b06caa03"), 1234 | updateTime: ISODate("2020-12-24T16:05:41.985Z") 1235 | } ]); 1236 | db.getCollection("user").insert([ { 1237 | _id: ObjectId("5fe5348b4dc44a36b06caa04"), 1238 | updateTime: ISODate("2020-12-25T00:38:35.738Z") 1239 | } ]); 1240 | db.getCollection("user").insert([ { 1241 | _id: ObjectId("5fe5348d4dc44a36b06caa05"), 1242 | updateTime: ISODate("2020-12-25T00:38:37.494Z") 1243 | } ]); 1244 | db.getCollection("user").insert([ { 1245 | _id: ObjectId("5fe5348e4dc44a36b06caa06"), 1246 | updateTime: ISODate("2020-12-25T00:38:38.455Z") 1247 | } ]); 1248 | db.getCollection("user").insert([ { 1249 | _id: ObjectId("5fe5348f4dc44a36b06caa07"), 1250 | updateTime: ISODate("2020-12-25T00:38:39.241Z") 1251 | } ]); 1252 | db.getCollection("user").insert([ { 1253 | _id: ObjectId("5fe534904dc44a36b06caa08"), 1254 | updateTime: ISODate("2020-12-25T00:38:40.144Z") 1255 | } ]); 1256 | db.getCollection("user").insert([ { 1257 | _id: ObjectId("5fe583794dc44a36b06caa09"), 1258 | username: "12345", 1259 | password: "12345", 1260 | phone: "12345", 1261 | updateTime: ISODate("2020-12-25T06:15:21.861Z") 1262 | } ]); 1263 | db.getCollection("user").insert([ { 1264 | _id: ObjectId("5fe6be0c852ffe6f28efedcb"), 1265 | username: "asd", 1266 | password: "asd", 1267 | phone: "122334", 1268 | updateTime: ISODate("2020-12-26T04:37:32.189Z") 1269 | } ]); 1270 | db.getCollection("user").insert([ { 1271 | _id: ObjectId("601ff53a2b12e10567cb867e"), 1272 | username: "1", 1273 | phone: "122", 1274 | password: "1", 1275 | timestamp: 1612707128322, 1276 | updateTime: ISODate("2021-02-07T14:12:10.721Z") 1277 | } ]); 1278 | db.getCollection("user").insert([ { 1279 | _id: ObjectId("604f4377b33142233ba5ed65"), 1280 | username: "4", 1281 | phone: "455", 1282 | password: "45", 1283 | timestamp: 1615807351119, 1284 | updateTime: ISODate("2021-03-15T11:22:31.416Z") 1285 | } ]); 1286 | db.getCollection("user").insert([ { 1287 | _id: ObjectId("604f4395b33142233ba5ed66"), 1288 | username: "lll", 1289 | phone: "s", 1290 | password: "s", 1291 | timestamp: 1615807381667, 1292 | updateTime: ISODate("2021-03-15T11:23:01.964Z") 1293 | } ]); 1294 | db.getCollection("user").insert([ { 1295 | _id: ObjectId("605172e3476e696ff4d1c50e"), 1296 | username: "test12138", 1297 | phone: "123", 1298 | password: "123", 1299 | timestamp: 1615950562044, 1300 | updateTime: ISODate("2021-03-17T03:09:23.174Z") 1301 | } ]); 1302 | db.getCollection("user").insert([ { 1303 | _id: ObjectId("60534b2a12ddff510151c3ca"), 1304 | username: "换个哈哈", 1305 | phone: "钢结构", 1306 | password: "各回各家", 1307 | timestamp: 1616071465764, 1308 | updateTime: ISODate("2021-03-18T12:44:26.303Z") 1309 | } ]); 1310 | db.getCollection("user").insert([ { 1311 | _id: ObjectId("60f3f4d3e416405eb8d06a6a"), 1312 | username: "admin", 1313 | phone: "180", 1314 | password: "123456", 1315 | timestamp: 1626600659392, 1316 | updateTime: ISODate("2021-07-18T09:30:59.622Z") 1317 | } ]); 1318 | db.getCollection("user").insert([ { 1319 | _id: ObjectId("61bfe2a94d4a8d2c5fe4b3fa"), 1320 | username: "test", 1321 | phone: "1111", 1322 | password: "123456", 1323 | timestamp: 1639965353436, 1324 | updateTime: ISODate("2021-12-20T01:55:53.818Z") 1325 | } ]); 1326 | db.getCollection("user").insert([ { 1327 | _id: ObjectId("61bfe2d64d4a8d2c5fe4b3fb"), 1328 | username: "1111", 1329 | phone: "1234", 1330 | password: "123456", 1331 | timestamp: 1639965398010, 1332 | updateTime: ISODate("2021-12-20T01:56:38.398Z") 1333 | } ]); 1334 | db.getCollection("user").insert([ { 1335 | _id: ObjectId("61bfeb518d8ad53f8028e10b"), 1336 | username: "111", 1337 | phone: "111", 1338 | password: "11", 1339 | timestamp: 1639967569240, 1340 | updateTime: ISODate("2021-12-20T02:32:49.821Z") 1341 | } ]); 1342 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 richard1015 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # IntelligentTourMap 智能导览图 2 | 3 | 项目地址 https://github.com/richard1015/IntelligentTourMap 4 | 5 | 技术栈 eggjs、MongoDB、swagger、websocket、Amap 6 | 7 | 演示地址: 8 | - 前台 https://school.zhuzhida.vip 9 | - API文档地址 https://school.zhuzhida.vip/swagger-ui.html 10 | 11 | - 后台管理 http://schoolmgr.zhuzhida.vip 12 | - 后台管理源码 > https://github.com/richard1015/IntelligentTourMapManager 13 | 14 | ## 功能说明 15 | 16 | - 1.目标导航 17 | - 2.根据经纬度计算 自动播放 18 | - 3.后台API 提供 19 | - 3.1 文件上传 token验证 20 | - 3.2 登录接口 21 | - 3.3 获取学校相关接口 (增删改查)token验证 22 | - 3.4 获取标点相关接口 (增删改查)token验证 23 | - 3.5 获取用户相关接口 (增删改查)token验证 24 | - 4.后台WebSocket 日志 实时推送 token验证 25 | - 5.swaager文档插件集成 26 | 27 | ## 功能截图 28 | 29 |  30 |  31 |  32 |  33 | ## QuickStart 34 | 35 | 36 | 37 | see [egg docs][egg] for more detail. 38 | 39 | ### Development 40 | 41 | ```bash 42 | $ npm i 43 | $ npm run dev 44 | $ open http://localhost:7002/ 45 | ``` 46 | 47 | ### Deploy 48 | 49 | ```bash 50 | $ npm start 51 | $ npm stop 52 | ``` 53 | 54 | ### npm scripts 55 | 56 | - Use `npm run lint` to check code style. 57 | - Use `npm test` to run unit test. 58 | - Use `npm run autod` to auto detect dependencies upgrade, see [autod](https://www.npmjs.com/package/autod) for more detail. 59 | 60 | 61 | [egg]: https://eggjs.org 62 | 63 | 64 | ### doc tree 65 | 66 | ```bash 67 | ├── README.md 说明文件 68 | ├── app 69 | │ ├── contract swagger文档model类 70 | │ │ └── model.js 71 | │ ├── controller 控制器 72 | │ │ ├── base.js 基类 token检查逻辑 通用返回标识符逻辑 73 | │ │ ├── common.js 通用类 74 | │ │ ├── home.js 默认首页逻辑 75 | │ │ ├── school.js 院校相关逻辑 76 | │ │ ├── spot.js 标点相关逻辑 77 | │ │ └── user.js 用户相关逻辑 78 | │ ├── public 静态资源存放处 79 | │ │ ├── css 80 | │ │ │ └── reset.css 81 | │ │ ├── images 82 | │ │ │ ├── offAuto.png 83 | │ │ │ ├── onAuto.png 84 | │ │ │ ├── play1.gif 85 | │ │ │ ├── play2.png 86 | │ │ │ └── play3.png 87 | │ │ ├── lib 88 | │ │ │ ├── jquery-3.3.1.js 89 | │ │ │ ├── layer_mobile 90 | │ │ │ │ ├── layer.js 91 | │ │ │ │ └── need 92 | │ │ │ │ └── layer.css 93 | │ │ │ └── rem.js 94 | │ │ └── resources 上传文件 存放处 95 | │ ├── router.js 项目路由 96 | │ ├── service 97 | │ │ ├── base.js 基类 MongoDB增删改查封装底层 98 | │ │ ├── school.js 院校数据处理逻辑 99 | │ │ ├── spot.js 标点数据处理逻辑 100 | │ │ └── user.js 后台用户数据处理逻辑 101 | │ └── view 102 | │ └── map.html 后台展示首页 103 | ├── app.js 项目初始逻辑 MongoDB检测机制,websocket日志推送启动 104 | ├── appveyor.yml 105 | ├── config 106 | │ ├── config.default.js 项目配置文件 107 | │ └── plugin.js 插件配置 108 | ├── jsconfig.json 109 | ├── logs 日志文件 110 | │ └── IntelligentTourMap 111 | │ ├── IntelligentTourMap-web.log 112 | │ ├── common-error.log 113 | │ ├── egg-agent.log 114 | │ ├── egg-schedule.log 115 | │ └── egg-web.log 116 | ├── package-lock.json 117 | ├── package.json 118 | ├── run 119 | │ ├── agent_config.json 120 | │ ├── agent_config_meta.json 121 | │ ├── agent_timing_31076.json 122 | │ ├── application_config.json 123 | │ ├── application_config_meta.json 124 | │ ├── application_timing_31085.json 125 | │ └── router.json 126 | ├── test 127 | │ └── app 128 | │ └── controller 129 | │ └── home.test.js 130 | └── typings 131 | ├── app 132 | │ ├── controller 133 | │ │ └── index.d.ts 134 | │ ├── index.d.ts 135 | │ └── service 136 | │ └── index.d.ts 137 | └── config 138 | ├── index.d.ts 139 | └── plugin.d.ts 140 | ``` -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable strict */ 2 | module.exports = app => { 3 | 4 | app.beforeStart(async () => { 5 | // 设置自定义 服务、参数等 ,例如 注入缓存readis 等等 6 | app.logger.info('app beforeStart... begin'); 7 | // check 网络通信 8 | // 保证应用启动监听端口前数据已经准备好了 9 | // 后续数据的更新由定时任务自动触发 10 | app.logger.info('app mongodb... begin'); 11 | // Connection URL 12 | const MongoClient = require('mongodb').MongoClient; 13 | app.getMongodb = () => { 14 | return new Promise((resolve, reject) => { 15 | console.log(app) 16 | MongoClient.connect(app.config.mongodbUrl, function (err, client) { 17 | if (err) throw reject(err); 18 | const db = client.db(app.config.mongodbName); 19 | resolve({ db, client }); 20 | }); 21 | }) 22 | } 23 | // 后续数据的更新由定时任务自动触发 24 | app.logger.info('app cache token reset '); 25 | // 缓存数据 26 | app.cache = { tokens: [] }; 27 | // websocket缓存链接 28 | app.wsClients = new Set(); 29 | }); 30 | 31 | app.once('server', server => { 32 | // websocket 33 | app.logger.info('web socket started'); 34 | 35 | var WebSocketServer = require('ws').Server; 36 | var wss = new WebSocketServer({ port: 3344 }); 37 | wss.on('connection', function connection(ws, req) { 38 | ws.on('message', function incoming(message) { 39 | const ip = req.connection.remoteAddress; 40 | app.logger.info(ip + 'received: %s', message); 41 | if (!app.cache.tokens.includes(message)) { 42 | app.logger.info('失效token' + message + '已强制关闭该链接!') 43 | ws.send('权限不足,请重新登录后台系统!'); 44 | ws.close(); 45 | } else { 46 | app.logger.info(message + '已连接!') 47 | ws.send('已成功连接服务器!'); 48 | app.wsClients.add(ws) 49 | } 50 | }); 51 | ws.on('close', function (code, reason) { 52 | this.close(); 53 | app.wsClients.delete(this) 54 | app.logger.info('socket 断开') 55 | }) 56 | }); 57 | setInterval(() => { 58 | app.logger.info('当前缓存tokens' + app.cache.tokens); 59 | app.logger.info('当前后台实时日志在线人数' + app.wsClients.size); 60 | }, 1000 * 60 * 10); 61 | }); 62 | app.on('error', (err, ctx) => { 63 | // report error 64 | }); 65 | app.on('request', ctx => { 66 | // log receive request 67 | // ctx.logger.info('request starttime...', ctx.starttime); 68 | // ctx.logger.info('request querystring ===', ctx.querystring); 69 | app.wsClients.forEach(ws => { 70 | try { 71 | ws.send(JSON.stringify(ctx)); 72 | } catch (error) { 73 | ws.close(); 74 | app.wsClients.delete(ws) 75 | } 76 | }); 77 | }); 78 | app.on('response', ctx => { 79 | // ctx.starttime is set by framework 80 | const used = Date.now() - ctx.starttime; 81 | // log total cost 82 | // ctx.logger.info('response endtime...', Date.now()); 83 | ctx.logger.info('response time...', used); 84 | }); 85 | }; 86 | -------------------------------------------------------------------------------- /app/contract/model.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | module.exports = { 4 | response: { 5 | success: { type: 'boolean', required: true }, 6 | errorMessage: { type: 'string' } 7 | }, 8 | 9 | userResponse: { 10 | arrays: { type: 'array', itemType: "user" }, 11 | pageIndex: { type: 'integer' }, 12 | pageSize: { type: 'integer' }, 13 | totalCount: { type: 'integer' }, 14 | hasNextPage: { type: 'boolean' }, 15 | }, 16 | schoolResponse: { 17 | arrays: { type: 'array', itemType: "school" }, 18 | pageIndex: { type: 'integer' }, 19 | pageSize: { type: 'integer' }, 20 | totalCount: { type: 'integer' }, 21 | hasNextPage: { type: 'boolean' }, 22 | }, 23 | spotResponse: { 24 | arrays: { type: 'array', itemType: "spot" }, 25 | pageIndex: { type: 'integer' }, 26 | pageSize: { type: 'integer' }, 27 | totalCount: { type: 'integer' }, 28 | hasNextPage: { type: 'boolean' }, 29 | }, 30 | login: { 31 | username: { type: 'string', required: true, description: '用户账号' }, 32 | password: { type: 'string', required: true, description: '密码' } 33 | }, 34 | user: { 35 | _id: { type: 'string', description: 'id 唯一键' }, 36 | username: { type: 'string', required: true, description: '用户账号' }, 37 | password: { type: 'string', required: true, description: '密码' }, 38 | phone: { type: 'string', required: true, description: '电话' }, 39 | }, 40 | school: { 41 | _id: { type: 'string', description: 'id 唯一键' }, 42 | name: { type: 'string', required: true, description: '学校名称' }, 43 | gaoDeLon: { type: 'string', required: true, description: '经度' }, 44 | gaoDeLat: { type: 'string', required: true, description: '纬度' }, 45 | count: { type: 'int', description: '访问量' } 46 | }, 47 | spot: { 48 | _id: { type: 'string', description: 'id 唯一键' }, 49 | pid: { type: 'string', description: 'pid school唯一键' }, 50 | name: { type: 'string', required: true, description: '标点名称' }, 51 | voiceUrl: { type: 'string', required: true, description: '音频url' }, 52 | gaoDeLon: { type: 'string', required: true, description: '经度' }, 53 | gaoDeLat: { type: 'string', required: true, description: '纬度' }, 54 | distance: { type: 'string', required: true, description: '智能播放距离' }, 55 | count: { type: 'int', description: '访问量' } 56 | } 57 | }; 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /app/controller/base.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Controller = require('egg').Controller; 4 | 5 | class BaseController extends Controller { 6 | 7 | /** 8 | * 检查token是否有效 9 | */ 10 | get checked() { 11 | let token = this.ctx.header.token 12 | if (token) { 13 | if (!this.app.cache.tokens.includes(token)) { 14 | this.error('token失效', 201); 15 | return false; 16 | } 17 | } else { 18 | this.error('token失效', 201); 19 | return false; 20 | } 21 | return true; 22 | } 23 | 24 | success(data) { 25 | this.ctx.body = { 26 | success: true, 27 | data, 28 | }; 29 | } 30 | 31 | notFound(msg) { 32 | msg = msg || 'not found'; 33 | this.ctx.throw(404, msg); 34 | } 35 | /** 36 | * 37 | * @param {*} errmsg 错误信息提示 38 | * @param {*} status 200 成功 201失效 39 | */ 40 | error(errmsg, status = 200) { 41 | this.ctx.body = { 42 | status, 43 | success: false, 44 | errorMsg: errmsg, 45 | }; 46 | } 47 | } 48 | 49 | module.exports = BaseController; 50 | -------------------------------------------------------------------------------- /app/controller/common.js: -------------------------------------------------------------------------------- 1 | 2 | 'use strict'; 3 | 4 | const Controller = require('./base'); 5 | /** 6 | * @controller common 公用接口 7 | */ 8 | class CommonController extends Controller { 9 | /** 10 | * @summary 上传文件 11 | * @description 上传文件 12 | * @router post /common/upload 13 | * @request formData file *file 14 | * @request header string *token 15 | * @response 200 response 上传成功 16 | */ 17 | async upload() { 18 | //token验证 19 | if (!this.checked) return; 20 | const { ctx, service } = this; 21 | const stream = await ctx.getFileStream(); 22 | // const id = stream.fields.id; 23 | const origin = ctx.origin; 24 | this.success(await service.base.uploadImg(origin, stream)) 25 | } 26 | /** 27 | * @summary 登录接口 28 | * @description 登录接口 29 | * @router post /common/login 30 | * * @request body login *body 31 | * @response 200 response 登录成功 32 | */ 33 | async login() { 34 | const { ctx, service } = this; 35 | const { username, password } = ctx.request.body; 36 | if (username && password) { 37 | try { 38 | this.success(await service.base.login(ctx.request.body)) 39 | } catch (error) { 40 | this.error(error); 41 | } 42 | 43 | } else { 44 | this.error('请检查参数!') 45 | } 46 | } 47 | } 48 | 49 | module.exports = CommonController; 50 | -------------------------------------------------------------------------------- /app/controller/home.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Controller = require('egg').Controller; 4 | 5 | class HomeController extends Controller { 6 | async index() { 7 | await this.ctx.render('map'); 8 | } 9 | } 10 | 11 | module.exports = HomeController; 12 | -------------------------------------------------------------------------------- /app/controller/school.js: -------------------------------------------------------------------------------- 1 | 2 | 'use strict'; 3 | 4 | const Controller = require('./base'); 5 | /** 6 | * @controller school 学校接口 7 | */ 8 | class SchoolController extends Controller { 9 | /** 10 | * @summary 获取所有学校 11 | * @description 分页获取所有学校 12 | * @router get /school/query 13 | * @request query string keyword 模糊搜索name 14 | * @request query integer pageIndex 页码 默认 1 15 | * @request query integer pageSize 单页数量 默认 10 16 | * @request header string *token 17 | * @response 200 schoolResponse 请求成功 18 | */ 19 | async query() { 20 | //token验证 21 | if (!this.checked) return; 22 | const { ctx, service } = this; 23 | let pageIndex = Number(ctx.query.pageIndex || 1); 24 | let pageSize = Number(ctx.query.pageSize || 10); 25 | let keyword = ctx.query.keyword || ""; 26 | this.success(await service.school.list(pageIndex, pageSize, { name: { $regex: new RegExp(keyword, 'i') } })) 27 | } 28 | /** 29 | * @summary 更新/创建 30 | * @description 创建 更新传 _id 创建不传_id 31 | * @router post /school/update 32 | * @request body school *body 33 | * @request header string *token 34 | * @response 200 response 更新成功 35 | */ 36 | async update() { 37 | //token验证 38 | if (!this.checked) return; 39 | this.success(await this.ctx.service.school.update(this.ctx.request.body)) 40 | } 41 | /** 42 | * @summary 删除 43 | * @description 删除 44 | * @router delete /school/destroy/{id} 45 | * @request path string *id 46 | * @request header string *token 47 | * @response 200 response 删除成功 48 | */ 49 | async destroy() { 50 | //token验证 51 | if (!this.checked) return; 52 | this.success(await this.ctx.service.school.destroy(this.ctx.params.id)) 53 | } 54 | /** 55 | * @summary 学校访问量增加 56 | * @description 57 | * @router get /school/visit/{id} 58 | * @request path string *id 59 | * @request header string *token 60 | * @response 200 response 成功 61 | */ 62 | async visit() { 63 | this.success(await this.ctx.service.school.visit(this.ctx.params.id)) 64 | } 65 | } 66 | 67 | module.exports = SchoolController; 68 | -------------------------------------------------------------------------------- /app/controller/spot.js: -------------------------------------------------------------------------------- 1 | 2 | 'use strict'; 3 | 4 | const Controller = require('./base'); 5 | /** 6 | * @controller spot 获取所有标注点接口 7 | */ 8 | class SpotController extends Controller { 9 | /** 10 | * @summary 根据学校id获取相应标注点 11 | * @description 分页获取标注点 12 | * @router get /spot/query 13 | * @request query string pid 学校id 14 | * @request query string keyword 模糊搜索name 15 | * @request query integer pageIndex 页码 默认 1 16 | * @request query integer pageSize 单页数量 默认 10 17 | * @response 200 spotResponse 请求成功 18 | */ 19 | async query() { 20 | const { ctx, service } = this; 21 | let pageIndex = Number(ctx.query.pageIndex || 1); 22 | let pageSize = Number(ctx.query.pageSize || 10); 23 | let pid = ctx.query.pid; 24 | let keyword = ctx.query.keyword || ""; 25 | if (!pid) { 26 | this.error('请传入pid') 27 | return; 28 | } 29 | this.success(await service.spot.list(pageIndex, pageSize, { pid, name: { $regex: new RegExp(keyword, 'i') } })) 30 | } 31 | /** 32 | * @summary 更新/创建 33 | * @description 创建 更新传 _id 创建不传_id 34 | * @router post /spot/update 35 | * @request body spot *body 36 | * @request header string *token 37 | * @response 200 response 更新成功 38 | */ 39 | async update() { 40 | //token验证 41 | if (!this.checked) return; 42 | this.success(await this.ctx.service.spot.update(this.ctx.request.body)) 43 | } 44 | /** 45 | * @summary 删除 46 | * @description 删除 47 | * @router delete /spot/destroy/{id} 48 | * @request path string *id 49 | * @request header string *token 50 | * @response 200 response 删除成功 51 | */ 52 | async destroy() { 53 | //token验证 54 | if (!this.checked) return; 55 | this.success(await this.ctx.service.spot.destroy(this.ctx.params.id)) 56 | } 57 | /** 58 | * @summary 标点播放点击量增加 59 | * @description 60 | * @router get /spot/visit/{id} 61 | * @request path string *id 62 | * @response 200 response 成功 63 | */ 64 | async visit() { 65 | this.success(await this.ctx.service.spot.visit(this.ctx.params.id)) 66 | } 67 | } 68 | 69 | module.exports = SpotController; 70 | -------------------------------------------------------------------------------- /app/controller/user.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const Controller = require('./base'); 4 | /** 5 | * @controller user 用户接口 6 | */ 7 | class UserController extends Controller { 8 | /** 9 | * @summary 获取用户 10 | * @description 分页获取用户信息 11 | * @router get /user/query 12 | * @request query string keyword 模糊搜索name 13 | * @request query integer pageIndex 页码 默认 1 14 | * @request query integer pageSize 单页数量 默认 10 15 | * @request header string *token 16 | * @response 200 userResponse 请求成功 17 | */ 18 | async query() { 19 | //token验证 20 | if (!this.checked) return; 21 | const { ctx, service } = this; 22 | let pageIndex = Number(ctx.query.pageIndex || 1); 23 | let pageSize = Number(ctx.query.pageSize || 10); 24 | let keyword = ctx.query.keyword || ""; 25 | this.success(await service.user.list(pageIndex, pageSize, { username: { $regex: new RegExp(keyword, 'i') } })) 26 | } 27 | /** 28 | * @summary 更新/创建 29 | * @description 更新传 _id 创建不传 _id 30 | * @router post /user/update 31 | * @request body user *body 32 | * @request header string *token 33 | * @response 200 response 更新成功 34 | */ 35 | async update() { 36 | //token验证 37 | if (!this.checked) return; 38 | this.success(await this.ctx.service.user.update(this.ctx.request.body)) 39 | } 40 | /** 41 | * @summary 删除 42 | * @description 删除 43 | * @router delete /user/destroy/{id} 44 | * @request path string *id 45 | * @request header string *token 46 | * @response 200 response 删除成功 47 | */ 48 | async destroy() { 49 | //token验证 50 | if (!this.checked) return; 51 | this.success(await this.ctx.service.user.destroy(this.ctx.params.id)) 52 | } 53 | } 54 | 55 | module.exports = UserController; 56 | -------------------------------------------------------------------------------- /app/public/css/reset.css: -------------------------------------------------------------------------------- 1 | html, 2 | body, 3 | div, 4 | span, 5 | h1, 6 | h2, 7 | h3, 8 | h4, 9 | h5, 10 | h6, 11 | p, 12 | pre, 13 | a, 14 | address, 15 | big, 16 | cite, 17 | em, 18 | img, 19 | q, 20 | small, 21 | strong, 22 | sub, 23 | sup, 24 | b, 25 | i, 26 | dl, 27 | dt, 28 | dd, 29 | ol, 30 | ul, 31 | li, 32 | form, 33 | label, 34 | table, 35 | tbody, 36 | tfoot, 37 | thead, 38 | tr, 39 | th, 40 | td, 41 | footer, 42 | header, 43 | menu, 44 | nav, 45 | output, 46 | section, 47 | time, 48 | audio, 49 | video, 50 | button, 51 | input { 52 | margin: 0; 53 | padding: 0; 54 | box-sizing: border-box; 55 | border: none; 56 | font: inherit; 57 | vertical-align: baseline; 58 | font-family: PingFang SC,Hiragino Sans GB,NotoSansCJKsc,Helvetica Neue,Roboto,"Microsoft Yahei"; 59 | -webkit-overflow-scrolling: touch; 60 | } 61 | html, 62 | body { 63 | width: 100%; 64 | height: 100%; 65 | font-size: .28rem; 66 | overflow-x: hidden; 67 | overflow-y: auto; 68 | } 69 | img{ 70 | vertical-align: middle; 71 | } 72 | 73 | /* HTML5 display-role reset for older browsers */ 74 | 75 | article, 76 | aside, 77 | details, 78 | figcaption, 79 | figure, 80 | footer, 81 | header, 82 | hgroup, 83 | menu, 84 | nav, 85 | section { 86 | display: block; 87 | } 88 | 89 | ol, 90 | ul,li { 91 | list-style: none; 92 | } 93 | 94 | table { 95 | border-collapse: collapse; 96 | border-spacing: 0; 97 | } 98 | 99 | button { 100 | -webkit-appearance: none; 101 | background: none; 102 | outline: none; 103 | color: inherit; 104 | } 105 | 106 | a { 107 | color: inherit; 108 | text-decoration: none; 109 | } 110 | 111 | input, 112 | textarea { 113 | border: none; 114 | outline: none; 115 | background: none; 116 | resize: none; 117 | } 118 | 119 | .clear { 120 | zoom: 1; 121 | } 122 | 123 | .clear:after { 124 | clear: both; 125 | content: ""; 126 | display: block; 127 | } 128 | 129 | ::-webkit-scrollbar { 130 | display: none; 131 | width: 0; 132 | height: 0; 133 | opacity: 0; 134 | } 135 | 136 | 137 | .ellipsis { 138 | overflow: hidden; 139 | text-overflow: ellipsis; 140 | white-space: nowrap; 141 | } 142 | 143 | 144 | .multi-ellipsis { 145 | overflow: hidden; 146 | text-overflow: ellipsis; 147 | display: -webkit-box; 148 | -webkit-line-clamp: 2; 149 | -webkit-box-orient: vertical; 150 | } 151 | -------------------------------------------------------------------------------- /app/public/images/offAuto.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/richard1015/IntelligentTourMap/20566838c605f5c1346b9eb11c0e10e1f004277a/app/public/images/offAuto.png -------------------------------------------------------------------------------- /app/public/images/onAuto.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/richard1015/IntelligentTourMap/20566838c605f5c1346b9eb11c0e10e1f004277a/app/public/images/onAuto.png -------------------------------------------------------------------------------- /app/public/images/play1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/richard1015/IntelligentTourMap/20566838c605f5c1346b9eb11c0e10e1f004277a/app/public/images/play1.gif -------------------------------------------------------------------------------- /app/public/images/play2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/richard1015/IntelligentTourMap/20566838c605f5c1346b9eb11c0e10e1f004277a/app/public/images/play2.png -------------------------------------------------------------------------------- /app/public/images/play3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/richard1015/IntelligentTourMap/20566838c605f5c1346b9eb11c0e10e1f004277a/app/public/images/play3.png -------------------------------------------------------------------------------- /app/public/lib/layer_mobile/layer.js: -------------------------------------------------------------------------------- 1 | /*! layer mobile-v2.0 弹层组件移动版 License LGPL http://layer.layui.com/mobile By 贤心 */ 2 | ;!function(a){"use strict";var b=document,c="querySelectorAll",d="getElementsByClassName",e=function(a){return b[c](a)},f={type:0,shade:!0,shadeClose:!0,fixed:!0,anim:"scale"},g={extend:function(a){var b=JSON.parse(JSON.stringify(f));for(var c in a)b[c]=a[c];return b},timer:{},end:{}};g.touch=function(a,b){a.addEventListener("click",function(a){b.call(this,a)},!1)};var h=0,i=["layui-m-layer"],j=function(a){var b=this;b.config=g.extend(a),b.view()};j.prototype.view=function(){var a=this,c=a.config,f=b.createElement("div");a.id=f.id=i[0]+h,f.setAttribute("class",i[0]+" "+i[0]+(c.type||0)),f.setAttribute("index",h);var g=function(){var a="object"==typeof c.title;return c.title?'
'+(c.content||"")+"
"),c.skin&&(c.anim="up"),"msg"===c.skin&&(c.shade=!1),f.innerHTML=(c.shade?"':"")+'