|
@@ -434,14 +434,15 @@ func (c *Client) Close() error {
|
|
|
// In order to add hooks to a specific client, call: `client.Node.Use(...)`.
|
|
|
func (c *Client) Use(hooks ...Hook) {
|
|
|
for _, n := range []interface{ Use(...Hook) }{
|
|
|
- c.Agent, c.AgentBase, c.AliyunAvatar, c.AllocAgent, c.ApiKey, c.BatchMsg, c.Category,
|
|
|
- c.ChatRecords, c.ChatSession, c.Contact, c.CreditBalance, c.CreditUsage,
|
|
|
- c.Employee, c.EmployeeConfig, c.Label, c.LabelRelationship, c.LabelTagging,
|
|
|
- c.Message, c.MessageRecords, c.Msg, c.PayRecharge, c.Server, c.SopNode,
|
|
|
- c.SopStage, c.SopTask, c.Token, c.Tutorial, c.UsageDetail, c.UsageStatisticDay,
|
|
|
- c.UsageStatisticHour, c.UsageStatisticMonth, c.UsageTotal, c.Whatsapp,
|
|
|
- c.WhatsappChannel, c.WorkExperience, c.WpChatroom, c.WpChatroomMember, c.Wx,
|
|
|
- c.WxCard, c.WxCardUser, c.WxCardVisit, c.Xunji, c.XunjiService,
|
|
|
+ c.Agent, c.AgentBase, c.AliyunAvatar, c.AllocAgent, c.ApiKey, c.BatchMsg,
|
|
|
+ c.Category, c.ChatRecords, c.ChatSession, c.Contact, c.CreditBalance,
|
|
|
+ c.CreditUsage, c.Employee, c.EmployeeConfig, c.Label, c.LabelRelationship,
|
|
|
+ c.LabelTagging, c.Message, c.MessageRecords, c.Msg, c.PayRecharge, c.Server,
|
|
|
+ c.SopNode, c.SopStage, c.SopTask, c.Token, c.Tutorial, c.UsageDetail,
|
|
|
+ c.UsageStatisticDay, c.UsageStatisticHour, c.UsageStatisticMonth, c.UsageTotal,
|
|
|
+ c.Whatsapp, c.WhatsappChannel, c.WorkExperience, c.WpChatroom,
|
|
|
+ c.WpChatroomMember, c.Wx, c.WxCard, c.WxCardUser, c.WxCardVisit, c.Xunji,
|
|
|
+ c.XunjiService,
|
|
|
} {
|
|
|
n.Use(hooks...)
|
|
|
}
|
|
@@ -451,14 +452,15 @@ func (c *Client) Use(hooks ...Hook) {
|
|
|
// In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.
|
|
|
func (c *Client) Intercept(interceptors ...Interceptor) {
|
|
|
for _, n := range []interface{ Intercept(...Interceptor) }{
|
|
|
- c.Agent, c.AgentBase, c.AliyunAvatar, c.AllocAgent, c.ApiKey, c.BatchMsg, c.Category,
|
|
|
- c.ChatRecords, c.ChatSession, c.Contact, c.CreditBalance, c.CreditUsage,
|
|
|
- c.Employee, c.EmployeeConfig, c.Label, c.LabelRelationship, c.LabelTagging,
|
|
|
- c.Message, c.MessageRecords, c.Msg, c.PayRecharge, c.Server, c.SopNode,
|
|
|
- c.SopStage, c.SopTask, c.Token, c.Tutorial, c.UsageDetail, c.UsageStatisticDay,
|
|
|
- c.UsageStatisticHour, c.UsageStatisticMonth, c.UsageTotal, c.Whatsapp,
|
|
|
- c.WhatsappChannel, c.WorkExperience, c.WpChatroom, c.WpChatroomMember, c.Wx,
|
|
|
- c.WxCard, c.WxCardUser, c.WxCardVisit, c.Xunji, c.XunjiService,
|
|
|
+ c.Agent, c.AgentBase, c.AliyunAvatar, c.AllocAgent, c.ApiKey, c.BatchMsg,
|
|
|
+ c.Category, c.ChatRecords, c.ChatSession, c.Contact, c.CreditBalance,
|
|
|
+ c.CreditUsage, c.Employee, c.EmployeeConfig, c.Label, c.LabelRelationship,
|
|
|
+ c.LabelTagging, c.Message, c.MessageRecords, c.Msg, c.PayRecharge, c.Server,
|
|
|
+ c.SopNode, c.SopStage, c.SopTask, c.Token, c.Tutorial, c.UsageDetail,
|
|
|
+ c.UsageStatisticDay, c.UsageStatisticHour, c.UsageStatisticMonth, c.UsageTotal,
|
|
|
+ c.Whatsapp, c.WhatsappChannel, c.WorkExperience, c.WpChatroom,
|
|
|
+ c.WpChatroomMember, c.Wx, c.WxCard, c.WxCardUser, c.WxCardVisit, c.Xunji,
|
|
|
+ c.XunjiService,
|
|
|
} {
|
|
|
n.Intercept(interceptors...)
|
|
|
}
|
|
@@ -714,7 +716,6 @@ func (c *AgentClient) QueryWaAgent(a *Agent) *WhatsappQuery {
|
|
|
return query
|
|
|
}
|
|
|
|
|
|
-
|
|
|
// QueryXjsAgent queries the xjs_agent edge of a Agent.
|
|
|
func (c *AgentClient) QueryXjsAgent(a *Agent) *XunjiServiceQuery {
|
|
|
query := (&XunjiServiceClient{config: c.config}).Query()
|
|
@@ -730,10 +731,10 @@ func (c *AgentClient) QueryXjsAgent(a *Agent) *XunjiServiceQuery {
|
|
|
}
|
|
|
return query
|
|
|
}
|
|
|
+
|
|
|
// QueryKeyAgent queries the key_agent edge of a Agent.
|
|
|
func (c *AgentClient) QueryKeyAgent(a *Agent) *ApiKeyQuery {
|
|
|
query := (&ApiKeyClient{config: c.config}).Query()
|
|
|
-
|
|
|
query.path = func(context.Context) (fromV *sql.Selector, _ error) {
|
|
|
id := a.ID
|
|
|
step := sqlgraph.NewStep(
|
|
@@ -6845,22 +6846,24 @@ func (c *XunjiServiceClient) mutate(ctx context.Context, m *XunjiServiceMutation
|
|
|
// hooks and interceptors per client, for fast access.
|
|
|
type (
|
|
|
hooks struct {
|
|
|
- Agent, AgentBase, AliyunAvatar, AllocAgent, ApiKey, BatchMsg, Category, ChatRecords,
|
|
|
- ChatSession, Contact, CreditBalance, CreditUsage, Employee, EmployeeConfig,
|
|
|
- Label, LabelRelationship, LabelTagging, Message, MessageRecords, Msg,
|
|
|
- PayRecharge, Server, SopNode, SopStage, SopTask, Token, Tutorial, UsageDetail,
|
|
|
- UsageStatisticDay, UsageStatisticHour, UsageStatisticMonth, UsageTotal,
|
|
|
- Whatsapp, WhatsappChannel, WorkExperience, WpChatroom, WpChatroomMember, Wx,
|
|
|
- WxCard, WxCardUser, WxCardVisit, Xunji, XunjiService []ent.Hook
|
|
|
+ Agent, AgentBase, AliyunAvatar, AllocAgent, ApiKey, BatchMsg, Category,
|
|
|
+ ChatRecords, ChatSession, Contact, CreditBalance, CreditUsage, Employee,
|
|
|
+ EmployeeConfig, Label, LabelRelationship, LabelTagging, Message,
|
|
|
+ MessageRecords, Msg, PayRecharge, Server, SopNode, SopStage, SopTask, Token,
|
|
|
+ Tutorial, UsageDetail, UsageStatisticDay, UsageStatisticHour,
|
|
|
+ UsageStatisticMonth, UsageTotal, Whatsapp, WhatsappChannel, WorkExperience,
|
|
|
+ WpChatroom, WpChatroomMember, Wx, WxCard, WxCardUser, WxCardVisit, Xunji,
|
|
|
+ XunjiService []ent.Hook
|
|
|
}
|
|
|
inters struct {
|
|
|
- Agent, AgentBase, AliyunAvatar, AllocAgent, ApiKey, BatchMsg, Category, ChatRecords,
|
|
|
- ChatSession, Contact, CreditBalance, CreditUsage, Employee, EmployeeConfig,
|
|
|
- Label, LabelRelationship, LabelTagging, Message, MessageRecords, Msg,
|
|
|
- PayRecharge, Server, SopNode, SopStage, SopTask, Token, Tutorial, UsageDetail,
|
|
|
- UsageStatisticDay, UsageStatisticHour, UsageStatisticMonth, UsageTotal,
|
|
|
- Whatsapp, WhatsappChannel, WorkExperience, WpChatroom, WpChatroomMember, Wx,
|
|
|
- WxCard, WxCardUser, WxCardVisit, Xunji, XunjiService []ent.Interceptor
|
|
|
+ Agent, AgentBase, AliyunAvatar, AllocAgent, ApiKey, BatchMsg, Category,
|
|
|
+ ChatRecords, ChatSession, Contact, CreditBalance, CreditUsage, Employee,
|
|
|
+ EmployeeConfig, Label, LabelRelationship, LabelTagging, Message,
|
|
|
+ MessageRecords, Msg, PayRecharge, Server, SopNode, SopStage, SopTask, Token,
|
|
|
+ Tutorial, UsageDetail, UsageStatisticDay, UsageStatisticHour,
|
|
|
+ UsageStatisticMonth, UsageTotal, Whatsapp, WhatsappChannel, WorkExperience,
|
|
|
+ WpChatroom, WpChatroomMember, Wx, WxCard, WxCardUser, WxCardVisit, Xunji,
|
|
|
+ XunjiService []ent.Interceptor
|
|
|
}
|
|
|
)
|
|
|
|