Files
MonkeyCode/backend/db/setting/setting.go
2025-07-31 17:36:56 +08:00

121 lines
4.4 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"
// FieldEnableAutoLogin holds the string denoting the enable_auto_login field in the database.
FieldEnableAutoLogin = "enable_auto_login"
// FieldDingtalkOauth holds the string denoting the dingtalk_oauth field in the database.
FieldDingtalkOauth = "dingtalk_oauth"
// FieldCustomOauth holds the string denoting the custom_oauth field in the database.
FieldCustomOauth = "custom_oauth"
// FieldBaseURL holds the string denoting the base_url field in the database.
FieldBaseURL = "base_url"
// 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,
FieldEnableAutoLogin,
FieldDingtalkOauth,
FieldCustomOauth,
FieldBaseURL,
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
// DefaultEnableAutoLogin holds the default value on creation for the "enable_auto_login" field.
DefaultEnableAutoLogin 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()
}
// ByEnableAutoLogin orders the results by the enable_auto_login field.
func ByEnableAutoLogin(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldEnableAutoLogin, opts...).ToFunc()
}
// ByBaseURL orders the results by the base_url field.
func ByBaseURL(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldBaseURL, 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()
}