當前位置:首頁 > IT技術 > 微信平臺 > 正文

校友資料登記平臺小程序開發(fā)筆記二-云數(shù)據(jù)庫設計
2021-07-25 12:47:24

云開發(fā)數(shù)據(jù)庫

云開發(fā)提供了一個 JSON 數(shù)據(jù)庫,顧名思義,數(shù)據(jù)庫中的每條記錄都是一個 JSON 格式的對象。一個數(shù)據(jù)庫可以有多個集合(相當于關系型數(shù)據(jù)中的表),集合可看做一個 JSON 數(shù)組,數(shù)組中的每個對象就是一條記錄,記錄的格式是 JSON 對象。

關系型數(shù)據(jù)庫和 JSON 數(shù)據(jù)庫的概念對應關系如下表:

校友資料登記平臺小程序開發(fā)筆記二-云數(shù)據(jù)庫設計_其他

?

?

主要表ER圖

?

?校友資料登記平臺小程序開發(fā)筆記二-云數(shù)據(jù)庫設計_其他_02

?

?

校友信息表
UserModel.DB_STRUCTURE = {
    _pid: 'string|true',
    USER_ID: 'string|true',

    USER_NAME: 'string|true|comment=用戶姓名',
    USER_PIC: 'string|true|comment=用戶頭像',
    USER_PIC_CLOUD_ID: 'string|false|comment=用戶頭像云存儲地址',

    USER_PHONE_CHECKED: 'string|true|comment=已校驗的手機號碼',
    USER_MINI_QRCODE: 'object|false|comment=小程序碼地址{url,cloudId}',

    USER_MINI_OPENID: 'string|true|comment=小程序openid',
    USER_MINI_ORI_OPENID: 'string|true|comment=小程序原始openid',
    USER_UNIONID: 'string|false|comment=微信開放平臺unionid',

    USER_WX_OPENID: 'string|false|comment=公眾號openid',
    USER_IS_SUBSCRIBE: 'int|true|default=0|comment=公眾號是否關注 0/1',
    USER_SUBSCRIBE_TIME: 'int|true|default=0|comment=公眾號關注時間',

    USER_IS_MASK: 'int|true|default=0|comment=是否馬甲 0/1',
    USER_STATUS: 'int|true|default=1|comment=狀態(tài) 0=待審核,1=正常,8=VIP(###1-8為正常區(qū)間),9=禁用, 10=已刪除',
    USER_IS_SUPP: 'int|true|default=1|comment=待補充資料 0/1',
    USER_INVITE_ID: 'string|false|comment=邀請碼',

    USER_TYPE: 'int|true|default=0|comment=用戶類型 0=求學,1=教職工',

    USER_CHECK_PIC: 'array|false|default=[]|comment=審核圖片 對象數(shù)組[{cloudId,url}]',


    USER_SEX: 'int|true|default=1|comment=性別 1=男,2=女',
    USER_BIRTH: 'string|true|comment=出生年月',
    USER_NATIVE: 'string|false|comment=籍貫',

    USER_OPEN_SET: 'int|true|default=1|comment=聯(lián)系資料公開方式 1=所有用戶,8=認證用戶和交換名片用戶, 3=好友, 9=已交換名片的用戶',


    USER_WHOLE: 'int|true|default=0|comment=資料完整度',

    USER_IS_CARD: 'int|true|default=1|comment=是否接受名片 0/1',
    USER_IS_CARD_MSG: 'int|true|default=1|comment=是否接受交換名片消息提醒 0/1',

    USER_MOBILE: 'string|false|comment=聯(lián)系電話',
    USER_WECHAT: 'string|false|comment=微信',
    USER_QQ: 'string|false|comment=QQ',
    USER_EMAIL: 'string|false',

    USER_ITEM: 'string|true|comment=班級',
    USER_ENROLL: 'int|true|default=0|comment=入學年份',
    USER_GRAD: 'string|true|default=0|comment=畢業(yè)年份',
    USER_EDU: 'string|true|comment=學歷 中學,高職,大專,本科,碩士,博士,博士后,其他',

    USER_ITEM2: 'string|false|comment=班級2',
    USER_ENROLL2: 'int|false|default=0|comment=入學年份2',
    USER_GRAD2: 'string|false|default=0|comment=畢業(yè)年份2',
    USER_EDU2: 'string|false|comment=學歷2 中學,高職,大專,本科,碩士,博士,博士后,其他',

    USER_ITEM3: 'string|false|comment=班級3',
    USER_ENROLL3: 'int|false|default=0|comment=入學年份3',
    USER_GRAD3: 'string|false|default=0|comment=畢業(yè)年份3',
    USER_EDU3: 'string|false|comment=學歷3 中學,高職,大專,本科,碩士,博士,博士后,其他',

    USER_COMPANY: 'string|false|comment=當前單位',
    USER_COMPANY_DEF: 'string|false|comment=當前單位性質 保留,機關部門,事業(yè)單位,國企,世界500強,外企,上市企業(yè),民營企業(yè),自有企業(yè),個體經(jīng)營,自由職業(yè),其他',
    USER_COMPANY_DESC: 'string|false|comment=公司/單位介紹',
    USER_COMPANY_DUTY: 'string|false|comment=當前職位',
    USER_TRADE: 'string|false|comment=當前行業(yè)',
    USER_TRADE_EX: 'string|false|comment=當前行業(yè)補充說明',
    USER_CITY: 'string|false|comment=當前城市',
    USER_WORK_STATUS: 'string|false|comment=工作狀態(tài) 保留,全職,兼職,學生,待業(yè),退休,老板,自由職業(yè)者,家庭主婦,其他',

    USER_DESC: 'string|false|comment=自我介紹',
    USER_RESOURCE: 'string|false|comment=可提供資源',
    USER_NEED: 'string|false|comment=需求',


    USER_SUPP: 'string|false|comment=注冊補充說明',

    USER_FAV_CNT: 'int|true|default=0|comment=被收藏人數(shù)',
    USER_INVITE_CNT: 'int|true|default=0|comment=邀請人數(shù)',
    USER_VIEW_CNT: 'int|true|default=0|comment=被查看次數(shù)',
    USER_ALBUM_CNT: 'int|true|default=0|comment=發(fā)相冊數(shù)量',
    USER_INFO_CNT: 'int|true|default=0|comment=發(fā)互助數(shù)量',
    USER_MEET_CNT: 'int|true|default=0|comment=發(fā)起活動次數(shù)',
    USER_MEET_JOIN_CNT: 'int|true|default=0|comment=活動報名次數(shù)',
    USER_MEET_CHECK_IN_CNT: 'int|true|default=0|comment=活動簽到次數(shù)',

    USER_WX_GENDER: 'int|true|default=0|comment=微信性別 0=未定義,1=男,2=女',
    USER_WX_AVATAR_URL: 'string|false|comment=微信頭像鏈接',
    USER_WX_NICKNAME: 'string|false|comment=微信昵稱',
    USER_WX_LANGUAGE: 'string|false|comment=微信語言',
    USER_WX_CITY: 'string|false|comment=微信城市',
    USER_WX_PROVINCE: 'string|false|comment=微信省份',
    USER_WX_COUNTRY: 'string|false|comment=微信國家',
    USER_WX_UPDATE_TIME: 'int|false|comment=微信信息更新時間',

    USER_ACTIVE: 'array|false|comment=用戶動態(tài)',

    USER_LOGIN_CNT: 'int|true|default=0|comment=登陸次數(shù)',
    USER_LOGIN_TIME: 'int|false|comment=最近登錄時間',

    USER_ADD_TIME: 'int|true',
    USER_ADD_IP: 'string|false',

    USER_EDIT_TIME: 'int|true',
    USER_EDIT_IP: 'string|false',
}

?

后臺操作日志表
LogModel.DB_STRUCTURE = {
    _pid: 'string|true',
    LOG_ID: 'string|true',
    LOG_CONTENT: 'string|true',
    LOG_ADMIN_ID: 'string|true|comment=校友資料平臺管理員',

    LOG_TYPE: 'int|true|comment=日志類型 ',

    LOG_ADD_TIME: 'int|true',
    LOG_EDIT_TIME: 'int|true',
    LOG_ADD_IP: 'string|false',
    LOG_EDIT_IP: 'string|false',
};

?

?

?

校友名片表
CardModel.DB_STRUCTURE = {
    _pid: 'string|true',
    CARD_ID: 'string|true',
    CARD_MY_ID: 'string|true',
    CARD_YOUR_ID: 'string|true|comment=所有者',

    CARD_MSG: 'string|false|comment=留言',
    CARD_STATUS: 'int|true|default=0|comment=狀態(tài) 0=等待 1=拒絕 9=通過',

    CARD_ADD_TIME: 'int|true',
    CARD_EDIT_TIME: 'int|true',
    CARD_ADD_IP: 'string|false',
    CARD_EDIT_IP: 'string|false',
};

?

?系統(tǒng)設置表

?

SetupModel.DB_STRUCTURE = {
    _pid: 'string|true',
    SETUP_ID: 'string|true',

    SETUP_TITLE: 'string|false|comment=網(wǎng)站名稱',
    SETUP_ABOUT: 'string|false|comment=關于我們',

    SETUP_SKIN: 'string|true|default=skin1|comment=皮膚',
    SETUP_MARK: 'object|false|default={}|comment=校徽 對象{cloudId,url}',

    SETUP_LOGO: 'object|false|default={}|comment=網(wǎng)站首頁底圖 對象{cloudId,url}',
    SETUP_LOGO_USER: 'object|false|default={}|comment=網(wǎng)站用戶詳情底圖 對象{cloudId,url}',
    SETUP_LOGO_MY: 'object|false|default={}|comment=網(wǎng)站個人中心底圖 對象{cloudId,url}',

    SETUP_MINI_QRCODE: 'object|false|default={}|comment=學校小程序碼 對象{cloudId,url}',

    SETUP_AD_PIC: 'array|false|default=[]|comment=海報底圖 對象數(shù)組[cloud1,cloud2,cloud3]',

    SETUP_REG_CHECK: 'int|true|default=0|comment=注冊是否審核 0/1',
    SETUP_REG_CHECK_DESC: 'string|false|comment=注冊審核說明',
    SETUP_REG_CHECK_PIC: 'int|true|default=0|comment=注冊是否審核 0/1',
    SETUP_REG_CHECK_PIC_DESC: 'string|false|comment=注冊審核說明',

    SETUP_ALBUM_CHECK: 'int|true|default=0|comment=相冊是否審核 0/1',
    SETUP_MEET_CHECK: 'int|true|default=0|comment=活動是否審核 0/1',
    SETUP_INFO_CHECK: 'int|true|default=0|comment=互助是否審核 0/1',

    SETUP_ALBUM_COMMENT: 'int|true|default=1|comment=相冊是否允許評論 0/1',
    SETUP_MEET_COMMENT: 'int|true|default=1|comment=活動是否允許評論 0/1',
    SETUP_INFO_COMMENT: 'int|true|default=1|comment=互助是否允許評論 0/1',
    SETUP_NEWS_COMMENT: 'int|true|default=1|comment=資訊是否允許評論 0/1',

    SETUP_REG_WORK: 'int|true|default=0|comment=注冊是否允許教職工 0/1',

    SETUP_ADD_TIME: 'int|true',
    SETUP_EDIT_TIME: 'int|true',
    SETUP_ADD_IP: 'string|false',
    SETUP_EDIT_IP: 'string|false',
};

·

?
?
?
?

本文摘自 :https://blog.51cto.com/c

開通會員,享受整站包年服務立即開通 >