瀏覽代碼

add drug data

yuebuzu-creater 4 月之前
父節點
當前提交
90051e6796

+ 1 - 0
wisdom-app/src/app/tabs/tabs.page.ts

@@ -24,6 +24,7 @@ export class TabsPage {
 
     constructor() {
       addIcons({
+        home, accessibility,cart, person,
         compassOutline, bookOutline, book, storefront, personOutline, documentOutline,
         mailOutline, calendarOutline, logoUsd, briefcaseOutline, heartOutline,
         footballOutline, chevronForwardOutline, storefrontOutline, businessOutline,

+ 3 - 1
wisdom-prod/schema/schema.md

@@ -364,4 +364,6 @@ HealthKnowledgeCollection "1" -- "0..*" HealthKnowledge : contains
 ### 设计说明
 
 - **HotDots** 表用于存储健康科普知识的内容。
-- **HotDotsCollection** 表用于存储用户收藏的健康科普知识,使用指针关联到 HotDots 表。
+- **HotDotsCollection** 表用于存储用户收藏的健康科普知识,使用指针关联到 HotDots 表。
+
+## 药品表

+ 4 - 0
wisdom-server/migration/data.js

@@ -419,3 +419,7 @@ module.exports.HotDotList = [
     "likes": 250
   }
 ]
+
+module.exports.DrugList = [
+  
+]

+ 17 - 8
wisdom-server/migration/import-data.js

@@ -1,11 +1,12 @@
 const { CloudQuery, CloudObject } = require("../lib/ncloud");
-const { DepartList, DoctorList, HotDotList} = require("./data");
+const { DepartList, DoctorList, HotDotList,DrugList} = require("./data");
 inportDapartAndDoctor()
 
 DataMap = {
     Doctor:{},
     Department:{},
     HotDot:{},
+    Drug:{},
 }
 
 async function inportDapartAndDoctor(){
@@ -24,14 +25,22 @@ async function inportDapartAndDoctor(){
     // }
 
     // 导入热点数据
-    let hotDotList = HotDotList
-    for (let index = 0; index < hotDotList.length; index++) {
-        let hotDot = hotDotList[index];
-        hotDot = await importObject("HotDot",hotDot)
+    // let hotDotList = HotDotList
+    // for (let index = 0; index < hotDotList.length; index++) {
+    //     let hotDot = hotDotList[index];
+    //     hotDot = await importObject("HotDot",hotDot)
+    // }
+    // let query = new CloudQuery('HotDot');
+    // query.equalTo('category', 'HotDot');
+    // console.log(await query.find())
+
+    // 导入药品数据
+    let drugList = DrugList
+    for (let index = 0; index < drugList.length; index++) {
+        let drug = drugList[index];
+        drug = await importObject("Drug",drug)
     }
-    let query = new CloudQuery('HotDot');
-    query.equalTo('category', 'HotDot');
-    console.log(await query.find())
+
     // console.log(DataMap["Doctor"])
 }