uni-im-group.schema.json 1.8 KB
Newer Older
DCloud_JSON's avatar
DCloud_JSON 已提交
1 2 3 4 5 6 7
// 文档教程: https://uniapp.dcloud.net.cn/uniCloud/schema
{
	"bsonType": "object",
  "description": "im群信息表",
	"required": ["name","join_option"],
	"permission": {
		"read": true,
DCloud_JSON's avatar
DCloud_JSON 已提交
8
		"create": false, // 禁止前端调用,仅触发器内可用
DCloud_JSON's avatar
DCloud_JSON 已提交
9 10 11 12 13 14 15 16 17 18 19 20 21
		"update": true, // 触发器内再处理
		"delete": "auth.uid == doc.user_id"
	},
	"properties": {
		"_id": {
			"description": "ID,系统自动生成"
		},
    "type":{
      "bsonType": "string",
      "description": "群类型"
    },
		"user_id":{
			"bsonType": "string",
DCloud_JSON's avatar
DCloud_JSON 已提交
22
			"description": "群主id"
DCloud_JSON's avatar
DCloud_JSON 已提交
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
		},
		"name":{
			"bsonType": "string",
			"label": "群名称",
			"maxLength": 30
		},
		"introduction":{
			"bsonType": "string",
			"label": "群简介",
			"maxLength": 240,
      "defaultValue":""
		},
		"notification":{
			"bsonType": "object",
			"label": "群公告"
		},
		"avatar_file":{
			"bsonType": "file",
			"label": "群头像"
		},
		"join_option":{
			"bsonType": "string",
			"description": "申请加群选项",
			"label": "申请加群方式",
			"defaultValue":"needPermission",
			"enum":[
				{
					"text": "需要验证权限",
					"value": "needPermission"
				},
				{
					"text": "自由加入",
					"value": "freeAccess"
				},
				{
					"text": "禁止加入",
					"value": "disableApply"
				}
			]
		},
		"create_time": {
			"bsonType": "timestamp",
			"description": "群创建的时间戳",
			"forceDefaultValue": {
				"$env": "now"
			}
		},
    "update_time": {
    	"bsonType": "timestamp",
    	"description": " 更新群的时间戳",
    	"forceDefaultValue": {
    		"$env": "now"
    	}
    },
    "mute_all_members":{
      "bsonType": "bool",
      "description": "全群成员禁言",
      "defaultValue":false
DCloud_JSON's avatar
DCloud_JSON 已提交
81 82 83 84
    },
    "ext":{
      "bsonType": "object",
      "description": "自定义数据"
DCloud_JSON's avatar
DCloud_JSON 已提交
85 86 87
    }
	}
}