123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- package label
- import (
- "time"
- "entgo.io/ent"
- "entgo.io/ent/dialect/sql"
- "entgo.io/ent/dialect/sql/sqlgraph"
- )
- const (
-
- Label = "label"
-
- FieldID = "id"
-
- FieldCreatedAt = "created_at"
-
- FieldUpdatedAt = "updated_at"
-
- FieldStatus = "status"
-
- FieldDeletedAt = "deleted_at"
-
- FieldType = "type"
-
- FieldName = "name"
-
- FieldFrom = "from"
-
- FieldMode = "mode"
-
- FieldConditions = "conditions"
-
- EdgeLabelRelationships = "label_relationships"
-
- Table = "label"
-
- LabelRelationshipsTable = "label_relationship"
-
-
- LabelRelationshipsInverseTable = "label_relationship"
-
- LabelRelationshipsColumn = "label_id"
- )
- var Columns = []string{
- FieldID,
- FieldCreatedAt,
- FieldUpdatedAt,
- FieldStatus,
- FieldDeletedAt,
- FieldType,
- FieldName,
- FieldFrom,
- FieldMode,
- FieldConditions,
- }
- 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
-
- DefaultStatus uint8
-
- DefaultType int
-
- DefaultName string
-
- DefaultFrom int
-
- DefaultMode int
-
- DefaultConditions 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 ByStatus(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldStatus, opts...).ToFunc()
- }
- func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
- }
- func ByType(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldType, opts...).ToFunc()
- }
- func ByName(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldName, opts...).ToFunc()
- }
- func ByFrom(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldFrom, opts...).ToFunc()
- }
- func ByMode(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldMode, opts...).ToFunc()
- }
- func ByConditions(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldConditions, opts...).ToFunc()
- }
- func ByLabelRelationshipsCount(opts ...sql.OrderTermOption) OrderOption {
- return func(s *sql.Selector) {
- sqlgraph.OrderByNeighborsCount(s, newLabelRelationshipsStep(), opts...)
- }
- }
- func ByLabelRelationships(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
- return func(s *sql.Selector) {
- sqlgraph.OrderByNeighborTerms(s, newLabelRelationshipsStep(), append([]sql.OrderTerm{term}, terms...)...)
- }
- }
- func newLabelRelationshipsStep() *sqlgraph.Step {
- return sqlgraph.NewStep(
- sqlgraph.From(Table, FieldID),
- sqlgraph.To(LabelRelationshipsInverseTable, FieldID),
- sqlgraph.Edge(sqlgraph.O2M, false, LabelRelationshipsTable, LabelRelationshipsColumn),
- )
- }
|