123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194 |
- package token
- import (
- "time"
- "entgo.io/ent"
- "entgo.io/ent/dialect/sql"
- "entgo.io/ent/dialect/sql/sqlgraph"
- )
- const (
-
- Label = "token"
-
- FieldID = "id"
-
- FieldCreatedAt = "created_at"
-
- FieldUpdatedAt = "updated_at"
-
- FieldDeletedAt = "deleted_at"
-
- FieldExpireAt = "expire_at"
-
- FieldToken = "token"
-
- FieldMAC = "mac"
-
- FieldOrganizationID = "organization_id"
-
- FieldAgentID = "agent_id"
-
- FieldCustomAgentBase = "custom_agent_base"
-
- FieldCustomAgentKey = "custom_agent_key"
-
- FieldOpenaiBase = "openai_base"
-
- FieldOpenaiKey = "openai_key"
-
- EdgeAgent = "agent"
-
- Table = "token"
-
- AgentTable = "token"
-
-
- AgentInverseTable = "agent"
-
- AgentColumn = "agent_id"
- )
- var Columns = []string{
- FieldID,
- FieldCreatedAt,
- FieldUpdatedAt,
- FieldDeletedAt,
- FieldExpireAt,
- FieldToken,
- FieldMAC,
- FieldOrganizationID,
- FieldAgentID,
- FieldCustomAgentBase,
- FieldCustomAgentKey,
- FieldOpenaiBase,
- FieldOpenaiKey,
- }
- func ValidColumn(column string) bool {
- for i := range Columns {
- if column == Columns[i] {
- return true
- }
- }
- return false
- }
- var (
- Hooks [1]ent.Hook
- Interceptors [1]ent.Interceptor
-
- DefaultCreatedAt func() time.Time
-
- DefaultUpdatedAt func() time.Time
-
- UpdateDefaultUpdatedAt func() time.Time
-
- DefaultToken string
-
- DefaultMAC string
-
- DefaultOrganizationID uint64
-
- DefaultAgentID uint64
-
- DefaultCustomAgentBase string
-
- DefaultCustomAgentKey string
-
- DefaultOpenaiBase string
-
- DefaultOpenaiKey string
- )
- type OrderOption func(*sql.Selector)
- func ByID(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldID, opts...).ToFunc()
- }
- func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
- }
- func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
- }
- func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
- }
- func ByExpireAt(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldExpireAt, opts...).ToFunc()
- }
- func ByToken(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldToken, opts...).ToFunc()
- }
- func ByMAC(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldMAC, opts...).ToFunc()
- }
- func ByOrganizationID(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldOrganizationID, opts...).ToFunc()
- }
- func ByAgentID(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldAgentID, opts...).ToFunc()
- }
- func ByCustomAgentBase(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldCustomAgentBase, opts...).ToFunc()
- }
- func ByCustomAgentKey(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldCustomAgentKey, opts...).ToFunc()
- }
- func ByOpenaiBase(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldOpenaiBase, opts...).ToFunc()
- }
- func ByOpenaiKey(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldOpenaiKey, opts...).ToFunc()
- }
- func ByAgentField(field string, opts ...sql.OrderTermOption) OrderOption {
- return func(s *sql.Selector) {
- sqlgraph.OrderByNeighborTerms(s, newAgentStep(), sql.OrderByField(field, opts...))
- }
- }
- func newAgentStep() *sqlgraph.Step {
- return sqlgraph.NewStep(
- sqlgraph.From(Table, FieldID),
- sqlgraph.To(AgentInverseTable, FieldID),
- sqlgraph.Edge(sqlgraph.M2O, true, AgentTable, AgentColumn),
- )
- }
|