Documentation
¶
Overview ¶
*
@author: taco @Date: 2023/8/15 @Time: 10:37
*
Index ¶
- func Close(db *sql.DB)
- func NewDbClient(c *DbConfig) (*gorm.DB, error)
- func NewGormZapLogger() gormLogger.Interface
- func NewPgDbClient(c *PgDbConfig) (*gorm.DB, error)
- type AuditByStringModel
- type AuditByUintModel
- type AuditRpcByStringModel
- type AuditRpcByUintModel
- type AuditTenantByStringModel
- type AuditTenantByUintModel
- type AuditTenantRpcByStringModel
- type AuditTenantRpcByUintModel
- type BaseAdminModel
- type BaseModel
- type BaseRpcModel
- type BaseTenantModel
- type DbConfig
- type PgDbConfig
- type UniqueIdAdminModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewGormZapLogger ¶
func NewGormZapLogger() gormLogger.Interface
func NewPgDbClient ¶
func NewPgDbClient(c *PgDbConfig) (*gorm.DB, error)
Types ¶
type AuditByStringModel ¶
type AuditByStringModel struct {
CreatedBy string `gorm:"index:idx_created_by;column:created_by;comment:创建者;type: varchar(255)" json:"created_by"`
UpdatedBy string `gorm:"index:idx_updated_by;column:updated_by;comment:更新者;type: varchar(255)" json:"updated_by"`
DeletedBy string `gorm:"index:idx_deleted_by;column:deleted_by;comment:删除者;type: varchar(255)" json:"-"`
}
note: 审计字段新版实现
type AuditByUintModel ¶
type AuditByUintModel struct {
CreatedBy uint `gorm:"index:idx_created_by;column:created_by;comment:创建者;type:int" json:"created_by"`
UpdatedBy uint `gorm:"index:idx_updated_by;column:updated_by;comment:更新者;type:int" json:"updated_by"`
DeletedBy uint `gorm:"index:idx_deleted_by;column:deleted_by;comment:删除者;type:int" json:"-"`
}
type AuditRpcByStringModel ¶
type AuditRpcByStringModel struct {
CreatedBy string `gorm:"index:idx_created_by;column:created_by;comment:创建者;type: varchar(255)" json:"createdBy"`
UpdatedBy string `gorm:"index:idx_updated_by;column:updated_by;comment:更新者;type: varchar(255)" json:"updatedBy"`
DeletedBy string `gorm:"index:idx_deleted_by;column:deleted_by;comment:删除者;type: varchar(255)" json:"-"`
}
type AuditRpcByUintModel ¶
type AuditRpcByUintModel struct {
CreatedBy string `gorm:"index:idx_created_by;column:created_by;comment:创建者;type:int" json:"createdBy"`
UpdatedBy string `gorm:"index:idx_updated_by;column:updated_by;comment:更新者;type:int" json:"updatedBy"`
DeletedBy string `gorm:"index:idx_deleted_by;column:deleted_by;comment:删除者;type:int" json:"-"`
}
type AuditTenantByStringModel ¶
type AuditTenantByStringModel struct {
CreatedTenantBy string `` /* 133-byte string literal not displayed */
UpdatedTenantBy string `` /* 133-byte string literal not displayed */
DeletedTenantBy string `gorm:"index:idx_deleted_tenant_by;column:deleted_tenant_by;comment:删除数据的租户;type: varchar(255)" json:"-"`
}
note: 审计模型租户版
type AuditTenantByUintModel ¶
type AuditTenantByUintModel struct {
CreatedTenantBy uint `gorm:"index:idx_created_tenant_by;column:created_tenant_by;comment:创建数据的租户;type:int" json:"created_tenant_by"`
UpdatedTenantBy uint `gorm:"index:idx_updated_tenant_by;column:updated_tenant_by;comment:更新数据的租户;type:int" json:"updated_tenant_by"`
DeletedTenantBy uint `gorm:"index:idx_deleted_tenant_by;column:deleted_tenant_by;comment:删除数据的租户;type:int" json:"-"`
}
type AuditTenantRpcByStringModel ¶
type AuditTenantRpcByStringModel struct {
CreatedTenantBy string `` /* 131-byte string literal not displayed */
UpdatedTenantBy string `` /* 131-byte string literal not displayed */
DeletedTenantBy string `gorm:"index:idx_deleted_tenant_by;column:deleted_tenant_by;comment:删除数据的租户;type: varchar(255)" json:"-"`
}
type AuditTenantRpcByUintModel ¶
type AuditTenantRpcByUintModel struct {
CreatedTenantBy uint `gorm:"index:idx_created_tenant_by;column:created_tenant_by;comment:创建数据的租户;type:int" json:"createdTenantBy"`
UpdatedTenantBy uint `gorm:"index:idx_updated_tenant_by;column:updated_tenant_by;comment:更新数据的租户;type:int" json:"updatedTenantBy"`
DeletedTenantBy uint `gorm:"index:idx_deleted_tenant_by;column:deleted_tenant_by;comment:删除数据的租户;type:int" json:"-"`
}
type BaseAdminModel ¶
type BaseModel ¶
type BaseModel struct {
ID uint `gorm:"primarykey" json:"id"`
CreatedAt time.Time `gorm:"column:created_at;comment:创建时间;" json:"created_at"`
UpdatedAt time.Time `gorm:"column:updated_at;comment:更新时间;" json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
}
note: 兼容实现
type BaseRpcModel ¶
type BaseRpcModel struct {
ID uint `gorm:"primarykey" json:"id"`
CreatedAt time.Time `gorm:"column:created_at;comment:创建时间;" json:"createdAt"`
UpdatedAt time.Time `gorm:"column:updated_at;comment:更新时间;" json:"updatedAt"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
}
note: rpc新版实现
type BaseTenantModel ¶
type BaseTenantModel struct {
CreatedTenantBy string `` /* 133-byte string literal not displayed */
UpdatedTenantBy string `` /* 133-byte string literal not displayed */
DeletedTenantBy string `gorm:"index:idx_deleted_tenant_by;column:deleted_tenant_by;comment:删除数据的租户;type: varchar(255)" json:"-"`
}
type PgDbConfig ¶
type UniqueIdAdminModel ¶
type UniqueIdAdminModel struct {
CreatedBy string `gorm:"index:idx_created_by;column:created_by;comment:创建者;type: varchar(255)" json:"created_by"`
UpdatedBy string `gorm:"index:idx_updated_by;column:updated_by;comment:更新者;type: varchar(255)" json:"updated_by"`
DeletedBy string `gorm:"index:idx_deleted_by;column:deleted_by;comment:删除者;type: varchar(255)" json:"-"`
}
Click to show internal directories.
Click to hide internal directories.