2020-09-02 19:27:53 +08:00
|
|
|
|
{
|
|
|
|
|
"schema": {
|
|
|
|
|
"bsonType": "object",
|
2021-01-09 22:03:09 +08:00
|
|
|
|
"required": ["name", "mobile", "area_code", "address"],
|
2020-09-02 19:27:53 +08:00
|
|
|
|
"properties": {
|
|
|
|
|
"_id": {
|
|
|
|
|
"description": "ID,系统自动生成"
|
|
|
|
|
},
|
|
|
|
|
"user_id": {
|
|
|
|
|
"bsonType": "string",
|
|
|
|
|
"description": "用户id,参考uni-id-users表"
|
|
|
|
|
},
|
|
|
|
|
"name": {
|
|
|
|
|
"bsonType": "string",
|
2020-11-23 17:39:09 +08:00
|
|
|
|
"description": "收货人",
|
2021-01-28 14:19:12 +08:00
|
|
|
|
"title": "收货人",
|
|
|
|
|
"trim": "both"
|
2020-09-02 19:27:53 +08:00
|
|
|
|
},
|
|
|
|
|
"alias": {
|
|
|
|
|
"bsonType": "string",
|
2021-01-11 11:19:41 +08:00
|
|
|
|
"description": "地址别名,例如:家、公司、学校",
|
2021-01-28 14:19:12 +08:00
|
|
|
|
"title": "地址别名",
|
|
|
|
|
"trim": "both"
|
2020-09-02 19:27:53 +08:00
|
|
|
|
},
|
|
|
|
|
"mobile": {
|
|
|
|
|
"bsonType": "string",
|
2020-11-23 17:39:09 +08:00
|
|
|
|
"description": "手机号码,加密存储",
|
2021-01-28 14:19:12 +08:00
|
|
|
|
"title": "手机号",
|
|
|
|
|
"pattern": "^\\+?[0-9-]{3,20}$",
|
|
|
|
|
"trim": "both"
|
2020-09-02 19:27:53 +08:00
|
|
|
|
},
|
|
|
|
|
"mobile_area_code": {
|
|
|
|
|
"bsonType": "string",
|
2020-11-23 17:39:09 +08:00
|
|
|
|
"description": "国际区号,中国大陆为 +86",
|
2021-01-28 14:19:12 +08:00
|
|
|
|
"title": "国际区号",
|
|
|
|
|
"trim": "both"
|
2020-09-02 19:27:53 +08:00
|
|
|
|
},
|
|
|
|
|
"province_code": {
|
|
|
|
|
"bsonType": "string",
|
2021-01-09 21:55:19 +08:00
|
|
|
|
"description": "省级编码,冗余存储",
|
2020-11-23 17:39:09 +08:00
|
|
|
|
"title": "省"
|
2020-09-02 19:27:53 +08:00
|
|
|
|
},
|
|
|
|
|
"city_code": {
|
|
|
|
|
"bsonType": "string",
|
2021-01-09 21:55:19 +08:00
|
|
|
|
"description": "地级编码,冗余存储",
|
2020-11-23 17:39:09 +08:00
|
|
|
|
"title": "市"
|
2020-09-02 19:27:53 +08:00
|
|
|
|
},
|
|
|
|
|
"area_code": {
|
|
|
|
|
"bsonType": "string",
|
2020-11-23 17:39:09 +08:00
|
|
|
|
"description": "区级编码",
|
2021-01-11 11:19:41 +08:00
|
|
|
|
"title": "省市区",
|
2021-01-28 10:48:37 +08:00
|
|
|
|
"foreignKey": "opendb-city-china.code",
|
2021-01-09 21:55:19 +08:00
|
|
|
|
"enumType": "tree",
|
|
|
|
|
"enum": {
|
|
|
|
|
"collection": "opendb-city-china",
|
|
|
|
|
"orderby": "value asc",
|
2021-01-21 11:45:21 +08:00
|
|
|
|
"field": "code as value, name as text, eq(type, 2) as isleaf"
|
2021-01-09 21:55:19 +08:00
|
|
|
|
}
|
2020-09-02 19:27:53 +08:00
|
|
|
|
},
|
|
|
|
|
"address": {
|
|
|
|
|
"bsonType": "string",
|
2021-01-09 21:55:19 +08:00
|
|
|
|
"description": "省市区后面的详细住址,包含街道小区房间号",
|
2021-01-28 14:19:12 +08:00
|
|
|
|
"title": "详细住址",
|
|
|
|
|
"trim": "both"
|
2020-09-02 19:27:53 +08:00
|
|
|
|
},
|
|
|
|
|
"formatted_address": {
|
|
|
|
|
"bsonType": "string",
|
2021-01-28 14:19:12 +08:00
|
|
|
|
"description": "完整地址信息,包括省市区及街道小区房间号",
|
|
|
|
|
"trim": "both"
|
2020-09-02 19:27:53 +08:00
|
|
|
|
},
|
|
|
|
|
"zip_code": {
|
|
|
|
|
"bsonType": "string",
|
2020-11-23 17:39:09 +08:00
|
|
|
|
"description": "邮编",
|
2021-01-28 14:19:12 +08:00
|
|
|
|
"title": "邮编",
|
|
|
|
|
"trim": "both"
|
2020-09-02 19:27:53 +08:00
|
|
|
|
},
|
|
|
|
|
"email": {
|
|
|
|
|
"bsonType": "string",
|
2020-11-23 17:39:09 +08:00
|
|
|
|
"description": "邮箱",
|
2021-01-28 14:19:12 +08:00
|
|
|
|
"title": "邮箱",
|
|
|
|
|
"format": "email",
|
|
|
|
|
"trim": "both"
|
2020-09-02 19:27:53 +08:00
|
|
|
|
},
|
2021-03-02 14:31:54 +08:00
|
|
|
|
"is_default": {
|
2020-09-02 19:27:53 +08:00
|
|
|
|
"bsonType": "bool",
|
2020-11-23 17:39:09 +08:00
|
|
|
|
"description": "是否为默认地址",
|
2021-01-28 14:19:12 +08:00
|
|
|
|
"title": "默认地址",
|
|
|
|
|
"defaultValue": false
|
2020-09-02 19:27:53 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"index": []
|
|
|
|
|
}
|