123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176 |
- package creditusage
- import (
- "time"
- "entgo.io/ent"
- "entgo.io/ent/dialect/sql"
- )
- const (
-
- Label = "credit_usage"
-
- FieldID = "id"
-
- FieldCreatedAt = "created_at"
-
- FieldUpdatedAt = "updated_at"
-
- FieldDeletedAt = "deleted_at"
-
- FieldUserID = "user_id"
-
- FieldNumber = "number"
-
- FieldStatus = "status"
-
- FieldNtype = "ntype"
-
- FieldTable = "table"
-
- FieldOrganizationID = "organization_id"
-
- FieldNid = "nid"
-
- FieldReason = "reason"
-
- FieldOperator = "operator"
-
- Table = "credit_usage"
- )
- var Columns = []string{
- FieldID,
- FieldCreatedAt,
- FieldUpdatedAt,
- FieldDeletedAt,
- FieldUserID,
- FieldNumber,
- FieldStatus,
- FieldNtype,
- FieldTable,
- FieldOrganizationID,
- FieldNid,
- FieldReason,
- FieldOperator,
- }
- 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
-
- UserIDValidator func(string) error
-
- DefaultStatus int
-
- StatusValidator func(int) error
-
- DefaultNtype int
-
- DefaultTable string
-
- OrganizationIDValidator func(uint64) error
-
- DefaultNid uint64
-
- DefaultReason string
-
- ReasonValidator func(string) error
-
- DefaultOperator string
-
- OperatorValidator func(string) error
- )
- 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 ByUserID(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldUserID, opts...).ToFunc()
- }
- func ByNumber(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldNumber, opts...).ToFunc()
- }
- func ByStatus(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldStatus, opts...).ToFunc()
- }
- func ByNtype(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldNtype, opts...).ToFunc()
- }
- func ByTable(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldTable, opts...).ToFunc()
- }
- func ByOrganizationID(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldOrganizationID, opts...).ToFunc()
- }
- func ByNid(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldNid, opts...).ToFunc()
- }
- func ByReason(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldReason, opts...).ToFunc()
- }
- func ByOperator(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldOperator, opts...).ToFunc()
- }
|