Commit b017f461 authored by 陈曦's avatar 陈曦
Browse files

confict fixed by v117

parents 11b97147 d162604f
This diff is collapsed.
This diff is collapsed.
// Code generated by ent, DO NOT EDIT.
package ent
import (
"encoding/json"
"fmt"
"strings"
"time"
"entgo.io/ent"
"entgo.io/ent/dialect/sql"
"github.com/Wei-Shaw/sub2api/ent/authidentity"
"github.com/Wei-Shaw/sub2api/ent/authidentitychannel"
)
// AuthIdentityChannel is the model entity for the AuthIdentityChannel schema.
type AuthIdentityChannel struct {
config `json:"-"`
// ID of the ent.
ID int64 `json:"id,omitempty"`
// CreatedAt holds the value of the "created_at" field.
CreatedAt time.Time `json:"created_at,omitempty"`
// UpdatedAt holds the value of the "updated_at" field.
UpdatedAt time.Time `json:"updated_at,omitempty"`
// IdentityID holds the value of the "identity_id" field.
IdentityID int64 `json:"identity_id,omitempty"`
// ProviderType holds the value of the "provider_type" field.
ProviderType string `json:"provider_type,omitempty"`
// ProviderKey holds the value of the "provider_key" field.
ProviderKey string `json:"provider_key,omitempty"`
// Channel holds the value of the "channel" field.
Channel string `json:"channel,omitempty"`
// ChannelAppID holds the value of the "channel_app_id" field.
ChannelAppID string `json:"channel_app_id,omitempty"`
// ChannelSubject holds the value of the "channel_subject" field.
ChannelSubject string `json:"channel_subject,omitempty"`
// Metadata holds the value of the "metadata" field.
Metadata map[string]interface{} `json:"metadata,omitempty"`
// Edges holds the relations/edges for other nodes in the graph.
// The values are being populated by the AuthIdentityChannelQuery when eager-loading is set.
Edges AuthIdentityChannelEdges `json:"edges"`
selectValues sql.SelectValues
}
// AuthIdentityChannelEdges holds the relations/edges for other nodes in the graph.
type AuthIdentityChannelEdges struct {
// Identity holds the value of the identity edge.
Identity *AuthIdentity `json:"identity,omitempty"`
// loadedTypes holds the information for reporting if a
// type was loaded (or requested) in eager-loading or not.
loadedTypes [1]bool
}
// IdentityOrErr returns the Identity value or an error if the edge
// was not loaded in eager-loading, or loaded but was not found.
func (e AuthIdentityChannelEdges) IdentityOrErr() (*AuthIdentity, error) {
if e.Identity != nil {
return e.Identity, nil
} else if e.loadedTypes[0] {
return nil, &NotFoundError{label: authidentity.Label}
}
return nil, &NotLoadedError{edge: "identity"}
}
// scanValues returns the types for scanning values from sql.Rows.
func (*AuthIdentityChannel) scanValues(columns []string) ([]any, error) {
values := make([]any, len(columns))
for i := range columns {
switch columns[i] {
case authidentitychannel.FieldMetadata:
values[i] = new([]byte)
case authidentitychannel.FieldID, authidentitychannel.FieldIdentityID:
values[i] = new(sql.NullInt64)
case authidentitychannel.FieldProviderType, authidentitychannel.FieldProviderKey, authidentitychannel.FieldChannel, authidentitychannel.FieldChannelAppID, authidentitychannel.FieldChannelSubject:
values[i] = new(sql.NullString)
case authidentitychannel.FieldCreatedAt, authidentitychannel.FieldUpdatedAt:
values[i] = new(sql.NullTime)
default:
values[i] = new(sql.UnknownType)
}
}
return values, nil
}
// assignValues assigns the values that were returned from sql.Rows (after scanning)
// to the AuthIdentityChannel fields.
func (_m *AuthIdentityChannel) assignValues(columns []string, values []any) error {
if m, n := len(values), len(columns); m < n {
return fmt.Errorf("mismatch number of scan values: %d != %d", m, n)
}
for i := range columns {
switch columns[i] {
case authidentitychannel.FieldID:
value, ok := values[i].(*sql.NullInt64)
if !ok {
return fmt.Errorf("unexpected type %T for field id", value)
}
_m.ID = int64(value.Int64)
case authidentitychannel.FieldCreatedAt:
if value, ok := values[i].(*sql.NullTime); !ok {
return fmt.Errorf("unexpected type %T for field created_at", values[i])
} else if value.Valid {
_m.CreatedAt = value.Time
}
case authidentitychannel.FieldUpdatedAt:
if value, ok := values[i].(*sql.NullTime); !ok {
return fmt.Errorf("unexpected type %T for field updated_at", values[i])
} else if value.Valid {
_m.UpdatedAt = value.Time
}
case authidentitychannel.FieldIdentityID:
if value, ok := values[i].(*sql.NullInt64); !ok {
return fmt.Errorf("unexpected type %T for field identity_id", values[i])
} else if value.Valid {
_m.IdentityID = value.Int64
}
case authidentitychannel.FieldProviderType:
if value, ok := values[i].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field provider_type", values[i])
} else if value.Valid {
_m.ProviderType = value.String
}
case authidentitychannel.FieldProviderKey:
if value, ok := values[i].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field provider_key", values[i])
} else if value.Valid {
_m.ProviderKey = value.String
}
case authidentitychannel.FieldChannel:
if value, ok := values[i].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field channel", values[i])
} else if value.Valid {
_m.Channel = value.String
}
case authidentitychannel.FieldChannelAppID:
if value, ok := values[i].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field channel_app_id", values[i])
} else if value.Valid {
_m.ChannelAppID = value.String
}
case authidentitychannel.FieldChannelSubject:
if value, ok := values[i].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field channel_subject", values[i])
} else if value.Valid {
_m.ChannelSubject = value.String
}
case authidentitychannel.FieldMetadata:
if value, ok := values[i].(*[]byte); !ok {
return fmt.Errorf("unexpected type %T for field metadata", values[i])
} else if value != nil && len(*value) > 0 {
if err := json.Unmarshal(*value, &_m.Metadata); err != nil {
return fmt.Errorf("unmarshal field metadata: %w", err)
}
}
default:
_m.selectValues.Set(columns[i], values[i])
}
}
return nil
}
// Value returns the ent.Value that was dynamically selected and assigned to the AuthIdentityChannel.
// This includes values selected through modifiers, order, etc.
func (_m *AuthIdentityChannel) Value(name string) (ent.Value, error) {
return _m.selectValues.Get(name)
}
// QueryIdentity queries the "identity" edge of the AuthIdentityChannel entity.
func (_m *AuthIdentityChannel) QueryIdentity() *AuthIdentityQuery {
return NewAuthIdentityChannelClient(_m.config).QueryIdentity(_m)
}
// Update returns a builder for updating this AuthIdentityChannel.
// Note that you need to call AuthIdentityChannel.Unwrap() before calling this method if this AuthIdentityChannel
// was returned from a transaction, and the transaction was committed or rolled back.
func (_m *AuthIdentityChannel) Update() *AuthIdentityChannelUpdateOne {
return NewAuthIdentityChannelClient(_m.config).UpdateOne(_m)
}
// Unwrap unwraps the AuthIdentityChannel entity that was returned from a transaction after it was closed,
// so that all future queries will be executed through the driver which created the transaction.
func (_m *AuthIdentityChannel) Unwrap() *AuthIdentityChannel {
_tx, ok := _m.config.driver.(*txDriver)
if !ok {
panic("ent: AuthIdentityChannel is not a transactional entity")
}
_m.config.driver = _tx.drv
return _m
}
// String implements the fmt.Stringer.
func (_m *AuthIdentityChannel) String() string {
var builder strings.Builder
builder.WriteString("AuthIdentityChannel(")
builder.WriteString(fmt.Sprintf("id=%v, ", _m.ID))
builder.WriteString("created_at=")
builder.WriteString(_m.CreatedAt.Format(time.ANSIC))
builder.WriteString(", ")
builder.WriteString("updated_at=")
builder.WriteString(_m.UpdatedAt.Format(time.ANSIC))
builder.WriteString(", ")
builder.WriteString("identity_id=")
builder.WriteString(fmt.Sprintf("%v", _m.IdentityID))
builder.WriteString(", ")
builder.WriteString("provider_type=")
builder.WriteString(_m.ProviderType)
builder.WriteString(", ")
builder.WriteString("provider_key=")
builder.WriteString(_m.ProviderKey)
builder.WriteString(", ")
builder.WriteString("channel=")
builder.WriteString(_m.Channel)
builder.WriteString(", ")
builder.WriteString("channel_app_id=")
builder.WriteString(_m.ChannelAppID)
builder.WriteString(", ")
builder.WriteString("channel_subject=")
builder.WriteString(_m.ChannelSubject)
builder.WriteString(", ")
builder.WriteString("metadata=")
builder.WriteString(fmt.Sprintf("%v", _m.Metadata))
builder.WriteByte(')')
return builder.String()
}
// AuthIdentityChannels is a parsable slice of AuthIdentityChannel.
type AuthIdentityChannels []*AuthIdentityChannel
// Code generated by ent, DO NOT EDIT.
package authidentitychannel
import (
"time"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
)
const (
// Label holds the string label denoting the authidentitychannel type in the database.
Label = "auth_identity_channel"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// 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"
// FieldIdentityID holds the string denoting the identity_id field in the database.
FieldIdentityID = "identity_id"
// FieldProviderType holds the string denoting the provider_type field in the database.
FieldProviderType = "provider_type"
// FieldProviderKey holds the string denoting the provider_key field in the database.
FieldProviderKey = "provider_key"
// FieldChannel holds the string denoting the channel field in the database.
FieldChannel = "channel"
// FieldChannelAppID holds the string denoting the channel_app_id field in the database.
FieldChannelAppID = "channel_app_id"
// FieldChannelSubject holds the string denoting the channel_subject field in the database.
FieldChannelSubject = "channel_subject"
// FieldMetadata holds the string denoting the metadata field in the database.
FieldMetadata = "metadata"
// EdgeIdentity holds the string denoting the identity edge name in mutations.
EdgeIdentity = "identity"
// Table holds the table name of the authidentitychannel in the database.
Table = "auth_identity_channels"
// IdentityTable is the table that holds the identity relation/edge.
IdentityTable = "auth_identity_channels"
// IdentityInverseTable is the table name for the AuthIdentity entity.
// It exists in this package in order to avoid circular dependency with the "authidentity" package.
IdentityInverseTable = "auth_identities"
// IdentityColumn is the table column denoting the identity relation/edge.
IdentityColumn = "identity_id"
)
// Columns holds all SQL columns for authidentitychannel fields.
var Columns = []string{
FieldID,
FieldCreatedAt,
FieldUpdatedAt,
FieldIdentityID,
FieldProviderType,
FieldProviderKey,
FieldChannel,
FieldChannelAppID,
FieldChannelSubject,
FieldMetadata,
}
// 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 (
// 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
// ProviderTypeValidator is a validator for the "provider_type" field. It is called by the builders before save.
ProviderTypeValidator func(string) error
// ProviderKeyValidator is a validator for the "provider_key" field. It is called by the builders before save.
ProviderKeyValidator func(string) error
// ChannelValidator is a validator for the "channel" field. It is called by the builders before save.
ChannelValidator func(string) error
// ChannelAppIDValidator is a validator for the "channel_app_id" field. It is called by the builders before save.
ChannelAppIDValidator func(string) error
// ChannelSubjectValidator is a validator for the "channel_subject" field. It is called by the builders before save.
ChannelSubjectValidator func(string) error
// DefaultMetadata holds the default value on creation for the "metadata" field.
DefaultMetadata func() map[string]interface{}
)
// OrderOption defines the ordering options for the AuthIdentityChannel 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()
}
// 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()
}
// ByIdentityID orders the results by the identity_id field.
func ByIdentityID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldIdentityID, opts...).ToFunc()
}
// ByProviderType orders the results by the provider_type field.
func ByProviderType(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldProviderType, opts...).ToFunc()
}
// ByProviderKey orders the results by the provider_key field.
func ByProviderKey(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldProviderKey, opts...).ToFunc()
}
// ByChannel orders the results by the channel field.
func ByChannel(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldChannel, opts...).ToFunc()
}
// ByChannelAppID orders the results by the channel_app_id field.
func ByChannelAppID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldChannelAppID, opts...).ToFunc()
}
// ByChannelSubject orders the results by the channel_subject field.
func ByChannelSubject(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldChannelSubject, opts...).ToFunc()
}
// ByIdentityField orders the results by identity field.
func ByIdentityField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newIdentityStep(), sql.OrderByField(field, opts...))
}
}
func newIdentityStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(IdentityInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, IdentityTable, IdentityColumn),
)
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment