mirror of
https://github.com/chaitin/MonkeyCode.git
synced 2026-02-02 06:43:23 +08:00
123 lines
4.7 KiB
Go
123 lines
4.7 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package setting
|
|
|
|
import (
|
|
"time"
|
|
|
|
"entgo.io/ent/dialect/sql"
|
|
)
|
|
|
|
const (
|
|
// Label holds the string label denoting the setting type in the database.
|
|
Label = "setting"
|
|
// FieldID holds the string denoting the id field in the database.
|
|
FieldID = "id"
|
|
// FieldEnableSSO holds the string denoting the enable_sso field in the database.
|
|
FieldEnableSSO = "enable_sso"
|
|
// FieldForceTwoFactorAuth holds the string denoting the force_two_factor_auth field in the database.
|
|
FieldForceTwoFactorAuth = "force_two_factor_auth"
|
|
// FieldDisablePasswordLogin holds the string denoting the disable_password_login field in the database.
|
|
FieldDisablePasswordLogin = "disable_password_login"
|
|
// FieldEnableDingtalkOauth holds the string denoting the enable_dingtalk_oauth field in the database.
|
|
FieldEnableDingtalkOauth = "enable_dingtalk_oauth"
|
|
// FieldDingtalkClientID holds the string denoting the dingtalk_client_id field in the database.
|
|
FieldDingtalkClientID = "dingtalk_client_id"
|
|
// FieldDingtalkClientSecret holds the string denoting the dingtalk_client_secret field in the database.
|
|
FieldDingtalkClientSecret = "dingtalk_client_secret"
|
|
// FieldCreatedAt holds the string denoting the created_at field in the database.
|
|
FieldCreatedAt = "created_at"
|
|
// FieldUpdatedAt holds the string denoting the updated_at field in the database.
|
|
FieldUpdatedAt = "updated_at"
|
|
// Table holds the table name of the setting in the database.
|
|
Table = "settings"
|
|
)
|
|
|
|
// Columns holds all SQL columns for setting fields.
|
|
var Columns = []string{
|
|
FieldID,
|
|
FieldEnableSSO,
|
|
FieldForceTwoFactorAuth,
|
|
FieldDisablePasswordLogin,
|
|
FieldEnableDingtalkOauth,
|
|
FieldDingtalkClientID,
|
|
FieldDingtalkClientSecret,
|
|
FieldCreatedAt,
|
|
FieldUpdatedAt,
|
|
}
|
|
|
|
// ValidColumn reports if the column name is valid (part of the table columns).
|
|
func ValidColumn(column string) bool {
|
|
for i := range Columns {
|
|
if column == Columns[i] {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
var (
|
|
// DefaultEnableSSO holds the default value on creation for the "enable_sso" field.
|
|
DefaultEnableSSO bool
|
|
// DefaultForceTwoFactorAuth holds the default value on creation for the "force_two_factor_auth" field.
|
|
DefaultForceTwoFactorAuth bool
|
|
// DefaultDisablePasswordLogin holds the default value on creation for the "disable_password_login" field.
|
|
DefaultDisablePasswordLogin bool
|
|
// DefaultEnableDingtalkOauth holds the default value on creation for the "enable_dingtalk_oauth" field.
|
|
DefaultEnableDingtalkOauth bool
|
|
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
|
|
DefaultCreatedAt func() time.Time
|
|
// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
|
|
DefaultUpdatedAt func() time.Time
|
|
// UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
|
|
UpdateDefaultUpdatedAt func() time.Time
|
|
)
|
|
|
|
// OrderOption defines the ordering options for the Setting queries.
|
|
type OrderOption func(*sql.Selector)
|
|
|
|
// ByID orders the results by the id field.
|
|
func ByID(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldID, opts...).ToFunc()
|
|
}
|
|
|
|
// ByEnableSSO orders the results by the enable_sso field.
|
|
func ByEnableSSO(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldEnableSSO, opts...).ToFunc()
|
|
}
|
|
|
|
// ByForceTwoFactorAuth orders the results by the force_two_factor_auth field.
|
|
func ByForceTwoFactorAuth(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldForceTwoFactorAuth, opts...).ToFunc()
|
|
}
|
|
|
|
// ByDisablePasswordLogin orders the results by the disable_password_login field.
|
|
func ByDisablePasswordLogin(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldDisablePasswordLogin, opts...).ToFunc()
|
|
}
|
|
|
|
// ByEnableDingtalkOauth orders the results by the enable_dingtalk_oauth field.
|
|
func ByEnableDingtalkOauth(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldEnableDingtalkOauth, opts...).ToFunc()
|
|
}
|
|
|
|
// ByDingtalkClientID orders the results by the dingtalk_client_id field.
|
|
func ByDingtalkClientID(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldDingtalkClientID, opts...).ToFunc()
|
|
}
|
|
|
|
// ByDingtalkClientSecret orders the results by the dingtalk_client_secret field.
|
|
func ByDingtalkClientSecret(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldDingtalkClientSecret, opts...).ToFunc()
|
|
}
|
|
|
|
// ByCreatedAt orders the results by the created_at field.
|
|
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
|
|
}
|
|
|
|
// ByUpdatedAt orders the results by the updated_at field.
|
|
func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
|
|
return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
|
|
}
|