Documentation ¶
Index ¶
- Constants
- func CheckFieldCreateUserID(entity Entity) error
- func CheckFieldCreateUserIDResult(checkResult check.Result) error
- func CheckFieldDeleteUserID(entity Entity) error
- func CheckFieldDeleteUserIDResult(checkResult check.Result) error
- func CheckFieldID(entity Entity) error
- func CheckFieldIDResult(checkResult check.Result) error
- func CheckFieldLastUpdateUserID(entity Entity) error
- func CheckFieldLastUpdateUserIDResult(checkResult check.Result) error
- func CheckFieldOperatorUserName(entity Entity) error
- func CheckFieldOperatorUserNameResult(checkResult check.Result) error
- func CheckFieldTenantID(entity Entity) error
- func CheckFieldTenantIDResult(checkResult check.Result) error
- func CheckIDTypeValue(domainCNName string, fieldCNName string, id string) error
- type Base
- type Entity
- type OperatorUserNameField
- type TenantIDField
- type TimeFields
- type UserIDFields
Constants ¶
const ( // FieldID ID字段名 FieldID = "ID" // FieldTenantID 租户ID字段名 FieldTenantID = "TenantID" // FieldCreateUserID 创建用户ID字段名 FieldCreateUserID = "CreateUserID" // FieldLastUpdateUserID 最近更新用户ID字段名 FieldLastUpdateUserID = "LastUpdateUserID" // FieldDeleteUserID 删除用户ID字段名 FieldDeleteUserID = "DeleteUserID" // FieldOperatorUserName 操作者用户名 FieldOperatorUserName = "OperatorUserName" // FieldCreatedTime 创建时间字段名 FieldCreatedTime = "CreatedTime" // FieldLastUpdatedTime 最近更新时间字段名 FieldLastUpdatedTime = "LastUpdatedTime" )
const ( // ColumnID ID列名 ColumnID = "id" // ColumnTenantID 租户ID列名 ColumnTenantID = "tenant_id" // ColumnCreateUserID 创建用户ID列名 ColumnCreateUserID = "create_user_id" // ColumnLastUpdateUserID 最新更新用户ID列名 ColumnLastUpdateUserID = "last_update_user_id" // ColumnDeleteUserID 删除用户ID列名 ColumnDeleteUserID = "delete_user_id" // ColumnOperatorUserName 操作者用户名列名 ColumnOperatorUserName = "operator_user_name" // ColumnCreatedTime 创建时间列名 ColumnCreatedTime = "created_time" // ColumnLastUpdatedTime 最近更新时间列名 ColumnLastUpdatedTime = "last_updated_time" )
Variables ¶
This section is empty.
Functions ¶
func CheckFieldCreateUserID ¶ added in v0.5.1
CheckFieldCreateUserID 校验领域实体的创建用户ID字段是否合规 参数: - entity: 领域实体 返回值: - 错误
func CheckFieldCreateUserIDResult ¶ added in v0.5.2
CheckFieldCreateUserIDResult 利用check.Struct函数返回的结果校验领域实体的创建用户ID字段是否合规 参数: - checkResult: check.Struct函数返回的结果 返回值: - 错误
func CheckFieldDeleteUserID ¶ added in v0.12.3
CheckFieldDeleteUserID 校验领域实体的删除用户ID字段是否合规 参数: - entity: 领域实体 返回值: - 错误
func CheckFieldDeleteUserIDResult ¶ added in v0.12.3
CheckFieldDeleteUserIDResult 利用check.Struct函数返回的结果校验领域实体的删除用户ID字段是否合规 参数: - checkResult: check.Struct函数返回的结果 返回值: - 错误
func CheckFieldID ¶ added in v0.5.1
CheckFieldID 校验领域实体的ID字段是否合规 参数: - entity: 领域实体 返回值: - 错误
func CheckFieldIDResult ¶ added in v0.5.2
CheckFieldIDResult 利用check.Struct函数返回的结果校验领域实体的ID字段是否合规 参数: - checkResult: check.Struct函数返回的结果 返回值: - 错误
func CheckFieldLastUpdateUserID ¶ added in v0.5.1
CheckFieldLastUpdateUserID 校验领域实体的最近更新用户ID字段是否合规 参数: - entity: 领域实体 返回值: - 错误
func CheckFieldLastUpdateUserIDResult ¶ added in v0.5.2
CheckFieldLastUpdateUserIDResult 利用check.Struct函数返回的结果校验领域实体的最近更新用户ID字段是否合规 参数: - checkResult: check.Struct函数返回的结果 返回值: - 错误
func CheckFieldOperatorUserName ¶ added in v0.12.3
CheckFieldOperatorUserName 校验领域实体的操作者用户ID字段是否合规 参数: - entity: 领域实体 返回值: - 错误
func CheckFieldOperatorUserNameResult ¶ added in v0.12.3
CheckFieldOperatorUserNameResult 利用check.Struct函数返回的结果校验领域实体的操作者用户ID字段是否合规 参数: - entity: 领域实体 返回值: - 错误
func CheckFieldTenantID ¶ added in v0.5.1
CheckFieldTenantID 校验领域实体的租户ID字段是否合规 参数: - entity: 领域实体 返回值: - 错误
func CheckFieldTenantIDResult ¶ added in v0.5.2
CheckFieldTenantIDResult 利用check.Struct函数返回的结果校验领域实体的租户ID字段是否合规 参数: - checkResult: check.Struct函数返回的结果 返回值: - 错误
Types ¶
type Base ¶
type Base struct {
ID string `sqlmapping:"column:id;key;" sqlresult:"column:id;" check:"required,len=32"`
}
func (*Base) GenerateID ¶
type Entity ¶
type Entity interface { domain.Object // GenerateID 生成ID GenerateID() error // GetID 获取ID GetID() string // ForCreate 创建准备方法(规则校验) ForCreate() error // ForDelete 删除准备方法(规则校验) ForDelete() error // ForUpdate 更新准备方法(规则校验) ForUpdate() error }
Entity 领域实体接口
type OperatorUserNameField ¶ added in v0.12.3
type OperatorUserNameField struct {
OperatorUserName string `sqlmapping:"-" sqlresult:"-" check:"required"`
}
OperatorUserNameField 操作者用户名
type TenantIDField ¶
type TenantIDField struct {
TenantID string `sqlmapping:"column:tenant_id;" sqlresult:"column:tenant_id;" check:"required,len=32"`
}
TenantIDField 租户ID字段
type TimeFields ¶
type TimeFields struct { CreatedTime time.Time `sqlmapping:"column:created_time;" sqlresult:"column:created_time;"` LastUpdatedTime time.Time `sqlmapping:"column:last_updated_time;" sqlresult:"column:last_updated_time;"` }
TimeFields 时间相关字段
type UserIDFields ¶
type UserIDFields struct { CreateUserID string `sqlmapping:"column:create_user_id;" sqlresult:"column:create_user_id;" check:"required,len=32"` LastUpdateUserID string `sqlmapping:"column:last_update_user_id;" sqlresult:"column:last_update_user_id;" check:"required,len=32"` DeleteUserID string `sqlmapping:"-" sqlresult:"-" check:"required,len=32"` }
UserIDFields 用户ID相关字段