Best JavaScript code snippet using karma
index.js
Source:index.js
...10 * @UpdateUserInfos æ´æ°ç¨æ·ä¿¡æ¯æ¥å£11 */12class USER {13 async Login (params = {}) {14 const res = await httpGet('/login', params);15 return res;16 }17 async GetUserInfos (params = {}) {18 const res = await httpGet('/getUserInfos', params);19 return res;20 }21 async UpdateUserInfo (data = {}) {22 const res = await httpPost('/updateUserInfo', data);23 return res;24 }25}26export const User = new USER();27/**28 * 导èªèåæ MENULIST ç¸å
³æ¥å£29 */30class MENULIST {31 async GetMenuList (params = {}) {32 const res = await httpGet('/getMenuList', params);33 return res;34 }35}36export const menuList = new MENULIST();37/**38 * ç¬è®° Dashboard ç¸å
³æ¥å£39 * @GetDashboardList æ¥è¯¢ Dashboard å表40 * @InsertDashboards æ°å¢/æ´æ° Dashboard æ¥å£41 */42class DASHBOARD {43 async InsertDashboard (data = {}) {44 const res = await httpPost('/insertDashboardListItem', data);45 return res;46 }47 async GetDashboardList (params = {}) {48 const res = await httpGet('/getDashboardList', params);49 return res;50 }51 async DeleteDashboardList (params = {}) {52 const res = await httpGet('/deleteDashboardItem', params);53 return res;54 }55}56export const Dashboard = new DASHBOARD();57/**58 * ç¬è®° FS ç¸å
³æ¥å£59 * @GetFsList æ¥è¯¢ Fs å表60 * @InsertFs æ°å¢/æ´æ° Fs æ¥å£61 */62class FS {63 async InsertFs (data = {}) {64 const res = await httpPost('/insertFsListItem', data);65 return res;66 }67 async GetFsList (params = {}) {68 const res = await httpGet('/getFsList', params);69 return res;70 }71 async DeleteFsList (params = {}) {72 const res = await httpGet('/deleteFsItem', params);73 return res;74 }75}76export const Fs = new FS();77/**78 * ç¬è®° Es5 ç¸å
³æ¥å£79 * @GetEs5List æ¥è¯¢ Es5 å表80 * @InsertEs5 æ°å¢/æ´æ° Es5 æ¥å£81 * @DeleteEs5List å é¤ Es5 æ¥å£82 */83class ES5 {84 async InsertEs5 (data = {}) {85 const res = await httpPost('/insertEs5ListItem', data);86 return res;87 }88 async GetEs5List (params = {}) {89 const res = await httpGet('/getEs5List', params);90 return res;91 }92 async DeleteEs5List (params = {}) {93 const res = await httpGet('/deleteEs5Item', params);94 return res;95 }96}97export const Es5 = new ES5();98/**99 * ç¬è®° Es6 ç¸å
³æ¥å£100 * @GetEs6List æ¥è¯¢ Es6 å表101 * @InsertEs6 æ°å¢/æ´æ° Es6 æ¥å£102 * @DeleteEs6List å é¤ Es6 æ¥å£103 */104class ES6 {105 async InsertEs6 (data = {}) {106 const res = await httpPost('/insertEs6ListItem', data);107 return res;108 }109 async GetEs6List (params = {}) {110 const res = await httpGet('/getEs6List', params);111 return res;112 }113 async DeleteEs6List (params = {}) {114 const res = await httpGet('/deleteEs6Item', params);115 return res;116 }117}118export const Es6 = new ES6();119/**120 * ç¬è®° Vue ç¸å
³æ¥å£121 * @GetVueList æ¥è¯¢ Vue å表122 * @InsertVue æ°å¢/æ´æ° Vue æ¥å£123 * @DeleteVueList å é¤ Vue æ¥å£124 */125class MYVUE {126 async InsertVue (data = {}) {127 const res = await httpPost('/insertVueListItem', data);128 return res;129 }130 async GetVueList (params = {}) {131 const res = await httpGet('/getVueList', params);132 return res;133 }134 async DeleteVueList (params = {}) {135 const res = await httpGet('/deleteVueItem', params);136 return res;137 }138}139export const VUE = new MYVUE();140/**141 * ç¬è®° BaiduMap ç¸å
³æ¥å£142 * @GetBaiduMapList æ¥è¯¢ BaiduMap å表143 * @InsertBaiduMap æ°å¢/æ´æ° BaiduMap æ¥å£144 * @DeleteBaiduMapList å é¤ BaiduMap æ¥å£145 */146class BAIDUMAP {147 async InsertBaiduMap (data = {}) {148 const res = await httpPost('/insertBaiduMapListItem', data);149 return res;150 }151 async GetBaiduMapList (params = {}) {152 const res = await httpGet('/getBaiduMapList', params);153 return res;154 }155 async DeleteBaiduMapList (params = {}) {156 const res = await httpGet('/deleteBaiduMapItem', params);157 return res;158 }159}160export const BaiduMap = new BAIDUMAP();161/**162 * ç¬è®° Echarts ç¸å
³æ¥å£163 * @GetEchartsList æ¥è¯¢ Echarts å表164 * @InsertEcharts æ°å¢/æ´æ° Echarts æ¥å£165 * @DeleteEchartsList å é¤ Echarts æ¥å£166 */167class ECHARTS {168 async InsertEcharts (data = {}) {169 const res = await httpPost('/insertEchartsListItem', data);170 return res;171 }172 async GetEchartsList (params = {}) {173 const res = await httpGet('/getEchartsList', params);174 return res;175 }176 async DeleteEchartsList (params = {}) {177 const res = await httpGet('/deleteEchartsItem', params);178 return res;179 }180}181export const Echarts = new ECHARTS();182/**183 * ç¬è®° Express ç¸å
³æ¥å£184 * @GetExpressList æ¥è¯¢ Express å表185 * @InsertExpress æ°å¢/æ´æ° Express æ¥å£186 * @DeleteExpressList å é¤ Express æ¥å£187 */188class EXPRESS {189 async InsertExpress (data = {}) {190 const res = await httpPost('/insertExpressListItem', data);191 return res;192 }193 async GetExpressList (params = {}) {194 const res = await httpGet('/getExpressList', params);195 return res;196 }197 async DeleteExpressList (params = {}) {198 const res = await httpGet('/deleteExpressItem', params);199 return res;200 }201}202export const Express = new EXPRESS();203/**204 * ç¬è®° Webpack ç¸å
³æ¥å£205 * @GetWebpackList æ¥è¯¢ Webpack å表206 * @InsertWebpack æ°å¢/æ´æ° Webpack æ¥å£207 * @DeleteWebpackList å é¤ Webpack æ¥å£208 */209class WEBPACK {210 async InsertWebpack (data = {}) {211 const res = await httpPost('/insertWebpackListItem', data);212 return res;213 }214 async GetWebpackList (params = {}) {215 const res = await httpGet('/getWebpackList', params);216 return res;217 }218 async DeleteEWebpackList (params = {}) {219 const res = await httpGet('/deleteWebpackItem', params);220 return res;221 }222}223export const Webpack = new WEBPACK();224/**225 * ç¬è®° ElementUI ç¸å
³æ¥å£226 * @GetElementUIList æ¥è¯¢ ElementUI å表227 * @InsertElementUI æ°å¢/æ´æ° ElementUI æ¥å£228 * @DeleteElementUIList å é¤ ElementUI æ¥å£229 */230class ELEMENTUI {231 async InsertElementUI (data = {}) {232 const res = await httpPost('/insertElementUIListItem', data);233 return res;234 }235 async GetElementUIList (params = {}) {236 const res = await httpGet('/getElementUIList', params);237 return res;238 }239 async DeleteElementUIList (params = {}) {240 const res = await httpGet('/deleteElementUIItem', params);241 return res;242 }243}244export const MyElementUI = new ELEMENTUI();245/**246 * ç¬è®° Eslint ç¸å
³æ¥å£247 * @GetEslintList æ¥è¯¢ Eslint å表248 * @InsertEslint æ°å¢/æ´æ° Eslint æ¥å£249 * @DeleteEslintList å é¤ Eslint æ¥å£250 */251class ESLINT {252 async InsertEslint (data = {}) {253 const res = await httpPost('/insertEslintListItem', data);254 return res;255 }256 async GetEslintList (params = {}) {257 const res = await httpGet('/getEslintList', params);258 return res;259 }260 async DeleteEslintList (params = {}) {261 const res = await httpGet('/deleteEslintItem', params);262 return res;263 }264}265export const Eslint = new ESLINT();266/**267 * ç¬è®° VueCli ç¸å
³æ¥å£268 * @GetVueCliList æ¥è¯¢ VueCli å表269 * @InsertVueCli æ°å¢/æ´æ° VueCli æ¥å£270 * @DeleteVueCliList å é¤ VueCli æ¥å£271 */272class VUECLI {273 async InsertVueCli (data = {}) {274 const res = await httpPost('/insertVueCliListItem', data);275 return res;276 }277 async GetVueCliList (params = {}) {278 const res = await httpGet('/getVueCliList', params);279 return res;280 }281 async DeleteVueCliList (params = {}) {282 const res = await httpGet('/deleteVueCliItem', params);283 return res;284 }285}286export const VueCli = new VUECLI();287/**288 * ç¬è®° Tslint ç¸å
³æ¥å£289 * @GetTslintList æ¥è¯¢ Tslint å表290 * @InsertTslint æ°å¢/æ´æ° Tslint æ¥å£291 * @DeleteTslintList å é¤ Tslint æ¥å£292 */293class TSLINT {294 async InsertTslint (data = {}) {295 const res = await httpPost('/insertTslintListItem', data);296 return res;297 }298 async GetTslintList (params = {}) {299 const res = await httpGet('/getTslintList', params);300 return res;301 }302 async DeleteTslintList (params = {}) {303 const res = await httpGet('/deleteTslintItem', params);304 return res;305 }306}307export const Tslint = new TSLINT();308/**309 * ç¬è®° Mongodb ç¸å
³æ¥å£310 * @GetMongodbList æ¥è¯¢ Mongodb å表311 * @InsertMongodb æ°å¢/æ´æ° Mongodb æ¥å£312 * @DeleteMongodbList å é¤ Mongodb æ¥å£313 */314class MONGODB {315 async InsertMongodb (data = {}) {316 const res = await httpPost('/insertMongodbListItem', data);317 return res;318 }319 async GetMongodbList (params = {}) {320 const res = await httpGet('/getMongodbList', params);321 return res;322 }323 async DeleteMongodbList (params = {}) {324 const res = await httpGet('/deleteMongodbItem', params);325 return res;326 }327}328export const Mongodb = new MONGODB();329/**330 * ç¬è®° Css ç¸å
³æ¥å£331 * @GetCssList æ¥è¯¢ Css å表332 * @InsertCss æ°å¢/æ´æ° Css æ¥å£333 */334class MYCSS {335 async InsertCss (data = {}) {336 const res = await httpPost('/insertCssListItem', data);337 return res;338 }339 async GetCssList (params = {}) {340 const res = await httpGet('/getCssList', params);341 return res;342 }343 async DeleteCssList (params = {}) {344 const res = await httpGet('/deleteCssItem', params);345 return res;346 }347}348export const Css = new MYCSS();349/**350 * ç¬è®° Less ç¸å
³æ¥å£351 * @GetLessList æ¥è¯¢ Less å表352 * @InsertLess æ°å¢/æ´æ° Less æ¥å£353 */354class MYLESS {355 async InsertLess (data = {}) {356 const res = await httpPost('/insertLessListItem', data);357 return res;358 }359 async GetLessList (params = {}) {360 const res = await httpGet('/getLessList', params);361 return res;362 }363 async DeleteLessList (params = {}) {364 const res = await httpGet('/deleteLessItem', params);365 return res;366 }367}368export const Less = new MYLESS();369/**370 * ç¬è®° Sass ç¸å
³æ¥å£371 * @GetSassList æ¥è¯¢ Sass å表372 * @InsertSass æ°å¢/æ´æ° Sass æ¥å£373 */374class MYSASS {375 async InsertSass (data = {}) {376 const res = await httpPost('/insertSassListItem', data);377 return res;378 }379 async GetSassList (params = {}) {380 const res = await httpGet('/getSassList', params);381 return res;382 }383 async DeleteSassList (params = {}) {384 const res = await httpGet('/deleteSassItem', params);385 return res;386 }387}388export const Sass = new MYSASS();389/**390 * ç¬è®° Dom ç¸å
³æ¥å£391 * @GetDomList æ¥è¯¢ Dom å表392 * @InsertDom æ°å¢/æ´æ° Dom æ¥å£393 */394class MYDOM {395 async InsertDom (data = {}) {396 const res = await httpPost('/insertDomListItem', data);397 return res;398 }399 async GetDomList (params = {}) {400 const res = await httpGet('/getDomList', params);401 return res;402 }403 async DeleteDomList (params = {}) {404 const res = await httpGet('/deleteDomItem', params);405 return res;406 }407}408export const Dom = new MYDOM();409/**410 * ç¬è®° Ubuntu ç¸å
³æ¥å£411 * @GetUbuntuList æ¥è¯¢ Ubuntu å表412 * @InsertUbuntu æ°å¢/æ´æ° Ubuntu æ¥å£413 */414class UBUNTU {415 async InsertUbuntu (data = {}) {416 const res = await httpPost('/insertUbuntuListItem', data);417 return res;418 }419 async GetUbuntuList (params = {}) {420 const res = await httpGet('/getUbuntuList', params);421 return res;422 }423 async DeleteUbuntuList (params = {}) {424 const res = await httpGet('/deleteUbuntuItem', params);425 return res;426 }427}428export const Ubuntu = new UBUNTU();429/**430 * ç¬è®° Terminal ç¸å
³æ¥å£431 * @GetTerminalList æ¥è¯¢ Terminal å表432 * @InsertTerminal æ°å¢/æ´æ° Terminal æ¥å£433 */434class TERMINAL {435 async InsertTerminal (data = {}) {436 const res = await httpPost('/insertTerminalListItem', data);437 return res;438 }439 async GetTerminalList (params = {}) {440 const res = await httpGet('/getTerminalList', params);441 return res;442 }443 async DeleteTerminalList (params = {}) {444 const res = await httpGet('/deleteTerminalItem', params);445 return res;446 }447}448export const Terminal = new TERMINAL();449/**450 * ç¬è®° Algorithm ç¸å
³æ¥å£451 * @GetAlgorithmList æ¥è¯¢ Algorithm å表452 * @InsertAlgorithm æ°å¢/æ´æ° Algorithm æ¥å£453 */454class ALGORITHM {455 async InsertAlgorithm (data = {}) {456 const res = await httpPost('/insertAlgorithmListItem', data);457 return res;458 }459 async GetAlgorithmList (params = {}) {460 const res = await httpGet('/getAlgorithmList', params);461 return res;462 }463 async DeleteAlgorithmList (params = {}) {464 const res = await httpGet('/deleteAlgorithmItem', params);465 return res;466 }467}...
carSellHelpInter.js
Source:carSellHelpInter.js
1import { HTTPGet, HTTPPost, HTTPPut } from '../utils/http'2export const carSellHelpInter = {3 // ===================================================== åç车å ==============================================================4 // åç车åï¼å å
¥å¯¹æ¯5 VehicleAttributeVS: (arr) => { // modelIds 车åIDï¼æ°ç»æ ¼å¼[105,120,108]6 return HTTPGet(`/website/Vehicle/attribute?modelIds=${arr}`);7 },8 // åç车åï¼è½¦å详æ
(å·®ä¸ä¸ªè½¦logo)9 getCarDetailInfo: (aliasName) => {10 return HTTPGet(`/website/api/getCarDetailInfo/${aliasName}`);11 },12 // åç车åï¼è½¦å详æ
ï¼æ´å¤è½¦å13 getMoreCars: (aliasName) => {14 return HTTPGet(`/website/Car/getMoreCars/alias/${aliasName}`);15 },16 // åç车åï¼è½¦åå±ç¤ºå表17 brandModelsList: () => {18 return HTTPGet(`/website/Car/brandModels`);19 },20 // åç车åï¼è·å车åçä»·æ ¼åçæ¬21 getVersion: (cid) => {22 return HTTPGet(`/website/Car/getVersion/cid/${cid}`);23 },24 // ===================================================== 纯æ£ç¨å ==============================================================25 // 纯æ£ç¨åï¼ç¨ååç±»26 gitViewLoadingEffect: (id) => {27 return HTTPGet(`/website/PureProducts/viewLoadingEffect/id/${id}`);28 },29 getClassifyPureProducts: () => {30 return HTTPGet(`/website/PureProducts/getClassify`);31 },32 // 纯æ£ç¨åï¼ç¨åå表 (è°æ´ä¸)33 getListPureProducts: (data) => {34 return HTTPPost(`/website/PureProducts/getList`, data);35 },36 // 纯æ£ç¨åï¼ç¨å详æ
37 getDetailPureProducts: (id) => {38 return HTTPGet(`/website/PureProducts/getDetail/id/${id}`);39 },40 // 纯æ£ç¨åï¼æè¦å¨è¯¢-æ交41 consult: (data) => {42 return HTTPPost(`/website/PureProducts/consult`, data);43 },44 // 纯æ£ç¨åï¼æè¦å¨è¯¢ï¼å¸¦å
¥ä¿¡æ¯45 getUserInfoPureProducts: (data) => {46 return HTTPPost(`/website/PureProducts/getUserInfo/id/accessToken`, data);47 },48 // ===================================================== ä¸è½½ä¸å¿ ==============================================================49 // ä¿åä¸è½½è®°å½ (æåä¹åçæç¤ºè¯ æ¯ æ¥è¯¢æå æ¯å¦éè¦æ¹æ£ï¼)50 insertDownLoadRecord: (data) => {51 return HTTPPost(`/website/api/insertDownLoadRecord`, data);52 },53 // ä¸è½½ä¸å¿ï¼è·åå£çº¸54 getWallpaper: (cid) => {55 return HTTPGet(`/website/api/getWallpaper/${cid}`);56 },57 // ===================================================== éèæå¡ ==============================================================58 // éèæå¡ èèµç§èµï¼ä¿éæ´»å¨å表 0éèä¿éæ´»å¨ï¼1èèµç§èµä¿éæ´»å¨59 getFinanceActiveList: (type) => {60 return HTTPGet(`/website/api/getFinanceActiveList/${type}`);61 },62 // éèæå¡ï¼è½¦åå表63 financeVehicleList: () => {64 return HTTPGet(`/website/api/financeVehicleList`);65 },66 // éèæå¡ï¼è½¦åé
ç½®åä»·æ ¼67 VehicleVersionList: (cid) => {68 return HTTPGet(`/website/api/vehicleVersionList/${cid}`);69 },70 // éèæå¡ï¼è·åéèæºæ71 financeOrganList: (cid) => {72 return HTTPGet(`/website/api/financeOrganList/${cid}`);73 },74 // éèæå¡ï¼è·å产åç±»å75 financeProductTypeList: (versionid, organId) => {76 return HTTPGet(`/website/api/financeProductTypeList/${versionid}/${organId}`);77 },78 // éèæå¡ï¼è·å产åå表79 financeProductList: (typeId, organId, versionId) => {80 return HTTPGet(`/website/api/financeProductList/${typeId}/${organId}/${versionId}`);81 },82 // éèæå¡ï¼äº§å详æ
83 financeProductDetail: (productId, versionId) => {84 return HTTPGet(`/website/api/financeProductDetail/${productId}/${versionId}`);85 },86 // éèæå¡ï¼çææ¹æ¡87 financeProgram: (data) => {88 return HTTPPost(`/website/api/financeProgram`, data);89 },90 // ===================================================== æ°è½¦ä¿é© ==============================================================91 // æ°è½¦ä¿é©ã延ä¿ä¿éæ´»å¨å表 ä¿éæ´»å¨åç±»type 0æ°è½¦ä¿é©ï¼1延ä¿æå¡92 getInsuranceActiveList: (type) => {93 return HTTPGet(`/website/api/getInsuranceActiveList/${type}`);94 },95 // ===================================================== èèµç§èµ ==============================================================96 // èèµç§èµï¼æç§è´·è®¡ç®å¨--丰ç°ç§èµ97 toyotaLease: (data) => {98 return HTTPPost(`/website/api/toyotaLease`, data);99 },100 // èèµç§èµï¼æç§è´·è®¡ç®å¨--ä¸æ±½ç§èµ101 fawLease: (data) => {102 return HTTPPost(`/website/api/fawLease`, data);103 },104 // èèµç§èµï¼æç§è´·è®¡ç®å¨--æé«ç§èµ105 yiXinLease: (data) => {106 return HTTPPost(`/website/api/yiXinLease`, data);107 },108 // èèµç§èµï¼æç§è´·è®¡ç®å¨--è·åç§èµé
ç½®ä¿¡æ¯ codeå¼ä¸ºï¼ä¸°ç°ç§èµï¼toyota_lease ä¸æ±½ç§èµï¼faw_lease109 getLeaseConfig: (code) => {110 return HTTPGet(`/website/api/getLeaseConfig/${code}`);111 },112 //é¶ä»¶æº¯æº113 searchdetail: (data) => {114 return HTTPPost(`/website/Pures/searchDetail`, data);115 }...
api.js
Source:api.js
...71 return res72 })73}74const categories_get = () => {75 return httpGet('/master/categories')76}77const category_update = (data) => {78 return httpPut('/master/category', data)79}80const category_create = (data) => {81 return httpPost('/master/category', data)82}83const category_get = (id) => {84 return httpGet('/master/category?id=' + id)85}86const category_delete = (id) => {87 return httpDelete('/master/category?id=' + id)88}89const plugin_update = (data) => {90 return httpPut('/master/plugin', data)91}92const plugin_get = (id) => {93 return httpGet('/master/plugin?id=' + id)94}95const plugin_create = (data) => {96 return httpPost('/master/plugin', data)97}98const plugin_delete = (id) => {99 return httpDelete('/master/plugin?id=' + id)100}101const cloud_plugins_get = () => {102 return httpGet('/master/cloud/plugins')103}104const cloud_plugin_get = (id) => {105 return httpGet('/master/cloud/plugin?id=' + id)106}107const cloud_plugin_install = (id) => {108 return httpGet('/master/cloud/plugin_install?id=' + id)109}110const cloud_categories_get = () => {111 return httpGet('/master/cloud/categories')112}113const cloud_releases_get = () => {114 return httpGet('/master/cloud/releases')115}116const user_update = (data) => {117 return httpPut('/master/user', data)118}119const user_get = (id) => {120 return httpGet('/master/user?id=' + id)121}122const user_delete = (id) => {123 return httpDelete('/master/user?id=' + id)124}125const system_update = (data) => {126 return httpPost('/master/system', data)127}128const system_get = () => {129 return httpGet('/master/system')130}131const templates_get = () => {132 return httpGet('/master/system/templates')133}134const plugin_templates_get = () => {135 return httpGet('/master/system/plugin_templates')136}137const ota_check = () => {138 return httpGet('/master/ota/check')139}140const ota_update = () => {141 return httpGet('/master/ota/update')142}143const ota_update_database = () => {144 return httpGet('/master/ota/database')145}146const ota_update_script = () => {147 return httpGet('/master/ota/script')148}149const plugin_total_request_count = () => {150 return httpGet('/master/analysis/plugin_total_request_count')151}152const plugin_max_request_count = () => {153 return httpGet('/master/analysis/plugin_max_request_count')154}155const plugin_request_count = () => {156 return httpGet('/master/analysis/plugin_request_count')157}158const user_active_count = () => {159 return httpGet('/master/analysis/user_active_count')160}161const user_increase_count = () => {162 return httpGet('/master/analysis/user_increase_count')163}164const system_info_get = () => {165 return httpGet('/master/system/info')...
carOwner.js
Source:carOwner.js
1import { HTTPGet, HTTPPost } from '../utils/http'2export const carOwner = {3 // ===================================================== 车主ä¸äº« ==============================================================4 // æå¡ä»ç»ï¼æå¡äº§åï¼å»¶ä¿è®¡ç®å¨5 extenInSur: (params) => {6 return HTTPPost(`/website/api/extentionCalculator`,params);7 },8 //æå¡å¤§å
ï¼è·åä¿å
»è®¡å车åå表9 getMaintainCarType: () => {10 return HTTPGet(`/website/api/getMaintainCarType`);11 },12 // æå¡å¤§å
ï¼ä¿å
»è®¡åæ¥è¯¢13 maintain: (params) => {14 return HTTPPost(`/website/api/maintainPlan`,params);15 },16 // æå¡å¤§å
ï¼è¿ç« æ¥è¯¢å¸¦å
¥ç¨æ·è½¦æ¶å·17 getCarCode: () => {18 return HTTPGet(`/website/api/getCarCode`);19 },20 // æå¡å¤§å
ï¼è¿ç« æ¥è¯¢21 TrafficViolationsList: (params) => {22 return HTTPPost(`/website/api/TrafficViolationsList`,params);23 },24 // æå¡æ´»å¨ï¼æç« å表25 carList: (page,row) => {26 return HTTPGet(`/website/News/carList?page=${page}&row=${row}`);27 },28 // æå¡æ´»å¨ï¼æç« è¯¦æ
29 carDetail: (id) => {30 return HTTPGet(`/website/News/carDetail?id=${id}`);31 },32 // 纯çé¶ä»¶ï¼é¶ä»¶å表33 getList: (id) => {34 return HTTPGet(`/website/Component/getList/id/${id}`);35 },36 // 纯çé¶ä»¶ï¼é¶ä»¶è¯¦æ
37 getDetail: (id) => {38 return HTTPGet(`/website/Component/getDetail/id/${id}`);39 },40 // 纯çé¶ä»¶ï¼ä¸çº§åç±»41 getFirstClassify: () => {42 return HTTPGet(`/website/Component/getFirstClassify`);43 },44 // 纯çé¶ä»¶ï¼äºçº§åç±»45 getSecondClassify: (data) => {46 return HTTPPost(`/website/Component/getSecondClassify`,data);47 },48 // 丰享æ±ï¼ææ°æ´»å¨å表49 CurActivityList: () => {50 return HTTPGet(`/website/api/CurActivityList`);51 },52 // 丰享æ±ï¼å¾ææ´»å¨å表53 PastActivityList: (data) => {54 return HTTPPost(`/website/api/PastActivityList`,data);55 },56 // 丰享æ±ï¼æ´»å¨è¯¦æ
57 ActivityDetail: (id) => {58 return HTTPGet(`/website/api/ActivityDetail/${id}`);59 },60 // æå¡æ´»å¨ï¼æå¿å表61 getMagazineList: (data) => {62 return HTTPPost(`/website/api/getMagazineList`,data);63 },64 // æå¡æ´»å¨ï¼æå¿è¯¦æ
65 getMagazineDetail: (magazineId) => {66 return HTTPGet(`/website/api/getMagazineDetail/${magazineId}`);67 },68 // æå¡å¤§å
ï¼é¢çº¦ä¿å
»ãé¢çº¦ç»´ä¿®è·åç¨æ·ç»å½ä¿¡æ¯ä¸ç±è½¦ä¿¡æ¯69 getUserInfo: (accessToken) => {70 return HTTPPost(`/website/Maintenance/getUserInfo`,accessToken);71 },72 // æå¡å¤§å
ï¼é¢çº¦ä¿å
»ï¼åçä¿¡73 // æå¡å¤§å
ï¼é¢çº¦ä¿å
»ï¼ç«å³é¢çº¦74 addMaintenance: (data) => {75 return HTTPPost(`/website/Maintenance/addMaintenance`,data);76 },77 // æå¡å¤§å
ï¼é¢çº¦ç»´ä¿®ï¼ç«å³é¢çº¦78 repair: (data) => {79 return HTTPPost(`/website/Maintenance/repair`,data);80 },81 // æå¡å¤§å
ï¼è¿ç« æ¥è¯¢ï¼ç份ç®ç§°å表ï¼è½¦çå·ç ï¼82 getProvinceBrief: (data) => {83 return HTTPGet('/website/api/getProvinceBrief');84 },85 // 丰享æ±ï¼è½¦ä¸»å
¥ä¼å表86 getOwnerStory: (data) => {87 return HTTPGet('/website/News/getOwnerStory?type=story&page=1&row=10');88 },89 // 丰享æ±ï¼è½¦ä¸»å
¥ä¼è¯¦æ
90 getOwnerStoryDetail: (id) => {91 return HTTPGet(`/website/News/getOwnerStoryDetail/id/${id}`)92 }93 94 ...
stockService.js
Source:stockService.js
...8 }9 return httpPost(`stock/search/${symbol}`);10}11export async function getStock(symbol) {12 return httpGet(`stock/s/${symbol}`);13}14export async function getStockForGuest(symbol) {15 return httpGet(`stock/s/${symbol}/guest_info`);16}17export async function getStockNextReportDate(symbol) {18 return httpGet(`stock/s/${symbol}/next_report_date`);19}20export async function getStockEvcInfo(symbol) {21 return httpGet(`stock/s/${symbol}/evc_info`);22}23export async function getStockDataInfo(symbol) {24 return httpGet(`stock/s/${symbol}/data_info`);25}26export async function incrementStock(symbol) {27 return httpGet(`stock/s/${symbol}/inc`);28}29export async function listHotStock(size = 10) {30 return httpGet(`stock/hot`, { size });31}32export async function listStock() {33 return httpGet(`stock/list`);34}35export async function deleteStock(symbol) {36 return httpDelete(`stock/s/${symbol}`);37}38export async function createStock(stock) {39 return httpPut(`stock`, stock);40}41export async function updateStock(stock) {42 return httpPost(`stock/s/${stock.symbol}`, stock);43}44export async function listStockSupport(symbol) {45 return httpGet(`stock/s/${symbol}/support`);46}47export async function saveStockSupport(symbol, lo, hi) {48 return httpPost(`stock/s/${symbol}/support`, { lo, hi });49}50export async function existsStock(symbol) {51 return httpGet(`stock/s/${symbol}/exists`);52}53export async function deleteStockSupport(id) {54 return httpDelete(`stock/support/${id}`);55}56export async function listStockResistance(symbol) {57 return httpGet(`stock/s/${symbol}/resistance`);58}59export async function saveStockResistance(symbol, lo, hi) {60 return httpPost(`stock/s/${symbol}/resistance`, { lo, hi });61}62export async function deleteStockResistance(id) {63 return httpDelete(`stock/resistance/${id}`);64}65export async function listStockEps(symbol) {66 return httpGet(`stock/s/${symbol}/eps`);67}68export async function saveStockEps(symbol, values) {69 return httpPost(`stock/s/${symbol}/eps`, values);70}71export async function syncStockEps(symbol) {72 return httpPost(`stock/s/${symbol}/eps/sync`);73}74export async function factorStockValue(symbol, date, factor) {75 return httpPost(`stock/s/${symbol}/factor`, { date, factor });76}77export async function deleteStockEps(symbol, reportDate) {78 return httpDelete(`stock/eps/${symbol}/${reportDate}`);79}80export async function listStockFairValue(symbol) {81 return httpGet(`stock/s/${symbol}/fairvalue`);82}83export async function saveStockFairValue(symbol, payload) {84 return httpPost(`stock/s/${symbol}/fairvalue`, payload);85}86export async function deleteStockFairValue(id) {87 return httpDelete(`stock/fairvalue/${id}`);88}89export async function getMarketMostActive() {90 return httpGet(`/stock/data/mostactive`);91}92export async function getMarketGainers() {93 return httpGet(`/stock/data/gainers`);94}95export async function getMarketLosers() {96 return httpGet(`/stock/data/losers`);97}98export async function getEarningsCalender(week = 0) {99 return httpGet(`/stock/data/earnings_calendar`, { week });100}101export async function getStockInsiderTransaction(symbol) {102 return httpGet(`/stock/s/${symbol}/insider`);103}104export async function getStockRoster(symbol) {105 return httpGet(`/stock/s/${symbol}/roster`);106}107export async function getStockNews(symbol) {108 return httpGet(`/stock/s/${symbol}/news`);109}110export async function getStockQuote(symbol) {111 return httpGet(`/stock/s/${symbol}/quote`);112}113export async function getStockPutCallRatioChart(symbol) {114 return httpGet(`/stock/s/${symbol}/chart/putcallratio`);115}116export async function submitStockPlea(symbol) {117 return httpPost(`stock/plea/${symbol}`);118}119export async function deleteStockPlea(symbol) {120 return httpDelete(`stock/plea/${symbol}`);...
app.js
Source:app.js
...5var toggleForW = 0;6let wbutton = document.getElementById("W");7wbutton.addEventListener("touchstart", function(){8 console.log('forward')9 httpGet(endpoint + '/forward')10})11wbutton.addEventListener("touchend", function(){12 httpGet(endpoint + '/stop')13 console.log('stop')14})15let abutton = document.getElementById("A");16abutton.addEventListener("touchstart", function(){17 console.log('left')18 httpGet(endpoint + '/goLeft')19})20abutton.addEventListener("touchend", function(){21 httpGet(endpoint + '/straight')22 console.log('straight')23})24let sbutton = document.getElementById("S");25sbutton.addEventListener("touchstart", function(){26 console.log('back')27 httpGet(endpoint + '/back')28})29sbutton.addEventListener("touchend", function(){30 httpGet(endpoint + '/stop')31 console.log('stop')32})33let dbutton = document.getElementById("D");34dbutton.addEventListener("touchstart", function(){35 console.log('right')36 httpGet(endpoint + '/goRight')37})38dbutton.addEventListener("touchend", function(){39 httpGet(endpoint + '/straight')40 console.log('straight')41})42let dancebutton = document.getElementById("dance");43dancebutton.addEventListener("touchstart", function(){44 console.log('dance')45 httpGet(endpoint + '/dance')46})47let passengerbutton = document.getElementById("passenger");48passengerbutton.addEventListener("touchstart", function(){49 console.log('passenger')50 passengerbutton.classList.toggle('active')51 httpGet(endpoint + '/openPassengerDoor')52})53let driverbutton = document.getElementById("driver");54driverbutton.addEventListener("touchstart", function(){55 console.log('driver')56 driverbutton.classList.toggle('active')57 httpGet(endpoint + '/openDriverDoor')58})59function keyDown(e){60 console.log(e);61 if (e.key.toUpperCase() == "W"){62 document.getElementById("W").classList.toggle('active')63 httpGet(endpoint + '/forward')64 }65 if (e.key.toUpperCase() == "A"){66 document.getElementById("A").classList.toggle('active')67 httpGet(endpoint + '/goLeft')68 }69 if (e.key.toUpperCase() == "S"){70 document.getElementById("S").classList.toggle('active')71 httpGet(endpoint + '/back')72 }73 if (e.key.toUpperCase() == "D"){74 document.getElementById("D").classList.toggle('active')75 httpGet(endpoint + '/goRight')76 }77}78function keyUp(e){79 if (e.key.toUpperCase() == "W"){80 document.getElementById("W").classList.toggle('active')81 httpGet(endpoint + '/stop')82 }83 if (e.key.toUpperCase() == "A"){84 document.getElementById("A").classList.toggle('active')85 httpGet(endpoint + '/straight')86 }87 if (e.key.toUpperCase() == "S"){88 document.getElementById("S").classList.toggle('active')89 httpGet(endpoint + '/straight')90 }91 if (e.key.toUpperCase() == "D"){92 document.getElementById("D").classList.toggle('active')93 httpGet(endpoint + '/stop')94 }95 if (e.key.toUpperCase() == "F"){96 document.getElementById("dance").classList.toggle('active')97 httpGet(endpoint + '/dance')98 }99 if (e.key.toUpperCase() == "G"){100 document.getElementById("passenger").classList.toggle('active')101 httpGet(endpoint + '/openPassengerDoor')102 }103 if (e.key.toUpperCase() == "H"){104 document.getElementById("driver").classList.toggle('active')105 httpGet(endpoint + '/openDriverDoor')106 }107}108function httpGet(theUrl)109{110 var xmlHttp = new XMLHttpRequest();111 xmlHttp.open( "GET", theUrl, true ); // false for synchronous request112 xmlHttp.setRequestHeader('Access-Control-Allow-Origin', 'https://web-car-controller.firebaseapp.com');113 xmlHttp.send( null );114 return xmlHttp.responseText;115}...
api-service.js
Source:api-service.js
1import {httpGet} from "../api-client";2export async function getPublicActions(more, limit) {3 const response = await httpGet("/public-actions/", {4 more: more || 0,5 limit: limit || 106 });7 return response.data ? response.data : {};8}9export async function getPublicAction(id) {10 const response = await httpGet(`/public-actions/${id}`);11 return response.data ? response.data : {};12}13export async function getActions() {14 const response = await httpGet("/actions");15 return response.data ? response.data : [];16}17export async function getAction(actionId) {18 const response = await httpGet(`/actions/${actionId}`);19 return response.data;20}21export async function getPrinciples() {22 const principlesResponse = await httpGet("/principles/");23 return principlesResponse.data;24}25export async function getPrinciple(principleId) {26 const response = await httpGet(`/principles/${principleId}`);27 return response.data;28}29export async function getSustainableDevelopmentGoals() {30 const principlesResponse = await httpGet("/sustainable-development-goals/");31 return principlesResponse.data;32}33export async function getSustainableDevelopmentGoal(goalId) {34 const response = await httpGet(`/sustainable-development-goals/${goalId}`);35 return response.data;36}37export async function getSDGObjective(sdgObjectiveId) {38 const response = await httpGet(`/sdg-objectives/${sdgObjectiveId}`);39 return response.data;40}41export async function getSDGMonitoringData(params) {42 const response = await httpGet(`/sdg-monitoring/`, params);43 return response.data;44}45export async function getPartners() {46 const partnersResponse = await httpGet("/partners");47 return partnersResponse.data;48}49export async function getPartner(partnerId) {50 const partnerResponse = await httpGet(`/partners/${partnerId}`);51 return partnerResponse.data;52}53export async function getDashboard(params) {54 const response = await httpGet("/dashboard", params);55 return response.data ? response.data : [];56}57export async function getBalance(params) {58 return httpGet("/balance", params);59}60export async function getMyStats(params) {61 const response = await httpGet("/my-stats", params);62 return response.data ? response.data : [];63}64export async function getPeriods(params) {65 const response = await httpGet("/periods", params);66 return response.data ? response.data : [];...
juggling-async.js
Source:juggling-async.js
1'use strict';2const https = require('https');3function httpGet(url) {4 return new Promise( function (resolve, reject) {5 https.get(url, function (res) {6 let buffer = '';7 res.on("data", data => buffer += data);8 res.on("end", () => resolve(buffer));9 res.on("error", err => reject(err));10 })11 })12}13/*14httpGet(process.argv[2]).then( function (buffer) {15 console.log(buffer);16 httpGet(process.argv[3]).then( function(buffer) {17 console.log(buffer);18 httpGet(process.argv[4]).then(function (buffer) {19 console.log(buffer);20 })21 })22});23 */24const show = async () => {25 console.log(await httpGet(process.argv[2]));26 console.log(await httpGet(process.argv[3]));27 console.log(await httpGet(process.argv[4]));28};29//show();30httpGet('https://straffesites.be')31 .then(buffer => {32 console.log(buffer);33 return httpGet('https://google.be');34 })35 .then(buffer => {36 console.log(buffer);37 return httpGet('https://vercel.com');38 })39 .then(buffer => console.log(buffer))40 .catch(error => console.error(error));41/*42Promise.all([httpGet(process.argv[2]), httpGet(process.argv[3]), httpGet(process.argv[4])])43 .then(console.log)44 .catch(console.error);...
Using AI Code Generation
1var httpGet = require('karma').httpGet;2var httpPost = require('karma').httpPost;3var httpPut = require('karma').httpPut;4var httpDelete = require('karma').httpDelete;5var httpPatch = require('karma').httpPatch;6var httpHead = require('karma').httpHead;7var httpOptions = require('karma').httpOptions;8 console.log('Status Code: ' + response.statusCode);9 console.log('Body: ' + body);10});11 console.log('Status Code: ' + response.statusCode);12 console.log('Body: ' + body);13});14 console.log('Status Code: ' + response.statusCode);15 console.log('Body: ' + body);16});17 console.log('Status Code: ' + response.statusCode);18 console.log('Body: ' + body);19});20 console.log('Status Code: ' + response.statusCode);21 console.log('Body: ' + body);22});23 console.log('Status Code: ' + response.statusCode);24 console.log('Body: ' + body);25});26 console.log('Status Code: ' + response.statusCode);27 console.log('Body: ' + body);28});
Using AI Code Generation
1var http = require('http');2var options = {3};4http.get(options, function(res) {5 console.log("Got response: " + res.statusCode);6}).on('error', function(e) {7 console.log("Got error: " + e.message);8});
Using AI Code Generation
1var http = require('http');2var url = require('url');3var httpGet = function(url, callback){4 http.get(url, function(res){5 var data = '';6 res.on('data', function(chunk){7 data += chunk;8 });9 res.on('end', function(){10 callback(data);11 });12 });13};14var http = require('http');15var url = require('url');16var httpGet = function(url, callback){17 http.get(url, function(res){18 var data = '';19 res.on('data', function(chunk){20 data += chunk;21 });22 res.on('end', function(){23 callback(data);24 });25 });26};27var http = require('http');28var url = require('url');29var httpGet = function(url, callback){30 http.get(url, function(res){31 var data = '';32 res.on('data', function(chunk){33 data += chunk;34 });35 res.on('end', function(){36 callback(data);37 });38 });39};40var http = require('http');41var url = require('url');42var httpGet = function(url, callback){43 http.get(url, function(res){44 var data = '';45 res.on('data', function(chunk){46 data += chunk;47 });48 res.on('end', function(){49 callback(data);50 });51 });52};53var http = require('http');54var url = require('url');55var httpGet = function(url, callback){56 http.get(url, function(res){57 var data = '';58 res.on('data', function(chunk){59 data += chunk;60 });61 res.on('end', function(){62 callback(data);63 });64 });65};66var http = require('http');67var url = require('url');68var httpGet = function(url, callback){69 http.get(url, function(res){70 var data = '';71 res.on('data', function(chunk){72 data += chunk;73 });74 res.on('end', function(){75 callback(data);76 });77 });78};79var http = require('http');80var url = require('url');81var httpGet = function(url, callback){
Using AI Code Generation
1var httpGet = require('karma').httpGet;2 if (error) {3 console.log(error);4 } else {5 console.log(body);6 }7});
Using AI Code Generation
1var httpGet = require('karma').httpGet;2httpGet(url, function(err, data) {3 console.log(data);4});5var httpGet = require('karma').httpGet;6httpGet(url, function(err, data) {7 console.log(data);8});9var httpGet = require('karma').httpGet;10httpGet(url, function(err, data) {11 console.log(data);12});13var httpGet = require('karma').httpGet;14httpGet(url, function(err, data) {15 console.log(data);16});17var httpGet = require('karma').httpGet;18httpGet(url, function(err, data) {19 console.log(data);20});21var httpGet = require('karma').httpGet;22httpGet(url, function(err, data) {23 console.log(data);24});25var httpGet = require('karma').httpGet;26httpGet(url, function(err, data) {27 console.log(data);28});29var httpGet = require('karma').httpGet;30httpGet(url, function(err, data) {31 console.log(data);32});33var httpGet = require('karma').httpGet;34httpGet(url, function(err, data) {35 console.log(data);36});
Using AI Code Generation
1var karmaClient = require('karma-client');2var client = new karmaClient();3 if (err) {4 console.error(err);5 return;6 }7 console.log(data);8});9var karmaClient = require('karma-client');10var client = new karmaClient();11 if (err) {12 console.error(err);13 return;14 }15 console.log(data);16});17var karmaClient = require('karma-client');18var client = new karmaClient();19 if (err) {20 console.error(err);21 return;22 }23 console.log(data);24});25var karmaClient = require('karma-client');26var client = new karmaClient();27 if (err) {28 console.error(err);29 return;30 }31 console.log(data);32});33var karmaClient = require('karma-client');34var client = new karmaClient();35 if (err) {36 console.error(err);37 return;38 }39 console.log(data);40});41var karmaClient = require('karma-client');42var client = new karmaClient();43 if (err) {44 console.error(err);45 return;46 }47 console.log(data);48});49var karmaClient = require('karma-client');50var client = new karmaClient();51 if (err) {52 console.error(err);53 return;54 }55 console.log(data);56});
Using AI Code Generation
1var http = require("http");2var request = require("request");3var fs = require("fs");4var path = require("path");5var dir = path.join(__dirname, "test");6var files = fs.readdirSync(dir);7var count = 0;8var file;9var i = 0;10var options = {11 qs: { file: file },12 {13 }14};15for (i = 0; i < files.length; i++) {16 file = files[i];17 if (file.endsWith(".js")) {18 request(options, function (error, response, body) {19 if (error) throw new Error(error);20 console.log(body);21 count++;22 if (count == files.length) {23 process.exit();24 }25 });26 }27}28var assert = require("assert");29var chai = require("chai");30var expect = chai.expect;31var should = chai.should();32var chaiHttp = require("chai-http");33chai.use(chaiHttp);34var fs = require("fs");35var path = require("path");36var dir = path.join(__dirname, "test");37var files = fs.readdirSync(dir);38var file;39var i = 0;40var options = {41 qs: { file: file },42 {43 }44};45var server = require("../server");46describe("Server", function () {47 describe("GET /", function () {48 it("should return 200 OK", function (done) {49 chai.request(server)50 .get("/")51 .end(function (err, res) {52 expect(res).to.have.status(200);53 done();54 });55 });56 });57 describe("GET /test", function () {58 for (i = 0; i < files.length; i++) {59 file = files[i];60 if (file.endsWith(".js")) {61 it("should return 200 OK", function (done) {62 chai.request(server)63 .get("/test
Using AI Code Generation
1var http = require("http");2var options = {3};4http.get(options, function(res) {5 console.log("Got response: " + res.statusCode);6}).on('error', function(e) {7 console.log("Got error: " + e.message);8});9Your name to display (optional):10Your name to display (optional):11Your name to display (optional):
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!