123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269 |
- package messagerecords
- import (
- "time"
- "entgo.io/ent"
- "entgo.io/ent/dialect/sql"
- "entgo.io/ent/dialect/sql/sqlgraph"
- )
- const (
-
- Label = "message_records"
-
- FieldID = "id"
-
- FieldCreatedAt = "created_at"
-
- FieldUpdatedAt = "updated_at"
-
- FieldStatus = "status"
-
- FieldDeletedAt = "deleted_at"
-
- FieldBotWxid = "bot_wxid"
-
- FieldContactID = "contact_id"
-
- FieldContactType = "contact_type"
-
- FieldContactWxid = "contact_wxid"
-
- FieldContentType = "content_type"
-
- FieldContent = "content"
-
- FieldMeta = "meta"
-
- FieldErrorDetail = "error_detail"
-
- FieldSendTime = "send_time"
-
- FieldSourceType = "source_type"
-
- FieldSourceID = "source_id"
-
- FieldSubSourceID = "sub_source_id"
-
- EdgeSopStage = "sop_stage"
-
- EdgeSopNode = "sop_node"
-
- EdgeMessageContact = "message_contact"
-
- Table = "message_records"
-
- SopStageTable = "message_records"
-
-
- SopStageInverseTable = "sop_stage"
-
- SopStageColumn = "source_id"
-
- SopNodeTable = "message_records"
-
-
- SopNodeInverseTable = "sop_node"
-
- SopNodeColumn = "sub_source_id"
-
- MessageContactTable = "message_records"
-
-
- MessageContactInverseTable = "contact"
-
- MessageContactColumn = "contact_id"
- )
- var Columns = []string{
- FieldID,
- FieldCreatedAt,
- FieldUpdatedAt,
- FieldStatus,
- FieldDeletedAt,
- FieldBotWxid,
- FieldContactID,
- FieldContactType,
- FieldContactWxid,
- FieldContentType,
- FieldContent,
- FieldMeta,
- FieldErrorDetail,
- FieldSendTime,
- FieldSourceType,
- FieldSourceID,
- FieldSubSourceID,
- }
- 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
-
- DefaultContactType int
-
- DefaultContactWxid string
-
- DefaultContentType int
-
- DefaultContent string
-
- DefaultErrorDetail string
-
- DefaultSourceType int
-
- DefaultSourceID uint64
-
- DefaultSubSourceID uint64
- )
- 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 ByBotWxid(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldBotWxid, opts...).ToFunc()
- }
- func ByContactID(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldContactID, opts...).ToFunc()
- }
- func ByContactType(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldContactType, opts...).ToFunc()
- }
- func ByContactWxid(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldContactWxid, opts...).ToFunc()
- }
- func ByContentType(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldContentType, opts...).ToFunc()
- }
- func ByContent(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldContent, opts...).ToFunc()
- }
- func ByErrorDetail(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldErrorDetail, opts...).ToFunc()
- }
- func BySendTime(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldSendTime, opts...).ToFunc()
- }
- func BySourceType(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldSourceType, opts...).ToFunc()
- }
- func BySourceID(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldSourceID, opts...).ToFunc()
- }
- func BySubSourceID(opts ...sql.OrderTermOption) OrderOption {
- return sql.OrderByField(FieldSubSourceID, opts...).ToFunc()
- }
- func BySopStageField(field string, opts ...sql.OrderTermOption) OrderOption {
- return func(s *sql.Selector) {
- sqlgraph.OrderByNeighborTerms(s, newSopStageStep(), sql.OrderByField(field, opts...))
- }
- }
- func BySopNodeField(field string, opts ...sql.OrderTermOption) OrderOption {
- return func(s *sql.Selector) {
- sqlgraph.OrderByNeighborTerms(s, newSopNodeStep(), sql.OrderByField(field, opts...))
- }
- }
- func ByMessageContactField(field string, opts ...sql.OrderTermOption) OrderOption {
- return func(s *sql.Selector) {
- sqlgraph.OrderByNeighborTerms(s, newMessageContactStep(), sql.OrderByField(field, opts...))
- }
- }
- func newSopStageStep() *sqlgraph.Step {
- return sqlgraph.NewStep(
- sqlgraph.From(Table, FieldID),
- sqlgraph.To(SopStageInverseTable, FieldID),
- sqlgraph.Edge(sqlgraph.M2O, true, SopStageTable, SopStageColumn),
- )
- }
- func newSopNodeStep() *sqlgraph.Step {
- return sqlgraph.NewStep(
- sqlgraph.From(Table, FieldID),
- sqlgraph.To(SopNodeInverseTable, FieldID),
- sqlgraph.Edge(sqlgraph.M2O, true, SopNodeTable, SopNodeColumn),
- )
- }
- func newMessageContactStep() *sqlgraph.Step {
- return sqlgraph.NewStep(
- sqlgraph.From(Table, FieldID),
- sqlgraph.To(MessageContactInverseTable, FieldID),
- sqlgraph.Edge(sqlgraph.M2O, true, MessageContactTable, MessageContactColumn),
- )
- }
|