feat: 完成鸽达达后台安全与审计改造
This commit is contained in:
@@ -0,0 +1,123 @@
|
||||
// ==========================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// ==========================================================================
|
||||
|
||||
package internal
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// ImMessageCurfewRulesDao is the data access object for the table im_message_curfew_rules.
|
||||
type ImMessageCurfewRulesDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of the current DAO.
|
||||
columns ImMessageCurfewRulesColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// ImMessageCurfewRulesColumns defines and stores column names for the table im_message_curfew_rules.
|
||||
type ImMessageCurfewRulesColumns struct {
|
||||
Id string //
|
||||
TenantId string //
|
||||
PolicyId string //
|
||||
RuleCode string //
|
||||
RuleName string //
|
||||
DateType string // daily, weekday, weekend, custom
|
||||
CustomDates string // YYYY-MM-DD values for custom date type
|
||||
Weekdays string // ISO weekdays 1 through 7
|
||||
Timezone string //
|
||||
StartTime string //
|
||||
EndTime string // Less than start_time means crossing midnight
|
||||
Scope string // private_message or group_message
|
||||
WhitelistUserIds string //
|
||||
WhitelistGroupIds string //
|
||||
Message string //
|
||||
Status string // 1 enabled, 2 disabled
|
||||
Sort string //
|
||||
CreatedAt string //
|
||||
CreatedBy string //
|
||||
UpdatedAt string //
|
||||
UpdatedBy string //
|
||||
DeletedAt string //
|
||||
DeletedBy string //
|
||||
}
|
||||
|
||||
// imMessageCurfewRulesColumns holds the columns for the table im_message_curfew_rules.
|
||||
var imMessageCurfewRulesColumns = ImMessageCurfewRulesColumns{
|
||||
Id: "id",
|
||||
TenantId: "tenant_id",
|
||||
PolicyId: "policy_id",
|
||||
RuleCode: "rule_code",
|
||||
RuleName: "rule_name",
|
||||
DateType: "date_type",
|
||||
CustomDates: "custom_dates",
|
||||
Weekdays: "weekdays",
|
||||
Timezone: "timezone",
|
||||
StartTime: "start_time",
|
||||
EndTime: "end_time",
|
||||
Scope: "scope",
|
||||
WhitelistUserIds: "whitelist_user_ids",
|
||||
WhitelistGroupIds: "whitelist_group_ids",
|
||||
Message: "message",
|
||||
Status: "status",
|
||||
Sort: "sort",
|
||||
CreatedAt: "created_at",
|
||||
CreatedBy: "created_by",
|
||||
UpdatedAt: "updated_at",
|
||||
UpdatedBy: "updated_by",
|
||||
DeletedAt: "deleted_at",
|
||||
DeletedBy: "deleted_by",
|
||||
}
|
||||
|
||||
// NewImMessageCurfewRulesDao creates and returns a new DAO object for table data access.
|
||||
func NewImMessageCurfewRulesDao(handlers ...gdb.ModelHandler) *ImMessageCurfewRulesDao {
|
||||
return &ImMessageCurfewRulesDao{
|
||||
group: "default",
|
||||
table: "im_message_curfew_rules",
|
||||
columns: imMessageCurfewRulesColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *ImMessageCurfewRulesDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *ImMessageCurfewRulesDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *ImMessageCurfewRulesDao) Columns() ImMessageCurfewRulesColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *ImMessageCurfewRulesDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *ImMessageCurfewRulesDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note: Do not commit or roll back the transaction in function f,
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *ImMessageCurfewRulesDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
// ==========================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// ==========================================================================
|
||||
|
||||
package internal
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// ImSecurityIpRulesDao is the data access object for the table im_security_ip_rules.
|
||||
type ImSecurityIpRulesDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of the current DAO.
|
||||
columns ImSecurityIpRulesColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// ImSecurityIpRulesColumns defines and stores column names for the table im_security_ip_rules.
|
||||
type ImSecurityIpRulesColumns struct {
|
||||
Id string //
|
||||
TenantId string //
|
||||
RuleType string // whitelist or blacklist
|
||||
IpCidr string // IPv4, IPv6 or CIDR
|
||||
Action string // allow, challenge, block, audit_only
|
||||
SceneJson string // login, register, message, upload and other scenes
|
||||
RiskLevel string //
|
||||
Status string // 1 enabled, 2 disabled
|
||||
ExpiresAt string //
|
||||
Remark string //
|
||||
CreatedAt string //
|
||||
CreatedBy string //
|
||||
UpdatedAt string //
|
||||
UpdatedBy string //
|
||||
DeletedAt string //
|
||||
DeletedBy string //
|
||||
}
|
||||
|
||||
// imSecurityIpRulesColumns holds the columns for the table im_security_ip_rules.
|
||||
var imSecurityIpRulesColumns = ImSecurityIpRulesColumns{
|
||||
Id: "id",
|
||||
TenantId: "tenant_id",
|
||||
RuleType: "rule_type",
|
||||
IpCidr: "ip_cidr",
|
||||
Action: "action",
|
||||
SceneJson: "scene_json",
|
||||
RiskLevel: "risk_level",
|
||||
Status: "status",
|
||||
ExpiresAt: "expires_at",
|
||||
Remark: "remark",
|
||||
CreatedAt: "created_at",
|
||||
CreatedBy: "created_by",
|
||||
UpdatedAt: "updated_at",
|
||||
UpdatedBy: "updated_by",
|
||||
DeletedAt: "deleted_at",
|
||||
DeletedBy: "deleted_by",
|
||||
}
|
||||
|
||||
// NewImSecurityIpRulesDao creates and returns a new DAO object for table data access.
|
||||
func NewImSecurityIpRulesDao(handlers ...gdb.ModelHandler) *ImSecurityIpRulesDao {
|
||||
return &ImSecurityIpRulesDao{
|
||||
group: "default",
|
||||
table: "im_security_ip_rules",
|
||||
columns: imSecurityIpRulesColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *ImSecurityIpRulesDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *ImSecurityIpRulesDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *ImSecurityIpRulesDao) Columns() ImSecurityIpRulesColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *ImSecurityIpRulesDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *ImSecurityIpRulesDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note: Do not commit or roll back the transaction in function f,
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *ImSecurityIpRulesDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
// ==========================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// ==========================================================================
|
||||
|
||||
package internal
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// ImSecurityPolicyDao is the data access object for the table im_security_policy.
|
||||
type ImSecurityPolicyDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of the current DAO.
|
||||
columns ImSecurityPolicyColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// ImSecurityPolicyColumns defines and stores column names for the table im_security_policy.
|
||||
type ImSecurityPolicyColumns struct {
|
||||
Id string //
|
||||
TenantId string // 0 means global fallback policy
|
||||
PolicyVersion string //
|
||||
PolicyName string //
|
||||
PublishStatus string //
|
||||
PasswordPolicy string //
|
||||
LoginRateLimit string //
|
||||
SensitiveWordPolicy string //
|
||||
FileReviewPolicy string //
|
||||
RealnamePolicy string //
|
||||
RiskChallengePolicy string //
|
||||
GlobalFriendEnabled string // Backend master switch for every add-friend entry
|
||||
FriendDisabledPolicy string // Profile masking, QR and group-member restrictions
|
||||
MessageCurfewEnabled string // Backend master switch for message curfew
|
||||
Remark string //
|
||||
PublishedAt string //
|
||||
PublishedBy string //
|
||||
CreatedAt string //
|
||||
CreatedBy string //
|
||||
UpdatedAt string //
|
||||
UpdatedBy string //
|
||||
DeletedAt string //
|
||||
DeletedBy string //
|
||||
}
|
||||
|
||||
// imSecurityPolicyColumns holds the columns for the table im_security_policy.
|
||||
var imSecurityPolicyColumns = ImSecurityPolicyColumns{
|
||||
Id: "id",
|
||||
TenantId: "tenant_id",
|
||||
PolicyVersion: "policy_version",
|
||||
PolicyName: "policy_name",
|
||||
PublishStatus: "publish_status",
|
||||
PasswordPolicy: "password_policy",
|
||||
LoginRateLimit: "login_rate_limit",
|
||||
SensitiveWordPolicy: "sensitive_word_policy",
|
||||
FileReviewPolicy: "file_review_policy",
|
||||
RealnamePolicy: "realname_policy",
|
||||
RiskChallengePolicy: "risk_challenge_policy",
|
||||
GlobalFriendEnabled: "global_friend_enabled",
|
||||
FriendDisabledPolicy: "friend_disabled_policy",
|
||||
MessageCurfewEnabled: "message_curfew_enabled",
|
||||
Remark: "remark",
|
||||
PublishedAt: "published_at",
|
||||
PublishedBy: "published_by",
|
||||
CreatedAt: "created_at",
|
||||
CreatedBy: "created_by",
|
||||
UpdatedAt: "updated_at",
|
||||
UpdatedBy: "updated_by",
|
||||
DeletedAt: "deleted_at",
|
||||
DeletedBy: "deleted_by",
|
||||
}
|
||||
|
||||
// NewImSecurityPolicyDao creates and returns a new DAO object for table data access.
|
||||
func NewImSecurityPolicyDao(handlers ...gdb.ModelHandler) *ImSecurityPolicyDao {
|
||||
return &ImSecurityPolicyDao{
|
||||
group: "default",
|
||||
table: "im_security_policy",
|
||||
columns: imSecurityPolicyColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *ImSecurityPolicyDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *ImSecurityPolicyDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *ImSecurityPolicyDao) Columns() ImSecurityPolicyColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *ImSecurityPolicyDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *ImSecurityPolicyDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note: Do not commit or roll back the transaction in function f,
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *ImSecurityPolicyDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
// ==========================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// ==========================================================================
|
||||
|
||||
package internal
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// ImSensitiveWordGroupsDao is the data access object for the table im_sensitive_word_groups.
|
||||
type ImSensitiveWordGroupsDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of the current DAO.
|
||||
columns ImSensitiveWordGroupsColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// ImSensitiveWordGroupsColumns defines and stores column names for the table im_sensitive_word_groups.
|
||||
type ImSensitiveWordGroupsColumns struct {
|
||||
Id string //
|
||||
TenantId string // 0 means global dictionary
|
||||
GroupCode string //
|
||||
GroupName string //
|
||||
Priority string //
|
||||
Status string // 1 enabled, 2 disabled
|
||||
Remark string //
|
||||
CreatedAt string //
|
||||
CreatedBy string //
|
||||
UpdatedAt string //
|
||||
UpdatedBy string //
|
||||
DeletedAt string //
|
||||
DeletedBy string //
|
||||
}
|
||||
|
||||
// imSensitiveWordGroupsColumns holds the columns for the table im_sensitive_word_groups.
|
||||
var imSensitiveWordGroupsColumns = ImSensitiveWordGroupsColumns{
|
||||
Id: "id",
|
||||
TenantId: "tenant_id",
|
||||
GroupCode: "group_code",
|
||||
GroupName: "group_name",
|
||||
Priority: "priority",
|
||||
Status: "status",
|
||||
Remark: "remark",
|
||||
CreatedAt: "created_at",
|
||||
CreatedBy: "created_by",
|
||||
UpdatedAt: "updated_at",
|
||||
UpdatedBy: "updated_by",
|
||||
DeletedAt: "deleted_at",
|
||||
DeletedBy: "deleted_by",
|
||||
}
|
||||
|
||||
// NewImSensitiveWordGroupsDao creates and returns a new DAO object for table data access.
|
||||
func NewImSensitiveWordGroupsDao(handlers ...gdb.ModelHandler) *ImSensitiveWordGroupsDao {
|
||||
return &ImSensitiveWordGroupsDao{
|
||||
group: "default",
|
||||
table: "im_sensitive_word_groups",
|
||||
columns: imSensitiveWordGroupsColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *ImSensitiveWordGroupsDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *ImSensitiveWordGroupsDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *ImSensitiveWordGroupsDao) Columns() ImSensitiveWordGroupsColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *ImSensitiveWordGroupsDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *ImSensitiveWordGroupsDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note: Do not commit or roll back the transaction in function f,
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *ImSensitiveWordGroupsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
// ==========================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// ==========================================================================
|
||||
|
||||
package internal
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// ImSensitiveWordsDao is the data access object for the table im_sensitive_words.
|
||||
type ImSensitiveWordsDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of the current DAO.
|
||||
columns ImSensitiveWordsColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// ImSensitiveWordsColumns defines and stores column names for the table im_sensitive_words.
|
||||
type ImSensitiveWordsColumns struct {
|
||||
Id string //
|
||||
TenantId string // 0 means global dictionary
|
||||
GroupId string //
|
||||
Word string //
|
||||
WordHash string // SHA-256 of normalized word
|
||||
MatchType string //
|
||||
SceneJson string // Enabled scenes
|
||||
Action string //
|
||||
Replacement string //
|
||||
RiskLevel string //
|
||||
Priority string //
|
||||
Status string // 1 enabled, 2 disabled
|
||||
Remark string //
|
||||
CreatedAt string //
|
||||
CreatedBy string //
|
||||
UpdatedAt string //
|
||||
UpdatedBy string //
|
||||
DeletedAt string //
|
||||
DeletedBy string //
|
||||
}
|
||||
|
||||
// imSensitiveWordsColumns holds the columns for the table im_sensitive_words.
|
||||
var imSensitiveWordsColumns = ImSensitiveWordsColumns{
|
||||
Id: "id",
|
||||
TenantId: "tenant_id",
|
||||
GroupId: "group_id",
|
||||
Word: "word",
|
||||
WordHash: "word_hash",
|
||||
MatchType: "match_type",
|
||||
SceneJson: "scene_json",
|
||||
Action: "action",
|
||||
Replacement: "replacement",
|
||||
RiskLevel: "risk_level",
|
||||
Priority: "priority",
|
||||
Status: "status",
|
||||
Remark: "remark",
|
||||
CreatedAt: "created_at",
|
||||
CreatedBy: "created_by",
|
||||
UpdatedAt: "updated_at",
|
||||
UpdatedBy: "updated_by",
|
||||
DeletedAt: "deleted_at",
|
||||
DeletedBy: "deleted_by",
|
||||
}
|
||||
|
||||
// NewImSensitiveWordsDao creates and returns a new DAO object for table data access.
|
||||
func NewImSensitiveWordsDao(handlers ...gdb.ModelHandler) *ImSensitiveWordsDao {
|
||||
return &ImSensitiveWordsDao{
|
||||
group: "default",
|
||||
table: "im_sensitive_words",
|
||||
columns: imSensitiveWordsColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *ImSensitiveWordsDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *ImSensitiveWordsDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *ImSensitiveWordsDao) Columns() ImSensitiveWordsColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *ImSensitiveWordsDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *ImSensitiveWordsDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note: Do not commit or roll back the transaction in function f,
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *ImSensitiveWordsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@@ -21,28 +21,36 @@ type ImTenantConfigDao struct {
|
||||
|
||||
// ImTenantConfigColumns defines and stores column names for the table im_tenant_config.
|
||||
type ImTenantConfigColumns struct {
|
||||
Id string //
|
||||
TenantId string //
|
||||
MaxUsers string // 0 means unlimited
|
||||
MaxGroups string // 0 means unlimited
|
||||
MaxGroupMembers string // 0 means unlimited
|
||||
CreatedAt string //
|
||||
CreatedBy string //
|
||||
UpdatedAt string //
|
||||
UpdatedBy string //
|
||||
Id string //
|
||||
TenantId string //
|
||||
MaxUsers string // 0 means unlimited
|
||||
MaxGroups string // 0 means unlimited
|
||||
MaxGroupMembers string // 0 means unlimited
|
||||
DefaultPolicyGroupId string // Default user policy group
|
||||
SecurityPolicyVersion string // Published security policy version
|
||||
GlobalFriendEnabled string // Published global friend switch
|
||||
MessageCurfewEnabled string // Published message curfew switch
|
||||
CreatedAt string //
|
||||
CreatedBy string //
|
||||
UpdatedAt string //
|
||||
UpdatedBy string //
|
||||
}
|
||||
|
||||
// imTenantConfigColumns holds the columns for the table im_tenant_config.
|
||||
var imTenantConfigColumns = ImTenantConfigColumns{
|
||||
Id: "id",
|
||||
TenantId: "tenant_id",
|
||||
MaxUsers: "max_users",
|
||||
MaxGroups: "max_groups",
|
||||
MaxGroupMembers: "max_group_members",
|
||||
CreatedAt: "created_at",
|
||||
CreatedBy: "created_by",
|
||||
UpdatedAt: "updated_at",
|
||||
UpdatedBy: "updated_by",
|
||||
Id: "id",
|
||||
TenantId: "tenant_id",
|
||||
MaxUsers: "max_users",
|
||||
MaxGroups: "max_groups",
|
||||
MaxGroupMembers: "max_group_members",
|
||||
DefaultPolicyGroupId: "default_policy_group_id",
|
||||
SecurityPolicyVersion: "security_policy_version",
|
||||
GlobalFriendEnabled: "global_friend_enabled",
|
||||
MessageCurfewEnabled: "message_curfew_enabled",
|
||||
CreatedAt: "created_at",
|
||||
CreatedBy: "created_by",
|
||||
UpdatedAt: "updated_at",
|
||||
UpdatedBy: "updated_by",
|
||||
}
|
||||
|
||||
// NewImTenantConfigDao creates and returns a new DAO object for table data access.
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
// ==========================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// ==========================================================================
|
||||
|
||||
package internal
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// ImUserPolicyGroupMembersDao is the data access object for the table im_user_policy_group_members.
|
||||
type ImUserPolicyGroupMembersDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of the current DAO.
|
||||
columns ImUserPolicyGroupMembersColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// ImUserPolicyGroupMembersColumns defines and stores column names for the table im_user_policy_group_members.
|
||||
type ImUserPolicyGroupMembersColumns struct {
|
||||
Id string //
|
||||
TenantId string //
|
||||
GroupId string //
|
||||
UserId string // User ID in the tenant database
|
||||
Status string // 1 enabled, 2 disabled
|
||||
ValidFrom string //
|
||||
ValidUntil string //
|
||||
Remark string //
|
||||
CreatedAt string //
|
||||
CreatedBy string //
|
||||
UpdatedAt string //
|
||||
UpdatedBy string //
|
||||
DeletedAt string //
|
||||
DeletedBy string //
|
||||
}
|
||||
|
||||
// imUserPolicyGroupMembersColumns holds the columns for the table im_user_policy_group_members.
|
||||
var imUserPolicyGroupMembersColumns = ImUserPolicyGroupMembersColumns{
|
||||
Id: "id",
|
||||
TenantId: "tenant_id",
|
||||
GroupId: "group_id",
|
||||
UserId: "user_id",
|
||||
Status: "status",
|
||||
ValidFrom: "valid_from",
|
||||
ValidUntil: "valid_until",
|
||||
Remark: "remark",
|
||||
CreatedAt: "created_at",
|
||||
CreatedBy: "created_by",
|
||||
UpdatedAt: "updated_at",
|
||||
UpdatedBy: "updated_by",
|
||||
DeletedAt: "deleted_at",
|
||||
DeletedBy: "deleted_by",
|
||||
}
|
||||
|
||||
// NewImUserPolicyGroupMembersDao creates and returns a new DAO object for table data access.
|
||||
func NewImUserPolicyGroupMembersDao(handlers ...gdb.ModelHandler) *ImUserPolicyGroupMembersDao {
|
||||
return &ImUserPolicyGroupMembersDao{
|
||||
group: "default",
|
||||
table: "im_user_policy_group_members",
|
||||
columns: imUserPolicyGroupMembersColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *ImUserPolicyGroupMembersDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *ImUserPolicyGroupMembersDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *ImUserPolicyGroupMembersDao) Columns() ImUserPolicyGroupMembersColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *ImUserPolicyGroupMembersDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *ImUserPolicyGroupMembersDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note: Do not commit or roll back the transaction in function f,
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *ImUserPolicyGroupMembersDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
// ==========================================================================
|
||||
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
|
||||
// ==========================================================================
|
||||
|
||||
package internal
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// ImUserPolicyGroupsDao is the data access object for the table im_user_policy_groups.
|
||||
type ImUserPolicyGroupsDao struct {
|
||||
table string // table is the underlying table name of the DAO.
|
||||
group string // group is the database configuration group name of the current DAO.
|
||||
columns ImUserPolicyGroupsColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// ImUserPolicyGroupsColumns defines and stores column names for the table im_user_policy_groups.
|
||||
type ImUserPolicyGroupsColumns struct {
|
||||
Id string //
|
||||
TenantId string // 0 means global default
|
||||
GroupCode string // Stable policy group code
|
||||
GroupName string // Policy group name
|
||||
Priority string // Higher value has higher priority
|
||||
Status string // 1 enabled, 2 disabled
|
||||
PolicyJson string // Login, friend, message, group and file policies
|
||||
IpWhitelist string // IPv4/IPv6 or CIDR list
|
||||
IpBlacklist string // IPv4/IPv6 or CIDR list
|
||||
Version string // Optimistic-lock/config version
|
||||
Remark string //
|
||||
CreatedAt string //
|
||||
CreatedBy string //
|
||||
UpdatedAt string //
|
||||
UpdatedBy string //
|
||||
DeletedAt string //
|
||||
DeletedBy string //
|
||||
}
|
||||
|
||||
// imUserPolicyGroupsColumns holds the columns for the table im_user_policy_groups.
|
||||
var imUserPolicyGroupsColumns = ImUserPolicyGroupsColumns{
|
||||
Id: "id",
|
||||
TenantId: "tenant_id",
|
||||
GroupCode: "group_code",
|
||||
GroupName: "group_name",
|
||||
Priority: "priority",
|
||||
Status: "status",
|
||||
PolicyJson: "policy_json",
|
||||
IpWhitelist: "ip_whitelist",
|
||||
IpBlacklist: "ip_blacklist",
|
||||
Version: "version",
|
||||
Remark: "remark",
|
||||
CreatedAt: "created_at",
|
||||
CreatedBy: "created_by",
|
||||
UpdatedAt: "updated_at",
|
||||
UpdatedBy: "updated_by",
|
||||
DeletedAt: "deleted_at",
|
||||
DeletedBy: "deleted_by",
|
||||
}
|
||||
|
||||
// NewImUserPolicyGroupsDao creates and returns a new DAO object for table data access.
|
||||
func NewImUserPolicyGroupsDao(handlers ...gdb.ModelHandler) *ImUserPolicyGroupsDao {
|
||||
return &ImUserPolicyGroupsDao{
|
||||
group: "default",
|
||||
table: "im_user_policy_groups",
|
||||
columns: imUserPolicyGroupsColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *ImUserPolicyGroupsDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *ImUserPolicyGroupsDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *ImUserPolicyGroupsDao) Columns() ImUserPolicyGroupsColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *ImUserPolicyGroupsDao) Group() string {
|
||||
return dao.group
|
||||
}
|
||||
|
||||
// Ctx creates and returns a Model for the current DAO. It automatically sets the context for the current operation.
|
||||
func (dao *ImUserPolicyGroupsDao) Ctx(ctx context.Context) *gdb.Model {
|
||||
model := dao.DB().Model(dao.table)
|
||||
for _, handler := range dao.handlers {
|
||||
model = handler(model)
|
||||
}
|
||||
return model.Safe().Ctx(ctx)
|
||||
}
|
||||
|
||||
// Transaction wraps the transaction logic using function f.
|
||||
// It rolls back the transaction and returns the error if function f returns a non-nil error.
|
||||
// It commits the transaction and returns nil if function f returns nil.
|
||||
//
|
||||
// Note: Do not commit or roll back the transaction in function f,
|
||||
// as it is automatically handled by this function.
|
||||
func (dao *ImUserPolicyGroupsDao) Transaction(ctx context.Context, f func(ctx context.Context, tx gdb.TX) error) (err error) {
|
||||
return dao.Ctx(ctx).Transaction(ctx, f)
|
||||
}
|
||||
Reference in New Issue
Block a user