refactor: merge tenant configuration into tenant registry
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
// =================================================================================
|
||||
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
|
||||
// =================================================================================
|
||||
|
||||
package dao
|
||||
|
||||
import (
|
||||
"hotgo/internal/dao/internal"
|
||||
)
|
||||
|
||||
// imTenantConfigDao is the data access object for the table im_tenant_config.
|
||||
// You can define custom methods on it to extend its functionality as needed.
|
||||
type imTenantConfigDao struct {
|
||||
*internal.ImTenantConfigDao
|
||||
}
|
||||
|
||||
var (
|
||||
// ImTenantConfig is a globally accessible object for table im_tenant_config operations.
|
||||
ImTenantConfig = imTenantConfigDao{internal.NewImTenantConfigDao()}
|
||||
)
|
||||
|
||||
// Add your custom methods and functionality below.
|
||||
@@ -21,32 +21,58 @@ type ImTenantDao struct {
|
||||
|
||||
// ImTenantColumns defines and stores column names for the table im_tenant.
|
||||
type ImTenantColumns struct {
|
||||
Id string //
|
||||
Code string //
|
||||
Name string //
|
||||
TenantDesc string //
|
||||
DbName string //
|
||||
DbDsn string //
|
||||
State string //
|
||||
CreatedAt string //
|
||||
CreatedBy string //
|
||||
UpdatedAt string //
|
||||
UpdatedBy string //
|
||||
Id string //
|
||||
Code string //
|
||||
Name string //
|
||||
TenantDesc string //
|
||||
MaxUsers string // 0表示ä¸é™åˆ¶
|
||||
MaxGroups string // 0表示ä¸é™åˆ¶
|
||||
MaxGroupMembers string // 0表示ä¸é™åˆ¶
|
||||
RealnameReviewPolicy string // 实åå®¡æ ¸ç–略:0自动通过,1è½¬äººå·¥å®¡æ ¸
|
||||
RealnameProviderMode string // 实åè®¤è¯æ¨¡å¼
|
||||
RealnameRequired string // 是å¦å¼ºåˆ¶å®žå
|
||||
RealnameAllowSkip string // 是å¦å…许跳过实å
|
||||
RealnameRemindAfter string // 实åæé†’延迟
|
||||
AliyunModerationEnabled string // 是å¦å¯ç”¨é˜¿é‡Œäº‘å†…å®¹å®¡æ ¸
|
||||
LocalModerationEnabled string // 是å¦å¯ç”¨æœ¬åœ°å†…å®¹å®¡æ ¸
|
||||
MessageEncryptionEnabled string // 是å¦å¯ç”¨æ¶ˆæ¯åР坆
|
||||
DefaultPolicyGroupId string // 默认用户ç–略组
|
||||
SecurityPolicyVersion string // å·²å‘布安全ç–略版本
|
||||
GlobalFriendEnabled string // å…¨å±€åŠ å¥½å‹å¼€å…³
|
||||
MessageCurfewEnabled string // 消æ¯å®µç¦å¼€å…³
|
||||
State string //
|
||||
CreatedAt string //
|
||||
CreatedBy string //
|
||||
UpdatedAt string //
|
||||
UpdatedBy string //
|
||||
}
|
||||
|
||||
// imTenantColumns holds the columns for the table im_tenant.
|
||||
var imTenantColumns = ImTenantColumns{
|
||||
Id: "id",
|
||||
Code: "code",
|
||||
Name: "name",
|
||||
TenantDesc: "tenant_desc",
|
||||
DbName: "db_name",
|
||||
DbDsn: "db_dsn",
|
||||
State: "state",
|
||||
CreatedAt: "created_at",
|
||||
CreatedBy: "created_by",
|
||||
UpdatedAt: "updated_at",
|
||||
UpdatedBy: "updated_by",
|
||||
Id: "id",
|
||||
Code: "code",
|
||||
Name: "name",
|
||||
TenantDesc: "tenant_desc",
|
||||
MaxUsers: "max_users",
|
||||
MaxGroups: "max_groups",
|
||||
MaxGroupMembers: "max_group_members",
|
||||
RealnameReviewPolicy: "realname_review_policy",
|
||||
RealnameProviderMode: "realname_provider_mode",
|
||||
RealnameRequired: "realname_required",
|
||||
RealnameAllowSkip: "realname_allow_skip",
|
||||
RealnameRemindAfter: "realname_remind_after",
|
||||
AliyunModerationEnabled: "aliyun_moderation_enabled",
|
||||
LocalModerationEnabled: "local_moderation_enabled",
|
||||
MessageEncryptionEnabled: "message_encryption_enabled",
|
||||
DefaultPolicyGroupId: "default_policy_group_id",
|
||||
SecurityPolicyVersion: "security_policy_version",
|
||||
GlobalFriendEnabled: "global_friend_enabled",
|
||||
MessageCurfewEnabled: "message_curfew_enabled",
|
||||
State: "state",
|
||||
CreatedAt: "created_at",
|
||||
CreatedBy: "created_by",
|
||||
UpdatedAt: "updated_at",
|
||||
UpdatedBy: "updated_by",
|
||||
}
|
||||
|
||||
// NewImTenantDao creates and returns a new DAO object for table data access.
|
||||
|
||||
@@ -1,103 +0,0 @@
|
||||
// ==========================================================================
|
||||
// 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"
|
||||
)
|
||||
|
||||
// ImTenantConfigDao is the data access object for the table im_tenant_config.
|
||||
type ImTenantConfigDao 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 ImTenantConfigColumns // columns contains all the column names of Table for convenient usage.
|
||||
handlers []gdb.ModelHandler // handlers for customized model modification.
|
||||
}
|
||||
|
||||
// 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
|
||||
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",
|
||||
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.
|
||||
func NewImTenantConfigDao(handlers ...gdb.ModelHandler) *ImTenantConfigDao {
|
||||
return &ImTenantConfigDao{
|
||||
group: "default",
|
||||
table: "im_tenant_config",
|
||||
columns: imTenantConfigColumns,
|
||||
handlers: handlers,
|
||||
}
|
||||
}
|
||||
|
||||
// DB retrieves and returns the underlying raw database management object of the current DAO.
|
||||
func (dao *ImTenantConfigDao) DB() gdb.DB {
|
||||
return g.DB(dao.group)
|
||||
}
|
||||
|
||||
// Table returns the table name of the current DAO.
|
||||
func (dao *ImTenantConfigDao) Table() string {
|
||||
return dao.table
|
||||
}
|
||||
|
||||
// Columns returns all column names of the current DAO.
|
||||
func (dao *ImTenantConfigDao) Columns() ImTenantConfigColumns {
|
||||
return dao.columns
|
||||
}
|
||||
|
||||
// Group returns the database configuration group name of the current DAO.
|
||||
func (dao *ImTenantConfigDao) 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 *ImTenantConfigDao) 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 *ImTenantConfigDao) 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