opendb-mall-goods.schema.json 3.0 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
{
	"bsonType": "object",
	"permission": {
		"create": false,
		"delete": false,
		"read": "doc.is_on_sale == true",
		"update": false
	},
	"properties": {
		"_id": {
			"description": "存储文档 ID(商品 ID),系统自动生成"
		},
		"add_date": {
			"bsonType": "timestamp",
			"defaultValue": {
				"$env": "now"
			},
			"description": "上架时间"
		},
		"category_id": {
			"bsonType": "string",
			"description": "分类 id,参考`opendb-mall-categories`表",
			"foreignKey": "opendb-mall-categories._id"
		},
		"comment_count": {
			"bsonType": "int",
			"description": "累计评论数"
		},
		"goods_banner_imgs": {
			"bsonType": "array",
			"description": "商品详情页的banner图地址"
		},
		"goods_desc": {
			"bsonType": "string",
			"description": "商品详细描述",
			"title": "详细描述",
			"trim": "both"
		},
		"goods_sn": {
			"bsonType": "string",
			"description": "商品的唯一货号",
			"title": "货号",
			"trim": "both"
		},
		"goods_thumb": {
			"bsonType": "string",
			"description": "商品缩略图,用于在列表或搜索结果中预览显示",
			"pattern": "^(http:\/\/|https:\/\/|\/|.\/|@\/)\\S",
			"title": "缩略图地址",
			"trim": "both"
		},
		"is_alone_sale": {
			"bsonType": "bool",
			"description": "是否能单独销售;如果不能单独销售,则只能作为某商品的配件或者赠品销售"
		},
		"is_best": {
			"bsonType": "bool",
			"description": "是否精品"
		},
		"is_hot": {
			"bsonType": "bool",
			"description": "是否热销"
		},
		"is_new": {
			"bsonType": "bool",
			"description": "是否新品",
			"title": "是否新品"
		},
		"is_on_sale": {
			"bsonType": "bool",
			"description": "是否上架销售",
			"title": "是否上架"
		},
		"is_real": {
			"bsonType": "bool",
			"description": "是否实物",
			"title": "是否为实物"
		},
		"keywords": {
			"bsonType": "string",
			"description": "商品关键字,为搜索引擎收录使用",
			"title": "关键字",
			"trim": "both"
		},
		"last_modify_date": {
			"bsonType": "timestamp",
			"defaultValue": {
				"$env": "now"
			},
			"description": "最后修改时间"
		},
		"month_sell_count": {
			"bsonType": "int",
			"description": "月销量"
		},
		"name": {
			"bsonType": "string",
			"description": "商品名称",
			"title": "名称",
			"trim": "both"
		},
		"remain_count": {
			"bsonType": "int",
			"description": "库存数量",
			"title": "库存数量"
		},
		"seller_note": {
			"bsonType": "string",
			"description": "商家备注,仅商家可见",
			"permission": {
				"read": false
			},
			"trim": "both"
		},
		"total_sell_count": {
			"bsonType": "int",
			"description": "总销量"
		}
	},
	"required": ["goods_sn", "name", "remain_count", "month_sell_count", "total_sell_count", "comment_count", "is_real",
		"is_on_sale", "is_alone_sale", "is_best", "is_new", "is_hot"
	]
}