update: opendb-banner, 增加索引字段 sort、status、category_id

This commit is contained in:
handongxun 2021-02-01 11:49:15 +08:00
parent a07328b36d
commit af941ddd6a

View File

@ -1,57 +1,87 @@
{ {
"schema": { "schema": {
"bsonType": "object", "bsonType": "object",
"required": [ "required": ["bannerfile"],
"image_url" "permission": {
], "read": true
},
"properties": { "properties": {
"_id": { "_id": {
"description": "ID系统自动生成" "description": "ID系统自动生成"
}, },
"image_url": { "bannerfile": {
"bsonType": "file", "bsonType": "file",
"fileMediaType": "image", "fileMediaType": "image",
"description": "图片url。可以是在线地址也支持本地地址", "title": "图片文件",
"label": "图片url", "description": "图片文件信息包括文件名、url等"
"trim":"both"
}, },
"open_url": { "open_url": {
"bsonType": "string", "bsonType": "string",
"description": "点击跳转目标地址。如果是web地址则使用内置web-view打开如果是本地页面则跳转本地页面如果是schema地址则打开本地的app", "description": "点击跳转目标地址。如果是web地址则使用内置web-view打开如果是本地页面则跳转本地页面如果是schema地址则打开本地的app",
"label": "点击目标地址", "title": "点击目标地址",
"pattern": "^(http://|https://|/|./|@/)\\S", "format": "url",
"trim":"both" "pattern": "^(http:\/\/|https:\/\/|\/|.\/|@\/)\\S",
"trim": "both"
}, },
"title": { "title": {
"bsonType": "string", "bsonType": "string",
"description": "标题。为避免背景图和前景文字靠色导致看不清建议使用把标题作为图片的一部分来处理。如可以保证不靠色则可以使用本字段或者额外扩展title_color、title_bgcolor等字段", "description": "注意标题文字颜色和背景图靠色导致看不清的问题",
"maxLength": 20, "maxLength": 20,
"label": "标题", "title": "标题",
"trim":"both" "trim": "both"
}, },
"sort": { "sort": {
"bsonType": "int", "bsonType": "int",
"description": "排序", "description": "数字越小,排序越前",
"label": "排序" "title": "排序"
}, },
"category_id": { "category_id": {
"bsonType": "string", "bsonType": "string",
"description": "多个栏目的banner都存在一个表里时可用这个字段区分", "description": "多个栏目的banner都存在一个表里时可用这个字段区分",
"label": "分类id" "title": "分类id"
}, },
"status": { "status": {
"bsonType": "bool", "bsonType": "bool",
"description": "状态: false 禁用true 正常",
"defaultValue": true, "defaultValue": true,
"label": "状态" "title": "生效状态"
}, },
"description": { "description": {
"bsonType": "string", "bsonType": "string",
"description": "维护者自用描述", "description": "维护者自用描述",
"label": "备注", "title": "备注",
"trim":"both" "trim": "both"
} }
} }
}, },
"index": [] "index": [{
"IndexName": "sort_",
"MgoKeySchema": {
"MgoIndexKeys": [{
"Name": "sort",
"Direction": "1"
}],
"MgoIsUnique": false
}
},
{
"IndexName": "status_",
"MgoKeySchema": {
"MgoIndexKeys": [{
"Name": "status",
"Direction": "1"
}],
"MgoIsUnique": false
}
},
{
"IndexName": "category_id_",
"MgoKeySchema": {
"MgoIndexKeys": [{
"Name": "category_id",
"Direction": "1"
}],
"MgoIsUnique": false
}
}
]
} }