78 lines
1.4 KiB
JSON
78 lines
1.4 KiB
JSON
{
|
||
"bsonType": "object",
|
||
"required": ["wx_openid", "createdAt"],
|
||
"permission": {
|
||
"read": "doc._id == auth.uid",
|
||
"create": "auth.uid != null",
|
||
"update": "doc._id == auth.uid",
|
||
"delete": false
|
||
},
|
||
"properties": {
|
||
"_id": {
|
||
"description": "用户ID,系统自动生成",
|
||
"bsonType": "string"
|
||
},
|
||
"wx_openid": {
|
||
"bsonType": "string",
|
||
"description": "微信openid",
|
||
"trim": "both"
|
||
},
|
||
"wx_unionid": {
|
||
"bsonType": "string",
|
||
"description": "微信unionid"
|
||
},
|
||
"nickName": {
|
||
"bsonType": "string",
|
||
"description": "微信昵称",
|
||
"trim": "both"
|
||
},
|
||
"avatarUrl": {
|
||
"bsonType": "string",
|
||
"description": "微信头像URL"
|
||
},
|
||
"phone": {
|
||
"bsonType": "string",
|
||
"description": "绑定手机号"
|
||
},
|
||
"membership": {
|
||
"bsonType": "object",
|
||
"properties": {
|
||
"type": {
|
||
"bsonType": "string",
|
||
"enum": ["free", "premium"],
|
||
"default": "free"
|
||
},
|
||
"expireAt": {
|
||
"bsonType": "timestamp",
|
||
"description": "会员过期时间"
|
||
}
|
||
}
|
||
},
|
||
"settings": {
|
||
"bsonType": "object",
|
||
"properties": {
|
||
"defaultPetId": {
|
||
"bsonType": "string",
|
||
"description": "默认选中宠物ID"
|
||
},
|
||
"reminderEnabled": {
|
||
"bsonType": "bool",
|
||
"default": true
|
||
}
|
||
}
|
||
},
|
||
"createdAt": {
|
||
"bsonType": "timestamp",
|
||
"defaultValue": {
|
||
"$env": "now"
|
||
}
|
||
},
|
||
"updatedAt": {
|
||
"bsonType": "timestamp",
|
||
"defaultValue": {
|
||
"$env": "now"
|
||
}
|
||
}
|
||
}
|
||
}
|