12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319 |
- // Code generated by ent, DO NOT EDIT.
- package intercept
- import (
- "context"
- "fmt"
- "wechat-api/ent"
- "wechat-api/ent/agent"
- "wechat-api/ent/agentbase"
- "wechat-api/ent/aliyunavatar"
- "wechat-api/ent/allocagent"
- "wechat-api/ent/batchmsg"
- "wechat-api/ent/category"
- "wechat-api/ent/chatrecords"
- "wechat-api/ent/chatsession"
- "wechat-api/ent/contact"
- "wechat-api/ent/creditbalance"
- "wechat-api/ent/creditusage"
- "wechat-api/ent/employee"
- "wechat-api/ent/employeeconfig"
- "wechat-api/ent/label"
- "wechat-api/ent/labelrelationship"
- "wechat-api/ent/labeltagging"
- "wechat-api/ent/message"
- "wechat-api/ent/messagerecords"
- "wechat-api/ent/msg"
- "wechat-api/ent/payrecharge"
- "wechat-api/ent/predicate"
- "wechat-api/ent/server"
- "wechat-api/ent/sopnode"
- "wechat-api/ent/sopstage"
- "wechat-api/ent/soptask"
- "wechat-api/ent/token"
- "wechat-api/ent/tutorial"
- "wechat-api/ent/usagedetail"
- "wechat-api/ent/usagestatisticday"
- "wechat-api/ent/usagestatistichour"
- "wechat-api/ent/usagestatisticmonth"
- "wechat-api/ent/usagetotal"
- "wechat-api/ent/whatsapp"
- "wechat-api/ent/whatsappchannel"
- "wechat-api/ent/workexperience"
- "wechat-api/ent/wpchatroom"
- "wechat-api/ent/wpchatroommember"
- "wechat-api/ent/wx"
- "wechat-api/ent/wxcard"
- "wechat-api/ent/wxcarduser"
- "wechat-api/ent/wxcardvisit"
- "entgo.io/ent/dialect/sql"
- )
- // The Query interface represents an operation that queries a graph.
- // By using this interface, users can write generic code that manipulates
- // query builders of different types.
- type Query interface {
- // Type returns the string representation of the query type.
- Type() string
- // Limit the number of records to be returned by this query.
- Limit(int)
- // Offset to start from.
- Offset(int)
- // Unique configures the query builder to filter duplicate records.
- Unique(bool)
- // Order specifies how the records should be ordered.
- Order(...func(*sql.Selector))
- // WhereP appends storage-level predicates to the query builder. Using this method, users
- // can use type-assertion to append predicates that do not depend on any generated package.
- WhereP(...func(*sql.Selector))
- }
- // The Func type is an adapter that allows ordinary functions to be used as interceptors.
- // Unlike traversal functions, interceptors are skipped during graph traversals. Note that the
- // implementation of Func is different from the one defined in entgo.io/ent.InterceptFunc.
- type Func func(context.Context, Query) error
- // Intercept calls f(ctx, q) and then applied the next Querier.
- func (f Func) Intercept(next ent.Querier) ent.Querier {
- return ent.QuerierFunc(func(ctx context.Context, q ent.Query) (ent.Value, error) {
- query, err := NewQuery(q)
- if err != nil {
- return nil, err
- }
- if err := f(ctx, query); err != nil {
- return nil, err
- }
- return next.Query(ctx, q)
- })
- }
- // The TraverseFunc type is an adapter to allow the use of ordinary function as Traverser.
- // If f is a function with the appropriate signature, TraverseFunc(f) is a Traverser that calls f.
- type TraverseFunc func(context.Context, Query) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseFunc) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseFunc) Traverse(ctx context.Context, q ent.Query) error {
- query, err := NewQuery(q)
- if err != nil {
- return err
- }
- return f(ctx, query)
- }
- // The AgentFunc type is an adapter to allow the use of ordinary function as a Querier.
- type AgentFunc func(context.Context, *ent.AgentQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f AgentFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.AgentQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.AgentQuery", q)
- }
- // The TraverseAgent type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseAgent func(context.Context, *ent.AgentQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseAgent) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseAgent) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.AgentQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.AgentQuery", q)
- }
- // The AgentBaseFunc type is an adapter to allow the use of ordinary function as a Querier.
- type AgentBaseFunc func(context.Context, *ent.AgentBaseQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f AgentBaseFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.AgentBaseQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.AgentBaseQuery", q)
- }
- // The TraverseAgentBase type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseAgentBase func(context.Context, *ent.AgentBaseQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseAgentBase) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseAgentBase) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.AgentBaseQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.AgentBaseQuery", q)
- }
- // The AliyunAvatarFunc type is an adapter to allow the use of ordinary function as a Querier.
- type AliyunAvatarFunc func(context.Context, *ent.AliyunAvatarQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f AliyunAvatarFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.AliyunAvatarQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.AliyunAvatarQuery", q)
- }
- // The TraverseAliyunAvatar type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseAliyunAvatar func(context.Context, *ent.AliyunAvatarQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseAliyunAvatar) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseAliyunAvatar) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.AliyunAvatarQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.AliyunAvatarQuery", q)
- }
- // The AllocAgentFunc type is an adapter to allow the use of ordinary function as a Querier.
- type AllocAgentFunc func(context.Context, *ent.AllocAgentQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f AllocAgentFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.AllocAgentQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.AllocAgentQuery", q)
- }
- // The TraverseAllocAgent type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseAllocAgent func(context.Context, *ent.AllocAgentQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseAllocAgent) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseAllocAgent) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.AllocAgentQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.AllocAgentQuery", q)
- }
- // The BatchMsgFunc type is an adapter to allow the use of ordinary function as a Querier.
- type BatchMsgFunc func(context.Context, *ent.BatchMsgQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f BatchMsgFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.BatchMsgQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.BatchMsgQuery", q)
- }
- // The TraverseBatchMsg type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseBatchMsg func(context.Context, *ent.BatchMsgQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseBatchMsg) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseBatchMsg) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.BatchMsgQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.BatchMsgQuery", q)
- }
- // The CategoryFunc type is an adapter to allow the use of ordinary function as a Querier.
- type CategoryFunc func(context.Context, *ent.CategoryQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f CategoryFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.CategoryQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.CategoryQuery", q)
- }
- // The TraverseCategory type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseCategory func(context.Context, *ent.CategoryQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseCategory) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseCategory) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.CategoryQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.CategoryQuery", q)
- }
- // The ChatRecordsFunc type is an adapter to allow the use of ordinary function as a Querier.
- type ChatRecordsFunc func(context.Context, *ent.ChatRecordsQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f ChatRecordsFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.ChatRecordsQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.ChatRecordsQuery", q)
- }
- // The TraverseChatRecords type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseChatRecords func(context.Context, *ent.ChatRecordsQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseChatRecords) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseChatRecords) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.ChatRecordsQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.ChatRecordsQuery", q)
- }
- // The ChatSessionFunc type is an adapter to allow the use of ordinary function as a Querier.
- type ChatSessionFunc func(context.Context, *ent.ChatSessionQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f ChatSessionFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.ChatSessionQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.ChatSessionQuery", q)
- }
- // The TraverseChatSession type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseChatSession func(context.Context, *ent.ChatSessionQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseChatSession) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseChatSession) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.ChatSessionQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.ChatSessionQuery", q)
- }
- // The ContactFunc type is an adapter to allow the use of ordinary function as a Querier.
- type ContactFunc func(context.Context, *ent.ContactQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f ContactFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.ContactQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.ContactQuery", q)
- }
- // The TraverseContact type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseContact func(context.Context, *ent.ContactQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseContact) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseContact) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.ContactQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.ContactQuery", q)
- }
- // The CreditBalanceFunc type is an adapter to allow the use of ordinary function as a Querier.
- type CreditBalanceFunc func(context.Context, *ent.CreditBalanceQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f CreditBalanceFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.CreditBalanceQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.CreditBalanceQuery", q)
- }
- // The TraverseCreditBalance type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseCreditBalance func(context.Context, *ent.CreditBalanceQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseCreditBalance) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseCreditBalance) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.CreditBalanceQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.CreditBalanceQuery", q)
- }
- // The CreditUsageFunc type is an adapter to allow the use of ordinary function as a Querier.
- type CreditUsageFunc func(context.Context, *ent.CreditUsageQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f CreditUsageFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.CreditUsageQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.CreditUsageQuery", q)
- }
- // The TraverseCreditUsage type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseCreditUsage func(context.Context, *ent.CreditUsageQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseCreditUsage) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseCreditUsage) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.CreditUsageQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.CreditUsageQuery", q)
- }
- // The EmployeeFunc type is an adapter to allow the use of ordinary function as a Querier.
- type EmployeeFunc func(context.Context, *ent.EmployeeQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f EmployeeFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.EmployeeQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.EmployeeQuery", q)
- }
- // The TraverseEmployee type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseEmployee func(context.Context, *ent.EmployeeQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseEmployee) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseEmployee) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.EmployeeQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.EmployeeQuery", q)
- }
- // The EmployeeConfigFunc type is an adapter to allow the use of ordinary function as a Querier.
- type EmployeeConfigFunc func(context.Context, *ent.EmployeeConfigQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f EmployeeConfigFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.EmployeeConfigQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.EmployeeConfigQuery", q)
- }
- // The TraverseEmployeeConfig type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseEmployeeConfig func(context.Context, *ent.EmployeeConfigQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseEmployeeConfig) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseEmployeeConfig) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.EmployeeConfigQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.EmployeeConfigQuery", q)
- }
- // The LabelFunc type is an adapter to allow the use of ordinary function as a Querier.
- type LabelFunc func(context.Context, *ent.LabelQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f LabelFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.LabelQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.LabelQuery", q)
- }
- // The TraverseLabel type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseLabel func(context.Context, *ent.LabelQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseLabel) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseLabel) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.LabelQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.LabelQuery", q)
- }
- // The LabelRelationshipFunc type is an adapter to allow the use of ordinary function as a Querier.
- type LabelRelationshipFunc func(context.Context, *ent.LabelRelationshipQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f LabelRelationshipFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.LabelRelationshipQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.LabelRelationshipQuery", q)
- }
- // The TraverseLabelRelationship type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseLabelRelationship func(context.Context, *ent.LabelRelationshipQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseLabelRelationship) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseLabelRelationship) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.LabelRelationshipQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.LabelRelationshipQuery", q)
- }
- // The LabelTaggingFunc type is an adapter to allow the use of ordinary function as a Querier.
- type LabelTaggingFunc func(context.Context, *ent.LabelTaggingQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f LabelTaggingFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.LabelTaggingQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.LabelTaggingQuery", q)
- }
- // The TraverseLabelTagging type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseLabelTagging func(context.Context, *ent.LabelTaggingQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseLabelTagging) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseLabelTagging) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.LabelTaggingQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.LabelTaggingQuery", q)
- }
- // The MessageFunc type is an adapter to allow the use of ordinary function as a Querier.
- type MessageFunc func(context.Context, *ent.MessageQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f MessageFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.MessageQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.MessageQuery", q)
- }
- // The TraverseMessage type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseMessage func(context.Context, *ent.MessageQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseMessage) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseMessage) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.MessageQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.MessageQuery", q)
- }
- // The MessageRecordsFunc type is an adapter to allow the use of ordinary function as a Querier.
- type MessageRecordsFunc func(context.Context, *ent.MessageRecordsQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f MessageRecordsFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.MessageRecordsQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.MessageRecordsQuery", q)
- }
- // The TraverseMessageRecords type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseMessageRecords func(context.Context, *ent.MessageRecordsQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseMessageRecords) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseMessageRecords) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.MessageRecordsQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.MessageRecordsQuery", q)
- }
- // The MsgFunc type is an adapter to allow the use of ordinary function as a Querier.
- type MsgFunc func(context.Context, *ent.MsgQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f MsgFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.MsgQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.MsgQuery", q)
- }
- // The TraverseMsg type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseMsg func(context.Context, *ent.MsgQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseMsg) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseMsg) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.MsgQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.MsgQuery", q)
- }
- // The PayRechargeFunc type is an adapter to allow the use of ordinary function as a Querier.
- type PayRechargeFunc func(context.Context, *ent.PayRechargeQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f PayRechargeFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.PayRechargeQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.PayRechargeQuery", q)
- }
- // The TraversePayRecharge type is an adapter to allow the use of ordinary function as Traverser.
- type TraversePayRecharge func(context.Context, *ent.PayRechargeQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraversePayRecharge) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraversePayRecharge) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.PayRechargeQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.PayRechargeQuery", q)
- }
- // The ServerFunc type is an adapter to allow the use of ordinary function as a Querier.
- type ServerFunc func(context.Context, *ent.ServerQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f ServerFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.ServerQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.ServerQuery", q)
- }
- // The TraverseServer type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseServer func(context.Context, *ent.ServerQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseServer) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseServer) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.ServerQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.ServerQuery", q)
- }
- // The SopNodeFunc type is an adapter to allow the use of ordinary function as a Querier.
- type SopNodeFunc func(context.Context, *ent.SopNodeQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f SopNodeFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.SopNodeQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.SopNodeQuery", q)
- }
- // The TraverseSopNode type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseSopNode func(context.Context, *ent.SopNodeQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseSopNode) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseSopNode) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.SopNodeQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.SopNodeQuery", q)
- }
- // The SopStageFunc type is an adapter to allow the use of ordinary function as a Querier.
- type SopStageFunc func(context.Context, *ent.SopStageQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f SopStageFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.SopStageQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.SopStageQuery", q)
- }
- // The TraverseSopStage type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseSopStage func(context.Context, *ent.SopStageQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseSopStage) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseSopStage) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.SopStageQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.SopStageQuery", q)
- }
- // The SopTaskFunc type is an adapter to allow the use of ordinary function as a Querier.
- type SopTaskFunc func(context.Context, *ent.SopTaskQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f SopTaskFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.SopTaskQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.SopTaskQuery", q)
- }
- // The TraverseSopTask type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseSopTask func(context.Context, *ent.SopTaskQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseSopTask) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseSopTask) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.SopTaskQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.SopTaskQuery", q)
- }
- // The TokenFunc type is an adapter to allow the use of ordinary function as a Querier.
- type TokenFunc func(context.Context, *ent.TokenQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f TokenFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.TokenQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.TokenQuery", q)
- }
- // The TraverseToken type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseToken func(context.Context, *ent.TokenQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseToken) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseToken) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.TokenQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.TokenQuery", q)
- }
- // The TutorialFunc type is an adapter to allow the use of ordinary function as a Querier.
- type TutorialFunc func(context.Context, *ent.TutorialQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f TutorialFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.TutorialQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.TutorialQuery", q)
- }
- // The TraverseTutorial type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseTutorial func(context.Context, *ent.TutorialQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseTutorial) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseTutorial) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.TutorialQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.TutorialQuery", q)
- }
- // The UsageDetailFunc type is an adapter to allow the use of ordinary function as a Querier.
- type UsageDetailFunc func(context.Context, *ent.UsageDetailQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f UsageDetailFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.UsageDetailQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.UsageDetailQuery", q)
- }
- // The TraverseUsageDetail type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseUsageDetail func(context.Context, *ent.UsageDetailQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseUsageDetail) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseUsageDetail) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.UsageDetailQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.UsageDetailQuery", q)
- }
- // The UsageStatisticDayFunc type is an adapter to allow the use of ordinary function as a Querier.
- type UsageStatisticDayFunc func(context.Context, *ent.UsageStatisticDayQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f UsageStatisticDayFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.UsageStatisticDayQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.UsageStatisticDayQuery", q)
- }
- // The TraverseUsageStatisticDay type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseUsageStatisticDay func(context.Context, *ent.UsageStatisticDayQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseUsageStatisticDay) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseUsageStatisticDay) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.UsageStatisticDayQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.UsageStatisticDayQuery", q)
- }
- // The UsageStatisticHourFunc type is an adapter to allow the use of ordinary function as a Querier.
- type UsageStatisticHourFunc func(context.Context, *ent.UsageStatisticHourQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f UsageStatisticHourFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.UsageStatisticHourQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.UsageStatisticHourQuery", q)
- }
- // The TraverseUsageStatisticHour type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseUsageStatisticHour func(context.Context, *ent.UsageStatisticHourQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseUsageStatisticHour) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseUsageStatisticHour) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.UsageStatisticHourQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.UsageStatisticHourQuery", q)
- }
- // The UsageStatisticMonthFunc type is an adapter to allow the use of ordinary function as a Querier.
- type UsageStatisticMonthFunc func(context.Context, *ent.UsageStatisticMonthQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f UsageStatisticMonthFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.UsageStatisticMonthQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.UsageStatisticMonthQuery", q)
- }
- // The TraverseUsageStatisticMonth type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseUsageStatisticMonth func(context.Context, *ent.UsageStatisticMonthQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseUsageStatisticMonth) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseUsageStatisticMonth) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.UsageStatisticMonthQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.UsageStatisticMonthQuery", q)
- }
- // The UsageTotalFunc type is an adapter to allow the use of ordinary function as a Querier.
- type UsageTotalFunc func(context.Context, *ent.UsageTotalQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f UsageTotalFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.UsageTotalQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.UsageTotalQuery", q)
- }
- // The TraverseUsageTotal type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseUsageTotal func(context.Context, *ent.UsageTotalQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseUsageTotal) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseUsageTotal) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.UsageTotalQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.UsageTotalQuery", q)
- }
- // The WhatsappFunc type is an adapter to allow the use of ordinary function as a Querier.
- type WhatsappFunc func(context.Context, *ent.WhatsappQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f WhatsappFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.WhatsappQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.WhatsappQuery", q)
- }
- // The TraverseWhatsapp type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseWhatsapp func(context.Context, *ent.WhatsappQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseWhatsapp) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseWhatsapp) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.WhatsappQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.WhatsappQuery", q)
- }
- // The WhatsappChannelFunc type is an adapter to allow the use of ordinary function as a Querier.
- type WhatsappChannelFunc func(context.Context, *ent.WhatsappChannelQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f WhatsappChannelFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.WhatsappChannelQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.WhatsappChannelQuery", q)
- }
- // The TraverseWhatsappChannel type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseWhatsappChannel func(context.Context, *ent.WhatsappChannelQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseWhatsappChannel) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseWhatsappChannel) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.WhatsappChannelQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.WhatsappChannelQuery", q)
- }
- // The WorkExperienceFunc type is an adapter to allow the use of ordinary function as a Querier.
- type WorkExperienceFunc func(context.Context, *ent.WorkExperienceQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f WorkExperienceFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.WorkExperienceQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.WorkExperienceQuery", q)
- }
- // The TraverseWorkExperience type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseWorkExperience func(context.Context, *ent.WorkExperienceQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseWorkExperience) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseWorkExperience) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.WorkExperienceQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.WorkExperienceQuery", q)
- }
- // The WpChatroomFunc type is an adapter to allow the use of ordinary function as a Querier.
- type WpChatroomFunc func(context.Context, *ent.WpChatroomQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f WpChatroomFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.WpChatroomQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.WpChatroomQuery", q)
- }
- // The TraverseWpChatroom type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseWpChatroom func(context.Context, *ent.WpChatroomQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseWpChatroom) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseWpChatroom) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.WpChatroomQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.WpChatroomQuery", q)
- }
- // The WpChatroomMemberFunc type is an adapter to allow the use of ordinary function as a Querier.
- type WpChatroomMemberFunc func(context.Context, *ent.WpChatroomMemberQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f WpChatroomMemberFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.WpChatroomMemberQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.WpChatroomMemberQuery", q)
- }
- // The TraverseWpChatroomMember type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseWpChatroomMember func(context.Context, *ent.WpChatroomMemberQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseWpChatroomMember) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseWpChatroomMember) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.WpChatroomMemberQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.WpChatroomMemberQuery", q)
- }
- // The WxFunc type is an adapter to allow the use of ordinary function as a Querier.
- type WxFunc func(context.Context, *ent.WxQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f WxFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.WxQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.WxQuery", q)
- }
- // The TraverseWx type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseWx func(context.Context, *ent.WxQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseWx) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseWx) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.WxQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.WxQuery", q)
- }
- // The WxCardFunc type is an adapter to allow the use of ordinary function as a Querier.
- type WxCardFunc func(context.Context, *ent.WxCardQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f WxCardFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.WxCardQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.WxCardQuery", q)
- }
- // The TraverseWxCard type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseWxCard func(context.Context, *ent.WxCardQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseWxCard) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseWxCard) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.WxCardQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.WxCardQuery", q)
- }
- // The WxCardUserFunc type is an adapter to allow the use of ordinary function as a Querier.
- type WxCardUserFunc func(context.Context, *ent.WxCardUserQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f WxCardUserFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.WxCardUserQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.WxCardUserQuery", q)
- }
- // The TraverseWxCardUser type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseWxCardUser func(context.Context, *ent.WxCardUserQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseWxCardUser) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseWxCardUser) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.WxCardUserQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.WxCardUserQuery", q)
- }
- // The WxCardVisitFunc type is an adapter to allow the use of ordinary function as a Querier.
- type WxCardVisitFunc func(context.Context, *ent.WxCardVisitQuery) (ent.Value, error)
- // Query calls f(ctx, q).
- func (f WxCardVisitFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
- if q, ok := q.(*ent.WxCardVisitQuery); ok {
- return f(ctx, q)
- }
- return nil, fmt.Errorf("unexpected query type %T. expect *ent.WxCardVisitQuery", q)
- }
- // The TraverseWxCardVisit type is an adapter to allow the use of ordinary function as Traverser.
- type TraverseWxCardVisit func(context.Context, *ent.WxCardVisitQuery) error
- // Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
- func (f TraverseWxCardVisit) Intercept(next ent.Querier) ent.Querier {
- return next
- }
- // Traverse calls f(ctx, q).
- func (f TraverseWxCardVisit) Traverse(ctx context.Context, q ent.Query) error {
- if q, ok := q.(*ent.WxCardVisitQuery); ok {
- return f(ctx, q)
- }
- return fmt.Errorf("unexpected query type %T. expect *ent.WxCardVisitQuery", q)
- }
- // NewQuery returns the generic Query interface for the given typed query.
- func NewQuery(q ent.Query) (Query, error) {
- switch q := q.(type) {
- case *ent.AgentQuery:
- return &query[*ent.AgentQuery, predicate.Agent, agent.OrderOption]{typ: ent.TypeAgent, tq: q}, nil
- case *ent.AgentBaseQuery:
- return &query[*ent.AgentBaseQuery, predicate.AgentBase, agentbase.OrderOption]{typ: ent.TypeAgentBase, tq: q}, nil
- case *ent.AliyunAvatarQuery:
- return &query[*ent.AliyunAvatarQuery, predicate.AliyunAvatar, aliyunavatar.OrderOption]{typ: ent.TypeAliyunAvatar, tq: q}, nil
- case *ent.AllocAgentQuery:
- return &query[*ent.AllocAgentQuery, predicate.AllocAgent, allocagent.OrderOption]{typ: ent.TypeAllocAgent, tq: q}, nil
- case *ent.BatchMsgQuery:
- return &query[*ent.BatchMsgQuery, predicate.BatchMsg, batchmsg.OrderOption]{typ: ent.TypeBatchMsg, tq: q}, nil
- case *ent.CategoryQuery:
- return &query[*ent.CategoryQuery, predicate.Category, category.OrderOption]{typ: ent.TypeCategory, tq: q}, nil
- case *ent.ChatRecordsQuery:
- return &query[*ent.ChatRecordsQuery, predicate.ChatRecords, chatrecords.OrderOption]{typ: ent.TypeChatRecords, tq: q}, nil
- case *ent.ChatSessionQuery:
- return &query[*ent.ChatSessionQuery, predicate.ChatSession, chatsession.OrderOption]{typ: ent.TypeChatSession, tq: q}, nil
- case *ent.ContactQuery:
- return &query[*ent.ContactQuery, predicate.Contact, contact.OrderOption]{typ: ent.TypeContact, tq: q}, nil
- case *ent.CreditBalanceQuery:
- return &query[*ent.CreditBalanceQuery, predicate.CreditBalance, creditbalance.OrderOption]{typ: ent.TypeCreditBalance, tq: q}, nil
- case *ent.CreditUsageQuery:
- return &query[*ent.CreditUsageQuery, predicate.CreditUsage, creditusage.OrderOption]{typ: ent.TypeCreditUsage, tq: q}, nil
- case *ent.EmployeeQuery:
- return &query[*ent.EmployeeQuery, predicate.Employee, employee.OrderOption]{typ: ent.TypeEmployee, tq: q}, nil
- case *ent.EmployeeConfigQuery:
- return &query[*ent.EmployeeConfigQuery, predicate.EmployeeConfig, employeeconfig.OrderOption]{typ: ent.TypeEmployeeConfig, tq: q}, nil
- case *ent.LabelQuery:
- return &query[*ent.LabelQuery, predicate.Label, label.OrderOption]{typ: ent.TypeLabel, tq: q}, nil
- case *ent.LabelRelationshipQuery:
- return &query[*ent.LabelRelationshipQuery, predicate.LabelRelationship, labelrelationship.OrderOption]{typ: ent.TypeLabelRelationship, tq: q}, nil
- case *ent.LabelTaggingQuery:
- return &query[*ent.LabelTaggingQuery, predicate.LabelTagging, labeltagging.OrderOption]{typ: ent.TypeLabelTagging, tq: q}, nil
- case *ent.MessageQuery:
- return &query[*ent.MessageQuery, predicate.Message, message.OrderOption]{typ: ent.TypeMessage, tq: q}, nil
- case *ent.MessageRecordsQuery:
- return &query[*ent.MessageRecordsQuery, predicate.MessageRecords, messagerecords.OrderOption]{typ: ent.TypeMessageRecords, tq: q}, nil
- case *ent.MsgQuery:
- return &query[*ent.MsgQuery, predicate.Msg, msg.OrderOption]{typ: ent.TypeMsg, tq: q}, nil
- case *ent.PayRechargeQuery:
- return &query[*ent.PayRechargeQuery, predicate.PayRecharge, payrecharge.OrderOption]{typ: ent.TypePayRecharge, tq: q}, nil
- case *ent.ServerQuery:
- return &query[*ent.ServerQuery, predicate.Server, server.OrderOption]{typ: ent.TypeServer, tq: q}, nil
- case *ent.SopNodeQuery:
- return &query[*ent.SopNodeQuery, predicate.SopNode, sopnode.OrderOption]{typ: ent.TypeSopNode, tq: q}, nil
- case *ent.SopStageQuery:
- return &query[*ent.SopStageQuery, predicate.SopStage, sopstage.OrderOption]{typ: ent.TypeSopStage, tq: q}, nil
- case *ent.SopTaskQuery:
- return &query[*ent.SopTaskQuery, predicate.SopTask, soptask.OrderOption]{typ: ent.TypeSopTask, tq: q}, nil
- case *ent.TokenQuery:
- return &query[*ent.TokenQuery, predicate.Token, token.OrderOption]{typ: ent.TypeToken, tq: q}, nil
- case *ent.TutorialQuery:
- return &query[*ent.TutorialQuery, predicate.Tutorial, tutorial.OrderOption]{typ: ent.TypeTutorial, tq: q}, nil
- case *ent.UsageDetailQuery:
- return &query[*ent.UsageDetailQuery, predicate.UsageDetail, usagedetail.OrderOption]{typ: ent.TypeUsageDetail, tq: q}, nil
- case *ent.UsageStatisticDayQuery:
- return &query[*ent.UsageStatisticDayQuery, predicate.UsageStatisticDay, usagestatisticday.OrderOption]{typ: ent.TypeUsageStatisticDay, tq: q}, nil
- case *ent.UsageStatisticHourQuery:
- return &query[*ent.UsageStatisticHourQuery, predicate.UsageStatisticHour, usagestatistichour.OrderOption]{typ: ent.TypeUsageStatisticHour, tq: q}, nil
- case *ent.UsageStatisticMonthQuery:
- return &query[*ent.UsageStatisticMonthQuery, predicate.UsageStatisticMonth, usagestatisticmonth.OrderOption]{typ: ent.TypeUsageStatisticMonth, tq: q}, nil
- case *ent.UsageTotalQuery:
- return &query[*ent.UsageTotalQuery, predicate.UsageTotal, usagetotal.OrderOption]{typ: ent.TypeUsageTotal, tq: q}, nil
- case *ent.WhatsappQuery:
- return &query[*ent.WhatsappQuery, predicate.Whatsapp, whatsapp.OrderOption]{typ: ent.TypeWhatsapp, tq: q}, nil
- case *ent.WhatsappChannelQuery:
- return &query[*ent.WhatsappChannelQuery, predicate.WhatsappChannel, whatsappchannel.OrderOption]{typ: ent.TypeWhatsappChannel, tq: q}, nil
- case *ent.WorkExperienceQuery:
- return &query[*ent.WorkExperienceQuery, predicate.WorkExperience, workexperience.OrderOption]{typ: ent.TypeWorkExperience, tq: q}, nil
- case *ent.WpChatroomQuery:
- return &query[*ent.WpChatroomQuery, predicate.WpChatroom, wpchatroom.OrderOption]{typ: ent.TypeWpChatroom, tq: q}, nil
- case *ent.WpChatroomMemberQuery:
- return &query[*ent.WpChatroomMemberQuery, predicate.WpChatroomMember, wpchatroommember.OrderOption]{typ: ent.TypeWpChatroomMember, tq: q}, nil
- case *ent.WxQuery:
- return &query[*ent.WxQuery, predicate.Wx, wx.OrderOption]{typ: ent.TypeWx, tq: q}, nil
- case *ent.WxCardQuery:
- return &query[*ent.WxCardQuery, predicate.WxCard, wxcard.OrderOption]{typ: ent.TypeWxCard, tq: q}, nil
- case *ent.WxCardUserQuery:
- return &query[*ent.WxCardUserQuery, predicate.WxCardUser, wxcarduser.OrderOption]{typ: ent.TypeWxCardUser, tq: q}, nil
- case *ent.WxCardVisitQuery:
- return &query[*ent.WxCardVisitQuery, predicate.WxCardVisit, wxcardvisit.OrderOption]{typ: ent.TypeWxCardVisit, tq: q}, nil
- default:
- return nil, fmt.Errorf("unknown query type %T", q)
- }
- }
- type query[T any, P ~func(*sql.Selector), R ~func(*sql.Selector)] struct {
- typ string
- tq interface {
- Limit(int) T
- Offset(int) T
- Unique(bool) T
- Order(...R) T
- Where(...P) T
- }
- }
- func (q query[T, P, R]) Type() string {
- return q.typ
- }
- func (q query[T, P, R]) Limit(limit int) {
- q.tq.Limit(limit)
- }
- func (q query[T, P, R]) Offset(offset int) {
- q.tq.Offset(offset)
- }
- func (q query[T, P, R]) Unique(unique bool) {
- q.tq.Unique(unique)
- }
- func (q query[T, P, R]) Order(orders ...func(*sql.Selector)) {
- rs := make([]R, len(orders))
- for i := range orders {
- rs[i] = orders[i]
- }
- q.tq.Order(rs...)
- }
- func (q query[T, P, R]) WhereP(ps ...func(*sql.Selector)) {
- p := make([]P, len(ps))
- for i := range ps {
- p[i] = ps[i]
- }
- q.tq.Where(p...)
- }
|