Documentation ¶
Index ¶
- Constants
- func AddGlobalScopeForEnterprise(name string, apply func(builder query.Condition))
- func AddGlobalScopeForOrganization(name string, apply func(builder query.Condition))
- func AddGlobalScopeForPasswordReset(name string, apply func(builder query.Condition))
- func AddGlobalScopeForRole(name string, apply func(builder query.Condition))
- func AddGlobalScopeForUser(name string, apply func(builder query.Condition))
- func AddGlobalScopeForUserExt(name string, apply func(builder query.Condition))
- func AddLocalScopeForEnterprise(name string, apply func(builder query.Condition))
- func AddLocalScopeForOrganization(name string, apply func(builder query.Condition))
- func AddLocalScopeForPasswordReset(name string, apply func(builder query.Condition))
- func AddLocalScopeForRole(name string, apply func(builder query.Condition))
- func AddLocalScopeForUser(name string, apply func(builder query.Condition))
- func AddLocalScopeForUserExt(name string, apply func(builder query.Condition))
- func EnterpriseFields() []string
- func EnterpriseTable() string
- func OrganizationFields() []string
- func OrganizationTable() string
- func PasswordResetFields() []string
- func PasswordResetTable() string
- func RoleFields() []string
- func RoleTable() string
- func SetEnterpriseTable(tableName string)
- func SetOrganizationTable(tableName string)
- func SetPasswordResetTable(tableName string)
- func SetRoleTable(tableName string)
- func SetUserExtTable(tableName string)
- func SetUserTable(tableName string)
- func UserExtFields() []string
- func UserExtTable() string
- func UserFields() []string
- func UserTable() string
- type Enterprise
- type EnterpriseHasManyUserRel
- func (rel *EnterpriseHasManyUserRel) Count(ctx context.Context, builders ...query.SQLBuilder) (int64, error)
- func (rel *EnterpriseHasManyUserRel) Create(ctx context.Context, target UserN) (int64, error)
- func (rel *EnterpriseHasManyUserRel) Exists(ctx context.Context, builders ...query.SQLBuilder) (bool, error)
- func (rel *EnterpriseHasManyUserRel) First(ctx context.Context, builders ...query.SQLBuilder) (*UserN, error)
- func (rel *EnterpriseHasManyUserRel) Get(ctx context.Context, builders ...query.SQLBuilder) ([]UserN, error)
- type EnterpriseModel
- func (m *EnterpriseModel) Condition(builder query.SQLBuilder) *EnterpriseModel
- func (m *EnterpriseModel) Count(ctx context.Context, builders ...query.SQLBuilder) (int64, error)
- func (m *EnterpriseModel) Create(ctx context.Context, kv query.KV) (int64, error)
- func (m *EnterpriseModel) Delete(ctx context.Context, builders ...query.SQLBuilder) (int64, error)
- func (m *EnterpriseModel) DeleteById(ctx context.Context, id int64) (int64, error)
- func (m *EnterpriseModel) Exists(ctx context.Context, builders ...query.SQLBuilder) (bool, error)
- func (m *EnterpriseModel) Find(ctx context.Context, id int64) (*EnterpriseN, error)
- func (m *EnterpriseModel) First(ctx context.Context, builders ...query.SQLBuilder) (*EnterpriseN, error)
- func (m *EnterpriseModel) ForceDelete(ctx context.Context, builders ...query.SQLBuilder) (int64, error)
- func (m *EnterpriseModel) ForceDeleteById(ctx context.Context, id int64) (int64, error)
- func (m *EnterpriseModel) Get(ctx context.Context, builders ...query.SQLBuilder) ([]EnterpriseN, error)
- func (m *EnterpriseModel) GetDB() query.Database
- func (m *EnterpriseModel) Paginate(ctx context.Context, page int64, perPage int64, builders ...query.SQLBuilder) ([]EnterpriseN, query.PaginateMeta, error)
- func (m *EnterpriseModel) Restore(ctx context.Context, builders ...query.SQLBuilder) (int64, error)
- func (m *EnterpriseModel) RestoreById(ctx context.Context, id int64) (int64, error)
- func (m *EnterpriseModel) Save(ctx context.Context, enterprise EnterpriseN, onlyFields ...string) (int64, error)
- func (m *EnterpriseModel) SaveAll(ctx context.Context, enterprises []EnterpriseN) ([]int64, error)
- func (m *EnterpriseModel) SaveOrUpdate(ctx context.Context, enterprise EnterpriseN, onlyFields ...string) (id int64, updated bool, err error)
- func (m *EnterpriseModel) Update(ctx context.Context, builder query.SQLBuilder, enterprise EnterpriseN, ...) (int64, error)
- func (m *EnterpriseModel) UpdateById(ctx context.Context, id int64, enterprise EnterpriseN, onlyFields ...string) (int64, error)
- func (m *EnterpriseModel) UpdateFields(ctx context.Context, kv query.KV, builders ...query.SQLBuilder) (int64, error)
- func (m *EnterpriseModel) WithLocalScopes(names ...string) *EnterpriseModel
- func (m *EnterpriseModel) WithTrashed() *EnterpriseModel
- func (m *EnterpriseModel) WithoutGlobalScopes(names ...string) *EnterpriseModel
- type EnterpriseN
- func (inst *EnterpriseN) As(dst interface{}) error
- func (inst *EnterpriseN) Delete(ctx context.Context) error
- func (inst *EnterpriseN) Save(ctx context.Context, onlyFields ...string) error
- func (inst *EnterpriseN) SetModel(enterpriseModel *EnterpriseModel)
- func (inst *EnterpriseN) Staled(onlyFields ...string) bool
- func (inst *EnterpriseN) StaledKV(onlyFields ...string) query.KV
- func (inst *EnterpriseN) String() string
- func (w *EnterpriseN) ToEnterprise() Enterprise
- func (inst *EnterpriseN) Users() *EnterpriseHasManyUserRel
- type Organization
- type OrganizationBelongsToManyUserRel
- func (rel *OrganizationBelongsToManyUserRel) Attach(ctx context.Context, target UserN) error
- func (rel *OrganizationBelongsToManyUserRel) Count(ctx context.Context, builders ...query.SQLBuilder) (int64, error)
- func (rel *OrganizationBelongsToManyUserRel) Create(ctx context.Context, target UserN, builders ...query.SQLBuilder) (int64, error)
- func (rel *OrganizationBelongsToManyUserRel) Detach(ctx context.Context, target UserN) error
- func (rel *OrganizationBelongsToManyUserRel) DetachAll(ctx context.Context) error
- func (rel *OrganizationBelongsToManyUserRel) Exists(ctx context.Context, builders ...query.SQLBuilder) (bool, error)
- func (rel *OrganizationBelongsToManyUserRel) Get(ctx context.Context, builders ...query.SQLBuilder) ([]UserN, error)
- type OrganizationModel
- func (m *OrganizationModel) Condition(builder query.SQLBuilder) *OrganizationModel
- func (m *OrganizationModel) Count(ctx context.Context, builders ...query.SQLBuilder) (int64, error)
- func (m *OrganizationModel) Create(ctx context.Context, kv query.KV) (int64, error)
- func (m *OrganizationModel) Delete(ctx context.Context, builders ...query.SQLBuilder) (int64, error)
- func (m *OrganizationModel) DeleteById(ctx context.Context, id int64) (int64, error)
- func (m *OrganizationModel) Exists(ctx context.Context, builders ...query.SQLBuilder) (bool, error)
- func (m *OrganizationModel) Find(ctx context.Context, id int64) (*OrganizationN, error)
- func (m *OrganizationModel) First(ctx context.Context, builders ...query.SQLBuilder) (*OrganizationN, error)
- func (m *OrganizationModel) Get(ctx context.Context, builders ...query.SQLBuilder) ([]OrganizationN, error)
- func (m *OrganizationModel) GetDB() query.Database
- func (m *OrganizationModel) Paginate(ctx context.Context, page int64, perPage int64, builders ...query.SQLBuilder) ([]OrganizationN, query.PaginateMeta, error)
- func (m *OrganizationModel) Save(ctx context.Context, organization OrganizationN, onlyFields ...string) (int64, error)
- func (m *OrganizationModel) SaveAll(ctx context.Context, organizations []OrganizationN) ([]int64, error)
- func (m *OrganizationModel) SaveOrUpdate(ctx context.Context, organization OrganizationN, onlyFields ...string) (id int64, updated bool, err error)
- func (m *OrganizationModel) Update(ctx context.Context, builder query.SQLBuilder, organization OrganizationN, ...) (int64, error)
- func (m *OrganizationModel) UpdateById(ctx context.Context, id int64, organization OrganizationN, ...) (int64, error)
- func (m *OrganizationModel) UpdateFields(ctx context.Context, kv query.KV, builders ...query.SQLBuilder) (int64, error)
- func (m *OrganizationModel) WithLocalScopes(names ...string) *OrganizationModel
- func (m *OrganizationModel) WithoutGlobalScopes(names ...string) *OrganizationModel
- type OrganizationN
- func (inst *OrganizationN) As(dst interface{}) error
- func (inst *OrganizationN) Delete(ctx context.Context) error
- func (inst *OrganizationN) Save(ctx context.Context, onlyFields ...string) error
- func (inst *OrganizationN) SetModel(organizationModel *OrganizationModel)
- func (inst *OrganizationN) Staled(onlyFields ...string) bool
- func (inst *OrganizationN) StaledKV(onlyFields ...string) query.KV
- func (inst *OrganizationN) String() string
- func (w *OrganizationN) ToOrganization() Organization
- func (inst *OrganizationN) Users() *OrganizationBelongsToManyUserRel
- type PasswordReset
- type PasswordResetModel
- func (m *PasswordResetModel) Condition(builder query.SQLBuilder) *PasswordResetModel
- func (m *PasswordResetModel) Count(ctx context.Context, builders ...query.SQLBuilder) (int64, error)
- func (m *PasswordResetModel) Create(ctx context.Context, kv query.KV) (int64, error)
- func (m *PasswordResetModel) Delete(ctx context.Context, builders ...query.SQLBuilder) (int64, error)
- func (m *PasswordResetModel) DeleteById(ctx context.Context, id int64) (int64, error)
- func (m *PasswordResetModel) Exists(ctx context.Context, builders ...query.SQLBuilder) (bool, error)
- func (m *PasswordResetModel) Find(ctx context.Context, id int64) (*PasswordResetN, error)
- func (m *PasswordResetModel) First(ctx context.Context, builders ...query.SQLBuilder) (*PasswordResetN, error)
- func (m *PasswordResetModel) Get(ctx context.Context, builders ...query.SQLBuilder) ([]PasswordResetN, error)
- func (m *PasswordResetModel) GetDB() query.Database
- func (m *PasswordResetModel) Paginate(ctx context.Context, page int64, perPage int64, builders ...query.SQLBuilder) ([]PasswordResetN, query.PaginateMeta, error)
- func (m *PasswordResetModel) Save(ctx context.Context, passwordReset PasswordResetN, onlyFields ...string) (int64, error)
- func (m *PasswordResetModel) SaveAll(ctx context.Context, passwordResets []PasswordResetN) ([]int64, error)
- func (m *PasswordResetModel) SaveOrUpdate(ctx context.Context, passwordReset PasswordResetN, onlyFields ...string) (id int64, updated bool, err error)
- func (m *PasswordResetModel) Update(ctx context.Context, builder query.SQLBuilder, passwordReset PasswordResetN, ...) (int64, error)
- func (m *PasswordResetModel) UpdateById(ctx context.Context, id int64, passwordReset PasswordResetN, ...) (int64, error)
- func (m *PasswordResetModel) UpdateFields(ctx context.Context, kv query.KV, builders ...query.SQLBuilder) (int64, error)
- func (m *PasswordResetModel) WithLocalScopes(names ...string) *PasswordResetModel
- func (m *PasswordResetModel) WithoutGlobalScopes(names ...string) *PasswordResetModel
- type PasswordResetN
- func (inst *PasswordResetN) As(dst interface{}) error
- func (inst *PasswordResetN) Delete(ctx context.Context) error
- func (inst *PasswordResetN) Save(ctx context.Context, onlyFields ...string) error
- func (inst *PasswordResetN) SetModel(passwordResetModel *PasswordResetModel)
- func (inst *PasswordResetN) Staled(onlyFields ...string) bool
- func (inst *PasswordResetN) StaledKV(onlyFields ...string) query.KV
- func (inst *PasswordResetN) String() string
- func (w *PasswordResetN) ToPasswordReset() PasswordReset
- type Role
- type RoleHasManyUserRel
- func (rel *RoleHasManyUserRel) Count(ctx context.Context, builders ...query.SQLBuilder) (int64, error)
- func (rel *RoleHasManyUserRel) Create(ctx context.Context, target UserN) (int64, error)
- func (rel *RoleHasManyUserRel) Exists(ctx context.Context, builders ...query.SQLBuilder) (bool, error)
- func (rel *RoleHasManyUserRel) First(ctx context.Context, builders ...query.SQLBuilder) (*UserN, error)
- func (rel *RoleHasManyUserRel) Get(ctx context.Context, builders ...query.SQLBuilder) ([]UserN, error)
- type RoleModel
- func (m *RoleModel) Condition(builder query.SQLBuilder) *RoleModel
- func (m *RoleModel) Count(ctx context.Context, builders ...query.SQLBuilder) (int64, error)
- func (m *RoleModel) Create(ctx context.Context, kv query.KV) (int64, error)
- func (m *RoleModel) Delete(ctx context.Context, builders ...query.SQLBuilder) (int64, error)
- func (m *RoleModel) DeleteById(ctx context.Context, id int64) (int64, error)
- func (m *RoleModel) Exists(ctx context.Context, builders ...query.SQLBuilder) (bool, error)
- func (m *RoleModel) Find(ctx context.Context, id int64) (*RoleN, error)
- func (m *RoleModel) First(ctx context.Context, builders ...query.SQLBuilder) (*RoleN, error)
- func (m *RoleModel) Get(ctx context.Context, builders ...query.SQLBuilder) ([]RoleN, error)
- func (m *RoleModel) GetDB() query.Database
- func (m *RoleModel) Paginate(ctx context.Context, page int64, perPage int64, builders ...query.SQLBuilder) ([]RoleN, query.PaginateMeta, error)
- func (m *RoleModel) Save(ctx context.Context, role RoleN, onlyFields ...string) (int64, error)
- func (m *RoleModel) SaveAll(ctx context.Context, roles []RoleN) ([]int64, error)
- func (m *RoleModel) SaveOrUpdate(ctx context.Context, role RoleN, onlyFields ...string) (id int64, updated bool, err error)
- func (m *RoleModel) Update(ctx context.Context, builder query.SQLBuilder, role RoleN, ...) (int64, error)
- func (m *RoleModel) UpdateById(ctx context.Context, id int64, role RoleN, onlyFields ...string) (int64, error)
- func (m *RoleModel) UpdateFields(ctx context.Context, kv query.KV, builders ...query.SQLBuilder) (int64, error)
- func (m *RoleModel) WithLocalScopes(names ...string) *RoleModel
- func (m *RoleModel) WithoutGlobalScopes(names ...string) *RoleModel
- type RoleN
- func (inst *RoleN) As(dst interface{}) error
- func (inst *RoleN) Delete(ctx context.Context) error
- func (inst *RoleN) Save(ctx context.Context, onlyFields ...string) error
- func (inst *RoleN) SetModel(roleModel *RoleModel)
- func (inst *RoleN) Staled(onlyFields ...string) bool
- func (inst *RoleN) StaledKV(onlyFields ...string) query.KV
- func (inst *RoleN) String() string
- func (w *RoleN) ToRole() Role
- func (inst *RoleN) Users() *RoleHasManyUserRel
- type User
- type UserBelongsToEnterpriseRel
- func (rel *UserBelongsToEnterpriseRel) Associate(ctx context.Context, target EnterpriseN) error
- func (rel *UserBelongsToEnterpriseRel) Create(ctx context.Context, target EnterpriseN) (int64, error)
- func (rel *UserBelongsToEnterpriseRel) Dissociate(ctx context.Context) error
- func (rel *UserBelongsToEnterpriseRel) Exists(ctx context.Context, builders ...query.SQLBuilder) (bool, error)
- func (rel *UserBelongsToEnterpriseRel) First(ctx context.Context, builders ...query.SQLBuilder) (*EnterpriseN, error)
- type UserBelongsToManyOrganizationRel
- func (rel *UserBelongsToManyOrganizationRel) Attach(ctx context.Context, target OrganizationN) error
- func (rel *UserBelongsToManyOrganizationRel) Count(ctx context.Context, builders ...query.SQLBuilder) (int64, error)
- func (rel *UserBelongsToManyOrganizationRel) Create(ctx context.Context, target OrganizationN, builders ...query.SQLBuilder) (int64, error)
- func (rel *UserBelongsToManyOrganizationRel) Detach(ctx context.Context, target OrganizationN) error
- func (rel *UserBelongsToManyOrganizationRel) DetachAll(ctx context.Context) error
- func (rel *UserBelongsToManyOrganizationRel) Exists(ctx context.Context, builders ...query.SQLBuilder) (bool, error)
- func (rel *UserBelongsToManyOrganizationRel) Get(ctx context.Context, builders ...query.SQLBuilder) ([]OrganizationN, error)
- type UserBelongsToRoleRel
- func (rel *UserBelongsToRoleRel) Associate(ctx context.Context, target RoleN) error
- func (rel *UserBelongsToRoleRel) Create(ctx context.Context, target RoleN) (int64, error)
- func (rel *UserBelongsToRoleRel) Dissociate(ctx context.Context) error
- func (rel *UserBelongsToRoleRel) Exists(ctx context.Context, builders ...query.SQLBuilder) (bool, error)
- func (rel *UserBelongsToRoleRel) First(ctx context.Context, builders ...query.SQLBuilder) (*RoleN, error)
- type UserExt
- type UserExtBelongsToUserRel
- func (rel *UserExtBelongsToUserRel) Associate(ctx context.Context, target UserN) error
- func (rel *UserExtBelongsToUserRel) Create(ctx context.Context, target UserN) (int64, error)
- func (rel *UserExtBelongsToUserRel) Dissociate(ctx context.Context) error
- func (rel *UserExtBelongsToUserRel) Exists(ctx context.Context, builders ...query.SQLBuilder) (bool, error)
- func (rel *UserExtBelongsToUserRel) First(ctx context.Context, builders ...query.SQLBuilder) (*UserN, error)
- type UserExtModel
- func (m *UserExtModel) Condition(builder query.SQLBuilder) *UserExtModel
- func (m *UserExtModel) Count(ctx context.Context, builders ...query.SQLBuilder) (int64, error)
- func (m *UserExtModel) Create(ctx context.Context, kv query.KV) (int64, error)
- func (m *UserExtModel) Delete(ctx context.Context, builders ...query.SQLBuilder) (int64, error)
- func (m *UserExtModel) DeleteById(ctx context.Context, id int64) (int64, error)
- func (m *UserExtModel) Exists(ctx context.Context, builders ...query.SQLBuilder) (bool, error)
- func (m *UserExtModel) Find(ctx context.Context, id int64) (*UserExtN, error)
- func (m *UserExtModel) First(ctx context.Context, builders ...query.SQLBuilder) (*UserExtN, error)
- func (m *UserExtModel) Get(ctx context.Context, builders ...query.SQLBuilder) ([]UserExtN, error)
- func (m *UserExtModel) GetDB() query.Database
- func (m *UserExtModel) Paginate(ctx context.Context, page int64, perPage int64, builders ...query.SQLBuilder) ([]UserExtN, query.PaginateMeta, error)
- func (m *UserExtModel) Save(ctx context.Context, userExt UserExtN, onlyFields ...string) (int64, error)
- func (m *UserExtModel) SaveAll(ctx context.Context, userExts []UserExtN) ([]int64, error)
- func (m *UserExtModel) SaveOrUpdate(ctx context.Context, userExt UserExtN, onlyFields ...string) (id int64, updated bool, err error)
- func (m *UserExtModel) Update(ctx context.Context, builder query.SQLBuilder, userExt UserExtN, ...) (int64, error)
- func (m *UserExtModel) UpdateById(ctx context.Context, id int64, userExt UserExtN, onlyFields ...string) (int64, error)
- func (m *UserExtModel) UpdateFields(ctx context.Context, kv query.KV, builders ...query.SQLBuilder) (int64, error)
- func (m *UserExtModel) WithLocalScopes(names ...string) *UserExtModel
- func (m *UserExtModel) WithoutGlobalScopes(names ...string) *UserExtModel
- type UserExtN
- func (inst *UserExtN) As(dst interface{}) error
- func (inst *UserExtN) Delete(ctx context.Context) error
- func (inst *UserExtN) Save(ctx context.Context, onlyFields ...string) error
- func (inst *UserExtN) SetModel(userExtModel *UserExtModel)
- func (inst *UserExtN) Staled(onlyFields ...string) bool
- func (inst *UserExtN) StaledKV(onlyFields ...string) query.KV
- func (inst *UserExtN) String() string
- func (w *UserExtN) ToUserExt() UserExt
- func (inst *UserExtN) User() *UserExtBelongsToUserRel
- type UserHasOneUserExtRel
- func (rel *UserHasOneUserExtRel) Associate(ctx context.Context, target UserExtN) error
- func (rel *UserHasOneUserExtRel) Create(ctx context.Context, target UserExtN) (int64, error)
- func (rel *UserHasOneUserExtRel) Dissociate(ctx context.Context) error
- func (rel *UserHasOneUserExtRel) Exists(ctx context.Context, builders ...query.SQLBuilder) (bool, error)
- func (rel *UserHasOneUserExtRel) First(ctx context.Context, builders ...query.SQLBuilder) (*UserExtN, error)
- type UserModel
- func (m *UserModel) Condition(builder query.SQLBuilder) *UserModel
- func (m *UserModel) Count(ctx context.Context, builders ...query.SQLBuilder) (int64, error)
- func (m *UserModel) Create(ctx context.Context, kv query.KV) (int64, error)
- func (m *UserModel) Delete(ctx context.Context, builders ...query.SQLBuilder) (int64, error)
- func (m *UserModel) DeleteById(ctx context.Context, id int64) (int64, error)
- func (m *UserModel) Exists(ctx context.Context, builders ...query.SQLBuilder) (bool, error)
- func (m *UserModel) Find(ctx context.Context, id int64) (*UserN, error)
- func (m *UserModel) First(ctx context.Context, builders ...query.SQLBuilder) (*UserN, error)
- func (m *UserModel) ForceDelete(ctx context.Context, builders ...query.SQLBuilder) (int64, error)
- func (m *UserModel) ForceDeleteById(ctx context.Context, id int64) (int64, error)
- func (m *UserModel) Get(ctx context.Context, builders ...query.SQLBuilder) ([]UserN, error)
- func (m *UserModel) GetDB() query.Database
- func (m *UserModel) Paginate(ctx context.Context, page int64, perPage int64, builders ...query.SQLBuilder) ([]UserN, query.PaginateMeta, error)
- func (m *UserModel) Restore(ctx context.Context, builders ...query.SQLBuilder) (int64, error)
- func (m *UserModel) RestoreById(ctx context.Context, id int64) (int64, error)
- func (m *UserModel) Save(ctx context.Context, user UserN, onlyFields ...string) (int64, error)
- func (m *UserModel) SaveAll(ctx context.Context, users []UserN) ([]int64, error)
- func (m *UserModel) SaveOrUpdate(ctx context.Context, user UserN, onlyFields ...string) (id int64, updated bool, err error)
- func (m *UserModel) Update(ctx context.Context, builder query.SQLBuilder, user UserN, ...) (int64, error)
- func (m *UserModel) UpdateById(ctx context.Context, id int64, user UserN, onlyFields ...string) (int64, error)
- func (m *UserModel) UpdateFields(ctx context.Context, kv query.KV, builders ...query.SQLBuilder) (int64, error)
- func (m *UserModel) WithLocalScopes(names ...string) *UserModel
- func (m *UserModel) WithTrashed() *UserModel
- func (m *UserModel) WithoutGlobalScopes(names ...string) *UserModel
- type UserN
- func (inst *UserN) As(dst interface{}) error
- func (inst *UserN) Delete(ctx context.Context) error
- func (inst *UserN) Enterprise() *UserBelongsToEnterpriseRel
- func (inst *UserN) Organizations() *UserBelongsToManyOrganizationRel
- func (inst *UserN) Role() *UserBelongsToRoleRel
- func (inst *UserN) Save(ctx context.Context, onlyFields ...string) error
- func (inst *UserN) SetModel(userModel *UserModel)
- func (inst *UserN) Staled(onlyFields ...string) bool
- func (inst *UserN) StaledKV(onlyFields ...string) query.KV
- func (inst *UserN) String() string
- func (w *UserN) ToUser() User
- func (inst *UserN) UserExt() *UserHasOneUserExtRel
Constants ¶
const ( FieldEnterpriseId = "id" FieldEnterpriseName = "name" FieldEnterpriseAddress = "address" FieldEnterpriseStatus = "status" FieldEnterpriseCreatedAt = "created_at" FieldEnterpriseUpdatedAt = "updated_at" FieldEnterpriseDeletedAt = "deleted_at" )
const ( FieldOrganizationId = "id" FieldOrganizationName = "name" FieldOrganizationCreatedAt = "created_at" FieldOrganizationUpdatedAt = "updated_at" )
const ( FieldRoleName = "name" FieldRoleDescription = "description" FieldRoleId = "id" FieldRoleCreatedAt = "created_at" FieldRoleUpdatedAt = "updated_at" )
const ( FieldUserId = "id" FieldUserName = "name" FieldUserEmail = "email" FieldUserPassword = "password" FieldUserRoleId = "role_id" FieldUserEnterpriseId = "enterprise_id" FieldUserRememberToken = "remember_token" FieldUserCreatedAt = "created_at" FieldUserUpdatedAt = "updated_at" FieldUserDeletedAt = "deleted_at" )
const ( FieldUserExtAddress = "address" FieldUserExtQq = "qq" FieldUserExtWechat = "wechat" FieldUserExtUserId = "user_id" FieldUserExtId = "id" FieldUserExtCreatedAt = "created_at" FieldUserExtUpdatedAt = "updated_at" )
const ( FieldPasswordResetEmail = "email" FieldPasswordResetToken = "token" FieldPasswordResetId = "id" FieldPasswordResetCreatedAt = "created_at" )
Variables ¶
This section is empty.
Functions ¶
func AddGlobalScopeForEnterprise ¶
AddGlobalScopeForEnterprise assign a global scope to a model
func AddGlobalScopeForOrganization ¶
AddGlobalScopeForOrganization assign a global scope to a model
func AddGlobalScopeForPasswordReset ¶
AddGlobalScopeForPasswordReset assign a global scope to a model
func AddGlobalScopeForRole ¶
AddGlobalScopeForRole assign a global scope to a model
func AddGlobalScopeForUser ¶
AddGlobalScopeForUser assign a global scope to a model
func AddGlobalScopeForUserExt ¶
AddGlobalScopeForUserExt assign a global scope to a model
func AddLocalScopeForEnterprise ¶
AddLocalScopeForEnterprise assign a local scope to a model
func AddLocalScopeForOrganization ¶
AddLocalScopeForOrganization assign a local scope to a model
func AddLocalScopeForPasswordReset ¶
AddLocalScopeForPasswordReset assign a local scope to a model
func AddLocalScopeForRole ¶
AddLocalScopeForRole assign a local scope to a model
func AddLocalScopeForUser ¶
AddLocalScopeForUser assign a local scope to a model
func AddLocalScopeForUserExt ¶
AddLocalScopeForUserExt assign a local scope to a model
func EnterpriseFields ¶
func EnterpriseFields() []string
EnterpriseFields return all fields in Enterprise model
func EnterpriseTable ¶
func EnterpriseTable() string
EnterpriseTable return table name for Enterprise
func OrganizationFields ¶
func OrganizationFields() []string
OrganizationFields return all fields in Organization model
func OrganizationTable ¶
func OrganizationTable() string
OrganizationTable return table name for Organization
func PasswordResetFields ¶
func PasswordResetFields() []string
PasswordResetFields return all fields in PasswordReset model
func PasswordResetTable ¶
func PasswordResetTable() string
PasswordResetTable return table name for PasswordReset
func SetEnterpriseTable ¶
func SetEnterpriseTable(tableName string)
func SetOrganizationTable ¶
func SetOrganizationTable(tableName string)
func SetPasswordResetTable ¶
func SetPasswordResetTable(tableName string)
func SetRoleTable ¶
func SetRoleTable(tableName string)
func SetUserExtTable ¶
func SetUserExtTable(tableName string)
func SetUserTable ¶
func SetUserTable(tableName string)
Types ¶
type Enterprise ¶
type Enterprise struct { Id int64 Name string Address string Status int8 CreatedAt time.Time UpdatedAt time.Time DeletedAt time.Time }
func (Enterprise) As ¶
func (w Enterprise) As(dst interface{}) error
As convert object to other type dst must be a pointer to struct
func (Enterprise) ToEnterpriseN ¶
func (w Enterprise) ToEnterpriseN(allows ...string) EnterpriseN
type EnterpriseHasManyUserRel ¶
type EnterpriseHasManyUserRel struct {
// contains filtered or unexported fields
}
func (*EnterpriseHasManyUserRel) Count ¶
func (rel *EnterpriseHasManyUserRel) Count(ctx context.Context, builders ...query.SQLBuilder) (int64, error)
func (*EnterpriseHasManyUserRel) Exists ¶
func (rel *EnterpriseHasManyUserRel) Exists(ctx context.Context, builders ...query.SQLBuilder) (bool, error)
func (*EnterpriseHasManyUserRel) First ¶
func (rel *EnterpriseHasManyUserRel) First(ctx context.Context, builders ...query.SQLBuilder) (*UserN, error)
func (*EnterpriseHasManyUserRel) Get ¶
func (rel *EnterpriseHasManyUserRel) Get(ctx context.Context, builders ...query.SQLBuilder) ([]UserN, error)
type EnterpriseModel ¶
type EnterpriseModel struct {
// contains filtered or unexported fields
}
EnterpriseModel is a model which encapsulates the operations of the object
func NewEnterpriseModel ¶
func NewEnterpriseModel(db query.Database) *EnterpriseModel
NewEnterpriseModel create a EnterpriseModel
func (*EnterpriseModel) Condition ¶
func (m *EnterpriseModel) Condition(builder query.SQLBuilder) *EnterpriseModel
Condition add query builder to model
func (*EnterpriseModel) Count ¶
func (m *EnterpriseModel) Count(ctx context.Context, builders ...query.SQLBuilder) (int64, error)
Count return model count for a given query
func (*EnterpriseModel) Delete ¶
func (m *EnterpriseModel) Delete(ctx context.Context, builders ...query.SQLBuilder) (int64, error)
Delete remove a model
func (*EnterpriseModel) DeleteById ¶
DeleteById remove a model by id
func (*EnterpriseModel) Exists ¶
func (m *EnterpriseModel) Exists(ctx context.Context, builders ...query.SQLBuilder) (bool, error)
Exists return whether the records exists for a given query
func (*EnterpriseModel) Find ¶
func (m *EnterpriseModel) Find(ctx context.Context, id int64) (*EnterpriseN, error)
Find retrieve a model by its primary key
func (*EnterpriseModel) First ¶
func (m *EnterpriseModel) First(ctx context.Context, builders ...query.SQLBuilder) (*EnterpriseN, error)
First return first result for given query
func (*EnterpriseModel) ForceDelete ¶
func (m *EnterpriseModel) ForceDelete(ctx context.Context, builders ...query.SQLBuilder) (int64, error)
ForceDelete permanently remove a soft deleted model from the database
func (*EnterpriseModel) ForceDeleteById ¶
ForceDeleteById permanently remove a soft deleted model from the database by id
func (*EnterpriseModel) Get ¶
func (m *EnterpriseModel) Get(ctx context.Context, builders ...query.SQLBuilder) ([]EnterpriseN, error)
Get retrieve all results for given query
func (*EnterpriseModel) GetDB ¶
func (m *EnterpriseModel) GetDB() query.Database
GetDB return database instance
func (*EnterpriseModel) Paginate ¶
func (m *EnterpriseModel) Paginate(ctx context.Context, page int64, perPage int64, builders ...query.SQLBuilder) ([]EnterpriseN, query.PaginateMeta, error)
func (*EnterpriseModel) Restore ¶
func (m *EnterpriseModel) Restore(ctx context.Context, builders ...query.SQLBuilder) (int64, error)
Restore restore a soft deleted model into an active state
func (*EnterpriseModel) RestoreById ¶
RestoreById restore a soft deleted model into an active state by id
func (*EnterpriseModel) Save ¶
func (m *EnterpriseModel) Save(ctx context.Context, enterprise EnterpriseN, onlyFields ...string) (int64, error)
Save save a enterprise to database
func (*EnterpriseModel) SaveAll ¶
func (m *EnterpriseModel) SaveAll(ctx context.Context, enterprises []EnterpriseN) ([]int64, error)
SaveAll save all enterprises to database
func (*EnterpriseModel) SaveOrUpdate ¶
func (m *EnterpriseModel) SaveOrUpdate(ctx context.Context, enterprise EnterpriseN, onlyFields ...string) (id int64, updated bool, err error)
SaveOrUpdate save a new enterprise or update it when it has a id > 0
func (*EnterpriseModel) Update ¶
func (m *EnterpriseModel) Update(ctx context.Context, builder query.SQLBuilder, enterprise EnterpriseN, onlyFields ...string) (int64, error)
Update update a model for given query
func (*EnterpriseModel) UpdateById ¶
func (m *EnterpriseModel) UpdateById(ctx context.Context, id int64, enterprise EnterpriseN, onlyFields ...string) (int64, error)
UpdateById update a model by id
func (*EnterpriseModel) UpdateFields ¶
func (m *EnterpriseModel) UpdateFields(ctx context.Context, kv query.KV, builders ...query.SQLBuilder) (int64, error)
UpdateFields update kv for a given query
func (*EnterpriseModel) WithLocalScopes ¶
func (m *EnterpriseModel) WithLocalScopes(names ...string) *EnterpriseModel
WithLocalScopes add a local scope for given query
func (*EnterpriseModel) WithTrashed ¶
func (m *EnterpriseModel) WithTrashed() *EnterpriseModel
WithTrashed force soft deleted models to appear in a result set
func (*EnterpriseModel) WithoutGlobalScopes ¶
func (m *EnterpriseModel) WithoutGlobalScopes(names ...string) *EnterpriseModel
WithoutGlobalScopes remove a global scope for given query
type EnterpriseN ¶
type EnterpriseN struct { Id null.Int Name null.String Address null.String Status null.Int CreatedAt null.Time UpdatedAt null.Time DeletedAt null.Time // contains filtered or unexported fields }
EnterpriseN is a Enterprise object, all fields are nullable
func (*EnterpriseN) As ¶
func (inst *EnterpriseN) As(dst interface{}) error
As convert object to other type dst must be a pointer to struct
func (*EnterpriseN) Delete ¶
func (inst *EnterpriseN) Delete(ctx context.Context) error
Delete remove a enterprise
func (*EnterpriseN) Save ¶
func (inst *EnterpriseN) Save(ctx context.Context, onlyFields ...string) error
Save create a new model or update it
func (*EnterpriseN) SetModel ¶
func (inst *EnterpriseN) SetModel(enterpriseModel *EnterpriseModel)
SetModel set model for Enterprise
func (*EnterpriseN) Staled ¶
func (inst *EnterpriseN) Staled(onlyFields ...string) bool
Staled identify whether the object has been modified
func (*EnterpriseN) StaledKV ¶
func (inst *EnterpriseN) StaledKV(onlyFields ...string) query.KV
StaledKV return all fields has been modified
func (*EnterpriseN) String ¶
func (inst *EnterpriseN) String() string
String convert instance to json string
func (*EnterpriseN) ToEnterprise ¶
func (w *EnterpriseN) ToEnterprise() Enterprise
func (*EnterpriseN) Users ¶
func (inst *EnterpriseN) Users() *EnterpriseHasManyUserRel
type Organization ¶
func (Organization) As ¶
func (w Organization) As(dst interface{}) error
As convert object to other type dst must be a pointer to struct
func (Organization) ToOrganizationN ¶
func (w Organization) ToOrganizationN(allows ...string) OrganizationN
type OrganizationBelongsToManyUserRel ¶
type OrganizationBelongsToManyUserRel struct {
// contains filtered or unexported fields
}
func (*OrganizationBelongsToManyUserRel) Attach ¶
func (rel *OrganizationBelongsToManyUserRel) Attach(ctx context.Context, target UserN) error
func (*OrganizationBelongsToManyUserRel) Count ¶
func (rel *OrganizationBelongsToManyUserRel) Count(ctx context.Context, builders ...query.SQLBuilder) (int64, error)
func (*OrganizationBelongsToManyUserRel) Create ¶
func (rel *OrganizationBelongsToManyUserRel) Create(ctx context.Context, target UserN, builders ...query.SQLBuilder) (int64, error)
func (*OrganizationBelongsToManyUserRel) Detach ¶
func (rel *OrganizationBelongsToManyUserRel) Detach(ctx context.Context, target UserN) error
func (*OrganizationBelongsToManyUserRel) DetachAll ¶
func (rel *OrganizationBelongsToManyUserRel) DetachAll(ctx context.Context) error
func (*OrganizationBelongsToManyUserRel) Exists ¶
func (rel *OrganizationBelongsToManyUserRel) Exists(ctx context.Context, builders ...query.SQLBuilder) (bool, error)
func (*OrganizationBelongsToManyUserRel) Get ¶
func (rel *OrganizationBelongsToManyUserRel) Get(ctx context.Context, builders ...query.SQLBuilder) ([]UserN, error)
type OrganizationModel ¶
type OrganizationModel struct {
// contains filtered or unexported fields
}
OrganizationModel is a model which encapsulates the operations of the object
func NewOrganizationModel ¶
func NewOrganizationModel(db query.Database) *OrganizationModel
NewOrganizationModel create a OrganizationModel
func (*OrganizationModel) Condition ¶
func (m *OrganizationModel) Condition(builder query.SQLBuilder) *OrganizationModel
Condition add query builder to model
func (*OrganizationModel) Count ¶
func (m *OrganizationModel) Count(ctx context.Context, builders ...query.SQLBuilder) (int64, error)
Count return model count for a given query
func (*OrganizationModel) Delete ¶
func (m *OrganizationModel) Delete(ctx context.Context, builders ...query.SQLBuilder) (int64, error)
Delete remove a model
func (*OrganizationModel) DeleteById ¶
DeleteById remove a model by id
func (*OrganizationModel) Exists ¶
func (m *OrganizationModel) Exists(ctx context.Context, builders ...query.SQLBuilder) (bool, error)
Exists return whether the records exists for a given query
func (*OrganizationModel) Find ¶
func (m *OrganizationModel) Find(ctx context.Context, id int64) (*OrganizationN, error)
Find retrieve a model by its primary key
func (*OrganizationModel) First ¶
func (m *OrganizationModel) First(ctx context.Context, builders ...query.SQLBuilder) (*OrganizationN, error)
First return first result for given query
func (*OrganizationModel) Get ¶
func (m *OrganizationModel) Get(ctx context.Context, builders ...query.SQLBuilder) ([]OrganizationN, error)
Get retrieve all results for given query
func (*OrganizationModel) GetDB ¶
func (m *OrganizationModel) GetDB() query.Database
GetDB return database instance
func (*OrganizationModel) Paginate ¶
func (m *OrganizationModel) Paginate(ctx context.Context, page int64, perPage int64, builders ...query.SQLBuilder) ([]OrganizationN, query.PaginateMeta, error)
func (*OrganizationModel) Save ¶
func (m *OrganizationModel) Save(ctx context.Context, organization OrganizationN, onlyFields ...string) (int64, error)
Save save a organization to database
func (*OrganizationModel) SaveAll ¶
func (m *OrganizationModel) SaveAll(ctx context.Context, organizations []OrganizationN) ([]int64, error)
SaveAll save all organizations to database
func (*OrganizationModel) SaveOrUpdate ¶
func (m *OrganizationModel) SaveOrUpdate(ctx context.Context, organization OrganizationN, onlyFields ...string) (id int64, updated bool, err error)
SaveOrUpdate save a new organization or update it when it has a id > 0
func (*OrganizationModel) Update ¶
func (m *OrganizationModel) Update(ctx context.Context, builder query.SQLBuilder, organization OrganizationN, onlyFields ...string) (int64, error)
Update update a model for given query
func (*OrganizationModel) UpdateById ¶
func (m *OrganizationModel) UpdateById(ctx context.Context, id int64, organization OrganizationN, onlyFields ...string) (int64, error)
UpdateById update a model by id
func (*OrganizationModel) UpdateFields ¶
func (m *OrganizationModel) UpdateFields(ctx context.Context, kv query.KV, builders ...query.SQLBuilder) (int64, error)
UpdateFields update kv for a given query
func (*OrganizationModel) WithLocalScopes ¶
func (m *OrganizationModel) WithLocalScopes(names ...string) *OrganizationModel
WithLocalScopes add a local scope for given query
func (*OrganizationModel) WithoutGlobalScopes ¶
func (m *OrganizationModel) WithoutGlobalScopes(names ...string) *OrganizationModel
WithoutGlobalScopes remove a global scope for given query
type OrganizationN ¶
type OrganizationN struct { Id null.Int Name null.String CreatedAt null.Time UpdatedAt null.Time // contains filtered or unexported fields }
OrganizationN is a Organization object, all fields are nullable
func (*OrganizationN) As ¶
func (inst *OrganizationN) As(dst interface{}) error
As convert object to other type dst must be a pointer to struct
func (*OrganizationN) Delete ¶
func (inst *OrganizationN) Delete(ctx context.Context) error
Delete remove a organization
func (*OrganizationN) Save ¶
func (inst *OrganizationN) Save(ctx context.Context, onlyFields ...string) error
Save create a new model or update it
func (*OrganizationN) SetModel ¶
func (inst *OrganizationN) SetModel(organizationModel *OrganizationModel)
SetModel set model for Organization
func (*OrganizationN) Staled ¶
func (inst *OrganizationN) Staled(onlyFields ...string) bool
Staled identify whether the object has been modified
func (*OrganizationN) StaledKV ¶
func (inst *OrganizationN) StaledKV(onlyFields ...string) query.KV
StaledKV return all fields has been modified
func (*OrganizationN) String ¶
func (inst *OrganizationN) String() string
String convert instance to json string
func (*OrganizationN) ToOrganization ¶
func (w *OrganizationN) ToOrganization() Organization
func (*OrganizationN) Users ¶
func (inst *OrganizationN) Users() *OrganizationBelongsToManyUserRel
type PasswordReset ¶
func (PasswordReset) As ¶
func (w PasswordReset) As(dst interface{}) error
As convert object to other type dst must be a pointer to struct
func (PasswordReset) ToPasswordResetN ¶
func (w PasswordReset) ToPasswordResetN(allows ...string) PasswordResetN
type PasswordResetModel ¶
type PasswordResetModel struct {
// contains filtered or unexported fields
}
PasswordResetModel is a model which encapsulates the operations of the object
func NewPasswordResetModel ¶
func NewPasswordResetModel(db query.Database) *PasswordResetModel
NewPasswordResetModel create a PasswordResetModel
func (*PasswordResetModel) Condition ¶
func (m *PasswordResetModel) Condition(builder query.SQLBuilder) *PasswordResetModel
Condition add query builder to model
func (*PasswordResetModel) Count ¶
func (m *PasswordResetModel) Count(ctx context.Context, builders ...query.SQLBuilder) (int64, error)
Count return model count for a given query
func (*PasswordResetModel) Delete ¶
func (m *PasswordResetModel) Delete(ctx context.Context, builders ...query.SQLBuilder) (int64, error)
Delete remove a model
func (*PasswordResetModel) DeleteById ¶
DeleteById remove a model by id
func (*PasswordResetModel) Exists ¶
func (m *PasswordResetModel) Exists(ctx context.Context, builders ...query.SQLBuilder) (bool, error)
Exists return whether the records exists for a given query
func (*PasswordResetModel) Find ¶
func (m *PasswordResetModel) Find(ctx context.Context, id int64) (*PasswordResetN, error)
Find retrieve a model by its primary key
func (*PasswordResetModel) First ¶
func (m *PasswordResetModel) First(ctx context.Context, builders ...query.SQLBuilder) (*PasswordResetN, error)
First return first result for given query
func (*PasswordResetModel) Get ¶
func (m *PasswordResetModel) Get(ctx context.Context, builders ...query.SQLBuilder) ([]PasswordResetN, error)
Get retrieve all results for given query
func (*PasswordResetModel) GetDB ¶
func (m *PasswordResetModel) GetDB() query.Database
GetDB return database instance
func (*PasswordResetModel) Paginate ¶
func (m *PasswordResetModel) Paginate(ctx context.Context, page int64, perPage int64, builders ...query.SQLBuilder) ([]PasswordResetN, query.PaginateMeta, error)
func (*PasswordResetModel) Save ¶
func (m *PasswordResetModel) Save(ctx context.Context, passwordReset PasswordResetN, onlyFields ...string) (int64, error)
Save save a PasswordReset to database
func (*PasswordResetModel) SaveAll ¶
func (m *PasswordResetModel) SaveAll(ctx context.Context, passwordResets []PasswordResetN) ([]int64, error)
SaveAll save all PasswordResets to database
func (*PasswordResetModel) SaveOrUpdate ¶
func (m *PasswordResetModel) SaveOrUpdate(ctx context.Context, passwordReset PasswordResetN, onlyFields ...string) (id int64, updated bool, err error)
SaveOrUpdate save a new PasswordReset or update it when it has a id > 0
func (*PasswordResetModel) Update ¶
func (m *PasswordResetModel) Update(ctx context.Context, builder query.SQLBuilder, passwordReset PasswordResetN, onlyFields ...string) (int64, error)
Update update a model for given query
func (*PasswordResetModel) UpdateById ¶
func (m *PasswordResetModel) UpdateById(ctx context.Context, id int64, passwordReset PasswordResetN, onlyFields ...string) (int64, error)
UpdateById update a model by id
func (*PasswordResetModel) UpdateFields ¶
func (m *PasswordResetModel) UpdateFields(ctx context.Context, kv query.KV, builders ...query.SQLBuilder) (int64, error)
UpdateFields update kv for a given query
func (*PasswordResetModel) WithLocalScopes ¶
func (m *PasswordResetModel) WithLocalScopes(names ...string) *PasswordResetModel
WithLocalScopes add a local scope for given query
func (*PasswordResetModel) WithoutGlobalScopes ¶
func (m *PasswordResetModel) WithoutGlobalScopes(names ...string) *PasswordResetModel
WithoutGlobalScopes remove a global scope for given query
type PasswordResetN ¶
type PasswordResetN struct { Email null.String Token null.String Id null.Int CreatedAt null.Time // contains filtered or unexported fields }
PasswordResetN is a PasswordReset object, all fields are nullable
func (*PasswordResetN) As ¶
func (inst *PasswordResetN) As(dst interface{}) error
As convert object to other type dst must be a pointer to struct
func (*PasswordResetN) Delete ¶
func (inst *PasswordResetN) Delete(ctx context.Context) error
Delete remove a PasswordReset
func (*PasswordResetN) Save ¶
func (inst *PasswordResetN) Save(ctx context.Context, onlyFields ...string) error
Save create a new model or update it
func (*PasswordResetN) SetModel ¶
func (inst *PasswordResetN) SetModel(passwordResetModel *PasswordResetModel)
SetModel set model for PasswordReset
func (*PasswordResetN) Staled ¶
func (inst *PasswordResetN) Staled(onlyFields ...string) bool
Staled identify whether the object has been modified
func (*PasswordResetN) StaledKV ¶
func (inst *PasswordResetN) StaledKV(onlyFields ...string) query.KV
StaledKV return all fields has been modified
func (*PasswordResetN) String ¶
func (inst *PasswordResetN) String() string
String convert instance to json string
func (*PasswordResetN) ToPasswordReset ¶
func (w *PasswordResetN) ToPasswordReset() PasswordReset
type Role ¶
type Role struct { Name string Description string Id int64 CreatedAt time.Time UpdatedAt time.Time }
type RoleHasManyUserRel ¶
type RoleHasManyUserRel struct {
// contains filtered or unexported fields
}
func (*RoleHasManyUserRel) Count ¶
func (rel *RoleHasManyUserRel) Count(ctx context.Context, builders ...query.SQLBuilder) (int64, error)
func (*RoleHasManyUserRel) Exists ¶
func (rel *RoleHasManyUserRel) Exists(ctx context.Context, builders ...query.SQLBuilder) (bool, error)
func (*RoleHasManyUserRel) First ¶
func (rel *RoleHasManyUserRel) First(ctx context.Context, builders ...query.SQLBuilder) (*UserN, error)
func (*RoleHasManyUserRel) Get ¶
func (rel *RoleHasManyUserRel) Get(ctx context.Context, builders ...query.SQLBuilder) ([]UserN, error)
type RoleModel ¶
type RoleModel struct {
// contains filtered or unexported fields
}
RoleModel is a model which encapsulates the operations of the object
func (*RoleModel) Condition ¶
func (m *RoleModel) Condition(builder query.SQLBuilder) *RoleModel
Condition add query builder to model
func (*RoleModel) DeleteById ¶
DeleteById remove a model by id
func (*RoleModel) SaveOrUpdate ¶
func (m *RoleModel) SaveOrUpdate(ctx context.Context, role RoleN, onlyFields ...string) (id int64, updated bool, err error)
SaveOrUpdate save a new Role or update it when it has a id > 0
func (*RoleModel) Update ¶
func (m *RoleModel) Update(ctx context.Context, builder query.SQLBuilder, role RoleN, onlyFields ...string) (int64, error)
Update update a model for given query
func (*RoleModel) UpdateById ¶
func (m *RoleModel) UpdateById(ctx context.Context, id int64, role RoleN, onlyFields ...string) (int64, error)
UpdateById update a model by id
func (*RoleModel) UpdateFields ¶
func (m *RoleModel) UpdateFields(ctx context.Context, kv query.KV, builders ...query.SQLBuilder) (int64, error)
UpdateFields update kv for a given query
func (*RoleModel) WithLocalScopes ¶
WithLocalScopes add a local scope for given query
func (*RoleModel) WithoutGlobalScopes ¶
WithoutGlobalScopes remove a global scope for given query
type RoleN ¶
type RoleN struct { Name null.String Description null.String Id null.Int CreatedAt null.Time UpdatedAt null.Time // contains filtered or unexported fields }
RoleN is a Role object, all fields are nullable
func (*RoleN) Users ¶
func (inst *RoleN) Users() *RoleHasManyUserRel
type User ¶
type User struct { Id int64 Name string Email string Password string RoleId int64 EnterpriseId int64 RememberToken string CreatedAt time.Time UpdatedAt time.Time DeletedAt time.Time }
type UserBelongsToEnterpriseRel ¶
type UserBelongsToEnterpriseRel struct {
// contains filtered or unexported fields
}
func (*UserBelongsToEnterpriseRel) Associate ¶
func (rel *UserBelongsToEnterpriseRel) Associate(ctx context.Context, target EnterpriseN) error
func (*UserBelongsToEnterpriseRel) Create ¶
func (rel *UserBelongsToEnterpriseRel) Create(ctx context.Context, target EnterpriseN) (int64, error)
func (*UserBelongsToEnterpriseRel) Dissociate ¶
func (rel *UserBelongsToEnterpriseRel) Dissociate(ctx context.Context) error
func (*UserBelongsToEnterpriseRel) Exists ¶
func (rel *UserBelongsToEnterpriseRel) Exists(ctx context.Context, builders ...query.SQLBuilder) (bool, error)
func (*UserBelongsToEnterpriseRel) First ¶
func (rel *UserBelongsToEnterpriseRel) First(ctx context.Context, builders ...query.SQLBuilder) (*EnterpriseN, error)
type UserBelongsToManyOrganizationRel ¶
type UserBelongsToManyOrganizationRel struct {
// contains filtered or unexported fields
}
func (*UserBelongsToManyOrganizationRel) Attach ¶
func (rel *UserBelongsToManyOrganizationRel) Attach(ctx context.Context, target OrganizationN) error
func (*UserBelongsToManyOrganizationRel) Count ¶
func (rel *UserBelongsToManyOrganizationRel) Count(ctx context.Context, builders ...query.SQLBuilder) (int64, error)
func (*UserBelongsToManyOrganizationRel) Create ¶
func (rel *UserBelongsToManyOrganizationRel) Create(ctx context.Context, target OrganizationN, builders ...query.SQLBuilder) (int64, error)
func (*UserBelongsToManyOrganizationRel) Detach ¶
func (rel *UserBelongsToManyOrganizationRel) Detach(ctx context.Context, target OrganizationN) error
func (*UserBelongsToManyOrganizationRel) DetachAll ¶
func (rel *UserBelongsToManyOrganizationRel) DetachAll(ctx context.Context) error
func (*UserBelongsToManyOrganizationRel) Exists ¶
func (rel *UserBelongsToManyOrganizationRel) Exists(ctx context.Context, builders ...query.SQLBuilder) (bool, error)
func (*UserBelongsToManyOrganizationRel) Get ¶
func (rel *UserBelongsToManyOrganizationRel) Get(ctx context.Context, builders ...query.SQLBuilder) ([]OrganizationN, error)
type UserBelongsToRoleRel ¶
type UserBelongsToRoleRel struct {
// contains filtered or unexported fields
}
func (*UserBelongsToRoleRel) Associate ¶
func (rel *UserBelongsToRoleRel) Associate(ctx context.Context, target RoleN) error
func (*UserBelongsToRoleRel) Dissociate ¶
func (rel *UserBelongsToRoleRel) Dissociate(ctx context.Context) error
func (*UserBelongsToRoleRel) Exists ¶
func (rel *UserBelongsToRoleRel) Exists(ctx context.Context, builders ...query.SQLBuilder) (bool, error)
func (*UserBelongsToRoleRel) First ¶
func (rel *UserBelongsToRoleRel) First(ctx context.Context, builders ...query.SQLBuilder) (*RoleN, error)
type UserExt ¶
type UserExt struct { Address string Qq string Wechat string UserId int64 Id int64 CreatedAt time.Time UpdatedAt time.Time }
func (UserExt) ToUserExtN ¶
type UserExtBelongsToUserRel ¶
type UserExtBelongsToUserRel struct {
// contains filtered or unexported fields
}
func (*UserExtBelongsToUserRel) Associate ¶
func (rel *UserExtBelongsToUserRel) Associate(ctx context.Context, target UserN) error
func (*UserExtBelongsToUserRel) Dissociate ¶
func (rel *UserExtBelongsToUserRel) Dissociate(ctx context.Context) error
func (*UserExtBelongsToUserRel) Exists ¶
func (rel *UserExtBelongsToUserRel) Exists(ctx context.Context, builders ...query.SQLBuilder) (bool, error)
func (*UserExtBelongsToUserRel) First ¶
func (rel *UserExtBelongsToUserRel) First(ctx context.Context, builders ...query.SQLBuilder) (*UserN, error)
type UserExtModel ¶
type UserExtModel struct {
// contains filtered or unexported fields
}
UserExtModel is a model which encapsulates the operations of the object
func NewUserExtModel ¶
func NewUserExtModel(db query.Database) *UserExtModel
NewUserExtModel create a UserExtModel
func (*UserExtModel) Condition ¶
func (m *UserExtModel) Condition(builder query.SQLBuilder) *UserExtModel
Condition add query builder to model
func (*UserExtModel) Count ¶
func (m *UserExtModel) Count(ctx context.Context, builders ...query.SQLBuilder) (int64, error)
Count return model count for a given query
func (*UserExtModel) Delete ¶
func (m *UserExtModel) Delete(ctx context.Context, builders ...query.SQLBuilder) (int64, error)
Delete remove a model
func (*UserExtModel) DeleteById ¶
DeleteById remove a model by id
func (*UserExtModel) Exists ¶
func (m *UserExtModel) Exists(ctx context.Context, builders ...query.SQLBuilder) (bool, error)
Exists return whether the records exists for a given query
func (*UserExtModel) First ¶
func (m *UserExtModel) First(ctx context.Context, builders ...query.SQLBuilder) (*UserExtN, error)
First return first result for given query
func (*UserExtModel) Get ¶
func (m *UserExtModel) Get(ctx context.Context, builders ...query.SQLBuilder) ([]UserExtN, error)
Get retrieve all results for given query
func (*UserExtModel) GetDB ¶
func (m *UserExtModel) GetDB() query.Database
GetDB return database instance
func (*UserExtModel) Paginate ¶
func (m *UserExtModel) Paginate(ctx context.Context, page int64, perPage int64, builders ...query.SQLBuilder) ([]UserExtN, query.PaginateMeta, error)
func (*UserExtModel) Save ¶
func (m *UserExtModel) Save(ctx context.Context, userExt UserExtN, onlyFields ...string) (int64, error)
Save save a UserExt to database
func (*UserExtModel) SaveOrUpdate ¶
func (m *UserExtModel) SaveOrUpdate(ctx context.Context, userExt UserExtN, onlyFields ...string) (id int64, updated bool, err error)
SaveOrUpdate save a new UserExt or update it when it has a id > 0
func (*UserExtModel) Update ¶
func (m *UserExtModel) Update(ctx context.Context, builder query.SQLBuilder, userExt UserExtN, onlyFields ...string) (int64, error)
Update update a model for given query
func (*UserExtModel) UpdateById ¶
func (m *UserExtModel) UpdateById(ctx context.Context, id int64, userExt UserExtN, onlyFields ...string) (int64, error)
UpdateById update a model by id
func (*UserExtModel) UpdateFields ¶
func (m *UserExtModel) UpdateFields(ctx context.Context, kv query.KV, builders ...query.SQLBuilder) (int64, error)
UpdateFields update kv for a given query
func (*UserExtModel) WithLocalScopes ¶
func (m *UserExtModel) WithLocalScopes(names ...string) *UserExtModel
WithLocalScopes add a local scope for given query
func (*UserExtModel) WithoutGlobalScopes ¶
func (m *UserExtModel) WithoutGlobalScopes(names ...string) *UserExtModel
WithoutGlobalScopes remove a global scope for given query
type UserExtN ¶
type UserExtN struct { Address null.String Qq null.String Wechat null.String UserId null.Int Id null.Int CreatedAt null.Time UpdatedAt null.Time // contains filtered or unexported fields }
UserExtN is a UserExt object, all fields are nullable
func (*UserExtN) SetModel ¶
func (inst *UserExtN) SetModel(userExtModel *UserExtModel)
SetModel set model for UserExt
func (*UserExtN) User ¶
func (inst *UserExtN) User() *UserExtBelongsToUserRel
type UserHasOneUserExtRel ¶
type UserHasOneUserExtRel struct {
// contains filtered or unexported fields
}
func (*UserHasOneUserExtRel) Associate ¶
func (rel *UserHasOneUserExtRel) Associate(ctx context.Context, target UserExtN) error
func (*UserHasOneUserExtRel) Dissociate ¶
func (rel *UserHasOneUserExtRel) Dissociate(ctx context.Context) error
func (*UserHasOneUserExtRel) Exists ¶
func (rel *UserHasOneUserExtRel) Exists(ctx context.Context, builders ...query.SQLBuilder) (bool, error)
func (*UserHasOneUserExtRel) First ¶
func (rel *UserHasOneUserExtRel) First(ctx context.Context, builders ...query.SQLBuilder) (*UserExtN, error)
type UserModel ¶
type UserModel struct {
// contains filtered or unexported fields
}
UserModel is a model which encapsulates the operations of the object
func (*UserModel) Condition ¶
func (m *UserModel) Condition(builder query.SQLBuilder) *UserModel
Condition add query builder to model
func (*UserModel) DeleteById ¶
DeleteById remove a model by id
func (*UserModel) ForceDelete ¶
ForceDelete permanently remove a soft deleted model from the database
func (*UserModel) ForceDeleteById ¶
ForceDeleteById permanently remove a soft deleted model from the database by id
func (*UserModel) RestoreById ¶
RestoreById restore a soft deleted model into an active state by id
func (*UserModel) SaveOrUpdate ¶
func (m *UserModel) SaveOrUpdate(ctx context.Context, user UserN, onlyFields ...string) (id int64, updated bool, err error)
SaveOrUpdate save a new User or update it when it has a id > 0
func (*UserModel) Update ¶
func (m *UserModel) Update(ctx context.Context, builder query.SQLBuilder, user UserN, onlyFields ...string) (int64, error)
Update update a model for given query
func (*UserModel) UpdateById ¶
func (m *UserModel) UpdateById(ctx context.Context, id int64, user UserN, onlyFields ...string) (int64, error)
UpdateById update a model by id
func (*UserModel) UpdateFields ¶
func (m *UserModel) UpdateFields(ctx context.Context, kv query.KV, builders ...query.SQLBuilder) (int64, error)
UpdateFields update kv for a given query
func (*UserModel) WithLocalScopes ¶
WithLocalScopes add a local scope for given query
func (*UserModel) WithTrashed ¶
WithTrashed force soft deleted models to appear in a result set
func (*UserModel) WithoutGlobalScopes ¶
WithoutGlobalScopes remove a global scope for given query
type UserN ¶
type UserN struct { Id null.Int `json:"id"` Name null.String Email null.String `json:"email"` Password null.String `json:"password" yaml:"password"` RoleId null.Int EnterpriseId null.Int RememberToken null.String `json:"remember_token" yaml:"remember_token"` CreatedAt null.Time UpdatedAt null.Time DeletedAt null.Time // contains filtered or unexported fields }
UserN is a User object, all fields are nullable
func (*UserN) Enterprise ¶
func (inst *UserN) Enterprise() *UserBelongsToEnterpriseRel
func (*UserN) Organizations ¶
func (inst *UserN) Organizations() *UserBelongsToManyOrganizationRel
func (*UserN) Role ¶
func (inst *UserN) Role() *UserBelongsToRoleRel
func (*UserN) UserExt ¶
func (inst *UserN) UserExt() *UserHasOneUserExtRel