【feature】添加组织数据读取权限

This commit is contained in:
XM-GO
2023-09-14 17:28:52 +08:00
parent bde42bfc9a
commit b5ee2a54b9
84 changed files with 1664 additions and 774 deletions

View File

@@ -40,7 +40,7 @@ func (p *RuleChainApi) GetRuleChainList(rc *restfulx.ReqCtx) {
rc.ResData = model.ResultPage{
Total: total,
PageNum: int64(pageNum),
PageSize: int64(pageNum),
PageSize: int64(pageSize),
Data: list,
}
}
@@ -64,6 +64,7 @@ func (p *RuleChainApi) InsertRuleChain(rc *restfulx.ReqCtx) {
restfulx.BindJsonAndValid(rc, &data)
data.Id = kgo.KStr.Uniqid("rule_")
data.Owner = rc.LoginAccount.UserName
data.OrgId = rc.LoginAccount.OrganizationId
p.RuleChainApp.Insert(data)
}

View File

@@ -28,7 +28,7 @@ func (p *RuleChainMsgLogApi) GetRuleChainMsgLogList(rc *restfulx.ReqCtx) {
rc.ResData = model.ResultPage{
Total: total,
PageNum: int64(pageNum),
PageSize: int64(pageNum),
PageSize: int64(pageSize),
Data: list,
}
}

View File

@@ -17,6 +17,8 @@ type RuleChainBase struct {
RuleName string `gorm:"ruleName;type:varchar(50);comment:名称" json:"ruleName"`
RuleBase64 string `gorm:"ruleBase64;type:longtext;comment:Base64缩略图" json:"ruleBase64"` //缩略图 base64
RuleRemark string `gorm:"ruleRemark;type:varchar(256);comment:说明" json:"ruleRemark"`
RoleId int64 `gorm:"-"` // 角色数据权限
}
type RuleChain struct {
@@ -30,12 +32,15 @@ func (RuleChain) TableName() string {
type RuleChainMsgLog struct {
MessageId string `gorm:"message_id;type:varchar(64);comment:消息Id" json:"messageId"`
OrgId int64 `json:"orgId" gorm:"type:int;comment:机构ID"`
MsgType string `gorm:"msg_type;type:varchar(64);comment:消息类型" json:"msgType"`
DeviceId string `gorm:"device_id;type:varchar(64);comment:设备ID" json:"deviceId"`
DeviceName string `gorm:"device_name;type:varchar(255);comment:设备名称" json:"deviceName"`
Ts time.Time `gorm:"ts;type:varchar(64);comment:时间" json:"ts"`
Content string `gorm:"content;type:varchar(1024);comment:内容" json:"content"`
CreatedAt time.Time `gorm:"column:create_at" json:"create_at"` // 创建时间
RoleId int64 `gorm:"-"` // 角色数据权限
}
func (RuleChainMsgLog) TableName() string {