feat(server-go): 微信订阅消息骨架(#11,绑定/订阅/巡检触发,配置占位)
This commit is contained in:
@@ -32,6 +32,8 @@ var AllPermissions = []PermissionDef{
|
||||
{"batch:write", "批次管理", "新增、编辑、删除批次"},
|
||||
{"rearing:read", "饲养记录查看", "查看饲养记录"},
|
||||
{"rearing:write", "饲养记录管理", "新增、编辑、删除饲养记录"},
|
||||
{"notification:read", "订阅查看", "查看微信订阅绑定状态"},
|
||||
{"notification:write", "订阅管理", "绑定微信并管理订阅授权"},
|
||||
{"user:manage", "用户管理", "管理用户、角色和权限"},
|
||||
{"audit:read", "审计查看", "查看审计日志"},
|
||||
}
|
||||
@@ -45,6 +47,7 @@ var RolePermissionMap = map[string][]string{
|
||||
"knowledge:read", "knowledge:write",
|
||||
"inspection:create", "inspection:read",
|
||||
"tray:read", "tray:write", "batch:read", "batch:write", "rearing:read", "rearing:write",
|
||||
"notification:read", "notification:write",
|
||||
"user:manage", "audit:read",
|
||||
},
|
||||
RoleOperator: {
|
||||
@@ -54,6 +57,7 @@ var RolePermissionMap = map[string][]string{
|
||||
"knowledge:read", "knowledge:write",
|
||||
"inspection:create", "inspection:read",
|
||||
"tray:read", "tray:write", "batch:read", "batch:write", "rearing:read", "rearing:write",
|
||||
"notification:read", "notification:write",
|
||||
},
|
||||
RoleViewer: {
|
||||
"dashboard:view", "room:read", "device:read",
|
||||
@@ -61,6 +65,7 @@ var RolePermissionMap = map[string][]string{
|
||||
"knowledge:read",
|
||||
"inspection:read",
|
||||
"tray:read", "batch:read", "rearing:read",
|
||||
"notification:read",
|
||||
},
|
||||
RoleFarmer: {
|
||||
"dashboard:view", "room:read", "device:read", "device:control",
|
||||
@@ -68,5 +73,6 @@ var RolePermissionMap = map[string][]string{
|
||||
"knowledge:read",
|
||||
"inspection:create", "inspection:read",
|
||||
"tray:read", "batch:read", "rearing:read",
|
||||
"notification:read", "notification:write",
|
||||
},
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"time"
|
||||
)
|
||||
|
||||
// WechatBinding 用户微信订阅绑定
|
||||
type WechatBinding struct {
|
||||
ID string `gorm:"type:uuid;primaryKey;default:gen_random_uuid()" json:"id"`
|
||||
UserID string `gorm:"column:user_id;type:uuid;uniqueIndex" json:"userId"`
|
||||
OpenID string `gorm:"column:open_id;size:128;uniqueIndex" json:"openId"`
|
||||
AuthorizedTemplates json.RawMessage `gorm:"column:authorized_templates;type:jsonb" json:"authorizedTemplates,omitempty"`
|
||||
CreatedAt time.Time `gorm:"type:timestamptz" json:"createdAt"`
|
||||
UpdatedAt time.Time `gorm:"type:timestamptz" json:"updatedAt"`
|
||||
}
|
||||
|
||||
func (WechatBinding) TableName() string { return "wechat_bindings" }
|
||||
Reference in New Issue
Block a user