lichangdong 1 неделя назад
Родитель
Сommit
e1de5a253b

+ 225 - 0
ent/addwechatfriendlog.go

@@ -0,0 +1,225 @@
+// Code generated by ent, DO NOT EDIT.
+
+package ent
+
+import (
+	"encoding/json"
+	"fmt"
+	"strings"
+	"wechat-api/ent/addwechatfriendlog"
+
+	"entgo.io/ent"
+	"entgo.io/ent/dialect/sql"
+)
+
+// 微信添加好友记录
+type AddWechatFriendLog struct {
+	config `json:"-"`
+	// ID of the ent.
+	// 主键id
+	ID int64 `json:"id,omitempty"`
+	// 属主的wxid
+	OwnerWxID string `json:"owner_wx_id,omitempty"`
+	// 属主的微信类型(1个微,2企微)
+	OwnerWxType int `json:"owner_wx_type,omitempty"`
+	// 手机号
+	FindContent string `json:"find_content,omitempty"`
+	// 发起查询数据的时候json
+	FindRequest map[string]interface{} `json:"find_request,omitempty"`
+	// 查询返回结果
+	FindResult map[string]interface{} `json:"find_result,omitempty"`
+	// 是否可以添加好友(与属主账号非好友且其数据查询正常时 0 不可以,1 可以)
+	IsCanAdd int `json:"is_can_add,omitempty"`
+	// 添加时候的请求体
+	TaskID int64 `json:"task_id,omitempty"`
+	// 添加时候的请求体
+	AddRequest map[string]interface{} `json:"add_request,omitempty"`
+	// 添加请求的结果
+	AddResult map[string]interface{} `json:"add_result,omitempty"`
+	// 创建时间戳
+	CreatedAt int64 `json:"created_at,omitempty"`
+	// 修改时间戳
+	UpdatedAt    int64 `json:"updated_at,omitempty"`
+	selectValues sql.SelectValues
+}
+
+// scanValues returns the types for scanning values from sql.Rows.
+func (*AddWechatFriendLog) scanValues(columns []string) ([]any, error) {
+	values := make([]any, len(columns))
+	for i := range columns {
+		switch columns[i] {
+		case addwechatfriendlog.FieldFindRequest, addwechatfriendlog.FieldFindResult, addwechatfriendlog.FieldAddRequest, addwechatfriendlog.FieldAddResult:
+			values[i] = new([]byte)
+		case addwechatfriendlog.FieldID, addwechatfriendlog.FieldOwnerWxType, addwechatfriendlog.FieldIsCanAdd, addwechatfriendlog.FieldTaskID, addwechatfriendlog.FieldCreatedAt, addwechatfriendlog.FieldUpdatedAt:
+			values[i] = new(sql.NullInt64)
+		case addwechatfriendlog.FieldOwnerWxID, addwechatfriendlog.FieldFindContent:
+			values[i] = new(sql.NullString)
+		default:
+			values[i] = new(sql.UnknownType)
+		}
+	}
+	return values, nil
+}
+
+// assignValues assigns the values that were returned from sql.Rows (after scanning)
+// to the AddWechatFriendLog fields.
+func (awfl *AddWechatFriendLog) assignValues(columns []string, values []any) error {
+	if m, n := len(values), len(columns); m < n {
+		return fmt.Errorf("mismatch number of scan values: %d != %d", m, n)
+	}
+	for i := range columns {
+		switch columns[i] {
+		case addwechatfriendlog.FieldID:
+			value, ok := values[i].(*sql.NullInt64)
+			if !ok {
+				return fmt.Errorf("unexpected type %T for field id", value)
+			}
+			awfl.ID = int64(value.Int64)
+		case addwechatfriendlog.FieldOwnerWxID:
+			if value, ok := values[i].(*sql.NullString); !ok {
+				return fmt.Errorf("unexpected type %T for field owner_wx_id", values[i])
+			} else if value.Valid {
+				awfl.OwnerWxID = value.String
+			}
+		case addwechatfriendlog.FieldOwnerWxType:
+			if value, ok := values[i].(*sql.NullInt64); !ok {
+				return fmt.Errorf("unexpected type %T for field owner_wx_type", values[i])
+			} else if value.Valid {
+				awfl.OwnerWxType = int(value.Int64)
+			}
+		case addwechatfriendlog.FieldFindContent:
+			if value, ok := values[i].(*sql.NullString); !ok {
+				return fmt.Errorf("unexpected type %T for field find_content", values[i])
+			} else if value.Valid {
+				awfl.FindContent = value.String
+			}
+		case addwechatfriendlog.FieldFindRequest:
+			if value, ok := values[i].(*[]byte); !ok {
+				return fmt.Errorf("unexpected type %T for field find_request", values[i])
+			} else if value != nil && len(*value) > 0 {
+				if err := json.Unmarshal(*value, &awfl.FindRequest); err != nil {
+					return fmt.Errorf("unmarshal field find_request: %w", err)
+				}
+			}
+		case addwechatfriendlog.FieldFindResult:
+			if value, ok := values[i].(*[]byte); !ok {
+				return fmt.Errorf("unexpected type %T for field find_result", values[i])
+			} else if value != nil && len(*value) > 0 {
+				if err := json.Unmarshal(*value, &awfl.FindResult); err != nil {
+					return fmt.Errorf("unmarshal field find_result: %w", err)
+				}
+			}
+		case addwechatfriendlog.FieldIsCanAdd:
+			if value, ok := values[i].(*sql.NullInt64); !ok {
+				return fmt.Errorf("unexpected type %T for field is_can_add", values[i])
+			} else if value.Valid {
+				awfl.IsCanAdd = int(value.Int64)
+			}
+		case addwechatfriendlog.FieldTaskID:
+			if value, ok := values[i].(*sql.NullInt64); !ok {
+				return fmt.Errorf("unexpected type %T for field task_id", values[i])
+			} else if value.Valid {
+				awfl.TaskID = value.Int64
+			}
+		case addwechatfriendlog.FieldAddRequest:
+			if value, ok := values[i].(*[]byte); !ok {
+				return fmt.Errorf("unexpected type %T for field add_request", values[i])
+			} else if value != nil && len(*value) > 0 {
+				if err := json.Unmarshal(*value, &awfl.AddRequest); err != nil {
+					return fmt.Errorf("unmarshal field add_request: %w", err)
+				}
+			}
+		case addwechatfriendlog.FieldAddResult:
+			if value, ok := values[i].(*[]byte); !ok {
+				return fmt.Errorf("unexpected type %T for field add_result", values[i])
+			} else if value != nil && len(*value) > 0 {
+				if err := json.Unmarshal(*value, &awfl.AddResult); err != nil {
+					return fmt.Errorf("unmarshal field add_result: %w", err)
+				}
+			}
+		case addwechatfriendlog.FieldCreatedAt:
+			if value, ok := values[i].(*sql.NullInt64); !ok {
+				return fmt.Errorf("unexpected type %T for field created_at", values[i])
+			} else if value.Valid {
+				awfl.CreatedAt = value.Int64
+			}
+		case addwechatfriendlog.FieldUpdatedAt:
+			if value, ok := values[i].(*sql.NullInt64); !ok {
+				return fmt.Errorf("unexpected type %T for field updated_at", values[i])
+			} else if value.Valid {
+				awfl.UpdatedAt = value.Int64
+			}
+		default:
+			awfl.selectValues.Set(columns[i], values[i])
+		}
+	}
+	return nil
+}
+
+// Value returns the ent.Value that was dynamically selected and assigned to the AddWechatFriendLog.
+// This includes values selected through modifiers, order, etc.
+func (awfl *AddWechatFriendLog) Value(name string) (ent.Value, error) {
+	return awfl.selectValues.Get(name)
+}
+
+// Update returns a builder for updating this AddWechatFriendLog.
+// Note that you need to call AddWechatFriendLog.Unwrap() before calling this method if this AddWechatFriendLog
+// was returned from a transaction, and the transaction was committed or rolled back.
+func (awfl *AddWechatFriendLog) Update() *AddWechatFriendLogUpdateOne {
+	return NewAddWechatFriendLogClient(awfl.config).UpdateOne(awfl)
+}
+
+// Unwrap unwraps the AddWechatFriendLog entity that was returned from a transaction after it was closed,
+// so that all future queries will be executed through the driver which created the transaction.
+func (awfl *AddWechatFriendLog) Unwrap() *AddWechatFriendLog {
+	_tx, ok := awfl.config.driver.(*txDriver)
+	if !ok {
+		panic("ent: AddWechatFriendLog is not a transactional entity")
+	}
+	awfl.config.driver = _tx.drv
+	return awfl
+}
+
+// String implements the fmt.Stringer.
+func (awfl *AddWechatFriendLog) String() string {
+	var builder strings.Builder
+	builder.WriteString("AddWechatFriendLog(")
+	builder.WriteString(fmt.Sprintf("id=%v, ", awfl.ID))
+	builder.WriteString("owner_wx_id=")
+	builder.WriteString(awfl.OwnerWxID)
+	builder.WriteString(", ")
+	builder.WriteString("owner_wx_type=")
+	builder.WriteString(fmt.Sprintf("%v", awfl.OwnerWxType))
+	builder.WriteString(", ")
+	builder.WriteString("find_content=")
+	builder.WriteString(awfl.FindContent)
+	builder.WriteString(", ")
+	builder.WriteString("find_request=")
+	builder.WriteString(fmt.Sprintf("%v", awfl.FindRequest))
+	builder.WriteString(", ")
+	builder.WriteString("find_result=")
+	builder.WriteString(fmt.Sprintf("%v", awfl.FindResult))
+	builder.WriteString(", ")
+	builder.WriteString("is_can_add=")
+	builder.WriteString(fmt.Sprintf("%v", awfl.IsCanAdd))
+	builder.WriteString(", ")
+	builder.WriteString("task_id=")
+	builder.WriteString(fmt.Sprintf("%v", awfl.TaskID))
+	builder.WriteString(", ")
+	builder.WriteString("add_request=")
+	builder.WriteString(fmt.Sprintf("%v", awfl.AddRequest))
+	builder.WriteString(", ")
+	builder.WriteString("add_result=")
+	builder.WriteString(fmt.Sprintf("%v", awfl.AddResult))
+	builder.WriteString(", ")
+	builder.WriteString("created_at=")
+	builder.WriteString(fmt.Sprintf("%v", awfl.CreatedAt))
+	builder.WriteString(", ")
+	builder.WriteString("updated_at=")
+	builder.WriteString(fmt.Sprintf("%v", awfl.UpdatedAt))
+	builder.WriteByte(')')
+	return builder.String()
+}
+
+// AddWechatFriendLogs is a parsable slice of AddWechatFriendLog.
+type AddWechatFriendLogs []*AddWechatFriendLog

+ 130 - 0
ent/addwechatfriendlog/addwechatfriendlog.go

@@ -0,0 +1,130 @@
+// Code generated by ent, DO NOT EDIT.
+
+package addwechatfriendlog
+
+import (
+	"entgo.io/ent/dialect/sql"
+)
+
+const (
+	// Label holds the string label denoting the addwechatfriendlog type in the database.
+	Label = "add_wechat_friend_log"
+	// FieldID holds the string denoting the id field in the database.
+	FieldID = "id"
+	// FieldOwnerWxID holds the string denoting the owner_wx_id field in the database.
+	FieldOwnerWxID = "owner_wx_id"
+	// FieldOwnerWxType holds the string denoting the owner_wx_type field in the database.
+	FieldOwnerWxType = "owner_wx_type"
+	// FieldFindContent holds the string denoting the find_content field in the database.
+	FieldFindContent = "find_content"
+	// FieldFindRequest holds the string denoting the find_request field in the database.
+	FieldFindRequest = "find_request"
+	// FieldFindResult holds the string denoting the find_result field in the database.
+	FieldFindResult = "find_result"
+	// FieldIsCanAdd holds the string denoting the is_can_add field in the database.
+	FieldIsCanAdd = "is_can_add"
+	// FieldTaskID holds the string denoting the task_id field in the database.
+	FieldTaskID = "task_id"
+	// FieldAddRequest holds the string denoting the add_request field in the database.
+	FieldAddRequest = "add_request"
+	// FieldAddResult holds the string denoting the add_result field in the database.
+	FieldAddResult = "add_result"
+	// FieldCreatedAt holds the string denoting the created_at field in the database.
+	FieldCreatedAt = "created_at"
+	// FieldUpdatedAt holds the string denoting the updated_at field in the database.
+	FieldUpdatedAt = "updated_at"
+	// Table holds the table name of the addwechatfriendlog in the database.
+	Table = "add_wechat_friend_logs"
+)
+
+// Columns holds all SQL columns for addwechatfriendlog fields.
+var Columns = []string{
+	FieldID,
+	FieldOwnerWxID,
+	FieldOwnerWxType,
+	FieldFindContent,
+	FieldFindRequest,
+	FieldFindResult,
+	FieldIsCanAdd,
+	FieldTaskID,
+	FieldAddRequest,
+	FieldAddResult,
+	FieldCreatedAt,
+	FieldUpdatedAt,
+}
+
+// ValidColumn reports if the column name is valid (part of the table columns).
+func ValidColumn(column string) bool {
+	for i := range Columns {
+		if column == Columns[i] {
+			return true
+		}
+	}
+	return false
+}
+
+var (
+	// DefaultOwnerWxID holds the default value on creation for the "owner_wx_id" field.
+	DefaultOwnerWxID string
+	// OwnerWxIDValidator is a validator for the "owner_wx_id" field. It is called by the builders before save.
+	OwnerWxIDValidator func(string) error
+	// DefaultOwnerWxType holds the default value on creation for the "owner_wx_type" field.
+	DefaultOwnerWxType int
+	// DefaultFindContent holds the default value on creation for the "find_content" field.
+	DefaultFindContent string
+	// FindContentValidator is a validator for the "find_content" field. It is called by the builders before save.
+	FindContentValidator func(string) error
+	// DefaultIsCanAdd holds the default value on creation for the "is_can_add" field.
+	DefaultIsCanAdd int
+	// DefaultTaskID holds the default value on creation for the "task_id" field.
+	DefaultTaskID int64
+	// DefaultCreatedAt holds the default value on creation for the "created_at" field.
+	DefaultCreatedAt func() int64
+	// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
+	DefaultUpdatedAt func() int64
+	// UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
+	UpdateDefaultUpdatedAt func() int64
+)
+
+// OrderOption defines the ordering options for the AddWechatFriendLog queries.
+type OrderOption func(*sql.Selector)
+
+// ByID orders the results by the id field.
+func ByID(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldID, opts...).ToFunc()
+}
+
+// ByOwnerWxID orders the results by the owner_wx_id field.
+func ByOwnerWxID(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldOwnerWxID, opts...).ToFunc()
+}
+
+// ByOwnerWxType orders the results by the owner_wx_type field.
+func ByOwnerWxType(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldOwnerWxType, opts...).ToFunc()
+}
+
+// ByFindContent orders the results by the find_content field.
+func ByFindContent(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldFindContent, opts...).ToFunc()
+}
+
+// ByIsCanAdd orders the results by the is_can_add field.
+func ByIsCanAdd(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldIsCanAdd, opts...).ToFunc()
+}
+
+// ByTaskID orders the results by the task_id field.
+func ByTaskID(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldTaskID, opts...).ToFunc()
+}
+
+// ByCreatedAt orders the results by the created_at field.
+func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
+}
+
+// ByUpdatedAt orders the results by the updated_at field.
+func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
+}

+ 474 - 0
ent/addwechatfriendlog/where.go

@@ -0,0 +1,474 @@
+// Code generated by ent, DO NOT EDIT.
+
+package addwechatfriendlog
+
+import (
+	"wechat-api/ent/predicate"
+
+	"entgo.io/ent/dialect/sql"
+)
+
+// ID filters vertices based on their ID field.
+func ID(id int64) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldEQ(FieldID, id))
+}
+
+// IDEQ applies the EQ predicate on the ID field.
+func IDEQ(id int64) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldEQ(FieldID, id))
+}
+
+// IDNEQ applies the NEQ predicate on the ID field.
+func IDNEQ(id int64) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldNEQ(FieldID, id))
+}
+
+// IDIn applies the In predicate on the ID field.
+func IDIn(ids ...int64) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldIn(FieldID, ids...))
+}
+
+// IDNotIn applies the NotIn predicate on the ID field.
+func IDNotIn(ids ...int64) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldNotIn(FieldID, ids...))
+}
+
+// IDGT applies the GT predicate on the ID field.
+func IDGT(id int64) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldGT(FieldID, id))
+}
+
+// IDGTE applies the GTE predicate on the ID field.
+func IDGTE(id int64) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldGTE(FieldID, id))
+}
+
+// IDLT applies the LT predicate on the ID field.
+func IDLT(id int64) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldLT(FieldID, id))
+}
+
+// IDLTE applies the LTE predicate on the ID field.
+func IDLTE(id int64) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldLTE(FieldID, id))
+}
+
+// OwnerWxID applies equality check predicate on the "owner_wx_id" field. It's identical to OwnerWxIDEQ.
+func OwnerWxID(v string) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldEQ(FieldOwnerWxID, v))
+}
+
+// OwnerWxType applies equality check predicate on the "owner_wx_type" field. It's identical to OwnerWxTypeEQ.
+func OwnerWxType(v int) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldEQ(FieldOwnerWxType, v))
+}
+
+// FindContent applies equality check predicate on the "find_content" field. It's identical to FindContentEQ.
+func FindContent(v string) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldEQ(FieldFindContent, v))
+}
+
+// IsCanAdd applies equality check predicate on the "is_can_add" field. It's identical to IsCanAddEQ.
+func IsCanAdd(v int) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldEQ(FieldIsCanAdd, v))
+}
+
+// TaskID applies equality check predicate on the "task_id" field. It's identical to TaskIDEQ.
+func TaskID(v int64) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldEQ(FieldTaskID, v))
+}
+
+// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
+func CreatedAt(v int64) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldEQ(FieldCreatedAt, v))
+}
+
+// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ.
+func UpdatedAt(v int64) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldEQ(FieldUpdatedAt, v))
+}
+
+// OwnerWxIDEQ applies the EQ predicate on the "owner_wx_id" field.
+func OwnerWxIDEQ(v string) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldEQ(FieldOwnerWxID, v))
+}
+
+// OwnerWxIDNEQ applies the NEQ predicate on the "owner_wx_id" field.
+func OwnerWxIDNEQ(v string) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldNEQ(FieldOwnerWxID, v))
+}
+
+// OwnerWxIDIn applies the In predicate on the "owner_wx_id" field.
+func OwnerWxIDIn(vs ...string) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldIn(FieldOwnerWxID, vs...))
+}
+
+// OwnerWxIDNotIn applies the NotIn predicate on the "owner_wx_id" field.
+func OwnerWxIDNotIn(vs ...string) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldNotIn(FieldOwnerWxID, vs...))
+}
+
+// OwnerWxIDGT applies the GT predicate on the "owner_wx_id" field.
+func OwnerWxIDGT(v string) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldGT(FieldOwnerWxID, v))
+}
+
+// OwnerWxIDGTE applies the GTE predicate on the "owner_wx_id" field.
+func OwnerWxIDGTE(v string) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldGTE(FieldOwnerWxID, v))
+}
+
+// OwnerWxIDLT applies the LT predicate on the "owner_wx_id" field.
+func OwnerWxIDLT(v string) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldLT(FieldOwnerWxID, v))
+}
+
+// OwnerWxIDLTE applies the LTE predicate on the "owner_wx_id" field.
+func OwnerWxIDLTE(v string) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldLTE(FieldOwnerWxID, v))
+}
+
+// OwnerWxIDContains applies the Contains predicate on the "owner_wx_id" field.
+func OwnerWxIDContains(v string) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldContains(FieldOwnerWxID, v))
+}
+
+// OwnerWxIDHasPrefix applies the HasPrefix predicate on the "owner_wx_id" field.
+func OwnerWxIDHasPrefix(v string) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldHasPrefix(FieldOwnerWxID, v))
+}
+
+// OwnerWxIDHasSuffix applies the HasSuffix predicate on the "owner_wx_id" field.
+func OwnerWxIDHasSuffix(v string) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldHasSuffix(FieldOwnerWxID, v))
+}
+
+// OwnerWxIDEqualFold applies the EqualFold predicate on the "owner_wx_id" field.
+func OwnerWxIDEqualFold(v string) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldEqualFold(FieldOwnerWxID, v))
+}
+
+// OwnerWxIDContainsFold applies the ContainsFold predicate on the "owner_wx_id" field.
+func OwnerWxIDContainsFold(v string) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldContainsFold(FieldOwnerWxID, v))
+}
+
+// OwnerWxTypeEQ applies the EQ predicate on the "owner_wx_type" field.
+func OwnerWxTypeEQ(v int) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldEQ(FieldOwnerWxType, v))
+}
+
+// OwnerWxTypeNEQ applies the NEQ predicate on the "owner_wx_type" field.
+func OwnerWxTypeNEQ(v int) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldNEQ(FieldOwnerWxType, v))
+}
+
+// OwnerWxTypeIn applies the In predicate on the "owner_wx_type" field.
+func OwnerWxTypeIn(vs ...int) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldIn(FieldOwnerWxType, vs...))
+}
+
+// OwnerWxTypeNotIn applies the NotIn predicate on the "owner_wx_type" field.
+func OwnerWxTypeNotIn(vs ...int) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldNotIn(FieldOwnerWxType, vs...))
+}
+
+// OwnerWxTypeGT applies the GT predicate on the "owner_wx_type" field.
+func OwnerWxTypeGT(v int) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldGT(FieldOwnerWxType, v))
+}
+
+// OwnerWxTypeGTE applies the GTE predicate on the "owner_wx_type" field.
+func OwnerWxTypeGTE(v int) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldGTE(FieldOwnerWxType, v))
+}
+
+// OwnerWxTypeLT applies the LT predicate on the "owner_wx_type" field.
+func OwnerWxTypeLT(v int) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldLT(FieldOwnerWxType, v))
+}
+
+// OwnerWxTypeLTE applies the LTE predicate on the "owner_wx_type" field.
+func OwnerWxTypeLTE(v int) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldLTE(FieldOwnerWxType, v))
+}
+
+// FindContentEQ applies the EQ predicate on the "find_content" field.
+func FindContentEQ(v string) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldEQ(FieldFindContent, v))
+}
+
+// FindContentNEQ applies the NEQ predicate on the "find_content" field.
+func FindContentNEQ(v string) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldNEQ(FieldFindContent, v))
+}
+
+// FindContentIn applies the In predicate on the "find_content" field.
+func FindContentIn(vs ...string) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldIn(FieldFindContent, vs...))
+}
+
+// FindContentNotIn applies the NotIn predicate on the "find_content" field.
+func FindContentNotIn(vs ...string) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldNotIn(FieldFindContent, vs...))
+}
+
+// FindContentGT applies the GT predicate on the "find_content" field.
+func FindContentGT(v string) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldGT(FieldFindContent, v))
+}
+
+// FindContentGTE applies the GTE predicate on the "find_content" field.
+func FindContentGTE(v string) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldGTE(FieldFindContent, v))
+}
+
+// FindContentLT applies the LT predicate on the "find_content" field.
+func FindContentLT(v string) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldLT(FieldFindContent, v))
+}
+
+// FindContentLTE applies the LTE predicate on the "find_content" field.
+func FindContentLTE(v string) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldLTE(FieldFindContent, v))
+}
+
+// FindContentContains applies the Contains predicate on the "find_content" field.
+func FindContentContains(v string) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldContains(FieldFindContent, v))
+}
+
+// FindContentHasPrefix applies the HasPrefix predicate on the "find_content" field.
+func FindContentHasPrefix(v string) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldHasPrefix(FieldFindContent, v))
+}
+
+// FindContentHasSuffix applies the HasSuffix predicate on the "find_content" field.
+func FindContentHasSuffix(v string) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldHasSuffix(FieldFindContent, v))
+}
+
+// FindContentEqualFold applies the EqualFold predicate on the "find_content" field.
+func FindContentEqualFold(v string) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldEqualFold(FieldFindContent, v))
+}
+
+// FindContentContainsFold applies the ContainsFold predicate on the "find_content" field.
+func FindContentContainsFold(v string) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldContainsFold(FieldFindContent, v))
+}
+
+// FindRequestIsNil applies the IsNil predicate on the "find_request" field.
+func FindRequestIsNil() predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldIsNull(FieldFindRequest))
+}
+
+// FindRequestNotNil applies the NotNil predicate on the "find_request" field.
+func FindRequestNotNil() predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldNotNull(FieldFindRequest))
+}
+
+// FindResultIsNil applies the IsNil predicate on the "find_result" field.
+func FindResultIsNil() predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldIsNull(FieldFindResult))
+}
+
+// FindResultNotNil applies the NotNil predicate on the "find_result" field.
+func FindResultNotNil() predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldNotNull(FieldFindResult))
+}
+
+// IsCanAddEQ applies the EQ predicate on the "is_can_add" field.
+func IsCanAddEQ(v int) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldEQ(FieldIsCanAdd, v))
+}
+
+// IsCanAddNEQ applies the NEQ predicate on the "is_can_add" field.
+func IsCanAddNEQ(v int) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldNEQ(FieldIsCanAdd, v))
+}
+
+// IsCanAddIn applies the In predicate on the "is_can_add" field.
+func IsCanAddIn(vs ...int) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldIn(FieldIsCanAdd, vs...))
+}
+
+// IsCanAddNotIn applies the NotIn predicate on the "is_can_add" field.
+func IsCanAddNotIn(vs ...int) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldNotIn(FieldIsCanAdd, vs...))
+}
+
+// IsCanAddGT applies the GT predicate on the "is_can_add" field.
+func IsCanAddGT(v int) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldGT(FieldIsCanAdd, v))
+}
+
+// IsCanAddGTE applies the GTE predicate on the "is_can_add" field.
+func IsCanAddGTE(v int) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldGTE(FieldIsCanAdd, v))
+}
+
+// IsCanAddLT applies the LT predicate on the "is_can_add" field.
+func IsCanAddLT(v int) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldLT(FieldIsCanAdd, v))
+}
+
+// IsCanAddLTE applies the LTE predicate on the "is_can_add" field.
+func IsCanAddLTE(v int) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldLTE(FieldIsCanAdd, v))
+}
+
+// TaskIDEQ applies the EQ predicate on the "task_id" field.
+func TaskIDEQ(v int64) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldEQ(FieldTaskID, v))
+}
+
+// TaskIDNEQ applies the NEQ predicate on the "task_id" field.
+func TaskIDNEQ(v int64) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldNEQ(FieldTaskID, v))
+}
+
+// TaskIDIn applies the In predicate on the "task_id" field.
+func TaskIDIn(vs ...int64) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldIn(FieldTaskID, vs...))
+}
+
+// TaskIDNotIn applies the NotIn predicate on the "task_id" field.
+func TaskIDNotIn(vs ...int64) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldNotIn(FieldTaskID, vs...))
+}
+
+// TaskIDGT applies the GT predicate on the "task_id" field.
+func TaskIDGT(v int64) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldGT(FieldTaskID, v))
+}
+
+// TaskIDGTE applies the GTE predicate on the "task_id" field.
+func TaskIDGTE(v int64) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldGTE(FieldTaskID, v))
+}
+
+// TaskIDLT applies the LT predicate on the "task_id" field.
+func TaskIDLT(v int64) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldLT(FieldTaskID, v))
+}
+
+// TaskIDLTE applies the LTE predicate on the "task_id" field.
+func TaskIDLTE(v int64) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldLTE(FieldTaskID, v))
+}
+
+// AddRequestIsNil applies the IsNil predicate on the "add_request" field.
+func AddRequestIsNil() predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldIsNull(FieldAddRequest))
+}
+
+// AddRequestNotNil applies the NotNil predicate on the "add_request" field.
+func AddRequestNotNil() predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldNotNull(FieldAddRequest))
+}
+
+// AddResultIsNil applies the IsNil predicate on the "add_result" field.
+func AddResultIsNil() predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldIsNull(FieldAddResult))
+}
+
+// AddResultNotNil applies the NotNil predicate on the "add_result" field.
+func AddResultNotNil() predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldNotNull(FieldAddResult))
+}
+
+// CreatedAtEQ applies the EQ predicate on the "created_at" field.
+func CreatedAtEQ(v int64) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldEQ(FieldCreatedAt, v))
+}
+
+// CreatedAtNEQ applies the NEQ predicate on the "created_at" field.
+func CreatedAtNEQ(v int64) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldNEQ(FieldCreatedAt, v))
+}
+
+// CreatedAtIn applies the In predicate on the "created_at" field.
+func CreatedAtIn(vs ...int64) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldIn(FieldCreatedAt, vs...))
+}
+
+// CreatedAtNotIn applies the NotIn predicate on the "created_at" field.
+func CreatedAtNotIn(vs ...int64) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldNotIn(FieldCreatedAt, vs...))
+}
+
+// CreatedAtGT applies the GT predicate on the "created_at" field.
+func CreatedAtGT(v int64) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldGT(FieldCreatedAt, v))
+}
+
+// CreatedAtGTE applies the GTE predicate on the "created_at" field.
+func CreatedAtGTE(v int64) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldGTE(FieldCreatedAt, v))
+}
+
+// CreatedAtLT applies the LT predicate on the "created_at" field.
+func CreatedAtLT(v int64) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldLT(FieldCreatedAt, v))
+}
+
+// CreatedAtLTE applies the LTE predicate on the "created_at" field.
+func CreatedAtLTE(v int64) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldLTE(FieldCreatedAt, v))
+}
+
+// UpdatedAtEQ applies the EQ predicate on the "updated_at" field.
+func UpdatedAtEQ(v int64) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldEQ(FieldUpdatedAt, v))
+}
+
+// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.
+func UpdatedAtNEQ(v int64) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldNEQ(FieldUpdatedAt, v))
+}
+
+// UpdatedAtIn applies the In predicate on the "updated_at" field.
+func UpdatedAtIn(vs ...int64) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldIn(FieldUpdatedAt, vs...))
+}
+
+// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field.
+func UpdatedAtNotIn(vs ...int64) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldNotIn(FieldUpdatedAt, vs...))
+}
+
+// UpdatedAtGT applies the GT predicate on the "updated_at" field.
+func UpdatedAtGT(v int64) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldGT(FieldUpdatedAt, v))
+}
+
+// UpdatedAtGTE applies the GTE predicate on the "updated_at" field.
+func UpdatedAtGTE(v int64) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldGTE(FieldUpdatedAt, v))
+}
+
+// UpdatedAtLT applies the LT predicate on the "updated_at" field.
+func UpdatedAtLT(v int64) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldLT(FieldUpdatedAt, v))
+}
+
+// UpdatedAtLTE applies the LTE predicate on the "updated_at" field.
+func UpdatedAtLTE(v int64) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.FieldLTE(FieldUpdatedAt, v))
+}
+
+// And groups predicates with the AND operator between them.
+func And(predicates ...predicate.AddWechatFriendLog) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.AndPredicates(predicates...))
+}
+
+// Or groups predicates with the OR operator between them.
+func Or(predicates ...predicate.AddWechatFriendLog) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.OrPredicates(predicates...))
+}
+
+// Not applies the not operator on the given predicate.
+func Not(p predicate.AddWechatFriendLog) predicate.AddWechatFriendLog {
+	return predicate.AddWechatFriendLog(sql.NotPredicates(p))
+}

+ 1282 - 0
ent/addwechatfriendlog_create.go

@@ -0,0 +1,1282 @@
+// Code generated by ent, DO NOT EDIT.
+
+package ent
+
+import (
+	"context"
+	"errors"
+	"fmt"
+	"wechat-api/ent/addwechatfriendlog"
+
+	"entgo.io/ent/dialect/sql"
+	"entgo.io/ent/dialect/sql/sqlgraph"
+	"entgo.io/ent/schema/field"
+)
+
+// AddWechatFriendLogCreate is the builder for creating a AddWechatFriendLog entity.
+type AddWechatFriendLogCreate struct {
+	config
+	mutation *AddWechatFriendLogMutation
+	hooks    []Hook
+	conflict []sql.ConflictOption
+}
+
+// SetOwnerWxID sets the "owner_wx_id" field.
+func (awflc *AddWechatFriendLogCreate) SetOwnerWxID(s string) *AddWechatFriendLogCreate {
+	awflc.mutation.SetOwnerWxID(s)
+	return awflc
+}
+
+// SetNillableOwnerWxID sets the "owner_wx_id" field if the given value is not nil.
+func (awflc *AddWechatFriendLogCreate) SetNillableOwnerWxID(s *string) *AddWechatFriendLogCreate {
+	if s != nil {
+		awflc.SetOwnerWxID(*s)
+	}
+	return awflc
+}
+
+// SetOwnerWxType sets the "owner_wx_type" field.
+func (awflc *AddWechatFriendLogCreate) SetOwnerWxType(i int) *AddWechatFriendLogCreate {
+	awflc.mutation.SetOwnerWxType(i)
+	return awflc
+}
+
+// SetNillableOwnerWxType sets the "owner_wx_type" field if the given value is not nil.
+func (awflc *AddWechatFriendLogCreate) SetNillableOwnerWxType(i *int) *AddWechatFriendLogCreate {
+	if i != nil {
+		awflc.SetOwnerWxType(*i)
+	}
+	return awflc
+}
+
+// SetFindContent sets the "find_content" field.
+func (awflc *AddWechatFriendLogCreate) SetFindContent(s string) *AddWechatFriendLogCreate {
+	awflc.mutation.SetFindContent(s)
+	return awflc
+}
+
+// SetNillableFindContent sets the "find_content" field if the given value is not nil.
+func (awflc *AddWechatFriendLogCreate) SetNillableFindContent(s *string) *AddWechatFriendLogCreate {
+	if s != nil {
+		awflc.SetFindContent(*s)
+	}
+	return awflc
+}
+
+// SetFindRequest sets the "find_request" field.
+func (awflc *AddWechatFriendLogCreate) SetFindRequest(m map[string]interface{}) *AddWechatFriendLogCreate {
+	awflc.mutation.SetFindRequest(m)
+	return awflc
+}
+
+// SetFindResult sets the "find_result" field.
+func (awflc *AddWechatFriendLogCreate) SetFindResult(m map[string]interface{}) *AddWechatFriendLogCreate {
+	awflc.mutation.SetFindResult(m)
+	return awflc
+}
+
+// SetIsCanAdd sets the "is_can_add" field.
+func (awflc *AddWechatFriendLogCreate) SetIsCanAdd(i int) *AddWechatFriendLogCreate {
+	awflc.mutation.SetIsCanAdd(i)
+	return awflc
+}
+
+// SetNillableIsCanAdd sets the "is_can_add" field if the given value is not nil.
+func (awflc *AddWechatFriendLogCreate) SetNillableIsCanAdd(i *int) *AddWechatFriendLogCreate {
+	if i != nil {
+		awflc.SetIsCanAdd(*i)
+	}
+	return awflc
+}
+
+// SetTaskID sets the "task_id" field.
+func (awflc *AddWechatFriendLogCreate) SetTaskID(i int64) *AddWechatFriendLogCreate {
+	awflc.mutation.SetTaskID(i)
+	return awflc
+}
+
+// SetNillableTaskID sets the "task_id" field if the given value is not nil.
+func (awflc *AddWechatFriendLogCreate) SetNillableTaskID(i *int64) *AddWechatFriendLogCreate {
+	if i != nil {
+		awflc.SetTaskID(*i)
+	}
+	return awflc
+}
+
+// SetAddRequest sets the "add_request" field.
+func (awflc *AddWechatFriendLogCreate) SetAddRequest(m map[string]interface{}) *AddWechatFriendLogCreate {
+	awflc.mutation.SetAddRequest(m)
+	return awflc
+}
+
+// SetAddResult sets the "add_result" field.
+func (awflc *AddWechatFriendLogCreate) SetAddResult(m map[string]interface{}) *AddWechatFriendLogCreate {
+	awflc.mutation.SetAddResult(m)
+	return awflc
+}
+
+// SetCreatedAt sets the "created_at" field.
+func (awflc *AddWechatFriendLogCreate) SetCreatedAt(i int64) *AddWechatFriendLogCreate {
+	awflc.mutation.SetCreatedAt(i)
+	return awflc
+}
+
+// SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
+func (awflc *AddWechatFriendLogCreate) SetNillableCreatedAt(i *int64) *AddWechatFriendLogCreate {
+	if i != nil {
+		awflc.SetCreatedAt(*i)
+	}
+	return awflc
+}
+
+// SetUpdatedAt sets the "updated_at" field.
+func (awflc *AddWechatFriendLogCreate) SetUpdatedAt(i int64) *AddWechatFriendLogCreate {
+	awflc.mutation.SetUpdatedAt(i)
+	return awflc
+}
+
+// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
+func (awflc *AddWechatFriendLogCreate) SetNillableUpdatedAt(i *int64) *AddWechatFriendLogCreate {
+	if i != nil {
+		awflc.SetUpdatedAt(*i)
+	}
+	return awflc
+}
+
+// SetID sets the "id" field.
+func (awflc *AddWechatFriendLogCreate) SetID(i int64) *AddWechatFriendLogCreate {
+	awflc.mutation.SetID(i)
+	return awflc
+}
+
+// Mutation returns the AddWechatFriendLogMutation object of the builder.
+func (awflc *AddWechatFriendLogCreate) Mutation() *AddWechatFriendLogMutation {
+	return awflc.mutation
+}
+
+// Save creates the AddWechatFriendLog in the database.
+func (awflc *AddWechatFriendLogCreate) Save(ctx context.Context) (*AddWechatFriendLog, error) {
+	awflc.defaults()
+	return withHooks(ctx, awflc.sqlSave, awflc.mutation, awflc.hooks)
+}
+
+// SaveX calls Save and panics if Save returns an error.
+func (awflc *AddWechatFriendLogCreate) SaveX(ctx context.Context) *AddWechatFriendLog {
+	v, err := awflc.Save(ctx)
+	if err != nil {
+		panic(err)
+	}
+	return v
+}
+
+// Exec executes the query.
+func (awflc *AddWechatFriendLogCreate) Exec(ctx context.Context) error {
+	_, err := awflc.Save(ctx)
+	return err
+}
+
+// ExecX is like Exec, but panics if an error occurs.
+func (awflc *AddWechatFriendLogCreate) ExecX(ctx context.Context) {
+	if err := awflc.Exec(ctx); err != nil {
+		panic(err)
+	}
+}
+
+// defaults sets the default values of the builder before save.
+func (awflc *AddWechatFriendLogCreate) defaults() {
+	if _, ok := awflc.mutation.OwnerWxID(); !ok {
+		v := addwechatfriendlog.DefaultOwnerWxID
+		awflc.mutation.SetOwnerWxID(v)
+	}
+	if _, ok := awflc.mutation.OwnerWxType(); !ok {
+		v := addwechatfriendlog.DefaultOwnerWxType
+		awflc.mutation.SetOwnerWxType(v)
+	}
+	if _, ok := awflc.mutation.FindContent(); !ok {
+		v := addwechatfriendlog.DefaultFindContent
+		awflc.mutation.SetFindContent(v)
+	}
+	if _, ok := awflc.mutation.IsCanAdd(); !ok {
+		v := addwechatfriendlog.DefaultIsCanAdd
+		awflc.mutation.SetIsCanAdd(v)
+	}
+	if _, ok := awflc.mutation.TaskID(); !ok {
+		v := addwechatfriendlog.DefaultTaskID
+		awflc.mutation.SetTaskID(v)
+	}
+	if _, ok := awflc.mutation.CreatedAt(); !ok {
+		v := addwechatfriendlog.DefaultCreatedAt()
+		awflc.mutation.SetCreatedAt(v)
+	}
+	if _, ok := awflc.mutation.UpdatedAt(); !ok {
+		v := addwechatfriendlog.DefaultUpdatedAt()
+		awflc.mutation.SetUpdatedAt(v)
+	}
+}
+
+// check runs all checks and user-defined validators on the builder.
+func (awflc *AddWechatFriendLogCreate) check() error {
+	if _, ok := awflc.mutation.OwnerWxID(); !ok {
+		return &ValidationError{Name: "owner_wx_id", err: errors.New(`ent: missing required field "AddWechatFriendLog.owner_wx_id"`)}
+	}
+	if v, ok := awflc.mutation.OwnerWxID(); ok {
+		if err := addwechatfriendlog.OwnerWxIDValidator(v); err != nil {
+			return &ValidationError{Name: "owner_wx_id", err: fmt.Errorf(`ent: validator failed for field "AddWechatFriendLog.owner_wx_id": %w`, err)}
+		}
+	}
+	if _, ok := awflc.mutation.OwnerWxType(); !ok {
+		return &ValidationError{Name: "owner_wx_type", err: errors.New(`ent: missing required field "AddWechatFriendLog.owner_wx_type"`)}
+	}
+	if _, ok := awflc.mutation.FindContent(); !ok {
+		return &ValidationError{Name: "find_content", err: errors.New(`ent: missing required field "AddWechatFriendLog.find_content"`)}
+	}
+	if v, ok := awflc.mutation.FindContent(); ok {
+		if err := addwechatfriendlog.FindContentValidator(v); err != nil {
+			return &ValidationError{Name: "find_content", err: fmt.Errorf(`ent: validator failed for field "AddWechatFriendLog.find_content": %w`, err)}
+		}
+	}
+	if _, ok := awflc.mutation.IsCanAdd(); !ok {
+		return &ValidationError{Name: "is_can_add", err: errors.New(`ent: missing required field "AddWechatFriendLog.is_can_add"`)}
+	}
+	if _, ok := awflc.mutation.TaskID(); !ok {
+		return &ValidationError{Name: "task_id", err: errors.New(`ent: missing required field "AddWechatFriendLog.task_id"`)}
+	}
+	if _, ok := awflc.mutation.CreatedAt(); !ok {
+		return &ValidationError{Name: "created_at", err: errors.New(`ent: missing required field "AddWechatFriendLog.created_at"`)}
+	}
+	if _, ok := awflc.mutation.UpdatedAt(); !ok {
+		return &ValidationError{Name: "updated_at", err: errors.New(`ent: missing required field "AddWechatFriendLog.updated_at"`)}
+	}
+	return nil
+}
+
+func (awflc *AddWechatFriendLogCreate) sqlSave(ctx context.Context) (*AddWechatFriendLog, error) {
+	if err := awflc.check(); err != nil {
+		return nil, err
+	}
+	_node, _spec := awflc.createSpec()
+	if err := sqlgraph.CreateNode(ctx, awflc.driver, _spec); err != nil {
+		if sqlgraph.IsConstraintError(err) {
+			err = &ConstraintError{msg: err.Error(), wrap: err}
+		}
+		return nil, err
+	}
+	if _spec.ID.Value != _node.ID {
+		id := _spec.ID.Value.(int64)
+		_node.ID = int64(id)
+	}
+	awflc.mutation.id = &_node.ID
+	awflc.mutation.done = true
+	return _node, nil
+}
+
+func (awflc *AddWechatFriendLogCreate) createSpec() (*AddWechatFriendLog, *sqlgraph.CreateSpec) {
+	var (
+		_node = &AddWechatFriendLog{config: awflc.config}
+		_spec = sqlgraph.NewCreateSpec(addwechatfriendlog.Table, sqlgraph.NewFieldSpec(addwechatfriendlog.FieldID, field.TypeInt64))
+	)
+	_spec.OnConflict = awflc.conflict
+	if id, ok := awflc.mutation.ID(); ok {
+		_node.ID = id
+		_spec.ID.Value = id
+	}
+	if value, ok := awflc.mutation.OwnerWxID(); ok {
+		_spec.SetField(addwechatfriendlog.FieldOwnerWxID, field.TypeString, value)
+		_node.OwnerWxID = value
+	}
+	if value, ok := awflc.mutation.OwnerWxType(); ok {
+		_spec.SetField(addwechatfriendlog.FieldOwnerWxType, field.TypeInt, value)
+		_node.OwnerWxType = value
+	}
+	if value, ok := awflc.mutation.FindContent(); ok {
+		_spec.SetField(addwechatfriendlog.FieldFindContent, field.TypeString, value)
+		_node.FindContent = value
+	}
+	if value, ok := awflc.mutation.FindRequest(); ok {
+		_spec.SetField(addwechatfriendlog.FieldFindRequest, field.TypeJSON, value)
+		_node.FindRequest = value
+	}
+	if value, ok := awflc.mutation.FindResult(); ok {
+		_spec.SetField(addwechatfriendlog.FieldFindResult, field.TypeJSON, value)
+		_node.FindResult = value
+	}
+	if value, ok := awflc.mutation.IsCanAdd(); ok {
+		_spec.SetField(addwechatfriendlog.FieldIsCanAdd, field.TypeInt, value)
+		_node.IsCanAdd = value
+	}
+	if value, ok := awflc.mutation.TaskID(); ok {
+		_spec.SetField(addwechatfriendlog.FieldTaskID, field.TypeInt64, value)
+		_node.TaskID = value
+	}
+	if value, ok := awflc.mutation.AddRequest(); ok {
+		_spec.SetField(addwechatfriendlog.FieldAddRequest, field.TypeJSON, value)
+		_node.AddRequest = value
+	}
+	if value, ok := awflc.mutation.AddResult(); ok {
+		_spec.SetField(addwechatfriendlog.FieldAddResult, field.TypeJSON, value)
+		_node.AddResult = value
+	}
+	if value, ok := awflc.mutation.CreatedAt(); ok {
+		_spec.SetField(addwechatfriendlog.FieldCreatedAt, field.TypeInt64, value)
+		_node.CreatedAt = value
+	}
+	if value, ok := awflc.mutation.UpdatedAt(); ok {
+		_spec.SetField(addwechatfriendlog.FieldUpdatedAt, field.TypeInt64, value)
+		_node.UpdatedAt = value
+	}
+	return _node, _spec
+}
+
+// OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause
+// of the `INSERT` statement. For example:
+//
+//	client.AddWechatFriendLog.Create().
+//		SetOwnerWxID(v).
+//		OnConflict(
+//			// Update the row with the new values
+//			// the was proposed for insertion.
+//			sql.ResolveWithNewValues(),
+//		).
+//		// Override some of the fields with custom
+//		// update values.
+//		Update(func(u *ent.AddWechatFriendLogUpsert) {
+//			SetOwnerWxID(v+v).
+//		}).
+//		Exec(ctx)
+func (awflc *AddWechatFriendLogCreate) OnConflict(opts ...sql.ConflictOption) *AddWechatFriendLogUpsertOne {
+	awflc.conflict = opts
+	return &AddWechatFriendLogUpsertOne{
+		create: awflc,
+	}
+}
+
+// OnConflictColumns calls `OnConflict` and configures the columns
+// as conflict target. Using this option is equivalent to using:
+//
+//	client.AddWechatFriendLog.Create().
+//		OnConflict(sql.ConflictColumns(columns...)).
+//		Exec(ctx)
+func (awflc *AddWechatFriendLogCreate) OnConflictColumns(columns ...string) *AddWechatFriendLogUpsertOne {
+	awflc.conflict = append(awflc.conflict, sql.ConflictColumns(columns...))
+	return &AddWechatFriendLogUpsertOne{
+		create: awflc,
+	}
+}
+
+type (
+	// AddWechatFriendLogUpsertOne is the builder for "upsert"-ing
+	//  one AddWechatFriendLog node.
+	AddWechatFriendLogUpsertOne struct {
+		create *AddWechatFriendLogCreate
+	}
+
+	// AddWechatFriendLogUpsert is the "OnConflict" setter.
+	AddWechatFriendLogUpsert struct {
+		*sql.UpdateSet
+	}
+)
+
+// SetOwnerWxID sets the "owner_wx_id" field.
+func (u *AddWechatFriendLogUpsert) SetOwnerWxID(v string) *AddWechatFriendLogUpsert {
+	u.Set(addwechatfriendlog.FieldOwnerWxID, v)
+	return u
+}
+
+// UpdateOwnerWxID sets the "owner_wx_id" field to the value that was provided on create.
+func (u *AddWechatFriendLogUpsert) UpdateOwnerWxID() *AddWechatFriendLogUpsert {
+	u.SetExcluded(addwechatfriendlog.FieldOwnerWxID)
+	return u
+}
+
+// SetOwnerWxType sets the "owner_wx_type" field.
+func (u *AddWechatFriendLogUpsert) SetOwnerWxType(v int) *AddWechatFriendLogUpsert {
+	u.Set(addwechatfriendlog.FieldOwnerWxType, v)
+	return u
+}
+
+// UpdateOwnerWxType sets the "owner_wx_type" field to the value that was provided on create.
+func (u *AddWechatFriendLogUpsert) UpdateOwnerWxType() *AddWechatFriendLogUpsert {
+	u.SetExcluded(addwechatfriendlog.FieldOwnerWxType)
+	return u
+}
+
+// AddOwnerWxType adds v to the "owner_wx_type" field.
+func (u *AddWechatFriendLogUpsert) AddOwnerWxType(v int) *AddWechatFriendLogUpsert {
+	u.Add(addwechatfriendlog.FieldOwnerWxType, v)
+	return u
+}
+
+// SetFindContent sets the "find_content" field.
+func (u *AddWechatFriendLogUpsert) SetFindContent(v string) *AddWechatFriendLogUpsert {
+	u.Set(addwechatfriendlog.FieldFindContent, v)
+	return u
+}
+
+// UpdateFindContent sets the "find_content" field to the value that was provided on create.
+func (u *AddWechatFriendLogUpsert) UpdateFindContent() *AddWechatFriendLogUpsert {
+	u.SetExcluded(addwechatfriendlog.FieldFindContent)
+	return u
+}
+
+// SetFindRequest sets the "find_request" field.
+func (u *AddWechatFriendLogUpsert) SetFindRequest(v map[string]interface{}) *AddWechatFriendLogUpsert {
+	u.Set(addwechatfriendlog.FieldFindRequest, v)
+	return u
+}
+
+// UpdateFindRequest sets the "find_request" field to the value that was provided on create.
+func (u *AddWechatFriendLogUpsert) UpdateFindRequest() *AddWechatFriendLogUpsert {
+	u.SetExcluded(addwechatfriendlog.FieldFindRequest)
+	return u
+}
+
+// ClearFindRequest clears the value of the "find_request" field.
+func (u *AddWechatFriendLogUpsert) ClearFindRequest() *AddWechatFriendLogUpsert {
+	u.SetNull(addwechatfriendlog.FieldFindRequest)
+	return u
+}
+
+// SetFindResult sets the "find_result" field.
+func (u *AddWechatFriendLogUpsert) SetFindResult(v map[string]interface{}) *AddWechatFriendLogUpsert {
+	u.Set(addwechatfriendlog.FieldFindResult, v)
+	return u
+}
+
+// UpdateFindResult sets the "find_result" field to the value that was provided on create.
+func (u *AddWechatFriendLogUpsert) UpdateFindResult() *AddWechatFriendLogUpsert {
+	u.SetExcluded(addwechatfriendlog.FieldFindResult)
+	return u
+}
+
+// ClearFindResult clears the value of the "find_result" field.
+func (u *AddWechatFriendLogUpsert) ClearFindResult() *AddWechatFriendLogUpsert {
+	u.SetNull(addwechatfriendlog.FieldFindResult)
+	return u
+}
+
+// SetIsCanAdd sets the "is_can_add" field.
+func (u *AddWechatFriendLogUpsert) SetIsCanAdd(v int) *AddWechatFriendLogUpsert {
+	u.Set(addwechatfriendlog.FieldIsCanAdd, v)
+	return u
+}
+
+// UpdateIsCanAdd sets the "is_can_add" field to the value that was provided on create.
+func (u *AddWechatFriendLogUpsert) UpdateIsCanAdd() *AddWechatFriendLogUpsert {
+	u.SetExcluded(addwechatfriendlog.FieldIsCanAdd)
+	return u
+}
+
+// AddIsCanAdd adds v to the "is_can_add" field.
+func (u *AddWechatFriendLogUpsert) AddIsCanAdd(v int) *AddWechatFriendLogUpsert {
+	u.Add(addwechatfriendlog.FieldIsCanAdd, v)
+	return u
+}
+
+// SetTaskID sets the "task_id" field.
+func (u *AddWechatFriendLogUpsert) SetTaskID(v int64) *AddWechatFriendLogUpsert {
+	u.Set(addwechatfriendlog.FieldTaskID, v)
+	return u
+}
+
+// UpdateTaskID sets the "task_id" field to the value that was provided on create.
+func (u *AddWechatFriendLogUpsert) UpdateTaskID() *AddWechatFriendLogUpsert {
+	u.SetExcluded(addwechatfriendlog.FieldTaskID)
+	return u
+}
+
+// AddTaskID adds v to the "task_id" field.
+func (u *AddWechatFriendLogUpsert) AddTaskID(v int64) *AddWechatFriendLogUpsert {
+	u.Add(addwechatfriendlog.FieldTaskID, v)
+	return u
+}
+
+// SetAddRequest sets the "add_request" field.
+func (u *AddWechatFriendLogUpsert) SetAddRequest(v map[string]interface{}) *AddWechatFriendLogUpsert {
+	u.Set(addwechatfriendlog.FieldAddRequest, v)
+	return u
+}
+
+// UpdateAddRequest sets the "add_request" field to the value that was provided on create.
+func (u *AddWechatFriendLogUpsert) UpdateAddRequest() *AddWechatFriendLogUpsert {
+	u.SetExcluded(addwechatfriendlog.FieldAddRequest)
+	return u
+}
+
+// ClearAddRequest clears the value of the "add_request" field.
+func (u *AddWechatFriendLogUpsert) ClearAddRequest() *AddWechatFriendLogUpsert {
+	u.SetNull(addwechatfriendlog.FieldAddRequest)
+	return u
+}
+
+// SetAddResult sets the "add_result" field.
+func (u *AddWechatFriendLogUpsert) SetAddResult(v map[string]interface{}) *AddWechatFriendLogUpsert {
+	u.Set(addwechatfriendlog.FieldAddResult, v)
+	return u
+}
+
+// UpdateAddResult sets the "add_result" field to the value that was provided on create.
+func (u *AddWechatFriendLogUpsert) UpdateAddResult() *AddWechatFriendLogUpsert {
+	u.SetExcluded(addwechatfriendlog.FieldAddResult)
+	return u
+}
+
+// ClearAddResult clears the value of the "add_result" field.
+func (u *AddWechatFriendLogUpsert) ClearAddResult() *AddWechatFriendLogUpsert {
+	u.SetNull(addwechatfriendlog.FieldAddResult)
+	return u
+}
+
+// SetCreatedAt sets the "created_at" field.
+func (u *AddWechatFriendLogUpsert) SetCreatedAt(v int64) *AddWechatFriendLogUpsert {
+	u.Set(addwechatfriendlog.FieldCreatedAt, v)
+	return u
+}
+
+// UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
+func (u *AddWechatFriendLogUpsert) UpdateCreatedAt() *AddWechatFriendLogUpsert {
+	u.SetExcluded(addwechatfriendlog.FieldCreatedAt)
+	return u
+}
+
+// AddCreatedAt adds v to the "created_at" field.
+func (u *AddWechatFriendLogUpsert) AddCreatedAt(v int64) *AddWechatFriendLogUpsert {
+	u.Add(addwechatfriendlog.FieldCreatedAt, v)
+	return u
+}
+
+// SetUpdatedAt sets the "updated_at" field.
+func (u *AddWechatFriendLogUpsert) SetUpdatedAt(v int64) *AddWechatFriendLogUpsert {
+	u.Set(addwechatfriendlog.FieldUpdatedAt, v)
+	return u
+}
+
+// UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
+func (u *AddWechatFriendLogUpsert) UpdateUpdatedAt() *AddWechatFriendLogUpsert {
+	u.SetExcluded(addwechatfriendlog.FieldUpdatedAt)
+	return u
+}
+
+// AddUpdatedAt adds v to the "updated_at" field.
+func (u *AddWechatFriendLogUpsert) AddUpdatedAt(v int64) *AddWechatFriendLogUpsert {
+	u.Add(addwechatfriendlog.FieldUpdatedAt, v)
+	return u
+}
+
+// UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field.
+// Using this option is equivalent to using:
+//
+//	client.AddWechatFriendLog.Create().
+//		OnConflict(
+//			sql.ResolveWithNewValues(),
+//			sql.ResolveWith(func(u *sql.UpdateSet) {
+//				u.SetIgnore(addwechatfriendlog.FieldID)
+//			}),
+//		).
+//		Exec(ctx)
+func (u *AddWechatFriendLogUpsertOne) UpdateNewValues() *AddWechatFriendLogUpsertOne {
+	u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues())
+	u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) {
+		if _, exists := u.create.mutation.ID(); exists {
+			s.SetIgnore(addwechatfriendlog.FieldID)
+		}
+	}))
+	return u
+}
+
+// Ignore sets each column to itself in case of conflict.
+// Using this option is equivalent to using:
+//
+//	client.AddWechatFriendLog.Create().
+//	    OnConflict(sql.ResolveWithIgnore()).
+//	    Exec(ctx)
+func (u *AddWechatFriendLogUpsertOne) Ignore() *AddWechatFriendLogUpsertOne {
+	u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore())
+	return u
+}
+
+// DoNothing configures the conflict_action to `DO NOTHING`.
+// Supported only by SQLite and PostgreSQL.
+func (u *AddWechatFriendLogUpsertOne) DoNothing() *AddWechatFriendLogUpsertOne {
+	u.create.conflict = append(u.create.conflict, sql.DoNothing())
+	return u
+}
+
+// Update allows overriding fields `UPDATE` values. See the AddWechatFriendLogCreate.OnConflict
+// documentation for more info.
+func (u *AddWechatFriendLogUpsertOne) Update(set func(*AddWechatFriendLogUpsert)) *AddWechatFriendLogUpsertOne {
+	u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) {
+		set(&AddWechatFriendLogUpsert{UpdateSet: update})
+	}))
+	return u
+}
+
+// SetOwnerWxID sets the "owner_wx_id" field.
+func (u *AddWechatFriendLogUpsertOne) SetOwnerWxID(v string) *AddWechatFriendLogUpsertOne {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.SetOwnerWxID(v)
+	})
+}
+
+// UpdateOwnerWxID sets the "owner_wx_id" field to the value that was provided on create.
+func (u *AddWechatFriendLogUpsertOne) UpdateOwnerWxID() *AddWechatFriendLogUpsertOne {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.UpdateOwnerWxID()
+	})
+}
+
+// SetOwnerWxType sets the "owner_wx_type" field.
+func (u *AddWechatFriendLogUpsertOne) SetOwnerWxType(v int) *AddWechatFriendLogUpsertOne {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.SetOwnerWxType(v)
+	})
+}
+
+// AddOwnerWxType adds v to the "owner_wx_type" field.
+func (u *AddWechatFriendLogUpsertOne) AddOwnerWxType(v int) *AddWechatFriendLogUpsertOne {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.AddOwnerWxType(v)
+	})
+}
+
+// UpdateOwnerWxType sets the "owner_wx_type" field to the value that was provided on create.
+func (u *AddWechatFriendLogUpsertOne) UpdateOwnerWxType() *AddWechatFriendLogUpsertOne {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.UpdateOwnerWxType()
+	})
+}
+
+// SetFindContent sets the "find_content" field.
+func (u *AddWechatFriendLogUpsertOne) SetFindContent(v string) *AddWechatFriendLogUpsertOne {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.SetFindContent(v)
+	})
+}
+
+// UpdateFindContent sets the "find_content" field to the value that was provided on create.
+func (u *AddWechatFriendLogUpsertOne) UpdateFindContent() *AddWechatFriendLogUpsertOne {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.UpdateFindContent()
+	})
+}
+
+// SetFindRequest sets the "find_request" field.
+func (u *AddWechatFriendLogUpsertOne) SetFindRequest(v map[string]interface{}) *AddWechatFriendLogUpsertOne {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.SetFindRequest(v)
+	})
+}
+
+// UpdateFindRequest sets the "find_request" field to the value that was provided on create.
+func (u *AddWechatFriendLogUpsertOne) UpdateFindRequest() *AddWechatFriendLogUpsertOne {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.UpdateFindRequest()
+	})
+}
+
+// ClearFindRequest clears the value of the "find_request" field.
+func (u *AddWechatFriendLogUpsertOne) ClearFindRequest() *AddWechatFriendLogUpsertOne {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.ClearFindRequest()
+	})
+}
+
+// SetFindResult sets the "find_result" field.
+func (u *AddWechatFriendLogUpsertOne) SetFindResult(v map[string]interface{}) *AddWechatFriendLogUpsertOne {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.SetFindResult(v)
+	})
+}
+
+// UpdateFindResult sets the "find_result" field to the value that was provided on create.
+func (u *AddWechatFriendLogUpsertOne) UpdateFindResult() *AddWechatFriendLogUpsertOne {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.UpdateFindResult()
+	})
+}
+
+// ClearFindResult clears the value of the "find_result" field.
+func (u *AddWechatFriendLogUpsertOne) ClearFindResult() *AddWechatFriendLogUpsertOne {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.ClearFindResult()
+	})
+}
+
+// SetIsCanAdd sets the "is_can_add" field.
+func (u *AddWechatFriendLogUpsertOne) SetIsCanAdd(v int) *AddWechatFriendLogUpsertOne {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.SetIsCanAdd(v)
+	})
+}
+
+// AddIsCanAdd adds v to the "is_can_add" field.
+func (u *AddWechatFriendLogUpsertOne) AddIsCanAdd(v int) *AddWechatFriendLogUpsertOne {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.AddIsCanAdd(v)
+	})
+}
+
+// UpdateIsCanAdd sets the "is_can_add" field to the value that was provided on create.
+func (u *AddWechatFriendLogUpsertOne) UpdateIsCanAdd() *AddWechatFriendLogUpsertOne {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.UpdateIsCanAdd()
+	})
+}
+
+// SetTaskID sets the "task_id" field.
+func (u *AddWechatFriendLogUpsertOne) SetTaskID(v int64) *AddWechatFriendLogUpsertOne {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.SetTaskID(v)
+	})
+}
+
+// AddTaskID adds v to the "task_id" field.
+func (u *AddWechatFriendLogUpsertOne) AddTaskID(v int64) *AddWechatFriendLogUpsertOne {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.AddTaskID(v)
+	})
+}
+
+// UpdateTaskID sets the "task_id" field to the value that was provided on create.
+func (u *AddWechatFriendLogUpsertOne) UpdateTaskID() *AddWechatFriendLogUpsertOne {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.UpdateTaskID()
+	})
+}
+
+// SetAddRequest sets the "add_request" field.
+func (u *AddWechatFriendLogUpsertOne) SetAddRequest(v map[string]interface{}) *AddWechatFriendLogUpsertOne {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.SetAddRequest(v)
+	})
+}
+
+// UpdateAddRequest sets the "add_request" field to the value that was provided on create.
+func (u *AddWechatFriendLogUpsertOne) UpdateAddRequest() *AddWechatFriendLogUpsertOne {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.UpdateAddRequest()
+	})
+}
+
+// ClearAddRequest clears the value of the "add_request" field.
+func (u *AddWechatFriendLogUpsertOne) ClearAddRequest() *AddWechatFriendLogUpsertOne {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.ClearAddRequest()
+	})
+}
+
+// SetAddResult sets the "add_result" field.
+func (u *AddWechatFriendLogUpsertOne) SetAddResult(v map[string]interface{}) *AddWechatFriendLogUpsertOne {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.SetAddResult(v)
+	})
+}
+
+// UpdateAddResult sets the "add_result" field to the value that was provided on create.
+func (u *AddWechatFriendLogUpsertOne) UpdateAddResult() *AddWechatFriendLogUpsertOne {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.UpdateAddResult()
+	})
+}
+
+// ClearAddResult clears the value of the "add_result" field.
+func (u *AddWechatFriendLogUpsertOne) ClearAddResult() *AddWechatFriendLogUpsertOne {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.ClearAddResult()
+	})
+}
+
+// SetCreatedAt sets the "created_at" field.
+func (u *AddWechatFriendLogUpsertOne) SetCreatedAt(v int64) *AddWechatFriendLogUpsertOne {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.SetCreatedAt(v)
+	})
+}
+
+// AddCreatedAt adds v to the "created_at" field.
+func (u *AddWechatFriendLogUpsertOne) AddCreatedAt(v int64) *AddWechatFriendLogUpsertOne {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.AddCreatedAt(v)
+	})
+}
+
+// UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
+func (u *AddWechatFriendLogUpsertOne) UpdateCreatedAt() *AddWechatFriendLogUpsertOne {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.UpdateCreatedAt()
+	})
+}
+
+// SetUpdatedAt sets the "updated_at" field.
+func (u *AddWechatFriendLogUpsertOne) SetUpdatedAt(v int64) *AddWechatFriendLogUpsertOne {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.SetUpdatedAt(v)
+	})
+}
+
+// AddUpdatedAt adds v to the "updated_at" field.
+func (u *AddWechatFriendLogUpsertOne) AddUpdatedAt(v int64) *AddWechatFriendLogUpsertOne {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.AddUpdatedAt(v)
+	})
+}
+
+// UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
+func (u *AddWechatFriendLogUpsertOne) UpdateUpdatedAt() *AddWechatFriendLogUpsertOne {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.UpdateUpdatedAt()
+	})
+}
+
+// Exec executes the query.
+func (u *AddWechatFriendLogUpsertOne) Exec(ctx context.Context) error {
+	if len(u.create.conflict) == 0 {
+		return errors.New("ent: missing options for AddWechatFriendLogCreate.OnConflict")
+	}
+	return u.create.Exec(ctx)
+}
+
+// ExecX is like Exec, but panics if an error occurs.
+func (u *AddWechatFriendLogUpsertOne) ExecX(ctx context.Context) {
+	if err := u.create.Exec(ctx); err != nil {
+		panic(err)
+	}
+}
+
+// Exec executes the UPSERT query and returns the inserted/updated ID.
+func (u *AddWechatFriendLogUpsertOne) ID(ctx context.Context) (id int64, err error) {
+	node, err := u.create.Save(ctx)
+	if err != nil {
+		return id, err
+	}
+	return node.ID, nil
+}
+
+// IDX is like ID, but panics if an error occurs.
+func (u *AddWechatFriendLogUpsertOne) IDX(ctx context.Context) int64 {
+	id, err := u.ID(ctx)
+	if err != nil {
+		panic(err)
+	}
+	return id
+}
+
+// AddWechatFriendLogCreateBulk is the builder for creating many AddWechatFriendLog entities in bulk.
+type AddWechatFriendLogCreateBulk struct {
+	config
+	err      error
+	builders []*AddWechatFriendLogCreate
+	conflict []sql.ConflictOption
+}
+
+// Save creates the AddWechatFriendLog entities in the database.
+func (awflcb *AddWechatFriendLogCreateBulk) Save(ctx context.Context) ([]*AddWechatFriendLog, error) {
+	if awflcb.err != nil {
+		return nil, awflcb.err
+	}
+	specs := make([]*sqlgraph.CreateSpec, len(awflcb.builders))
+	nodes := make([]*AddWechatFriendLog, len(awflcb.builders))
+	mutators := make([]Mutator, len(awflcb.builders))
+	for i := range awflcb.builders {
+		func(i int, root context.Context) {
+			builder := awflcb.builders[i]
+			builder.defaults()
+			var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {
+				mutation, ok := m.(*AddWechatFriendLogMutation)
+				if !ok {
+					return nil, fmt.Errorf("unexpected mutation type %T", m)
+				}
+				if err := builder.check(); err != nil {
+					return nil, err
+				}
+				builder.mutation = mutation
+				var err error
+				nodes[i], specs[i] = builder.createSpec()
+				if i < len(mutators)-1 {
+					_, err = mutators[i+1].Mutate(root, awflcb.builders[i+1].mutation)
+				} else {
+					spec := &sqlgraph.BatchCreateSpec{Nodes: specs}
+					spec.OnConflict = awflcb.conflict
+					// Invoke the actual operation on the latest mutation in the chain.
+					if err = sqlgraph.BatchCreate(ctx, awflcb.driver, spec); err != nil {
+						if sqlgraph.IsConstraintError(err) {
+							err = &ConstraintError{msg: err.Error(), wrap: err}
+						}
+					}
+				}
+				if err != nil {
+					return nil, err
+				}
+				mutation.id = &nodes[i].ID
+				if specs[i].ID.Value != nil && nodes[i].ID == 0 {
+					id := specs[i].ID.Value.(int64)
+					nodes[i].ID = int64(id)
+				}
+				mutation.done = true
+				return nodes[i], nil
+			})
+			for i := len(builder.hooks) - 1; i >= 0; i-- {
+				mut = builder.hooks[i](mut)
+			}
+			mutators[i] = mut
+		}(i, ctx)
+	}
+	if len(mutators) > 0 {
+		if _, err := mutators[0].Mutate(ctx, awflcb.builders[0].mutation); err != nil {
+			return nil, err
+		}
+	}
+	return nodes, nil
+}
+
+// SaveX is like Save, but panics if an error occurs.
+func (awflcb *AddWechatFriendLogCreateBulk) SaveX(ctx context.Context) []*AddWechatFriendLog {
+	v, err := awflcb.Save(ctx)
+	if err != nil {
+		panic(err)
+	}
+	return v
+}
+
+// Exec executes the query.
+func (awflcb *AddWechatFriendLogCreateBulk) Exec(ctx context.Context) error {
+	_, err := awflcb.Save(ctx)
+	return err
+}
+
+// ExecX is like Exec, but panics if an error occurs.
+func (awflcb *AddWechatFriendLogCreateBulk) ExecX(ctx context.Context) {
+	if err := awflcb.Exec(ctx); err != nil {
+		panic(err)
+	}
+}
+
+// OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause
+// of the `INSERT` statement. For example:
+//
+//	client.AddWechatFriendLog.CreateBulk(builders...).
+//		OnConflict(
+//			// Update the row with the new values
+//			// the was proposed for insertion.
+//			sql.ResolveWithNewValues(),
+//		).
+//		// Override some of the fields with custom
+//		// update values.
+//		Update(func(u *ent.AddWechatFriendLogUpsert) {
+//			SetOwnerWxID(v+v).
+//		}).
+//		Exec(ctx)
+func (awflcb *AddWechatFriendLogCreateBulk) OnConflict(opts ...sql.ConflictOption) *AddWechatFriendLogUpsertBulk {
+	awflcb.conflict = opts
+	return &AddWechatFriendLogUpsertBulk{
+		create: awflcb,
+	}
+}
+
+// OnConflictColumns calls `OnConflict` and configures the columns
+// as conflict target. Using this option is equivalent to using:
+//
+//	client.AddWechatFriendLog.Create().
+//		OnConflict(sql.ConflictColumns(columns...)).
+//		Exec(ctx)
+func (awflcb *AddWechatFriendLogCreateBulk) OnConflictColumns(columns ...string) *AddWechatFriendLogUpsertBulk {
+	awflcb.conflict = append(awflcb.conflict, sql.ConflictColumns(columns...))
+	return &AddWechatFriendLogUpsertBulk{
+		create: awflcb,
+	}
+}
+
+// AddWechatFriendLogUpsertBulk is the builder for "upsert"-ing
+// a bulk of AddWechatFriendLog nodes.
+type AddWechatFriendLogUpsertBulk struct {
+	create *AddWechatFriendLogCreateBulk
+}
+
+// UpdateNewValues updates the mutable fields using the new values that
+// were set on create. Using this option is equivalent to using:
+//
+//	client.AddWechatFriendLog.Create().
+//		OnConflict(
+//			sql.ResolveWithNewValues(),
+//			sql.ResolveWith(func(u *sql.UpdateSet) {
+//				u.SetIgnore(addwechatfriendlog.FieldID)
+//			}),
+//		).
+//		Exec(ctx)
+func (u *AddWechatFriendLogUpsertBulk) UpdateNewValues() *AddWechatFriendLogUpsertBulk {
+	u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues())
+	u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) {
+		for _, b := range u.create.builders {
+			if _, exists := b.mutation.ID(); exists {
+				s.SetIgnore(addwechatfriendlog.FieldID)
+			}
+		}
+	}))
+	return u
+}
+
+// Ignore sets each column to itself in case of conflict.
+// Using this option is equivalent to using:
+//
+//	client.AddWechatFriendLog.Create().
+//		OnConflict(sql.ResolveWithIgnore()).
+//		Exec(ctx)
+func (u *AddWechatFriendLogUpsertBulk) Ignore() *AddWechatFriendLogUpsertBulk {
+	u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore())
+	return u
+}
+
+// DoNothing configures the conflict_action to `DO NOTHING`.
+// Supported only by SQLite and PostgreSQL.
+func (u *AddWechatFriendLogUpsertBulk) DoNothing() *AddWechatFriendLogUpsertBulk {
+	u.create.conflict = append(u.create.conflict, sql.DoNothing())
+	return u
+}
+
+// Update allows overriding fields `UPDATE` values. See the AddWechatFriendLogCreateBulk.OnConflict
+// documentation for more info.
+func (u *AddWechatFriendLogUpsertBulk) Update(set func(*AddWechatFriendLogUpsert)) *AddWechatFriendLogUpsertBulk {
+	u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) {
+		set(&AddWechatFriendLogUpsert{UpdateSet: update})
+	}))
+	return u
+}
+
+// SetOwnerWxID sets the "owner_wx_id" field.
+func (u *AddWechatFriendLogUpsertBulk) SetOwnerWxID(v string) *AddWechatFriendLogUpsertBulk {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.SetOwnerWxID(v)
+	})
+}
+
+// UpdateOwnerWxID sets the "owner_wx_id" field to the value that was provided on create.
+func (u *AddWechatFriendLogUpsertBulk) UpdateOwnerWxID() *AddWechatFriendLogUpsertBulk {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.UpdateOwnerWxID()
+	})
+}
+
+// SetOwnerWxType sets the "owner_wx_type" field.
+func (u *AddWechatFriendLogUpsertBulk) SetOwnerWxType(v int) *AddWechatFriendLogUpsertBulk {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.SetOwnerWxType(v)
+	})
+}
+
+// AddOwnerWxType adds v to the "owner_wx_type" field.
+func (u *AddWechatFriendLogUpsertBulk) AddOwnerWxType(v int) *AddWechatFriendLogUpsertBulk {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.AddOwnerWxType(v)
+	})
+}
+
+// UpdateOwnerWxType sets the "owner_wx_type" field to the value that was provided on create.
+func (u *AddWechatFriendLogUpsertBulk) UpdateOwnerWxType() *AddWechatFriendLogUpsertBulk {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.UpdateOwnerWxType()
+	})
+}
+
+// SetFindContent sets the "find_content" field.
+func (u *AddWechatFriendLogUpsertBulk) SetFindContent(v string) *AddWechatFriendLogUpsertBulk {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.SetFindContent(v)
+	})
+}
+
+// UpdateFindContent sets the "find_content" field to the value that was provided on create.
+func (u *AddWechatFriendLogUpsertBulk) UpdateFindContent() *AddWechatFriendLogUpsertBulk {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.UpdateFindContent()
+	})
+}
+
+// SetFindRequest sets the "find_request" field.
+func (u *AddWechatFriendLogUpsertBulk) SetFindRequest(v map[string]interface{}) *AddWechatFriendLogUpsertBulk {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.SetFindRequest(v)
+	})
+}
+
+// UpdateFindRequest sets the "find_request" field to the value that was provided on create.
+func (u *AddWechatFriendLogUpsertBulk) UpdateFindRequest() *AddWechatFriendLogUpsertBulk {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.UpdateFindRequest()
+	})
+}
+
+// ClearFindRequest clears the value of the "find_request" field.
+func (u *AddWechatFriendLogUpsertBulk) ClearFindRequest() *AddWechatFriendLogUpsertBulk {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.ClearFindRequest()
+	})
+}
+
+// SetFindResult sets the "find_result" field.
+func (u *AddWechatFriendLogUpsertBulk) SetFindResult(v map[string]interface{}) *AddWechatFriendLogUpsertBulk {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.SetFindResult(v)
+	})
+}
+
+// UpdateFindResult sets the "find_result" field to the value that was provided on create.
+func (u *AddWechatFriendLogUpsertBulk) UpdateFindResult() *AddWechatFriendLogUpsertBulk {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.UpdateFindResult()
+	})
+}
+
+// ClearFindResult clears the value of the "find_result" field.
+func (u *AddWechatFriendLogUpsertBulk) ClearFindResult() *AddWechatFriendLogUpsertBulk {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.ClearFindResult()
+	})
+}
+
+// SetIsCanAdd sets the "is_can_add" field.
+func (u *AddWechatFriendLogUpsertBulk) SetIsCanAdd(v int) *AddWechatFriendLogUpsertBulk {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.SetIsCanAdd(v)
+	})
+}
+
+// AddIsCanAdd adds v to the "is_can_add" field.
+func (u *AddWechatFriendLogUpsertBulk) AddIsCanAdd(v int) *AddWechatFriendLogUpsertBulk {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.AddIsCanAdd(v)
+	})
+}
+
+// UpdateIsCanAdd sets the "is_can_add" field to the value that was provided on create.
+func (u *AddWechatFriendLogUpsertBulk) UpdateIsCanAdd() *AddWechatFriendLogUpsertBulk {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.UpdateIsCanAdd()
+	})
+}
+
+// SetTaskID sets the "task_id" field.
+func (u *AddWechatFriendLogUpsertBulk) SetTaskID(v int64) *AddWechatFriendLogUpsertBulk {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.SetTaskID(v)
+	})
+}
+
+// AddTaskID adds v to the "task_id" field.
+func (u *AddWechatFriendLogUpsertBulk) AddTaskID(v int64) *AddWechatFriendLogUpsertBulk {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.AddTaskID(v)
+	})
+}
+
+// UpdateTaskID sets the "task_id" field to the value that was provided on create.
+func (u *AddWechatFriendLogUpsertBulk) UpdateTaskID() *AddWechatFriendLogUpsertBulk {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.UpdateTaskID()
+	})
+}
+
+// SetAddRequest sets the "add_request" field.
+func (u *AddWechatFriendLogUpsertBulk) SetAddRequest(v map[string]interface{}) *AddWechatFriendLogUpsertBulk {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.SetAddRequest(v)
+	})
+}
+
+// UpdateAddRequest sets the "add_request" field to the value that was provided on create.
+func (u *AddWechatFriendLogUpsertBulk) UpdateAddRequest() *AddWechatFriendLogUpsertBulk {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.UpdateAddRequest()
+	})
+}
+
+// ClearAddRequest clears the value of the "add_request" field.
+func (u *AddWechatFriendLogUpsertBulk) ClearAddRequest() *AddWechatFriendLogUpsertBulk {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.ClearAddRequest()
+	})
+}
+
+// SetAddResult sets the "add_result" field.
+func (u *AddWechatFriendLogUpsertBulk) SetAddResult(v map[string]interface{}) *AddWechatFriendLogUpsertBulk {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.SetAddResult(v)
+	})
+}
+
+// UpdateAddResult sets the "add_result" field to the value that was provided on create.
+func (u *AddWechatFriendLogUpsertBulk) UpdateAddResult() *AddWechatFriendLogUpsertBulk {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.UpdateAddResult()
+	})
+}
+
+// ClearAddResult clears the value of the "add_result" field.
+func (u *AddWechatFriendLogUpsertBulk) ClearAddResult() *AddWechatFriendLogUpsertBulk {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.ClearAddResult()
+	})
+}
+
+// SetCreatedAt sets the "created_at" field.
+func (u *AddWechatFriendLogUpsertBulk) SetCreatedAt(v int64) *AddWechatFriendLogUpsertBulk {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.SetCreatedAt(v)
+	})
+}
+
+// AddCreatedAt adds v to the "created_at" field.
+func (u *AddWechatFriendLogUpsertBulk) AddCreatedAt(v int64) *AddWechatFriendLogUpsertBulk {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.AddCreatedAt(v)
+	})
+}
+
+// UpdateCreatedAt sets the "created_at" field to the value that was provided on create.
+func (u *AddWechatFriendLogUpsertBulk) UpdateCreatedAt() *AddWechatFriendLogUpsertBulk {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.UpdateCreatedAt()
+	})
+}
+
+// SetUpdatedAt sets the "updated_at" field.
+func (u *AddWechatFriendLogUpsertBulk) SetUpdatedAt(v int64) *AddWechatFriendLogUpsertBulk {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.SetUpdatedAt(v)
+	})
+}
+
+// AddUpdatedAt adds v to the "updated_at" field.
+func (u *AddWechatFriendLogUpsertBulk) AddUpdatedAt(v int64) *AddWechatFriendLogUpsertBulk {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.AddUpdatedAt(v)
+	})
+}
+
+// UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
+func (u *AddWechatFriendLogUpsertBulk) UpdateUpdatedAt() *AddWechatFriendLogUpsertBulk {
+	return u.Update(func(s *AddWechatFriendLogUpsert) {
+		s.UpdateUpdatedAt()
+	})
+}
+
+// Exec executes the query.
+func (u *AddWechatFriendLogUpsertBulk) Exec(ctx context.Context) error {
+	if u.create.err != nil {
+		return u.create.err
+	}
+	for i, b := range u.create.builders {
+		if len(b.conflict) != 0 {
+			return fmt.Errorf("ent: OnConflict was set for builder %d. Set it on the AddWechatFriendLogCreateBulk instead", i)
+		}
+	}
+	if len(u.create.conflict) == 0 {
+		return errors.New("ent: missing options for AddWechatFriendLogCreateBulk.OnConflict")
+	}
+	return u.create.Exec(ctx)
+}
+
+// ExecX is like Exec, but panics if an error occurs.
+func (u *AddWechatFriendLogUpsertBulk) ExecX(ctx context.Context) {
+	if err := u.create.Exec(ctx); err != nil {
+		panic(err)
+	}
+}

+ 88 - 0
ent/addwechatfriendlog_delete.go

@@ -0,0 +1,88 @@
+// Code generated by ent, DO NOT EDIT.
+
+package ent
+
+import (
+	"context"
+	"wechat-api/ent/addwechatfriendlog"
+	"wechat-api/ent/predicate"
+
+	"entgo.io/ent/dialect/sql"
+	"entgo.io/ent/dialect/sql/sqlgraph"
+	"entgo.io/ent/schema/field"
+)
+
+// AddWechatFriendLogDelete is the builder for deleting a AddWechatFriendLog entity.
+type AddWechatFriendLogDelete struct {
+	config
+	hooks    []Hook
+	mutation *AddWechatFriendLogMutation
+}
+
+// Where appends a list predicates to the AddWechatFriendLogDelete builder.
+func (awfld *AddWechatFriendLogDelete) Where(ps ...predicate.AddWechatFriendLog) *AddWechatFriendLogDelete {
+	awfld.mutation.Where(ps...)
+	return awfld
+}
+
+// Exec executes the deletion query and returns how many vertices were deleted.
+func (awfld *AddWechatFriendLogDelete) Exec(ctx context.Context) (int, error) {
+	return withHooks(ctx, awfld.sqlExec, awfld.mutation, awfld.hooks)
+}
+
+// ExecX is like Exec, but panics if an error occurs.
+func (awfld *AddWechatFriendLogDelete) ExecX(ctx context.Context) int {
+	n, err := awfld.Exec(ctx)
+	if err != nil {
+		panic(err)
+	}
+	return n
+}
+
+func (awfld *AddWechatFriendLogDelete) sqlExec(ctx context.Context) (int, error) {
+	_spec := sqlgraph.NewDeleteSpec(addwechatfriendlog.Table, sqlgraph.NewFieldSpec(addwechatfriendlog.FieldID, field.TypeInt64))
+	if ps := awfld.mutation.predicates; len(ps) > 0 {
+		_spec.Predicate = func(selector *sql.Selector) {
+			for i := range ps {
+				ps[i](selector)
+			}
+		}
+	}
+	affected, err := sqlgraph.DeleteNodes(ctx, awfld.driver, _spec)
+	if err != nil && sqlgraph.IsConstraintError(err) {
+		err = &ConstraintError{msg: err.Error(), wrap: err}
+	}
+	awfld.mutation.done = true
+	return affected, err
+}
+
+// AddWechatFriendLogDeleteOne is the builder for deleting a single AddWechatFriendLog entity.
+type AddWechatFriendLogDeleteOne struct {
+	awfld *AddWechatFriendLogDelete
+}
+
+// Where appends a list predicates to the AddWechatFriendLogDelete builder.
+func (awfldo *AddWechatFriendLogDeleteOne) Where(ps ...predicate.AddWechatFriendLog) *AddWechatFriendLogDeleteOne {
+	awfldo.awfld.mutation.Where(ps...)
+	return awfldo
+}
+
+// Exec executes the deletion query.
+func (awfldo *AddWechatFriendLogDeleteOne) Exec(ctx context.Context) error {
+	n, err := awfldo.awfld.Exec(ctx)
+	switch {
+	case err != nil:
+		return err
+	case n == 0:
+		return &NotFoundError{addwechatfriendlog.Label}
+	default:
+		return nil
+	}
+}
+
+// ExecX is like Exec, but panics if an error occurs.
+func (awfldo *AddWechatFriendLogDeleteOne) ExecX(ctx context.Context) {
+	if err := awfldo.Exec(ctx); err != nil {
+		panic(err)
+	}
+}

+ 526 - 0
ent/addwechatfriendlog_query.go

@@ -0,0 +1,526 @@
+// Code generated by ent, DO NOT EDIT.
+
+package ent
+
+import (
+	"context"
+	"fmt"
+	"math"
+	"wechat-api/ent/addwechatfriendlog"
+	"wechat-api/ent/predicate"
+
+	"entgo.io/ent/dialect/sql"
+	"entgo.io/ent/dialect/sql/sqlgraph"
+	"entgo.io/ent/schema/field"
+)
+
+// AddWechatFriendLogQuery is the builder for querying AddWechatFriendLog entities.
+type AddWechatFriendLogQuery struct {
+	config
+	ctx        *QueryContext
+	order      []addwechatfriendlog.OrderOption
+	inters     []Interceptor
+	predicates []predicate.AddWechatFriendLog
+	// intermediate query (i.e. traversal path).
+	sql  *sql.Selector
+	path func(context.Context) (*sql.Selector, error)
+}
+
+// Where adds a new predicate for the AddWechatFriendLogQuery builder.
+func (awflq *AddWechatFriendLogQuery) Where(ps ...predicate.AddWechatFriendLog) *AddWechatFriendLogQuery {
+	awflq.predicates = append(awflq.predicates, ps...)
+	return awflq
+}
+
+// Limit the number of records to be returned by this query.
+func (awflq *AddWechatFriendLogQuery) Limit(limit int) *AddWechatFriendLogQuery {
+	awflq.ctx.Limit = &limit
+	return awflq
+}
+
+// Offset to start from.
+func (awflq *AddWechatFriendLogQuery) Offset(offset int) *AddWechatFriendLogQuery {
+	awflq.ctx.Offset = &offset
+	return awflq
+}
+
+// Unique configures the query builder to filter duplicate records on query.
+// By default, unique is set to true, and can be disabled using this method.
+func (awflq *AddWechatFriendLogQuery) Unique(unique bool) *AddWechatFriendLogQuery {
+	awflq.ctx.Unique = &unique
+	return awflq
+}
+
+// Order specifies how the records should be ordered.
+func (awflq *AddWechatFriendLogQuery) Order(o ...addwechatfriendlog.OrderOption) *AddWechatFriendLogQuery {
+	awflq.order = append(awflq.order, o...)
+	return awflq
+}
+
+// First returns the first AddWechatFriendLog entity from the query.
+// Returns a *NotFoundError when no AddWechatFriendLog was found.
+func (awflq *AddWechatFriendLogQuery) First(ctx context.Context) (*AddWechatFriendLog, error) {
+	nodes, err := awflq.Limit(1).All(setContextOp(ctx, awflq.ctx, "First"))
+	if err != nil {
+		return nil, err
+	}
+	if len(nodes) == 0 {
+		return nil, &NotFoundError{addwechatfriendlog.Label}
+	}
+	return nodes[0], nil
+}
+
+// FirstX is like First, but panics if an error occurs.
+func (awflq *AddWechatFriendLogQuery) FirstX(ctx context.Context) *AddWechatFriendLog {
+	node, err := awflq.First(ctx)
+	if err != nil && !IsNotFound(err) {
+		panic(err)
+	}
+	return node
+}
+
+// FirstID returns the first AddWechatFriendLog ID from the query.
+// Returns a *NotFoundError when no AddWechatFriendLog ID was found.
+func (awflq *AddWechatFriendLogQuery) FirstID(ctx context.Context) (id int64, err error) {
+	var ids []int64
+	if ids, err = awflq.Limit(1).IDs(setContextOp(ctx, awflq.ctx, "FirstID")); err != nil {
+		return
+	}
+	if len(ids) == 0 {
+		err = &NotFoundError{addwechatfriendlog.Label}
+		return
+	}
+	return ids[0], nil
+}
+
+// FirstIDX is like FirstID, but panics if an error occurs.
+func (awflq *AddWechatFriendLogQuery) FirstIDX(ctx context.Context) int64 {
+	id, err := awflq.FirstID(ctx)
+	if err != nil && !IsNotFound(err) {
+		panic(err)
+	}
+	return id
+}
+
+// Only returns a single AddWechatFriendLog entity found by the query, ensuring it only returns one.
+// Returns a *NotSingularError when more than one AddWechatFriendLog entity is found.
+// Returns a *NotFoundError when no AddWechatFriendLog entities are found.
+func (awflq *AddWechatFriendLogQuery) Only(ctx context.Context) (*AddWechatFriendLog, error) {
+	nodes, err := awflq.Limit(2).All(setContextOp(ctx, awflq.ctx, "Only"))
+	if err != nil {
+		return nil, err
+	}
+	switch len(nodes) {
+	case 1:
+		return nodes[0], nil
+	case 0:
+		return nil, &NotFoundError{addwechatfriendlog.Label}
+	default:
+		return nil, &NotSingularError{addwechatfriendlog.Label}
+	}
+}
+
+// OnlyX is like Only, but panics if an error occurs.
+func (awflq *AddWechatFriendLogQuery) OnlyX(ctx context.Context) *AddWechatFriendLog {
+	node, err := awflq.Only(ctx)
+	if err != nil {
+		panic(err)
+	}
+	return node
+}
+
+// OnlyID is like Only, but returns the only AddWechatFriendLog ID in the query.
+// Returns a *NotSingularError when more than one AddWechatFriendLog ID is found.
+// Returns a *NotFoundError when no entities are found.
+func (awflq *AddWechatFriendLogQuery) OnlyID(ctx context.Context) (id int64, err error) {
+	var ids []int64
+	if ids, err = awflq.Limit(2).IDs(setContextOp(ctx, awflq.ctx, "OnlyID")); err != nil {
+		return
+	}
+	switch len(ids) {
+	case 1:
+		id = ids[0]
+	case 0:
+		err = &NotFoundError{addwechatfriendlog.Label}
+	default:
+		err = &NotSingularError{addwechatfriendlog.Label}
+	}
+	return
+}
+
+// OnlyIDX is like OnlyID, but panics if an error occurs.
+func (awflq *AddWechatFriendLogQuery) OnlyIDX(ctx context.Context) int64 {
+	id, err := awflq.OnlyID(ctx)
+	if err != nil {
+		panic(err)
+	}
+	return id
+}
+
+// All executes the query and returns a list of AddWechatFriendLogs.
+func (awflq *AddWechatFriendLogQuery) All(ctx context.Context) ([]*AddWechatFriendLog, error) {
+	ctx = setContextOp(ctx, awflq.ctx, "All")
+	if err := awflq.prepareQuery(ctx); err != nil {
+		return nil, err
+	}
+	qr := querierAll[[]*AddWechatFriendLog, *AddWechatFriendLogQuery]()
+	return withInterceptors[[]*AddWechatFriendLog](ctx, awflq, qr, awflq.inters)
+}
+
+// AllX is like All, but panics if an error occurs.
+func (awflq *AddWechatFriendLogQuery) AllX(ctx context.Context) []*AddWechatFriendLog {
+	nodes, err := awflq.All(ctx)
+	if err != nil {
+		panic(err)
+	}
+	return nodes
+}
+
+// IDs executes the query and returns a list of AddWechatFriendLog IDs.
+func (awflq *AddWechatFriendLogQuery) IDs(ctx context.Context) (ids []int64, err error) {
+	if awflq.ctx.Unique == nil && awflq.path != nil {
+		awflq.Unique(true)
+	}
+	ctx = setContextOp(ctx, awflq.ctx, "IDs")
+	if err = awflq.Select(addwechatfriendlog.FieldID).Scan(ctx, &ids); err != nil {
+		return nil, err
+	}
+	return ids, nil
+}
+
+// IDsX is like IDs, but panics if an error occurs.
+func (awflq *AddWechatFriendLogQuery) IDsX(ctx context.Context) []int64 {
+	ids, err := awflq.IDs(ctx)
+	if err != nil {
+		panic(err)
+	}
+	return ids
+}
+
+// Count returns the count of the given query.
+func (awflq *AddWechatFriendLogQuery) Count(ctx context.Context) (int, error) {
+	ctx = setContextOp(ctx, awflq.ctx, "Count")
+	if err := awflq.prepareQuery(ctx); err != nil {
+		return 0, err
+	}
+	return withInterceptors[int](ctx, awflq, querierCount[*AddWechatFriendLogQuery](), awflq.inters)
+}
+
+// CountX is like Count, but panics if an error occurs.
+func (awflq *AddWechatFriendLogQuery) CountX(ctx context.Context) int {
+	count, err := awflq.Count(ctx)
+	if err != nil {
+		panic(err)
+	}
+	return count
+}
+
+// Exist returns true if the query has elements in the graph.
+func (awflq *AddWechatFriendLogQuery) Exist(ctx context.Context) (bool, error) {
+	ctx = setContextOp(ctx, awflq.ctx, "Exist")
+	switch _, err := awflq.FirstID(ctx); {
+	case IsNotFound(err):
+		return false, nil
+	case err != nil:
+		return false, fmt.Errorf("ent: check existence: %w", err)
+	default:
+		return true, nil
+	}
+}
+
+// ExistX is like Exist, but panics if an error occurs.
+func (awflq *AddWechatFriendLogQuery) ExistX(ctx context.Context) bool {
+	exist, err := awflq.Exist(ctx)
+	if err != nil {
+		panic(err)
+	}
+	return exist
+}
+
+// Clone returns a duplicate of the AddWechatFriendLogQuery builder, including all associated steps. It can be
+// used to prepare common query builders and use them differently after the clone is made.
+func (awflq *AddWechatFriendLogQuery) Clone() *AddWechatFriendLogQuery {
+	if awflq == nil {
+		return nil
+	}
+	return &AddWechatFriendLogQuery{
+		config:     awflq.config,
+		ctx:        awflq.ctx.Clone(),
+		order:      append([]addwechatfriendlog.OrderOption{}, awflq.order...),
+		inters:     append([]Interceptor{}, awflq.inters...),
+		predicates: append([]predicate.AddWechatFriendLog{}, awflq.predicates...),
+		// clone intermediate query.
+		sql:  awflq.sql.Clone(),
+		path: awflq.path,
+	}
+}
+
+// GroupBy is used to group vertices by one or more fields/columns.
+// It is often used with aggregate functions, like: count, max, mean, min, sum.
+//
+// Example:
+//
+//	var v []struct {
+//		OwnerWxID string `json:"owner_wx_id,omitempty"`
+//		Count int `json:"count,omitempty"`
+//	}
+//
+//	client.AddWechatFriendLog.Query().
+//		GroupBy(addwechatfriendlog.FieldOwnerWxID).
+//		Aggregate(ent.Count()).
+//		Scan(ctx, &v)
+func (awflq *AddWechatFriendLogQuery) GroupBy(field string, fields ...string) *AddWechatFriendLogGroupBy {
+	awflq.ctx.Fields = append([]string{field}, fields...)
+	grbuild := &AddWechatFriendLogGroupBy{build: awflq}
+	grbuild.flds = &awflq.ctx.Fields
+	grbuild.label = addwechatfriendlog.Label
+	grbuild.scan = grbuild.Scan
+	return grbuild
+}
+
+// Select allows the selection one or more fields/columns for the given query,
+// instead of selecting all fields in the entity.
+//
+// Example:
+//
+//	var v []struct {
+//		OwnerWxID string `json:"owner_wx_id,omitempty"`
+//	}
+//
+//	client.AddWechatFriendLog.Query().
+//		Select(addwechatfriendlog.FieldOwnerWxID).
+//		Scan(ctx, &v)
+func (awflq *AddWechatFriendLogQuery) Select(fields ...string) *AddWechatFriendLogSelect {
+	awflq.ctx.Fields = append(awflq.ctx.Fields, fields...)
+	sbuild := &AddWechatFriendLogSelect{AddWechatFriendLogQuery: awflq}
+	sbuild.label = addwechatfriendlog.Label
+	sbuild.flds, sbuild.scan = &awflq.ctx.Fields, sbuild.Scan
+	return sbuild
+}
+
+// Aggregate returns a AddWechatFriendLogSelect configured with the given aggregations.
+func (awflq *AddWechatFriendLogQuery) Aggregate(fns ...AggregateFunc) *AddWechatFriendLogSelect {
+	return awflq.Select().Aggregate(fns...)
+}
+
+func (awflq *AddWechatFriendLogQuery) prepareQuery(ctx context.Context) error {
+	for _, inter := range awflq.inters {
+		if inter == nil {
+			return fmt.Errorf("ent: uninitialized interceptor (forgotten import ent/runtime?)")
+		}
+		if trv, ok := inter.(Traverser); ok {
+			if err := trv.Traverse(ctx, awflq); err != nil {
+				return err
+			}
+		}
+	}
+	for _, f := range awflq.ctx.Fields {
+		if !addwechatfriendlog.ValidColumn(f) {
+			return &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)}
+		}
+	}
+	if awflq.path != nil {
+		prev, err := awflq.path(ctx)
+		if err != nil {
+			return err
+		}
+		awflq.sql = prev
+	}
+	return nil
+}
+
+func (awflq *AddWechatFriendLogQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*AddWechatFriendLog, error) {
+	var (
+		nodes = []*AddWechatFriendLog{}
+		_spec = awflq.querySpec()
+	)
+	_spec.ScanValues = func(columns []string) ([]any, error) {
+		return (*AddWechatFriendLog).scanValues(nil, columns)
+	}
+	_spec.Assign = func(columns []string, values []any) error {
+		node := &AddWechatFriendLog{config: awflq.config}
+		nodes = append(nodes, node)
+		return node.assignValues(columns, values)
+	}
+	for i := range hooks {
+		hooks[i](ctx, _spec)
+	}
+	if err := sqlgraph.QueryNodes(ctx, awflq.driver, _spec); err != nil {
+		return nil, err
+	}
+	if len(nodes) == 0 {
+		return nodes, nil
+	}
+	return nodes, nil
+}
+
+func (awflq *AddWechatFriendLogQuery) sqlCount(ctx context.Context) (int, error) {
+	_spec := awflq.querySpec()
+	_spec.Node.Columns = awflq.ctx.Fields
+	if len(awflq.ctx.Fields) > 0 {
+		_spec.Unique = awflq.ctx.Unique != nil && *awflq.ctx.Unique
+	}
+	return sqlgraph.CountNodes(ctx, awflq.driver, _spec)
+}
+
+func (awflq *AddWechatFriendLogQuery) querySpec() *sqlgraph.QuerySpec {
+	_spec := sqlgraph.NewQuerySpec(addwechatfriendlog.Table, addwechatfriendlog.Columns, sqlgraph.NewFieldSpec(addwechatfriendlog.FieldID, field.TypeInt64))
+	_spec.From = awflq.sql
+	if unique := awflq.ctx.Unique; unique != nil {
+		_spec.Unique = *unique
+	} else if awflq.path != nil {
+		_spec.Unique = true
+	}
+	if fields := awflq.ctx.Fields; len(fields) > 0 {
+		_spec.Node.Columns = make([]string, 0, len(fields))
+		_spec.Node.Columns = append(_spec.Node.Columns, addwechatfriendlog.FieldID)
+		for i := range fields {
+			if fields[i] != addwechatfriendlog.FieldID {
+				_spec.Node.Columns = append(_spec.Node.Columns, fields[i])
+			}
+		}
+	}
+	if ps := awflq.predicates; len(ps) > 0 {
+		_spec.Predicate = func(selector *sql.Selector) {
+			for i := range ps {
+				ps[i](selector)
+			}
+		}
+	}
+	if limit := awflq.ctx.Limit; limit != nil {
+		_spec.Limit = *limit
+	}
+	if offset := awflq.ctx.Offset; offset != nil {
+		_spec.Offset = *offset
+	}
+	if ps := awflq.order; len(ps) > 0 {
+		_spec.Order = func(selector *sql.Selector) {
+			for i := range ps {
+				ps[i](selector)
+			}
+		}
+	}
+	return _spec
+}
+
+func (awflq *AddWechatFriendLogQuery) sqlQuery(ctx context.Context) *sql.Selector {
+	builder := sql.Dialect(awflq.driver.Dialect())
+	t1 := builder.Table(addwechatfriendlog.Table)
+	columns := awflq.ctx.Fields
+	if len(columns) == 0 {
+		columns = addwechatfriendlog.Columns
+	}
+	selector := builder.Select(t1.Columns(columns...)...).From(t1)
+	if awflq.sql != nil {
+		selector = awflq.sql
+		selector.Select(selector.Columns(columns...)...)
+	}
+	if awflq.ctx.Unique != nil && *awflq.ctx.Unique {
+		selector.Distinct()
+	}
+	for _, p := range awflq.predicates {
+		p(selector)
+	}
+	for _, p := range awflq.order {
+		p(selector)
+	}
+	if offset := awflq.ctx.Offset; offset != nil {
+		// limit is mandatory for offset clause. We start
+		// with default value, and override it below if needed.
+		selector.Offset(*offset).Limit(math.MaxInt32)
+	}
+	if limit := awflq.ctx.Limit; limit != nil {
+		selector.Limit(*limit)
+	}
+	return selector
+}
+
+// AddWechatFriendLogGroupBy is the group-by builder for AddWechatFriendLog entities.
+type AddWechatFriendLogGroupBy struct {
+	selector
+	build *AddWechatFriendLogQuery
+}
+
+// Aggregate adds the given aggregation functions to the group-by query.
+func (awflgb *AddWechatFriendLogGroupBy) Aggregate(fns ...AggregateFunc) *AddWechatFriendLogGroupBy {
+	awflgb.fns = append(awflgb.fns, fns...)
+	return awflgb
+}
+
+// Scan applies the selector query and scans the result into the given value.
+func (awflgb *AddWechatFriendLogGroupBy) Scan(ctx context.Context, v any) error {
+	ctx = setContextOp(ctx, awflgb.build.ctx, "GroupBy")
+	if err := awflgb.build.prepareQuery(ctx); err != nil {
+		return err
+	}
+	return scanWithInterceptors[*AddWechatFriendLogQuery, *AddWechatFriendLogGroupBy](ctx, awflgb.build, awflgb, awflgb.build.inters, v)
+}
+
+func (awflgb *AddWechatFriendLogGroupBy) sqlScan(ctx context.Context, root *AddWechatFriendLogQuery, v any) error {
+	selector := root.sqlQuery(ctx).Select()
+	aggregation := make([]string, 0, len(awflgb.fns))
+	for _, fn := range awflgb.fns {
+		aggregation = append(aggregation, fn(selector))
+	}
+	if len(selector.SelectedColumns()) == 0 {
+		columns := make([]string, 0, len(*awflgb.flds)+len(awflgb.fns))
+		for _, f := range *awflgb.flds {
+			columns = append(columns, selector.C(f))
+		}
+		columns = append(columns, aggregation...)
+		selector.Select(columns...)
+	}
+	selector.GroupBy(selector.Columns(*awflgb.flds...)...)
+	if err := selector.Err(); err != nil {
+		return err
+	}
+	rows := &sql.Rows{}
+	query, args := selector.Query()
+	if err := awflgb.build.driver.Query(ctx, query, args, rows); err != nil {
+		return err
+	}
+	defer rows.Close()
+	return sql.ScanSlice(rows, v)
+}
+
+// AddWechatFriendLogSelect is the builder for selecting fields of AddWechatFriendLog entities.
+type AddWechatFriendLogSelect struct {
+	*AddWechatFriendLogQuery
+	selector
+}
+
+// Aggregate adds the given aggregation functions to the selector query.
+func (awfls *AddWechatFriendLogSelect) Aggregate(fns ...AggregateFunc) *AddWechatFriendLogSelect {
+	awfls.fns = append(awfls.fns, fns...)
+	return awfls
+}
+
+// Scan applies the selector query and scans the result into the given value.
+func (awfls *AddWechatFriendLogSelect) Scan(ctx context.Context, v any) error {
+	ctx = setContextOp(ctx, awfls.ctx, "Select")
+	if err := awfls.prepareQuery(ctx); err != nil {
+		return err
+	}
+	return scanWithInterceptors[*AddWechatFriendLogQuery, *AddWechatFriendLogSelect](ctx, awfls.AddWechatFriendLogQuery, awfls, awfls.inters, v)
+}
+
+func (awfls *AddWechatFriendLogSelect) sqlScan(ctx context.Context, root *AddWechatFriendLogQuery, v any) error {
+	selector := root.sqlQuery(ctx)
+	aggregation := make([]string, 0, len(awfls.fns))
+	for _, fn := range awfls.fns {
+		aggregation = append(aggregation, fn(selector))
+	}
+	switch n := len(*awfls.selector.flds); {
+	case n == 0 && len(aggregation) > 0:
+		selector.Select(aggregation...)
+	case n != 0 && len(aggregation) > 0:
+		selector.AppendSelect(aggregation...)
+	}
+	rows := &sql.Rows{}
+	query, args := selector.Query()
+	if err := awfls.driver.Query(ctx, query, args, rows); err != nil {
+		return err
+	}
+	defer rows.Close()
+	return sql.ScanSlice(rows, v)
+}

+ 695 - 0
ent/addwechatfriendlog_update.go

@@ -0,0 +1,695 @@
+// Code generated by ent, DO NOT EDIT.
+
+package ent
+
+import (
+	"context"
+	"errors"
+	"fmt"
+	"wechat-api/ent/addwechatfriendlog"
+	"wechat-api/ent/predicate"
+
+	"entgo.io/ent/dialect/sql"
+	"entgo.io/ent/dialect/sql/sqlgraph"
+	"entgo.io/ent/schema/field"
+)
+
+// AddWechatFriendLogUpdate is the builder for updating AddWechatFriendLog entities.
+type AddWechatFriendLogUpdate struct {
+	config
+	hooks    []Hook
+	mutation *AddWechatFriendLogMutation
+}
+
+// Where appends a list predicates to the AddWechatFriendLogUpdate builder.
+func (awflu *AddWechatFriendLogUpdate) Where(ps ...predicate.AddWechatFriendLog) *AddWechatFriendLogUpdate {
+	awflu.mutation.Where(ps...)
+	return awflu
+}
+
+// SetOwnerWxID sets the "owner_wx_id" field.
+func (awflu *AddWechatFriendLogUpdate) SetOwnerWxID(s string) *AddWechatFriendLogUpdate {
+	awflu.mutation.SetOwnerWxID(s)
+	return awflu
+}
+
+// SetNillableOwnerWxID sets the "owner_wx_id" field if the given value is not nil.
+func (awflu *AddWechatFriendLogUpdate) SetNillableOwnerWxID(s *string) *AddWechatFriendLogUpdate {
+	if s != nil {
+		awflu.SetOwnerWxID(*s)
+	}
+	return awflu
+}
+
+// SetOwnerWxType sets the "owner_wx_type" field.
+func (awflu *AddWechatFriendLogUpdate) SetOwnerWxType(i int) *AddWechatFriendLogUpdate {
+	awflu.mutation.ResetOwnerWxType()
+	awflu.mutation.SetOwnerWxType(i)
+	return awflu
+}
+
+// SetNillableOwnerWxType sets the "owner_wx_type" field if the given value is not nil.
+func (awflu *AddWechatFriendLogUpdate) SetNillableOwnerWxType(i *int) *AddWechatFriendLogUpdate {
+	if i != nil {
+		awflu.SetOwnerWxType(*i)
+	}
+	return awflu
+}
+
+// AddOwnerWxType adds i to the "owner_wx_type" field.
+func (awflu *AddWechatFriendLogUpdate) AddOwnerWxType(i int) *AddWechatFriendLogUpdate {
+	awflu.mutation.AddOwnerWxType(i)
+	return awflu
+}
+
+// SetFindContent sets the "find_content" field.
+func (awflu *AddWechatFriendLogUpdate) SetFindContent(s string) *AddWechatFriendLogUpdate {
+	awflu.mutation.SetFindContent(s)
+	return awflu
+}
+
+// SetNillableFindContent sets the "find_content" field if the given value is not nil.
+func (awflu *AddWechatFriendLogUpdate) SetNillableFindContent(s *string) *AddWechatFriendLogUpdate {
+	if s != nil {
+		awflu.SetFindContent(*s)
+	}
+	return awflu
+}
+
+// SetFindRequest sets the "find_request" field.
+func (awflu *AddWechatFriendLogUpdate) SetFindRequest(m map[string]interface{}) *AddWechatFriendLogUpdate {
+	awflu.mutation.SetFindRequest(m)
+	return awflu
+}
+
+// ClearFindRequest clears the value of the "find_request" field.
+func (awflu *AddWechatFriendLogUpdate) ClearFindRequest() *AddWechatFriendLogUpdate {
+	awflu.mutation.ClearFindRequest()
+	return awflu
+}
+
+// SetFindResult sets the "find_result" field.
+func (awflu *AddWechatFriendLogUpdate) SetFindResult(m map[string]interface{}) *AddWechatFriendLogUpdate {
+	awflu.mutation.SetFindResult(m)
+	return awflu
+}
+
+// ClearFindResult clears the value of the "find_result" field.
+func (awflu *AddWechatFriendLogUpdate) ClearFindResult() *AddWechatFriendLogUpdate {
+	awflu.mutation.ClearFindResult()
+	return awflu
+}
+
+// SetIsCanAdd sets the "is_can_add" field.
+func (awflu *AddWechatFriendLogUpdate) SetIsCanAdd(i int) *AddWechatFriendLogUpdate {
+	awflu.mutation.ResetIsCanAdd()
+	awflu.mutation.SetIsCanAdd(i)
+	return awflu
+}
+
+// SetNillableIsCanAdd sets the "is_can_add" field if the given value is not nil.
+func (awflu *AddWechatFriendLogUpdate) SetNillableIsCanAdd(i *int) *AddWechatFriendLogUpdate {
+	if i != nil {
+		awflu.SetIsCanAdd(*i)
+	}
+	return awflu
+}
+
+// AddIsCanAdd adds i to the "is_can_add" field.
+func (awflu *AddWechatFriendLogUpdate) AddIsCanAdd(i int) *AddWechatFriendLogUpdate {
+	awflu.mutation.AddIsCanAdd(i)
+	return awflu
+}
+
+// SetTaskID sets the "task_id" field.
+func (awflu *AddWechatFriendLogUpdate) SetTaskID(i int64) *AddWechatFriendLogUpdate {
+	awflu.mutation.ResetTaskID()
+	awflu.mutation.SetTaskID(i)
+	return awflu
+}
+
+// SetNillableTaskID sets the "task_id" field if the given value is not nil.
+func (awflu *AddWechatFriendLogUpdate) SetNillableTaskID(i *int64) *AddWechatFriendLogUpdate {
+	if i != nil {
+		awflu.SetTaskID(*i)
+	}
+	return awflu
+}
+
+// AddTaskID adds i to the "task_id" field.
+func (awflu *AddWechatFriendLogUpdate) AddTaskID(i int64) *AddWechatFriendLogUpdate {
+	awflu.mutation.AddTaskID(i)
+	return awflu
+}
+
+// SetAddRequest sets the "add_request" field.
+func (awflu *AddWechatFriendLogUpdate) SetAddRequest(m map[string]interface{}) *AddWechatFriendLogUpdate {
+	awflu.mutation.SetAddRequest(m)
+	return awflu
+}
+
+// ClearAddRequest clears the value of the "add_request" field.
+func (awflu *AddWechatFriendLogUpdate) ClearAddRequest() *AddWechatFriendLogUpdate {
+	awflu.mutation.ClearAddRequest()
+	return awflu
+}
+
+// SetAddResult sets the "add_result" field.
+func (awflu *AddWechatFriendLogUpdate) SetAddResult(m map[string]interface{}) *AddWechatFriendLogUpdate {
+	awflu.mutation.SetAddResult(m)
+	return awflu
+}
+
+// ClearAddResult clears the value of the "add_result" field.
+func (awflu *AddWechatFriendLogUpdate) ClearAddResult() *AddWechatFriendLogUpdate {
+	awflu.mutation.ClearAddResult()
+	return awflu
+}
+
+// SetCreatedAt sets the "created_at" field.
+func (awflu *AddWechatFriendLogUpdate) SetCreatedAt(i int64) *AddWechatFriendLogUpdate {
+	awflu.mutation.ResetCreatedAt()
+	awflu.mutation.SetCreatedAt(i)
+	return awflu
+}
+
+// SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
+func (awflu *AddWechatFriendLogUpdate) SetNillableCreatedAt(i *int64) *AddWechatFriendLogUpdate {
+	if i != nil {
+		awflu.SetCreatedAt(*i)
+	}
+	return awflu
+}
+
+// AddCreatedAt adds i to the "created_at" field.
+func (awflu *AddWechatFriendLogUpdate) AddCreatedAt(i int64) *AddWechatFriendLogUpdate {
+	awflu.mutation.AddCreatedAt(i)
+	return awflu
+}
+
+// SetUpdatedAt sets the "updated_at" field.
+func (awflu *AddWechatFriendLogUpdate) SetUpdatedAt(i int64) *AddWechatFriendLogUpdate {
+	awflu.mutation.ResetUpdatedAt()
+	awflu.mutation.SetUpdatedAt(i)
+	return awflu
+}
+
+// AddUpdatedAt adds i to the "updated_at" field.
+func (awflu *AddWechatFriendLogUpdate) AddUpdatedAt(i int64) *AddWechatFriendLogUpdate {
+	awflu.mutation.AddUpdatedAt(i)
+	return awflu
+}
+
+// Mutation returns the AddWechatFriendLogMutation object of the builder.
+func (awflu *AddWechatFriendLogUpdate) Mutation() *AddWechatFriendLogMutation {
+	return awflu.mutation
+}
+
+// Save executes the query and returns the number of nodes affected by the update operation.
+func (awflu *AddWechatFriendLogUpdate) Save(ctx context.Context) (int, error) {
+	awflu.defaults()
+	return withHooks(ctx, awflu.sqlSave, awflu.mutation, awflu.hooks)
+}
+
+// SaveX is like Save, but panics if an error occurs.
+func (awflu *AddWechatFriendLogUpdate) SaveX(ctx context.Context) int {
+	affected, err := awflu.Save(ctx)
+	if err != nil {
+		panic(err)
+	}
+	return affected
+}
+
+// Exec executes the query.
+func (awflu *AddWechatFriendLogUpdate) Exec(ctx context.Context) error {
+	_, err := awflu.Save(ctx)
+	return err
+}
+
+// ExecX is like Exec, but panics if an error occurs.
+func (awflu *AddWechatFriendLogUpdate) ExecX(ctx context.Context) {
+	if err := awflu.Exec(ctx); err != nil {
+		panic(err)
+	}
+}
+
+// defaults sets the default values of the builder before save.
+func (awflu *AddWechatFriendLogUpdate) defaults() {
+	if _, ok := awflu.mutation.UpdatedAt(); !ok {
+		v := addwechatfriendlog.UpdateDefaultUpdatedAt()
+		awflu.mutation.SetUpdatedAt(v)
+	}
+}
+
+// check runs all checks and user-defined validators on the builder.
+func (awflu *AddWechatFriendLogUpdate) check() error {
+	if v, ok := awflu.mutation.OwnerWxID(); ok {
+		if err := addwechatfriendlog.OwnerWxIDValidator(v); err != nil {
+			return &ValidationError{Name: "owner_wx_id", err: fmt.Errorf(`ent: validator failed for field "AddWechatFriendLog.owner_wx_id": %w`, err)}
+		}
+	}
+	if v, ok := awflu.mutation.FindContent(); ok {
+		if err := addwechatfriendlog.FindContentValidator(v); err != nil {
+			return &ValidationError{Name: "find_content", err: fmt.Errorf(`ent: validator failed for field "AddWechatFriendLog.find_content": %w`, err)}
+		}
+	}
+	return nil
+}
+
+func (awflu *AddWechatFriendLogUpdate) sqlSave(ctx context.Context) (n int, err error) {
+	if err := awflu.check(); err != nil {
+		return n, err
+	}
+	_spec := sqlgraph.NewUpdateSpec(addwechatfriendlog.Table, addwechatfriendlog.Columns, sqlgraph.NewFieldSpec(addwechatfriendlog.FieldID, field.TypeInt64))
+	if ps := awflu.mutation.predicates; len(ps) > 0 {
+		_spec.Predicate = func(selector *sql.Selector) {
+			for i := range ps {
+				ps[i](selector)
+			}
+		}
+	}
+	if value, ok := awflu.mutation.OwnerWxID(); ok {
+		_spec.SetField(addwechatfriendlog.FieldOwnerWxID, field.TypeString, value)
+	}
+	if value, ok := awflu.mutation.OwnerWxType(); ok {
+		_spec.SetField(addwechatfriendlog.FieldOwnerWxType, field.TypeInt, value)
+	}
+	if value, ok := awflu.mutation.AddedOwnerWxType(); ok {
+		_spec.AddField(addwechatfriendlog.FieldOwnerWxType, field.TypeInt, value)
+	}
+	if value, ok := awflu.mutation.FindContent(); ok {
+		_spec.SetField(addwechatfriendlog.FieldFindContent, field.TypeString, value)
+	}
+	if value, ok := awflu.mutation.FindRequest(); ok {
+		_spec.SetField(addwechatfriendlog.FieldFindRequest, field.TypeJSON, value)
+	}
+	if awflu.mutation.FindRequestCleared() {
+		_spec.ClearField(addwechatfriendlog.FieldFindRequest, field.TypeJSON)
+	}
+	if value, ok := awflu.mutation.FindResult(); ok {
+		_spec.SetField(addwechatfriendlog.FieldFindResult, field.TypeJSON, value)
+	}
+	if awflu.mutation.FindResultCleared() {
+		_spec.ClearField(addwechatfriendlog.FieldFindResult, field.TypeJSON)
+	}
+	if value, ok := awflu.mutation.IsCanAdd(); ok {
+		_spec.SetField(addwechatfriendlog.FieldIsCanAdd, field.TypeInt, value)
+	}
+	if value, ok := awflu.mutation.AddedIsCanAdd(); ok {
+		_spec.AddField(addwechatfriendlog.FieldIsCanAdd, field.TypeInt, value)
+	}
+	if value, ok := awflu.mutation.TaskID(); ok {
+		_spec.SetField(addwechatfriendlog.FieldTaskID, field.TypeInt64, value)
+	}
+	if value, ok := awflu.mutation.AddedTaskID(); ok {
+		_spec.AddField(addwechatfriendlog.FieldTaskID, field.TypeInt64, value)
+	}
+	if value, ok := awflu.mutation.AddRequest(); ok {
+		_spec.SetField(addwechatfriendlog.FieldAddRequest, field.TypeJSON, value)
+	}
+	if awflu.mutation.AddRequestCleared() {
+		_spec.ClearField(addwechatfriendlog.FieldAddRequest, field.TypeJSON)
+	}
+	if value, ok := awflu.mutation.AddResult(); ok {
+		_spec.SetField(addwechatfriendlog.FieldAddResult, field.TypeJSON, value)
+	}
+	if awflu.mutation.AddResultCleared() {
+		_spec.ClearField(addwechatfriendlog.FieldAddResult, field.TypeJSON)
+	}
+	if value, ok := awflu.mutation.CreatedAt(); ok {
+		_spec.SetField(addwechatfriendlog.FieldCreatedAt, field.TypeInt64, value)
+	}
+	if value, ok := awflu.mutation.AddedCreatedAt(); ok {
+		_spec.AddField(addwechatfriendlog.FieldCreatedAt, field.TypeInt64, value)
+	}
+	if value, ok := awflu.mutation.UpdatedAt(); ok {
+		_spec.SetField(addwechatfriendlog.FieldUpdatedAt, field.TypeInt64, value)
+	}
+	if value, ok := awflu.mutation.AddedUpdatedAt(); ok {
+		_spec.AddField(addwechatfriendlog.FieldUpdatedAt, field.TypeInt64, value)
+	}
+	if n, err = sqlgraph.UpdateNodes(ctx, awflu.driver, _spec); err != nil {
+		if _, ok := err.(*sqlgraph.NotFoundError); ok {
+			err = &NotFoundError{addwechatfriendlog.Label}
+		} else if sqlgraph.IsConstraintError(err) {
+			err = &ConstraintError{msg: err.Error(), wrap: err}
+		}
+		return 0, err
+	}
+	awflu.mutation.done = true
+	return n, nil
+}
+
+// AddWechatFriendLogUpdateOne is the builder for updating a single AddWechatFriendLog entity.
+type AddWechatFriendLogUpdateOne struct {
+	config
+	fields   []string
+	hooks    []Hook
+	mutation *AddWechatFriendLogMutation
+}
+
+// SetOwnerWxID sets the "owner_wx_id" field.
+func (awfluo *AddWechatFriendLogUpdateOne) SetOwnerWxID(s string) *AddWechatFriendLogUpdateOne {
+	awfluo.mutation.SetOwnerWxID(s)
+	return awfluo
+}
+
+// SetNillableOwnerWxID sets the "owner_wx_id" field if the given value is not nil.
+func (awfluo *AddWechatFriendLogUpdateOne) SetNillableOwnerWxID(s *string) *AddWechatFriendLogUpdateOne {
+	if s != nil {
+		awfluo.SetOwnerWxID(*s)
+	}
+	return awfluo
+}
+
+// SetOwnerWxType sets the "owner_wx_type" field.
+func (awfluo *AddWechatFriendLogUpdateOne) SetOwnerWxType(i int) *AddWechatFriendLogUpdateOne {
+	awfluo.mutation.ResetOwnerWxType()
+	awfluo.mutation.SetOwnerWxType(i)
+	return awfluo
+}
+
+// SetNillableOwnerWxType sets the "owner_wx_type" field if the given value is not nil.
+func (awfluo *AddWechatFriendLogUpdateOne) SetNillableOwnerWxType(i *int) *AddWechatFriendLogUpdateOne {
+	if i != nil {
+		awfluo.SetOwnerWxType(*i)
+	}
+	return awfluo
+}
+
+// AddOwnerWxType adds i to the "owner_wx_type" field.
+func (awfluo *AddWechatFriendLogUpdateOne) AddOwnerWxType(i int) *AddWechatFriendLogUpdateOne {
+	awfluo.mutation.AddOwnerWxType(i)
+	return awfluo
+}
+
+// SetFindContent sets the "find_content" field.
+func (awfluo *AddWechatFriendLogUpdateOne) SetFindContent(s string) *AddWechatFriendLogUpdateOne {
+	awfluo.mutation.SetFindContent(s)
+	return awfluo
+}
+
+// SetNillableFindContent sets the "find_content" field if the given value is not nil.
+func (awfluo *AddWechatFriendLogUpdateOne) SetNillableFindContent(s *string) *AddWechatFriendLogUpdateOne {
+	if s != nil {
+		awfluo.SetFindContent(*s)
+	}
+	return awfluo
+}
+
+// SetFindRequest sets the "find_request" field.
+func (awfluo *AddWechatFriendLogUpdateOne) SetFindRequest(m map[string]interface{}) *AddWechatFriendLogUpdateOne {
+	awfluo.mutation.SetFindRequest(m)
+	return awfluo
+}
+
+// ClearFindRequest clears the value of the "find_request" field.
+func (awfluo *AddWechatFriendLogUpdateOne) ClearFindRequest() *AddWechatFriendLogUpdateOne {
+	awfluo.mutation.ClearFindRequest()
+	return awfluo
+}
+
+// SetFindResult sets the "find_result" field.
+func (awfluo *AddWechatFriendLogUpdateOne) SetFindResult(m map[string]interface{}) *AddWechatFriendLogUpdateOne {
+	awfluo.mutation.SetFindResult(m)
+	return awfluo
+}
+
+// ClearFindResult clears the value of the "find_result" field.
+func (awfluo *AddWechatFriendLogUpdateOne) ClearFindResult() *AddWechatFriendLogUpdateOne {
+	awfluo.mutation.ClearFindResult()
+	return awfluo
+}
+
+// SetIsCanAdd sets the "is_can_add" field.
+func (awfluo *AddWechatFriendLogUpdateOne) SetIsCanAdd(i int) *AddWechatFriendLogUpdateOne {
+	awfluo.mutation.ResetIsCanAdd()
+	awfluo.mutation.SetIsCanAdd(i)
+	return awfluo
+}
+
+// SetNillableIsCanAdd sets the "is_can_add" field if the given value is not nil.
+func (awfluo *AddWechatFriendLogUpdateOne) SetNillableIsCanAdd(i *int) *AddWechatFriendLogUpdateOne {
+	if i != nil {
+		awfluo.SetIsCanAdd(*i)
+	}
+	return awfluo
+}
+
+// AddIsCanAdd adds i to the "is_can_add" field.
+func (awfluo *AddWechatFriendLogUpdateOne) AddIsCanAdd(i int) *AddWechatFriendLogUpdateOne {
+	awfluo.mutation.AddIsCanAdd(i)
+	return awfluo
+}
+
+// SetTaskID sets the "task_id" field.
+func (awfluo *AddWechatFriendLogUpdateOne) SetTaskID(i int64) *AddWechatFriendLogUpdateOne {
+	awfluo.mutation.ResetTaskID()
+	awfluo.mutation.SetTaskID(i)
+	return awfluo
+}
+
+// SetNillableTaskID sets the "task_id" field if the given value is not nil.
+func (awfluo *AddWechatFriendLogUpdateOne) SetNillableTaskID(i *int64) *AddWechatFriendLogUpdateOne {
+	if i != nil {
+		awfluo.SetTaskID(*i)
+	}
+	return awfluo
+}
+
+// AddTaskID adds i to the "task_id" field.
+func (awfluo *AddWechatFriendLogUpdateOne) AddTaskID(i int64) *AddWechatFriendLogUpdateOne {
+	awfluo.mutation.AddTaskID(i)
+	return awfluo
+}
+
+// SetAddRequest sets the "add_request" field.
+func (awfluo *AddWechatFriendLogUpdateOne) SetAddRequest(m map[string]interface{}) *AddWechatFriendLogUpdateOne {
+	awfluo.mutation.SetAddRequest(m)
+	return awfluo
+}
+
+// ClearAddRequest clears the value of the "add_request" field.
+func (awfluo *AddWechatFriendLogUpdateOne) ClearAddRequest() *AddWechatFriendLogUpdateOne {
+	awfluo.mutation.ClearAddRequest()
+	return awfluo
+}
+
+// SetAddResult sets the "add_result" field.
+func (awfluo *AddWechatFriendLogUpdateOne) SetAddResult(m map[string]interface{}) *AddWechatFriendLogUpdateOne {
+	awfluo.mutation.SetAddResult(m)
+	return awfluo
+}
+
+// ClearAddResult clears the value of the "add_result" field.
+func (awfluo *AddWechatFriendLogUpdateOne) ClearAddResult() *AddWechatFriendLogUpdateOne {
+	awfluo.mutation.ClearAddResult()
+	return awfluo
+}
+
+// SetCreatedAt sets the "created_at" field.
+func (awfluo *AddWechatFriendLogUpdateOne) SetCreatedAt(i int64) *AddWechatFriendLogUpdateOne {
+	awfluo.mutation.ResetCreatedAt()
+	awfluo.mutation.SetCreatedAt(i)
+	return awfluo
+}
+
+// SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
+func (awfluo *AddWechatFriendLogUpdateOne) SetNillableCreatedAt(i *int64) *AddWechatFriendLogUpdateOne {
+	if i != nil {
+		awfluo.SetCreatedAt(*i)
+	}
+	return awfluo
+}
+
+// AddCreatedAt adds i to the "created_at" field.
+func (awfluo *AddWechatFriendLogUpdateOne) AddCreatedAt(i int64) *AddWechatFriendLogUpdateOne {
+	awfluo.mutation.AddCreatedAt(i)
+	return awfluo
+}
+
+// SetUpdatedAt sets the "updated_at" field.
+func (awfluo *AddWechatFriendLogUpdateOne) SetUpdatedAt(i int64) *AddWechatFriendLogUpdateOne {
+	awfluo.mutation.ResetUpdatedAt()
+	awfluo.mutation.SetUpdatedAt(i)
+	return awfluo
+}
+
+// AddUpdatedAt adds i to the "updated_at" field.
+func (awfluo *AddWechatFriendLogUpdateOne) AddUpdatedAt(i int64) *AddWechatFriendLogUpdateOne {
+	awfluo.mutation.AddUpdatedAt(i)
+	return awfluo
+}
+
+// Mutation returns the AddWechatFriendLogMutation object of the builder.
+func (awfluo *AddWechatFriendLogUpdateOne) Mutation() *AddWechatFriendLogMutation {
+	return awfluo.mutation
+}
+
+// Where appends a list predicates to the AddWechatFriendLogUpdate builder.
+func (awfluo *AddWechatFriendLogUpdateOne) Where(ps ...predicate.AddWechatFriendLog) *AddWechatFriendLogUpdateOne {
+	awfluo.mutation.Where(ps...)
+	return awfluo
+}
+
+// Select allows selecting one or more fields (columns) of the returned entity.
+// The default is selecting all fields defined in the entity schema.
+func (awfluo *AddWechatFriendLogUpdateOne) Select(field string, fields ...string) *AddWechatFriendLogUpdateOne {
+	awfluo.fields = append([]string{field}, fields...)
+	return awfluo
+}
+
+// Save executes the query and returns the updated AddWechatFriendLog entity.
+func (awfluo *AddWechatFriendLogUpdateOne) Save(ctx context.Context) (*AddWechatFriendLog, error) {
+	awfluo.defaults()
+	return withHooks(ctx, awfluo.sqlSave, awfluo.mutation, awfluo.hooks)
+}
+
+// SaveX is like Save, but panics if an error occurs.
+func (awfluo *AddWechatFriendLogUpdateOne) SaveX(ctx context.Context) *AddWechatFriendLog {
+	node, err := awfluo.Save(ctx)
+	if err != nil {
+		panic(err)
+	}
+	return node
+}
+
+// Exec executes the query on the entity.
+func (awfluo *AddWechatFriendLogUpdateOne) Exec(ctx context.Context) error {
+	_, err := awfluo.Save(ctx)
+	return err
+}
+
+// ExecX is like Exec, but panics if an error occurs.
+func (awfluo *AddWechatFriendLogUpdateOne) ExecX(ctx context.Context) {
+	if err := awfluo.Exec(ctx); err != nil {
+		panic(err)
+	}
+}
+
+// defaults sets the default values of the builder before save.
+func (awfluo *AddWechatFriendLogUpdateOne) defaults() {
+	if _, ok := awfluo.mutation.UpdatedAt(); !ok {
+		v := addwechatfriendlog.UpdateDefaultUpdatedAt()
+		awfluo.mutation.SetUpdatedAt(v)
+	}
+}
+
+// check runs all checks and user-defined validators on the builder.
+func (awfluo *AddWechatFriendLogUpdateOne) check() error {
+	if v, ok := awfluo.mutation.OwnerWxID(); ok {
+		if err := addwechatfriendlog.OwnerWxIDValidator(v); err != nil {
+			return &ValidationError{Name: "owner_wx_id", err: fmt.Errorf(`ent: validator failed for field "AddWechatFriendLog.owner_wx_id": %w`, err)}
+		}
+	}
+	if v, ok := awfluo.mutation.FindContent(); ok {
+		if err := addwechatfriendlog.FindContentValidator(v); err != nil {
+			return &ValidationError{Name: "find_content", err: fmt.Errorf(`ent: validator failed for field "AddWechatFriendLog.find_content": %w`, err)}
+		}
+	}
+	return nil
+}
+
+func (awfluo *AddWechatFriendLogUpdateOne) sqlSave(ctx context.Context) (_node *AddWechatFriendLog, err error) {
+	if err := awfluo.check(); err != nil {
+		return _node, err
+	}
+	_spec := sqlgraph.NewUpdateSpec(addwechatfriendlog.Table, addwechatfriendlog.Columns, sqlgraph.NewFieldSpec(addwechatfriendlog.FieldID, field.TypeInt64))
+	id, ok := awfluo.mutation.ID()
+	if !ok {
+		return nil, &ValidationError{Name: "id", err: errors.New(`ent: missing "AddWechatFriendLog.id" for update`)}
+	}
+	_spec.Node.ID.Value = id
+	if fields := awfluo.fields; len(fields) > 0 {
+		_spec.Node.Columns = make([]string, 0, len(fields))
+		_spec.Node.Columns = append(_spec.Node.Columns, addwechatfriendlog.FieldID)
+		for _, f := range fields {
+			if !addwechatfriendlog.ValidColumn(f) {
+				return nil, &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)}
+			}
+			if f != addwechatfriendlog.FieldID {
+				_spec.Node.Columns = append(_spec.Node.Columns, f)
+			}
+		}
+	}
+	if ps := awfluo.mutation.predicates; len(ps) > 0 {
+		_spec.Predicate = func(selector *sql.Selector) {
+			for i := range ps {
+				ps[i](selector)
+			}
+		}
+	}
+	if value, ok := awfluo.mutation.OwnerWxID(); ok {
+		_spec.SetField(addwechatfriendlog.FieldOwnerWxID, field.TypeString, value)
+	}
+	if value, ok := awfluo.mutation.OwnerWxType(); ok {
+		_spec.SetField(addwechatfriendlog.FieldOwnerWxType, field.TypeInt, value)
+	}
+	if value, ok := awfluo.mutation.AddedOwnerWxType(); ok {
+		_spec.AddField(addwechatfriendlog.FieldOwnerWxType, field.TypeInt, value)
+	}
+	if value, ok := awfluo.mutation.FindContent(); ok {
+		_spec.SetField(addwechatfriendlog.FieldFindContent, field.TypeString, value)
+	}
+	if value, ok := awfluo.mutation.FindRequest(); ok {
+		_spec.SetField(addwechatfriendlog.FieldFindRequest, field.TypeJSON, value)
+	}
+	if awfluo.mutation.FindRequestCleared() {
+		_spec.ClearField(addwechatfriendlog.FieldFindRequest, field.TypeJSON)
+	}
+	if value, ok := awfluo.mutation.FindResult(); ok {
+		_spec.SetField(addwechatfriendlog.FieldFindResult, field.TypeJSON, value)
+	}
+	if awfluo.mutation.FindResultCleared() {
+		_spec.ClearField(addwechatfriendlog.FieldFindResult, field.TypeJSON)
+	}
+	if value, ok := awfluo.mutation.IsCanAdd(); ok {
+		_spec.SetField(addwechatfriendlog.FieldIsCanAdd, field.TypeInt, value)
+	}
+	if value, ok := awfluo.mutation.AddedIsCanAdd(); ok {
+		_spec.AddField(addwechatfriendlog.FieldIsCanAdd, field.TypeInt, value)
+	}
+	if value, ok := awfluo.mutation.TaskID(); ok {
+		_spec.SetField(addwechatfriendlog.FieldTaskID, field.TypeInt64, value)
+	}
+	if value, ok := awfluo.mutation.AddedTaskID(); ok {
+		_spec.AddField(addwechatfriendlog.FieldTaskID, field.TypeInt64, value)
+	}
+	if value, ok := awfluo.mutation.AddRequest(); ok {
+		_spec.SetField(addwechatfriendlog.FieldAddRequest, field.TypeJSON, value)
+	}
+	if awfluo.mutation.AddRequestCleared() {
+		_spec.ClearField(addwechatfriendlog.FieldAddRequest, field.TypeJSON)
+	}
+	if value, ok := awfluo.mutation.AddResult(); ok {
+		_spec.SetField(addwechatfriendlog.FieldAddResult, field.TypeJSON, value)
+	}
+	if awfluo.mutation.AddResultCleared() {
+		_spec.ClearField(addwechatfriendlog.FieldAddResult, field.TypeJSON)
+	}
+	if value, ok := awfluo.mutation.CreatedAt(); ok {
+		_spec.SetField(addwechatfriendlog.FieldCreatedAt, field.TypeInt64, value)
+	}
+	if value, ok := awfluo.mutation.AddedCreatedAt(); ok {
+		_spec.AddField(addwechatfriendlog.FieldCreatedAt, field.TypeInt64, value)
+	}
+	if value, ok := awfluo.mutation.UpdatedAt(); ok {
+		_spec.SetField(addwechatfriendlog.FieldUpdatedAt, field.TypeInt64, value)
+	}
+	if value, ok := awfluo.mutation.AddedUpdatedAt(); ok {
+		_spec.AddField(addwechatfriendlog.FieldUpdatedAt, field.TypeInt64, value)
+	}
+	_node = &AddWechatFriendLog{config: awfluo.config}
+	_spec.Assign = _node.assignValues
+	_spec.ScanValues = _node.scanValues
+	if err = sqlgraph.UpdateNode(ctx, awfluo.driver, _spec); err != nil {
+		if _, ok := err.(*sqlgraph.NotFoundError); ok {
+			err = &NotFoundError{addwechatfriendlog.Label}
+		} else if sqlgraph.IsConstraintError(err) {
+			err = &ConstraintError{msg: err.Error(), wrap: err}
+		}
+		return nil, err
+	}
+	awfluo.mutation.done = true
+	return _node, nil
+}

+ 180 - 37
ent/client.go

@@ -11,6 +11,7 @@ import (
 
 	"wechat-api/ent/migrate"
 
+	"wechat-api/ent/addwechatfriendlog"
 	"wechat-api/ent/agent"
 	"wechat-api/ent/agentbase"
 	"wechat-api/ent/aliyunavatar"
@@ -72,6 +73,8 @@ type Client struct {
 	config
 	// Schema is the client for creating, migrating and dropping schema.
 	Schema *migrate.Schema
+	// AddWechatFriendLog is the client for interacting with the AddWechatFriendLog builders.
+	AddWechatFriendLog *AddWechatFriendLogClient
 	// Agent is the client for interacting with the Agent builders.
 	Agent *AgentClient
 	// AgentBase is the client for interacting with the AgentBase builders.
@@ -177,6 +180,7 @@ func NewClient(opts ...Option) *Client {
 
 func (c *Client) init() {
 	c.Schema = migrate.NewSchema(c.driver)
+	c.AddWechatFriendLog = NewAddWechatFriendLogClient(c.config)
 	c.Agent = NewAgentClient(c.config)
 	c.AgentBase = NewAgentBaseClient(c.config)
 	c.AliyunAvatar = NewAliyunAvatarClient(c.config)
@@ -316,6 +320,7 @@ func (c *Client) Tx(ctx context.Context) (*Tx, error) {
 	return &Tx{
 		ctx:                  ctx,
 		config:               cfg,
+		AddWechatFriendLog:   NewAddWechatFriendLogClient(cfg),
 		Agent:                NewAgentClient(cfg),
 		AgentBase:            NewAgentBaseClient(cfg),
 		AliyunAvatar:         NewAliyunAvatarClient(cfg),
@@ -382,6 +387,7 @@ func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
 	return &Tx{
 		ctx:                  ctx,
 		config:               cfg,
+		AddWechatFriendLog:   NewAddWechatFriendLogClient(cfg),
 		Agent:                NewAgentClient(cfg),
 		AgentBase:            NewAgentBaseClient(cfg),
 		AliyunAvatar:         NewAliyunAvatarClient(cfg),
@@ -435,7 +441,7 @@ func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
 // Debug returns a new debug-client. It's used to get verbose logging on specific operations.
 //
 //	client.Debug().
-//		Agent.
+//		AddWechatFriendLog.
 //		Query().
 //		Count(ctx)
 func (c *Client) Debug() *Client {
@@ -458,16 +464,16 @@ 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.CompapiAsynctask, c.Contact,
-		c.ContactField, c.ContactFieldTemplate, c.CreditBalance, c.CreditUsage,
-		c.Employee, c.EmployeeConfig, c.Label, c.LabelLog, 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.AddWechatFriendLog, c.Agent, c.AgentBase, c.AliyunAvatar, c.AllocAgent,
+		c.ApiKey, c.BatchMsg, c.Category, c.ChatRecords, c.ChatSession,
+		c.CompapiAsynctask, c.Contact, c.ContactField, c.ContactFieldTemplate,
+		c.CreditBalance, c.CreditUsage, c.Employee, c.EmployeeConfig, c.Label,
+		c.LabelLog, 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...)
 	}
@@ -477,16 +483,16 @@ 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.CompapiAsynctask, c.Contact,
-		c.ContactField, c.ContactFieldTemplate, c.CreditBalance, c.CreditUsage,
-		c.Employee, c.EmployeeConfig, c.Label, c.LabelLog, 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.AddWechatFriendLog, c.Agent, c.AgentBase, c.AliyunAvatar, c.AllocAgent,
+		c.ApiKey, c.BatchMsg, c.Category, c.ChatRecords, c.ChatSession,
+		c.CompapiAsynctask, c.Contact, c.ContactField, c.ContactFieldTemplate,
+		c.CreditBalance, c.CreditUsage, c.Employee, c.EmployeeConfig, c.Label,
+		c.LabelLog, 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...)
 	}
@@ -495,6 +501,8 @@ func (c *Client) Intercept(interceptors ...Interceptor) {
 // Mutate implements the ent.Mutator interface.
 func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error) {
 	switch m := m.(type) {
+	case *AddWechatFriendLogMutation:
+		return c.AddWechatFriendLog.mutate(ctx, m)
 	case *AgentMutation:
 		return c.Agent.mutate(ctx, m)
 	case *AgentBaseMutation:
@@ -594,6 +602,139 @@ func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error) {
 	}
 }
 
+// AddWechatFriendLogClient is a client for the AddWechatFriendLog schema.
+type AddWechatFriendLogClient struct {
+	config
+}
+
+// NewAddWechatFriendLogClient returns a client for the AddWechatFriendLog from the given config.
+func NewAddWechatFriendLogClient(c config) *AddWechatFriendLogClient {
+	return &AddWechatFriendLogClient{config: c}
+}
+
+// Use adds a list of mutation hooks to the hooks stack.
+// A call to `Use(f, g, h)` equals to `addwechatfriendlog.Hooks(f(g(h())))`.
+func (c *AddWechatFriendLogClient) Use(hooks ...Hook) {
+	c.hooks.AddWechatFriendLog = append(c.hooks.AddWechatFriendLog, hooks...)
+}
+
+// Intercept adds a list of query interceptors to the interceptors stack.
+// A call to `Intercept(f, g, h)` equals to `addwechatfriendlog.Intercept(f(g(h())))`.
+func (c *AddWechatFriendLogClient) Intercept(interceptors ...Interceptor) {
+	c.inters.AddWechatFriendLog = append(c.inters.AddWechatFriendLog, interceptors...)
+}
+
+// Create returns a builder for creating a AddWechatFriendLog entity.
+func (c *AddWechatFriendLogClient) Create() *AddWechatFriendLogCreate {
+	mutation := newAddWechatFriendLogMutation(c.config, OpCreate)
+	return &AddWechatFriendLogCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
+}
+
+// CreateBulk returns a builder for creating a bulk of AddWechatFriendLog entities.
+func (c *AddWechatFriendLogClient) CreateBulk(builders ...*AddWechatFriendLogCreate) *AddWechatFriendLogCreateBulk {
+	return &AddWechatFriendLogCreateBulk{config: c.config, builders: builders}
+}
+
+// MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates
+// a builder and applies setFunc on it.
+func (c *AddWechatFriendLogClient) MapCreateBulk(slice any, setFunc func(*AddWechatFriendLogCreate, int)) *AddWechatFriendLogCreateBulk {
+	rv := reflect.ValueOf(slice)
+	if rv.Kind() != reflect.Slice {
+		return &AddWechatFriendLogCreateBulk{err: fmt.Errorf("calling to AddWechatFriendLogClient.MapCreateBulk with wrong type %T, need slice", slice)}
+	}
+	builders := make([]*AddWechatFriendLogCreate, rv.Len())
+	for i := 0; i < rv.Len(); i++ {
+		builders[i] = c.Create()
+		setFunc(builders[i], i)
+	}
+	return &AddWechatFriendLogCreateBulk{config: c.config, builders: builders}
+}
+
+// Update returns an update builder for AddWechatFriendLog.
+func (c *AddWechatFriendLogClient) Update() *AddWechatFriendLogUpdate {
+	mutation := newAddWechatFriendLogMutation(c.config, OpUpdate)
+	return &AddWechatFriendLogUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation}
+}
+
+// UpdateOne returns an update builder for the given entity.
+func (c *AddWechatFriendLogClient) UpdateOne(awfl *AddWechatFriendLog) *AddWechatFriendLogUpdateOne {
+	mutation := newAddWechatFriendLogMutation(c.config, OpUpdateOne, withAddWechatFriendLog(awfl))
+	return &AddWechatFriendLogUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
+}
+
+// UpdateOneID returns an update builder for the given id.
+func (c *AddWechatFriendLogClient) UpdateOneID(id int64) *AddWechatFriendLogUpdateOne {
+	mutation := newAddWechatFriendLogMutation(c.config, OpUpdateOne, withAddWechatFriendLogID(id))
+	return &AddWechatFriendLogUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
+}
+
+// Delete returns a delete builder for AddWechatFriendLog.
+func (c *AddWechatFriendLogClient) Delete() *AddWechatFriendLogDelete {
+	mutation := newAddWechatFriendLogMutation(c.config, OpDelete)
+	return &AddWechatFriendLogDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
+}
+
+// DeleteOne returns a builder for deleting the given entity.
+func (c *AddWechatFriendLogClient) DeleteOne(awfl *AddWechatFriendLog) *AddWechatFriendLogDeleteOne {
+	return c.DeleteOneID(awfl.ID)
+}
+
+// DeleteOneID returns a builder for deleting the given entity by its id.
+func (c *AddWechatFriendLogClient) DeleteOneID(id int64) *AddWechatFriendLogDeleteOne {
+	builder := c.Delete().Where(addwechatfriendlog.ID(id))
+	builder.mutation.id = &id
+	builder.mutation.op = OpDeleteOne
+	return &AddWechatFriendLogDeleteOne{builder}
+}
+
+// Query returns a query builder for AddWechatFriendLog.
+func (c *AddWechatFriendLogClient) Query() *AddWechatFriendLogQuery {
+	return &AddWechatFriendLogQuery{
+		config: c.config,
+		ctx:    &QueryContext{Type: TypeAddWechatFriendLog},
+		inters: c.Interceptors(),
+	}
+}
+
+// Get returns a AddWechatFriendLog entity by its id.
+func (c *AddWechatFriendLogClient) Get(ctx context.Context, id int64) (*AddWechatFriendLog, error) {
+	return c.Query().Where(addwechatfriendlog.ID(id)).Only(ctx)
+}
+
+// GetX is like Get, but panics if an error occurs.
+func (c *AddWechatFriendLogClient) GetX(ctx context.Context, id int64) *AddWechatFriendLog {
+	obj, err := c.Get(ctx, id)
+	if err != nil {
+		panic(err)
+	}
+	return obj
+}
+
+// Hooks returns the client hooks.
+func (c *AddWechatFriendLogClient) Hooks() []Hook {
+	return c.hooks.AddWechatFriendLog
+}
+
+// Interceptors returns the client interceptors.
+func (c *AddWechatFriendLogClient) Interceptors() []Interceptor {
+	return c.inters.AddWechatFriendLog
+}
+
+func (c *AddWechatFriendLogClient) mutate(ctx context.Context, m *AddWechatFriendLogMutation) (Value, error) {
+	switch m.Op() {
+	case OpCreate:
+		return (&AddWechatFriendLogCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
+	case OpUpdate:
+		return (&AddWechatFriendLogUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
+	case OpUpdateOne:
+		return (&AddWechatFriendLogUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
+	case OpDelete, OpDeleteOne:
+		return (&AddWechatFriendLogDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx)
+	default:
+		return nil, fmt.Errorf("ent: unknown AddWechatFriendLog mutation op: %q", m.Op())
+	}
+}
+
 // AgentClient is a client for the Agent schema.
 type AgentClient struct {
 	config
@@ -7448,24 +7589,26 @@ 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, CompapiAsynctask, Contact, ContactField,
-		ContactFieldTemplate, CreditBalance, CreditUsage, Employee, EmployeeConfig,
-		Label, LabelLog, 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
+		AddWechatFriendLog, Agent, AgentBase, AliyunAvatar, AllocAgent, ApiKey,
+		BatchMsg, Category, ChatRecords, ChatSession, CompapiAsynctask, Contact,
+		ContactField, ContactFieldTemplate, CreditBalance, CreditUsage, Employee,
+		EmployeeConfig, Label, LabelLog, 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, CompapiAsynctask, Contact, ContactField,
-		ContactFieldTemplate, CreditBalance, CreditUsage, Employee, EmployeeConfig,
-		Label, LabelLog, 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
+		AddWechatFriendLog, Agent, AgentBase, AliyunAvatar, AllocAgent, ApiKey,
+		BatchMsg, Category, ChatRecords, ChatSession, CompapiAsynctask, Contact,
+		ContactField, ContactFieldTemplate, CreditBalance, CreditUsage, Employee,
+		EmployeeConfig, Label, LabelLog, 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
 	}
 )
 

+ 2 - 0
ent/ent.go

@@ -8,6 +8,7 @@ import (
 	"fmt"
 	"reflect"
 	"sync"
+	"wechat-api/ent/addwechatfriendlog"
 	"wechat-api/ent/agent"
 	"wechat-api/ent/agentbase"
 	"wechat-api/ent/aliyunavatar"
@@ -119,6 +120,7 @@ var (
 func checkColumn(table, column string) error {
 	initCheck.Do(func() {
 		columnCheck = sql.NewColumnCheck(map[string]func(string) bool{
+			addwechatfriendlog.Table:   addwechatfriendlog.ValidColumn,
 			agent.Table:                agent.ValidColumn,
 			agentbase.Table:            agentbase.ValidColumn,
 			aliyunavatar.Table:         aliyunavatar.ValidColumn,

+ 12 - 0
ent/hook/hook.go

@@ -8,6 +8,18 @@ import (
 	"wechat-api/ent"
 )
 
+// The AddWechatFriendLogFunc type is an adapter to allow the use of ordinary
+// function as AddWechatFriendLog mutator.
+type AddWechatFriendLogFunc func(context.Context, *ent.AddWechatFriendLogMutation) (ent.Value, error)
+
+// Mutate calls f(ctx, m).
+func (f AddWechatFriendLogFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
+	if mv, ok := m.(*ent.AddWechatFriendLogMutation); ok {
+		return f(ctx, mv)
+	}
+	return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.AddWechatFriendLogMutation", m)
+}
+
 // The AgentFunc type is an adapter to allow the use of ordinary
 // function as Agent mutator.
 type AgentFunc func(context.Context, *ent.AgentMutation) (ent.Value, error)

+ 30 - 0
ent/intercept/intercept.go

@@ -6,6 +6,7 @@ import (
 	"context"
 	"fmt"
 	"wechat-api/ent"
+	"wechat-api/ent/addwechatfriendlog"
 	"wechat-api/ent/agent"
 	"wechat-api/ent/agentbase"
 	"wechat-api/ent/aliyunavatar"
@@ -114,6 +115,33 @@ func (f TraverseFunc) Traverse(ctx context.Context, q ent.Query) error {
 	return f(ctx, query)
 }
 
+// The AddWechatFriendLogFunc type is an adapter to allow the use of ordinary function as a Querier.
+type AddWechatFriendLogFunc func(context.Context, *ent.AddWechatFriendLogQuery) (ent.Value, error)
+
+// Query calls f(ctx, q).
+func (f AddWechatFriendLogFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
+	if q, ok := q.(*ent.AddWechatFriendLogQuery); ok {
+		return f(ctx, q)
+	}
+	return nil, fmt.Errorf("unexpected query type %T. expect *ent.AddWechatFriendLogQuery", q)
+}
+
+// The TraverseAddWechatFriendLog type is an adapter to allow the use of ordinary function as Traverser.
+type TraverseAddWechatFriendLog func(context.Context, *ent.AddWechatFriendLogQuery) error
+
+// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
+func (f TraverseAddWechatFriendLog) Intercept(next ent.Querier) ent.Querier {
+	return next
+}
+
+// Traverse calls f(ctx, q).
+func (f TraverseAddWechatFriendLog) Traverse(ctx context.Context, q ent.Query) error {
+	if q, ok := q.(*ent.AddWechatFriendLogQuery); ok {
+		return f(ctx, q)
+	}
+	return fmt.Errorf("unexpected query type %T. expect *ent.AddWechatFriendLogQuery", q)
+}
+
 // 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)
 
@@ -1386,6 +1414,8 @@ func (f TraverseXunjiService) Traverse(ctx context.Context, q ent.Query) error {
 // NewQuery returns the generic Query interface for the given typed query.
 func NewQuery(q ent.Query) (Query, error) {
 	switch q := q.(type) {
+	case *ent.AddWechatFriendLogQuery:
+		return &query[*ent.AddWechatFriendLogQuery, predicate.AddWechatFriendLog, addwechatfriendlog.OrderOption]{typ: ent.TypeAddWechatFriendLog, tq: q}, nil
 	case *ent.AgentQuery:
 		return &query[*ent.AgentQuery, predicate.Agent, agent.OrderOption]{typ: ent.TypeAgent, tq: q}, nil
 	case *ent.AgentBaseQuery:

+ 29 - 0
ent/migrate/schema.go

@@ -9,6 +9,34 @@ import (
 )
 
 var (
+	// AddWechatFriendLogsColumns holds the columns for the "add_wechat_friend_logs" table.
+	AddWechatFriendLogsColumns = []*schema.Column{
+		{Name: "id", Type: field.TypeInt64, Increment: true},
+		{Name: "owner_wx_id", Type: field.TypeString, Size: 64, Default: ""},
+		{Name: "owner_wx_type", Type: field.TypeInt, Default: 1},
+		{Name: "find_content", Type: field.TypeString, Size: 64, Default: ""},
+		{Name: "find_request", Type: field.TypeJSON, Nullable: true},
+		{Name: "find_result", Type: field.TypeJSON, Nullable: true},
+		{Name: "is_can_add", Type: field.TypeInt, Default: 0},
+		{Name: "task_id", Type: field.TypeInt64, Default: 0},
+		{Name: "add_request", Type: field.TypeJSON, Nullable: true},
+		{Name: "add_result", Type: field.TypeJSON, Nullable: true},
+		{Name: "created_at", Type: field.TypeInt64},
+		{Name: "updated_at", Type: field.TypeInt64},
+	}
+	// AddWechatFriendLogsTable holds the schema information for the "add_wechat_friend_logs" table.
+	AddWechatFriendLogsTable = &schema.Table{
+		Name:       "add_wechat_friend_logs",
+		Columns:    AddWechatFriendLogsColumns,
+		PrimaryKey: []*schema.Column{AddWechatFriendLogsColumns[0]},
+		Indexes: []*schema.Index{
+			{
+				Name:    "addwechatfriendlog_owner_wx_id_is_can_add",
+				Unique:  false,
+				Columns: []*schema.Column{AddWechatFriendLogsColumns[1], AddWechatFriendLogsColumns[6]},
+			},
+		},
+	}
 	// AgentColumns holds the columns for the "agent" table.
 	AgentColumns = []*schema.Column{
 		{Name: "id", Type: field.TypeUint64, Increment: true},
@@ -1586,6 +1614,7 @@ var (
 	}
 	// Tables holds all the tables in the schema.
 	Tables = []*schema.Table{
+		AddWechatFriendLogsTable,
 		AgentTable,
 		AgentBaseTable,
 		AliyunAvatarTable,

+ 1121 - 0
ent/mutation.go

@@ -8,6 +8,7 @@ import (
 	"fmt"
 	"sync"
 	"time"
+	"wechat-api/ent/addwechatfriendlog"
 	"wechat-api/ent/agent"
 	"wechat-api/ent/agentbase"
 	"wechat-api/ent/aliyunavatar"
@@ -71,6 +72,7 @@ const (
 	OpUpdateOne = ent.OpUpdateOne
 
 	// Node types.
+	TypeAddWechatFriendLog   = "AddWechatFriendLog"
 	TypeAgent                = "Agent"
 	TypeAgentBase            = "AgentBase"
 	TypeAliyunAvatar         = "AliyunAvatar"
@@ -120,6 +122,1125 @@ const (
 	TypeXunjiService         = "XunjiService"
 )
 
+// AddWechatFriendLogMutation represents an operation that mutates the AddWechatFriendLog nodes in the graph.
+type AddWechatFriendLogMutation struct {
+	config
+	op               Op
+	typ              string
+	id               *int64
+	owner_wx_id      *string
+	owner_wx_type    *int
+	addowner_wx_type *int
+	find_content     *string
+	find_request     *map[string]interface{}
+	find_result      *map[string]interface{}
+	is_can_add       *int
+	addis_can_add    *int
+	task_id          *int64
+	addtask_id       *int64
+	add_request      *map[string]interface{}
+	add_result       *map[string]interface{}
+	created_at       *int64
+	addcreated_at    *int64
+	updated_at       *int64
+	addupdated_at    *int64
+	clearedFields    map[string]struct{}
+	done             bool
+	oldValue         func(context.Context) (*AddWechatFriendLog, error)
+	predicates       []predicate.AddWechatFriendLog
+}
+
+var _ ent.Mutation = (*AddWechatFriendLogMutation)(nil)
+
+// addwechatfriendlogOption allows management of the mutation configuration using functional options.
+type addwechatfriendlogOption func(*AddWechatFriendLogMutation)
+
+// newAddWechatFriendLogMutation creates new mutation for the AddWechatFriendLog entity.
+func newAddWechatFriendLogMutation(c config, op Op, opts ...addwechatfriendlogOption) *AddWechatFriendLogMutation {
+	m := &AddWechatFriendLogMutation{
+		config:        c,
+		op:            op,
+		typ:           TypeAddWechatFriendLog,
+		clearedFields: make(map[string]struct{}),
+	}
+	for _, opt := range opts {
+		opt(m)
+	}
+	return m
+}
+
+// withAddWechatFriendLogID sets the ID field of the mutation.
+func withAddWechatFriendLogID(id int64) addwechatfriendlogOption {
+	return func(m *AddWechatFriendLogMutation) {
+		var (
+			err   error
+			once  sync.Once
+			value *AddWechatFriendLog
+		)
+		m.oldValue = func(ctx context.Context) (*AddWechatFriendLog, error) {
+			once.Do(func() {
+				if m.done {
+					err = errors.New("querying old values post mutation is not allowed")
+				} else {
+					value, err = m.Client().AddWechatFriendLog.Get(ctx, id)
+				}
+			})
+			return value, err
+		}
+		m.id = &id
+	}
+}
+
+// withAddWechatFriendLog sets the old AddWechatFriendLog of the mutation.
+func withAddWechatFriendLog(node *AddWechatFriendLog) addwechatfriendlogOption {
+	return func(m *AddWechatFriendLogMutation) {
+		m.oldValue = func(context.Context) (*AddWechatFriendLog, error) {
+			return node, nil
+		}
+		m.id = &node.ID
+	}
+}
+
+// Client returns a new `ent.Client` from the mutation. If the mutation was
+// executed in a transaction (ent.Tx), a transactional client is returned.
+func (m AddWechatFriendLogMutation) Client() *Client {
+	client := &Client{config: m.config}
+	client.init()
+	return client
+}
+
+// Tx returns an `ent.Tx` for mutations that were executed in transactions;
+// it returns an error otherwise.
+func (m AddWechatFriendLogMutation) Tx() (*Tx, error) {
+	if _, ok := m.driver.(*txDriver); !ok {
+		return nil, errors.New("ent: mutation is not running in a transaction")
+	}
+	tx := &Tx{config: m.config}
+	tx.init()
+	return tx, nil
+}
+
+// SetID sets the value of the id field. Note that this
+// operation is only accepted on creation of AddWechatFriendLog entities.
+func (m *AddWechatFriendLogMutation) SetID(id int64) {
+	m.id = &id
+}
+
+// ID returns the ID value in the mutation. Note that the ID is only available
+// if it was provided to the builder or after it was returned from the database.
+func (m *AddWechatFriendLogMutation) ID() (id int64, exists bool) {
+	if m.id == nil {
+		return
+	}
+	return *m.id, true
+}
+
+// IDs queries the database and returns the entity ids that match the mutation's predicate.
+// That means, if the mutation is applied within a transaction with an isolation level such
+// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated
+// or updated by the mutation.
+func (m *AddWechatFriendLogMutation) IDs(ctx context.Context) ([]int64, error) {
+	switch {
+	case m.op.Is(OpUpdateOne | OpDeleteOne):
+		id, exists := m.ID()
+		if exists {
+			return []int64{id}, nil
+		}
+		fallthrough
+	case m.op.Is(OpUpdate | OpDelete):
+		return m.Client().AddWechatFriendLog.Query().Where(m.predicates...).IDs(ctx)
+	default:
+		return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op)
+	}
+}
+
+// SetOwnerWxID sets the "owner_wx_id" field.
+func (m *AddWechatFriendLogMutation) SetOwnerWxID(s string) {
+	m.owner_wx_id = &s
+}
+
+// OwnerWxID returns the value of the "owner_wx_id" field in the mutation.
+func (m *AddWechatFriendLogMutation) OwnerWxID() (r string, exists bool) {
+	v := m.owner_wx_id
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// OldOwnerWxID returns the old "owner_wx_id" field's value of the AddWechatFriendLog entity.
+// If the AddWechatFriendLog object wasn't provided to the builder, the object is fetched from the database.
+// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
+func (m *AddWechatFriendLogMutation) OldOwnerWxID(ctx context.Context) (v string, err error) {
+	if !m.op.Is(OpUpdateOne) {
+		return v, errors.New("OldOwnerWxID is only allowed on UpdateOne operations")
+	}
+	if m.id == nil || m.oldValue == nil {
+		return v, errors.New("OldOwnerWxID requires an ID field in the mutation")
+	}
+	oldValue, err := m.oldValue(ctx)
+	if err != nil {
+		return v, fmt.Errorf("querying old value for OldOwnerWxID: %w", err)
+	}
+	return oldValue.OwnerWxID, nil
+}
+
+// ResetOwnerWxID resets all changes to the "owner_wx_id" field.
+func (m *AddWechatFriendLogMutation) ResetOwnerWxID() {
+	m.owner_wx_id = nil
+}
+
+// SetOwnerWxType sets the "owner_wx_type" field.
+func (m *AddWechatFriendLogMutation) SetOwnerWxType(i int) {
+	m.owner_wx_type = &i
+	m.addowner_wx_type = nil
+}
+
+// OwnerWxType returns the value of the "owner_wx_type" field in the mutation.
+func (m *AddWechatFriendLogMutation) OwnerWxType() (r int, exists bool) {
+	v := m.owner_wx_type
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// OldOwnerWxType returns the old "owner_wx_type" field's value of the AddWechatFriendLog entity.
+// If the AddWechatFriendLog object wasn't provided to the builder, the object is fetched from the database.
+// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
+func (m *AddWechatFriendLogMutation) OldOwnerWxType(ctx context.Context) (v int, err error) {
+	if !m.op.Is(OpUpdateOne) {
+		return v, errors.New("OldOwnerWxType is only allowed on UpdateOne operations")
+	}
+	if m.id == nil || m.oldValue == nil {
+		return v, errors.New("OldOwnerWxType requires an ID field in the mutation")
+	}
+	oldValue, err := m.oldValue(ctx)
+	if err != nil {
+		return v, fmt.Errorf("querying old value for OldOwnerWxType: %w", err)
+	}
+	return oldValue.OwnerWxType, nil
+}
+
+// AddOwnerWxType adds i to the "owner_wx_type" field.
+func (m *AddWechatFriendLogMutation) AddOwnerWxType(i int) {
+	if m.addowner_wx_type != nil {
+		*m.addowner_wx_type += i
+	} else {
+		m.addowner_wx_type = &i
+	}
+}
+
+// AddedOwnerWxType returns the value that was added to the "owner_wx_type" field in this mutation.
+func (m *AddWechatFriendLogMutation) AddedOwnerWxType() (r int, exists bool) {
+	v := m.addowner_wx_type
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// ResetOwnerWxType resets all changes to the "owner_wx_type" field.
+func (m *AddWechatFriendLogMutation) ResetOwnerWxType() {
+	m.owner_wx_type = nil
+	m.addowner_wx_type = nil
+}
+
+// SetFindContent sets the "find_content" field.
+func (m *AddWechatFriendLogMutation) SetFindContent(s string) {
+	m.find_content = &s
+}
+
+// FindContent returns the value of the "find_content" field in the mutation.
+func (m *AddWechatFriendLogMutation) FindContent() (r string, exists bool) {
+	v := m.find_content
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// OldFindContent returns the old "find_content" field's value of the AddWechatFriendLog entity.
+// If the AddWechatFriendLog object wasn't provided to the builder, the object is fetched from the database.
+// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
+func (m *AddWechatFriendLogMutation) OldFindContent(ctx context.Context) (v string, err error) {
+	if !m.op.Is(OpUpdateOne) {
+		return v, errors.New("OldFindContent is only allowed on UpdateOne operations")
+	}
+	if m.id == nil || m.oldValue == nil {
+		return v, errors.New("OldFindContent requires an ID field in the mutation")
+	}
+	oldValue, err := m.oldValue(ctx)
+	if err != nil {
+		return v, fmt.Errorf("querying old value for OldFindContent: %w", err)
+	}
+	return oldValue.FindContent, nil
+}
+
+// ResetFindContent resets all changes to the "find_content" field.
+func (m *AddWechatFriendLogMutation) ResetFindContent() {
+	m.find_content = nil
+}
+
+// SetFindRequest sets the "find_request" field.
+func (m *AddWechatFriendLogMutation) SetFindRequest(value map[string]interface{}) {
+	m.find_request = &value
+}
+
+// FindRequest returns the value of the "find_request" field in the mutation.
+func (m *AddWechatFriendLogMutation) FindRequest() (r map[string]interface{}, exists bool) {
+	v := m.find_request
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// OldFindRequest returns the old "find_request" field's value of the AddWechatFriendLog entity.
+// If the AddWechatFriendLog object wasn't provided to the builder, the object is fetched from the database.
+// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
+func (m *AddWechatFriendLogMutation) OldFindRequest(ctx context.Context) (v map[string]interface{}, err error) {
+	if !m.op.Is(OpUpdateOne) {
+		return v, errors.New("OldFindRequest is only allowed on UpdateOne operations")
+	}
+	if m.id == nil || m.oldValue == nil {
+		return v, errors.New("OldFindRequest requires an ID field in the mutation")
+	}
+	oldValue, err := m.oldValue(ctx)
+	if err != nil {
+		return v, fmt.Errorf("querying old value for OldFindRequest: %w", err)
+	}
+	return oldValue.FindRequest, nil
+}
+
+// ClearFindRequest clears the value of the "find_request" field.
+func (m *AddWechatFriendLogMutation) ClearFindRequest() {
+	m.find_request = nil
+	m.clearedFields[addwechatfriendlog.FieldFindRequest] = struct{}{}
+}
+
+// FindRequestCleared returns if the "find_request" field was cleared in this mutation.
+func (m *AddWechatFriendLogMutation) FindRequestCleared() bool {
+	_, ok := m.clearedFields[addwechatfriendlog.FieldFindRequest]
+	return ok
+}
+
+// ResetFindRequest resets all changes to the "find_request" field.
+func (m *AddWechatFriendLogMutation) ResetFindRequest() {
+	m.find_request = nil
+	delete(m.clearedFields, addwechatfriendlog.FieldFindRequest)
+}
+
+// SetFindResult sets the "find_result" field.
+func (m *AddWechatFriendLogMutation) SetFindResult(value map[string]interface{}) {
+	m.find_result = &value
+}
+
+// FindResult returns the value of the "find_result" field in the mutation.
+func (m *AddWechatFriendLogMutation) FindResult() (r map[string]interface{}, exists bool) {
+	v := m.find_result
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// OldFindResult returns the old "find_result" field's value of the AddWechatFriendLog entity.
+// If the AddWechatFriendLog object wasn't provided to the builder, the object is fetched from the database.
+// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
+func (m *AddWechatFriendLogMutation) OldFindResult(ctx context.Context) (v map[string]interface{}, err error) {
+	if !m.op.Is(OpUpdateOne) {
+		return v, errors.New("OldFindResult is only allowed on UpdateOne operations")
+	}
+	if m.id == nil || m.oldValue == nil {
+		return v, errors.New("OldFindResult requires an ID field in the mutation")
+	}
+	oldValue, err := m.oldValue(ctx)
+	if err != nil {
+		return v, fmt.Errorf("querying old value for OldFindResult: %w", err)
+	}
+	return oldValue.FindResult, nil
+}
+
+// ClearFindResult clears the value of the "find_result" field.
+func (m *AddWechatFriendLogMutation) ClearFindResult() {
+	m.find_result = nil
+	m.clearedFields[addwechatfriendlog.FieldFindResult] = struct{}{}
+}
+
+// FindResultCleared returns if the "find_result" field was cleared in this mutation.
+func (m *AddWechatFriendLogMutation) FindResultCleared() bool {
+	_, ok := m.clearedFields[addwechatfriendlog.FieldFindResult]
+	return ok
+}
+
+// ResetFindResult resets all changes to the "find_result" field.
+func (m *AddWechatFriendLogMutation) ResetFindResult() {
+	m.find_result = nil
+	delete(m.clearedFields, addwechatfriendlog.FieldFindResult)
+}
+
+// SetIsCanAdd sets the "is_can_add" field.
+func (m *AddWechatFriendLogMutation) SetIsCanAdd(i int) {
+	m.is_can_add = &i
+	m.addis_can_add = nil
+}
+
+// IsCanAdd returns the value of the "is_can_add" field in the mutation.
+func (m *AddWechatFriendLogMutation) IsCanAdd() (r int, exists bool) {
+	v := m.is_can_add
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// OldIsCanAdd returns the old "is_can_add" field's value of the AddWechatFriendLog entity.
+// If the AddWechatFriendLog object wasn't provided to the builder, the object is fetched from the database.
+// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
+func (m *AddWechatFriendLogMutation) OldIsCanAdd(ctx context.Context) (v int, err error) {
+	if !m.op.Is(OpUpdateOne) {
+		return v, errors.New("OldIsCanAdd is only allowed on UpdateOne operations")
+	}
+	if m.id == nil || m.oldValue == nil {
+		return v, errors.New("OldIsCanAdd requires an ID field in the mutation")
+	}
+	oldValue, err := m.oldValue(ctx)
+	if err != nil {
+		return v, fmt.Errorf("querying old value for OldIsCanAdd: %w", err)
+	}
+	return oldValue.IsCanAdd, nil
+}
+
+// AddIsCanAdd adds i to the "is_can_add" field.
+func (m *AddWechatFriendLogMutation) AddIsCanAdd(i int) {
+	if m.addis_can_add != nil {
+		*m.addis_can_add += i
+	} else {
+		m.addis_can_add = &i
+	}
+}
+
+// AddedIsCanAdd returns the value that was added to the "is_can_add" field in this mutation.
+func (m *AddWechatFriendLogMutation) AddedIsCanAdd() (r int, exists bool) {
+	v := m.addis_can_add
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// ResetIsCanAdd resets all changes to the "is_can_add" field.
+func (m *AddWechatFriendLogMutation) ResetIsCanAdd() {
+	m.is_can_add = nil
+	m.addis_can_add = nil
+}
+
+// SetTaskID sets the "task_id" field.
+func (m *AddWechatFriendLogMutation) SetTaskID(i int64) {
+	m.task_id = &i
+	m.addtask_id = nil
+}
+
+// TaskID returns the value of the "task_id" field in the mutation.
+func (m *AddWechatFriendLogMutation) TaskID() (r int64, exists bool) {
+	v := m.task_id
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// OldTaskID returns the old "task_id" field's value of the AddWechatFriendLog entity.
+// If the AddWechatFriendLog object wasn't provided to the builder, the object is fetched from the database.
+// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
+func (m *AddWechatFriendLogMutation) OldTaskID(ctx context.Context) (v int64, err error) {
+	if !m.op.Is(OpUpdateOne) {
+		return v, errors.New("OldTaskID is only allowed on UpdateOne operations")
+	}
+	if m.id == nil || m.oldValue == nil {
+		return v, errors.New("OldTaskID requires an ID field in the mutation")
+	}
+	oldValue, err := m.oldValue(ctx)
+	if err != nil {
+		return v, fmt.Errorf("querying old value for OldTaskID: %w", err)
+	}
+	return oldValue.TaskID, nil
+}
+
+// AddTaskID adds i to the "task_id" field.
+func (m *AddWechatFriendLogMutation) AddTaskID(i int64) {
+	if m.addtask_id != nil {
+		*m.addtask_id += i
+	} else {
+		m.addtask_id = &i
+	}
+}
+
+// AddedTaskID returns the value that was added to the "task_id" field in this mutation.
+func (m *AddWechatFriendLogMutation) AddedTaskID() (r int64, exists bool) {
+	v := m.addtask_id
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// ResetTaskID resets all changes to the "task_id" field.
+func (m *AddWechatFriendLogMutation) ResetTaskID() {
+	m.task_id = nil
+	m.addtask_id = nil
+}
+
+// SetAddRequest sets the "add_request" field.
+func (m *AddWechatFriendLogMutation) SetAddRequest(value map[string]interface{}) {
+	m.add_request = &value
+}
+
+// AddRequest returns the value of the "add_request" field in the mutation.
+func (m *AddWechatFriendLogMutation) AddRequest() (r map[string]interface{}, exists bool) {
+	v := m.add_request
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// OldAddRequest returns the old "add_request" field's value of the AddWechatFriendLog entity.
+// If the AddWechatFriendLog object wasn't provided to the builder, the object is fetched from the database.
+// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
+func (m *AddWechatFriendLogMutation) OldAddRequest(ctx context.Context) (v map[string]interface{}, err error) {
+	if !m.op.Is(OpUpdateOne) {
+		return v, errors.New("OldAddRequest is only allowed on UpdateOne operations")
+	}
+	if m.id == nil || m.oldValue == nil {
+		return v, errors.New("OldAddRequest requires an ID field in the mutation")
+	}
+	oldValue, err := m.oldValue(ctx)
+	if err != nil {
+		return v, fmt.Errorf("querying old value for OldAddRequest: %w", err)
+	}
+	return oldValue.AddRequest, nil
+}
+
+// ClearAddRequest clears the value of the "add_request" field.
+func (m *AddWechatFriendLogMutation) ClearAddRequest() {
+	m.add_request = nil
+	m.clearedFields[addwechatfriendlog.FieldAddRequest] = struct{}{}
+}
+
+// AddRequestCleared returns if the "add_request" field was cleared in this mutation.
+func (m *AddWechatFriendLogMutation) AddRequestCleared() bool {
+	_, ok := m.clearedFields[addwechatfriendlog.FieldAddRequest]
+	return ok
+}
+
+// ResetAddRequest resets all changes to the "add_request" field.
+func (m *AddWechatFriendLogMutation) ResetAddRequest() {
+	m.add_request = nil
+	delete(m.clearedFields, addwechatfriendlog.FieldAddRequest)
+}
+
+// SetAddResult sets the "add_result" field.
+func (m *AddWechatFriendLogMutation) SetAddResult(value map[string]interface{}) {
+	m.add_result = &value
+}
+
+// AddResult returns the value of the "add_result" field in the mutation.
+func (m *AddWechatFriendLogMutation) AddResult() (r map[string]interface{}, exists bool) {
+	v := m.add_result
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// OldAddResult returns the old "add_result" field's value of the AddWechatFriendLog entity.
+// If the AddWechatFriendLog object wasn't provided to the builder, the object is fetched from the database.
+// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
+func (m *AddWechatFriendLogMutation) OldAddResult(ctx context.Context) (v map[string]interface{}, err error) {
+	if !m.op.Is(OpUpdateOne) {
+		return v, errors.New("OldAddResult is only allowed on UpdateOne operations")
+	}
+	if m.id == nil || m.oldValue == nil {
+		return v, errors.New("OldAddResult requires an ID field in the mutation")
+	}
+	oldValue, err := m.oldValue(ctx)
+	if err != nil {
+		return v, fmt.Errorf("querying old value for OldAddResult: %w", err)
+	}
+	return oldValue.AddResult, nil
+}
+
+// ClearAddResult clears the value of the "add_result" field.
+func (m *AddWechatFriendLogMutation) ClearAddResult() {
+	m.add_result = nil
+	m.clearedFields[addwechatfriendlog.FieldAddResult] = struct{}{}
+}
+
+// AddResultCleared returns if the "add_result" field was cleared in this mutation.
+func (m *AddWechatFriendLogMutation) AddResultCleared() bool {
+	_, ok := m.clearedFields[addwechatfriendlog.FieldAddResult]
+	return ok
+}
+
+// ResetAddResult resets all changes to the "add_result" field.
+func (m *AddWechatFriendLogMutation) ResetAddResult() {
+	m.add_result = nil
+	delete(m.clearedFields, addwechatfriendlog.FieldAddResult)
+}
+
+// SetCreatedAt sets the "created_at" field.
+func (m *AddWechatFriendLogMutation) SetCreatedAt(i int64) {
+	m.created_at = &i
+	m.addcreated_at = nil
+}
+
+// CreatedAt returns the value of the "created_at" field in the mutation.
+func (m *AddWechatFriendLogMutation) CreatedAt() (r int64, exists bool) {
+	v := m.created_at
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// OldCreatedAt returns the old "created_at" field's value of the AddWechatFriendLog entity.
+// If the AddWechatFriendLog object wasn't provided to the builder, the object is fetched from the database.
+// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
+func (m *AddWechatFriendLogMutation) OldCreatedAt(ctx context.Context) (v int64, err error) {
+	if !m.op.Is(OpUpdateOne) {
+		return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations")
+	}
+	if m.id == nil || m.oldValue == nil {
+		return v, errors.New("OldCreatedAt requires an ID field in the mutation")
+	}
+	oldValue, err := m.oldValue(ctx)
+	if err != nil {
+		return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err)
+	}
+	return oldValue.CreatedAt, nil
+}
+
+// AddCreatedAt adds i to the "created_at" field.
+func (m *AddWechatFriendLogMutation) AddCreatedAt(i int64) {
+	if m.addcreated_at != nil {
+		*m.addcreated_at += i
+	} else {
+		m.addcreated_at = &i
+	}
+}
+
+// AddedCreatedAt returns the value that was added to the "created_at" field in this mutation.
+func (m *AddWechatFriendLogMutation) AddedCreatedAt() (r int64, exists bool) {
+	v := m.addcreated_at
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// ResetCreatedAt resets all changes to the "created_at" field.
+func (m *AddWechatFriendLogMutation) ResetCreatedAt() {
+	m.created_at = nil
+	m.addcreated_at = nil
+}
+
+// SetUpdatedAt sets the "updated_at" field.
+func (m *AddWechatFriendLogMutation) SetUpdatedAt(i int64) {
+	m.updated_at = &i
+	m.addupdated_at = nil
+}
+
+// UpdatedAt returns the value of the "updated_at" field in the mutation.
+func (m *AddWechatFriendLogMutation) UpdatedAt() (r int64, exists bool) {
+	v := m.updated_at
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// OldUpdatedAt returns the old "updated_at" field's value of the AddWechatFriendLog entity.
+// If the AddWechatFriendLog object wasn't provided to the builder, the object is fetched from the database.
+// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
+func (m *AddWechatFriendLogMutation) OldUpdatedAt(ctx context.Context) (v int64, err error) {
+	if !m.op.Is(OpUpdateOne) {
+		return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations")
+	}
+	if m.id == nil || m.oldValue == nil {
+		return v, errors.New("OldUpdatedAt requires an ID field in the mutation")
+	}
+	oldValue, err := m.oldValue(ctx)
+	if err != nil {
+		return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err)
+	}
+	return oldValue.UpdatedAt, nil
+}
+
+// AddUpdatedAt adds i to the "updated_at" field.
+func (m *AddWechatFriendLogMutation) AddUpdatedAt(i int64) {
+	if m.addupdated_at != nil {
+		*m.addupdated_at += i
+	} else {
+		m.addupdated_at = &i
+	}
+}
+
+// AddedUpdatedAt returns the value that was added to the "updated_at" field in this mutation.
+func (m *AddWechatFriendLogMutation) AddedUpdatedAt() (r int64, exists bool) {
+	v := m.addupdated_at
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// ResetUpdatedAt resets all changes to the "updated_at" field.
+func (m *AddWechatFriendLogMutation) ResetUpdatedAt() {
+	m.updated_at = nil
+	m.addupdated_at = nil
+}
+
+// Where appends a list predicates to the AddWechatFriendLogMutation builder.
+func (m *AddWechatFriendLogMutation) Where(ps ...predicate.AddWechatFriendLog) {
+	m.predicates = append(m.predicates, ps...)
+}
+
+// WhereP appends storage-level predicates to the AddWechatFriendLogMutation builder. Using this method,
+// users can use type-assertion to append predicates that do not depend on any generated package.
+func (m *AddWechatFriendLogMutation) WhereP(ps ...func(*sql.Selector)) {
+	p := make([]predicate.AddWechatFriendLog, len(ps))
+	for i := range ps {
+		p[i] = ps[i]
+	}
+	m.Where(p...)
+}
+
+// Op returns the operation name.
+func (m *AddWechatFriendLogMutation) Op() Op {
+	return m.op
+}
+
+// SetOp allows setting the mutation operation.
+func (m *AddWechatFriendLogMutation) SetOp(op Op) {
+	m.op = op
+}
+
+// Type returns the node type of this mutation (AddWechatFriendLog).
+func (m *AddWechatFriendLogMutation) Type() string {
+	return m.typ
+}
+
+// Fields returns all fields that were changed during this mutation. Note that in
+// order to get all numeric fields that were incremented/decremented, call
+// AddedFields().
+func (m *AddWechatFriendLogMutation) Fields() []string {
+	fields := make([]string, 0, 11)
+	if m.owner_wx_id != nil {
+		fields = append(fields, addwechatfriendlog.FieldOwnerWxID)
+	}
+	if m.owner_wx_type != nil {
+		fields = append(fields, addwechatfriendlog.FieldOwnerWxType)
+	}
+	if m.find_content != nil {
+		fields = append(fields, addwechatfriendlog.FieldFindContent)
+	}
+	if m.find_request != nil {
+		fields = append(fields, addwechatfriendlog.FieldFindRequest)
+	}
+	if m.find_result != nil {
+		fields = append(fields, addwechatfriendlog.FieldFindResult)
+	}
+	if m.is_can_add != nil {
+		fields = append(fields, addwechatfriendlog.FieldIsCanAdd)
+	}
+	if m.task_id != nil {
+		fields = append(fields, addwechatfriendlog.FieldTaskID)
+	}
+	if m.add_request != nil {
+		fields = append(fields, addwechatfriendlog.FieldAddRequest)
+	}
+	if m.add_result != nil {
+		fields = append(fields, addwechatfriendlog.FieldAddResult)
+	}
+	if m.created_at != nil {
+		fields = append(fields, addwechatfriendlog.FieldCreatedAt)
+	}
+	if m.updated_at != nil {
+		fields = append(fields, addwechatfriendlog.FieldUpdatedAt)
+	}
+	return fields
+}
+
+// Field returns the value of a field with the given name. The second boolean
+// return value indicates that this field was not set, or was not defined in the
+// schema.
+func (m *AddWechatFriendLogMutation) Field(name string) (ent.Value, bool) {
+	switch name {
+	case addwechatfriendlog.FieldOwnerWxID:
+		return m.OwnerWxID()
+	case addwechatfriendlog.FieldOwnerWxType:
+		return m.OwnerWxType()
+	case addwechatfriendlog.FieldFindContent:
+		return m.FindContent()
+	case addwechatfriendlog.FieldFindRequest:
+		return m.FindRequest()
+	case addwechatfriendlog.FieldFindResult:
+		return m.FindResult()
+	case addwechatfriendlog.FieldIsCanAdd:
+		return m.IsCanAdd()
+	case addwechatfriendlog.FieldTaskID:
+		return m.TaskID()
+	case addwechatfriendlog.FieldAddRequest:
+		return m.AddRequest()
+	case addwechatfriendlog.FieldAddResult:
+		return m.AddResult()
+	case addwechatfriendlog.FieldCreatedAt:
+		return m.CreatedAt()
+	case addwechatfriendlog.FieldUpdatedAt:
+		return m.UpdatedAt()
+	}
+	return nil, false
+}
+
+// OldField returns the old value of the field from the database. An error is
+// returned if the mutation operation is not UpdateOne, or the query to the
+// database failed.
+func (m *AddWechatFriendLogMutation) OldField(ctx context.Context, name string) (ent.Value, error) {
+	switch name {
+	case addwechatfriendlog.FieldOwnerWxID:
+		return m.OldOwnerWxID(ctx)
+	case addwechatfriendlog.FieldOwnerWxType:
+		return m.OldOwnerWxType(ctx)
+	case addwechatfriendlog.FieldFindContent:
+		return m.OldFindContent(ctx)
+	case addwechatfriendlog.FieldFindRequest:
+		return m.OldFindRequest(ctx)
+	case addwechatfriendlog.FieldFindResult:
+		return m.OldFindResult(ctx)
+	case addwechatfriendlog.FieldIsCanAdd:
+		return m.OldIsCanAdd(ctx)
+	case addwechatfriendlog.FieldTaskID:
+		return m.OldTaskID(ctx)
+	case addwechatfriendlog.FieldAddRequest:
+		return m.OldAddRequest(ctx)
+	case addwechatfriendlog.FieldAddResult:
+		return m.OldAddResult(ctx)
+	case addwechatfriendlog.FieldCreatedAt:
+		return m.OldCreatedAt(ctx)
+	case addwechatfriendlog.FieldUpdatedAt:
+		return m.OldUpdatedAt(ctx)
+	}
+	return nil, fmt.Errorf("unknown AddWechatFriendLog field %s", name)
+}
+
+// SetField sets the value of a field with the given name. It returns an error if
+// the field is not defined in the schema, or if the type mismatched the field
+// type.
+func (m *AddWechatFriendLogMutation) SetField(name string, value ent.Value) error {
+	switch name {
+	case addwechatfriendlog.FieldOwnerWxID:
+		v, ok := value.(string)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.SetOwnerWxID(v)
+		return nil
+	case addwechatfriendlog.FieldOwnerWxType:
+		v, ok := value.(int)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.SetOwnerWxType(v)
+		return nil
+	case addwechatfriendlog.FieldFindContent:
+		v, ok := value.(string)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.SetFindContent(v)
+		return nil
+	case addwechatfriendlog.FieldFindRequest:
+		v, ok := value.(map[string]interface{})
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.SetFindRequest(v)
+		return nil
+	case addwechatfriendlog.FieldFindResult:
+		v, ok := value.(map[string]interface{})
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.SetFindResult(v)
+		return nil
+	case addwechatfriendlog.FieldIsCanAdd:
+		v, ok := value.(int)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.SetIsCanAdd(v)
+		return nil
+	case addwechatfriendlog.FieldTaskID:
+		v, ok := value.(int64)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.SetTaskID(v)
+		return nil
+	case addwechatfriendlog.FieldAddRequest:
+		v, ok := value.(map[string]interface{})
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.SetAddRequest(v)
+		return nil
+	case addwechatfriendlog.FieldAddResult:
+		v, ok := value.(map[string]interface{})
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.SetAddResult(v)
+		return nil
+	case addwechatfriendlog.FieldCreatedAt:
+		v, ok := value.(int64)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.SetCreatedAt(v)
+		return nil
+	case addwechatfriendlog.FieldUpdatedAt:
+		v, ok := value.(int64)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.SetUpdatedAt(v)
+		return nil
+	}
+	return fmt.Errorf("unknown AddWechatFriendLog field %s", name)
+}
+
+// AddedFields returns all numeric fields that were incremented/decremented during
+// this mutation.
+func (m *AddWechatFriendLogMutation) AddedFields() []string {
+	var fields []string
+	if m.addowner_wx_type != nil {
+		fields = append(fields, addwechatfriendlog.FieldOwnerWxType)
+	}
+	if m.addis_can_add != nil {
+		fields = append(fields, addwechatfriendlog.FieldIsCanAdd)
+	}
+	if m.addtask_id != nil {
+		fields = append(fields, addwechatfriendlog.FieldTaskID)
+	}
+	if m.addcreated_at != nil {
+		fields = append(fields, addwechatfriendlog.FieldCreatedAt)
+	}
+	if m.addupdated_at != nil {
+		fields = append(fields, addwechatfriendlog.FieldUpdatedAt)
+	}
+	return fields
+}
+
+// AddedField returns the numeric value that was incremented/decremented on a field
+// with the given name. The second boolean return value indicates that this field
+// was not set, or was not defined in the schema.
+func (m *AddWechatFriendLogMutation) AddedField(name string) (ent.Value, bool) {
+	switch name {
+	case addwechatfriendlog.FieldOwnerWxType:
+		return m.AddedOwnerWxType()
+	case addwechatfriendlog.FieldIsCanAdd:
+		return m.AddedIsCanAdd()
+	case addwechatfriendlog.FieldTaskID:
+		return m.AddedTaskID()
+	case addwechatfriendlog.FieldCreatedAt:
+		return m.AddedCreatedAt()
+	case addwechatfriendlog.FieldUpdatedAt:
+		return m.AddedUpdatedAt()
+	}
+	return nil, false
+}
+
+// AddField adds the value to the field with the given name. It returns an error if
+// the field is not defined in the schema, or if the type mismatched the field
+// type.
+func (m *AddWechatFriendLogMutation) AddField(name string, value ent.Value) error {
+	switch name {
+	case addwechatfriendlog.FieldOwnerWxType:
+		v, ok := value.(int)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.AddOwnerWxType(v)
+		return nil
+	case addwechatfriendlog.FieldIsCanAdd:
+		v, ok := value.(int)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.AddIsCanAdd(v)
+		return nil
+	case addwechatfriendlog.FieldTaskID:
+		v, ok := value.(int64)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.AddTaskID(v)
+		return nil
+	case addwechatfriendlog.FieldCreatedAt:
+		v, ok := value.(int64)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.AddCreatedAt(v)
+		return nil
+	case addwechatfriendlog.FieldUpdatedAt:
+		v, ok := value.(int64)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.AddUpdatedAt(v)
+		return nil
+	}
+	return fmt.Errorf("unknown AddWechatFriendLog numeric field %s", name)
+}
+
+// ClearedFields returns all nullable fields that were cleared during this
+// mutation.
+func (m *AddWechatFriendLogMutation) ClearedFields() []string {
+	var fields []string
+	if m.FieldCleared(addwechatfriendlog.FieldFindRequest) {
+		fields = append(fields, addwechatfriendlog.FieldFindRequest)
+	}
+	if m.FieldCleared(addwechatfriendlog.FieldFindResult) {
+		fields = append(fields, addwechatfriendlog.FieldFindResult)
+	}
+	if m.FieldCleared(addwechatfriendlog.FieldAddRequest) {
+		fields = append(fields, addwechatfriendlog.FieldAddRequest)
+	}
+	if m.FieldCleared(addwechatfriendlog.FieldAddResult) {
+		fields = append(fields, addwechatfriendlog.FieldAddResult)
+	}
+	return fields
+}
+
+// FieldCleared returns a boolean indicating if a field with the given name was
+// cleared in this mutation.
+func (m *AddWechatFriendLogMutation) FieldCleared(name string) bool {
+	_, ok := m.clearedFields[name]
+	return ok
+}
+
+// ClearField clears the value of the field with the given name. It returns an
+// error if the field is not defined in the schema.
+func (m *AddWechatFriendLogMutation) ClearField(name string) error {
+	switch name {
+	case addwechatfriendlog.FieldFindRequest:
+		m.ClearFindRequest()
+		return nil
+	case addwechatfriendlog.FieldFindResult:
+		m.ClearFindResult()
+		return nil
+	case addwechatfriendlog.FieldAddRequest:
+		m.ClearAddRequest()
+		return nil
+	case addwechatfriendlog.FieldAddResult:
+		m.ClearAddResult()
+		return nil
+	}
+	return fmt.Errorf("unknown AddWechatFriendLog nullable field %s", name)
+}
+
+// ResetField resets all changes in the mutation for the field with the given name.
+// It returns an error if the field is not defined in the schema.
+func (m *AddWechatFriendLogMutation) ResetField(name string) error {
+	switch name {
+	case addwechatfriendlog.FieldOwnerWxID:
+		m.ResetOwnerWxID()
+		return nil
+	case addwechatfriendlog.FieldOwnerWxType:
+		m.ResetOwnerWxType()
+		return nil
+	case addwechatfriendlog.FieldFindContent:
+		m.ResetFindContent()
+		return nil
+	case addwechatfriendlog.FieldFindRequest:
+		m.ResetFindRequest()
+		return nil
+	case addwechatfriendlog.FieldFindResult:
+		m.ResetFindResult()
+		return nil
+	case addwechatfriendlog.FieldIsCanAdd:
+		m.ResetIsCanAdd()
+		return nil
+	case addwechatfriendlog.FieldTaskID:
+		m.ResetTaskID()
+		return nil
+	case addwechatfriendlog.FieldAddRequest:
+		m.ResetAddRequest()
+		return nil
+	case addwechatfriendlog.FieldAddResult:
+		m.ResetAddResult()
+		return nil
+	case addwechatfriendlog.FieldCreatedAt:
+		m.ResetCreatedAt()
+		return nil
+	case addwechatfriendlog.FieldUpdatedAt:
+		m.ResetUpdatedAt()
+		return nil
+	}
+	return fmt.Errorf("unknown AddWechatFriendLog field %s", name)
+}
+
+// AddedEdges returns all edge names that were set/added in this mutation.
+func (m *AddWechatFriendLogMutation) AddedEdges() []string {
+	edges := make([]string, 0, 0)
+	return edges
+}
+
+// AddedIDs returns all IDs (to other nodes) that were added for the given edge
+// name in this mutation.
+func (m *AddWechatFriendLogMutation) AddedIDs(name string) []ent.Value {
+	return nil
+}
+
+// RemovedEdges returns all edge names that were removed in this mutation.
+func (m *AddWechatFriendLogMutation) RemovedEdges() []string {
+	edges := make([]string, 0, 0)
+	return edges
+}
+
+// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with
+// the given name in this mutation.
+func (m *AddWechatFriendLogMutation) RemovedIDs(name string) []ent.Value {
+	return nil
+}
+
+// ClearedEdges returns all edge names that were cleared in this mutation.
+func (m *AddWechatFriendLogMutation) ClearedEdges() []string {
+	edges := make([]string, 0, 0)
+	return edges
+}
+
+// EdgeCleared returns a boolean which indicates if the edge with the given name
+// was cleared in this mutation.
+func (m *AddWechatFriendLogMutation) EdgeCleared(name string) bool {
+	return false
+}
+
+// ClearEdge clears the value of the edge with the given name. It returns an error
+// if that edge is not defined in the schema.
+func (m *AddWechatFriendLogMutation) ClearEdge(name string) error {
+	return fmt.Errorf("unknown AddWechatFriendLog unique edge %s", name)
+}
+
+// ResetEdge resets all changes to the edge with the given name in this mutation.
+// It returns an error if the edge is not defined in the schema.
+func (m *AddWechatFriendLogMutation) ResetEdge(name string) error {
+	return fmt.Errorf("unknown AddWechatFriendLog edge %s", name)
+}
+
 // AgentMutation represents an operation that mutates the Agent nodes in the graph.
 type AgentMutation struct {
 	config

+ 82 - 0
ent/pagination.go

@@ -5,6 +5,7 @@ package ent
 import (
 	"context"
 	"fmt"
+	"wechat-api/ent/addwechatfriendlog"
 	"wechat-api/ent/agent"
 	"wechat-api/ent/agentbase"
 	"wechat-api/ent/aliyunavatar"
@@ -100,6 +101,87 @@ func (o OrderDirection) reverse() OrderDirection {
 
 const errInvalidPagination = "INVALID_PAGINATION"
 
+type AddWechatFriendLogPager struct {
+	Order  addwechatfriendlog.OrderOption
+	Filter func(*AddWechatFriendLogQuery) (*AddWechatFriendLogQuery, error)
+}
+
+// AddWechatFriendLogPaginateOption enables pagination customization.
+type AddWechatFriendLogPaginateOption func(*AddWechatFriendLogPager)
+
+// DefaultAddWechatFriendLogOrder is the default ordering of AddWechatFriendLog.
+var DefaultAddWechatFriendLogOrder = Desc(addwechatfriendlog.FieldID)
+
+func newAddWechatFriendLogPager(opts []AddWechatFriendLogPaginateOption) (*AddWechatFriendLogPager, error) {
+	pager := &AddWechatFriendLogPager{}
+	for _, opt := range opts {
+		opt(pager)
+	}
+	if pager.Order == nil {
+		pager.Order = DefaultAddWechatFriendLogOrder
+	}
+	return pager, nil
+}
+
+func (p *AddWechatFriendLogPager) ApplyFilter(query *AddWechatFriendLogQuery) (*AddWechatFriendLogQuery, error) {
+	if p.Filter != nil {
+		return p.Filter(query)
+	}
+	return query, nil
+}
+
+// AddWechatFriendLogPageList is AddWechatFriendLog PageList result.
+type AddWechatFriendLogPageList struct {
+	List        []*AddWechatFriendLog `json:"list"`
+	PageDetails *PageDetails          `json:"pageDetails"`
+}
+
+func (awfl *AddWechatFriendLogQuery) Page(
+	ctx context.Context, pageNum uint64, pageSize uint64, opts ...AddWechatFriendLogPaginateOption,
+) (*AddWechatFriendLogPageList, error) {
+
+	pager, err := newAddWechatFriendLogPager(opts)
+	if err != nil {
+		return nil, err
+	}
+
+	if awfl, err = pager.ApplyFilter(awfl); err != nil {
+		return nil, err
+	}
+
+	ret := &AddWechatFriendLogPageList{}
+
+	ret.PageDetails = &PageDetails{
+		Page: pageNum,
+		Size: pageSize,
+	}
+
+	query := awfl.Clone()
+	query.ctx.Fields = nil
+	count, err := query.Count(ctx)
+
+	if err != nil {
+		return nil, err
+	}
+
+	ret.PageDetails.Total = uint64(count)
+
+	if pager.Order != nil {
+		awfl = awfl.Order(pager.Order)
+	} else {
+		awfl = awfl.Order(DefaultAddWechatFriendLogOrder)
+	}
+
+	awfl = awfl.Offset(int((pageNum - 1) * pageSize)).Limit(int(pageSize))
+	list, err := awfl.All(ctx)
+	if err != nil {
+		return nil, err
+	}
+	ret.List = list
+
+	return ret, nil
+}
+
 type AgentPager struct {
 	Order  agent.OrderOption
 	Filter func(*AgentQuery) (*AgentQuery, error)

+ 3 - 0
ent/predicate/predicate.go

@@ -6,6 +6,9 @@ import (
 	"entgo.io/ent/dialect/sql"
 )
 
+// AddWechatFriendLog is the predicate function for addwechatfriendlog builders.
+type AddWechatFriendLog func(*sql.Selector)
+
 // Agent is the predicate function for agent builders.
 type Agent func(*sql.Selector)
 

+ 65 - 0
ent/runtime/runtime.go

@@ -4,6 +4,7 @@ package runtime
 
 import (
 	"time"
+	"wechat-api/ent/addwechatfriendlog"
 	"wechat-api/ent/agent"
 	"wechat-api/ent/agentbase"
 	"wechat-api/ent/aliyunavatar"
@@ -58,6 +59,70 @@ import (
 // (default values, validators, hooks and policies) and stitches it
 // to their package variables.
 func init() {
+	addwechatfriendlogFields := schema.AddWechatFriendLog{}.Fields()
+	_ = addwechatfriendlogFields
+	// addwechatfriendlogDescOwnerWxID is the schema descriptor for owner_wx_id field.
+	addwechatfriendlogDescOwnerWxID := addwechatfriendlogFields[1].Descriptor()
+	// addwechatfriendlog.DefaultOwnerWxID holds the default value on creation for the owner_wx_id field.
+	addwechatfriendlog.DefaultOwnerWxID = addwechatfriendlogDescOwnerWxID.Default.(string)
+	// addwechatfriendlog.OwnerWxIDValidator is a validator for the "owner_wx_id" field. It is called by the builders before save.
+	addwechatfriendlog.OwnerWxIDValidator = func() func(string) error {
+		validators := addwechatfriendlogDescOwnerWxID.Validators
+		fns := [...]func(string) error{
+			validators[0].(func(string) error),
+			validators[1].(func(string) error),
+		}
+		return func(owner_wx_id string) error {
+			for _, fn := range fns {
+				if err := fn(owner_wx_id); err != nil {
+					return err
+				}
+			}
+			return nil
+		}
+	}()
+	// addwechatfriendlogDescOwnerWxType is the schema descriptor for owner_wx_type field.
+	addwechatfriendlogDescOwnerWxType := addwechatfriendlogFields[2].Descriptor()
+	// addwechatfriendlog.DefaultOwnerWxType holds the default value on creation for the owner_wx_type field.
+	addwechatfriendlog.DefaultOwnerWxType = addwechatfriendlogDescOwnerWxType.Default.(int)
+	// addwechatfriendlogDescFindContent is the schema descriptor for find_content field.
+	addwechatfriendlogDescFindContent := addwechatfriendlogFields[3].Descriptor()
+	// addwechatfriendlog.DefaultFindContent holds the default value on creation for the find_content field.
+	addwechatfriendlog.DefaultFindContent = addwechatfriendlogDescFindContent.Default.(string)
+	// addwechatfriendlog.FindContentValidator is a validator for the "find_content" field. It is called by the builders before save.
+	addwechatfriendlog.FindContentValidator = func() func(string) error {
+		validators := addwechatfriendlogDescFindContent.Validators
+		fns := [...]func(string) error{
+			validators[0].(func(string) error),
+			validators[1].(func(string) error),
+		}
+		return func(find_content string) error {
+			for _, fn := range fns {
+				if err := fn(find_content); err != nil {
+					return err
+				}
+			}
+			return nil
+		}
+	}()
+	// addwechatfriendlogDescIsCanAdd is the schema descriptor for is_can_add field.
+	addwechatfriendlogDescIsCanAdd := addwechatfriendlogFields[6].Descriptor()
+	// addwechatfriendlog.DefaultIsCanAdd holds the default value on creation for the is_can_add field.
+	addwechatfriendlog.DefaultIsCanAdd = addwechatfriendlogDescIsCanAdd.Default.(int)
+	// addwechatfriendlogDescTaskID is the schema descriptor for task_id field.
+	addwechatfriendlogDescTaskID := addwechatfriendlogFields[7].Descriptor()
+	// addwechatfriendlog.DefaultTaskID holds the default value on creation for the task_id field.
+	addwechatfriendlog.DefaultTaskID = addwechatfriendlogDescTaskID.Default.(int64)
+	// addwechatfriendlogDescCreatedAt is the schema descriptor for created_at field.
+	addwechatfriendlogDescCreatedAt := addwechatfriendlogFields[10].Descriptor()
+	// addwechatfriendlog.DefaultCreatedAt holds the default value on creation for the created_at field.
+	addwechatfriendlog.DefaultCreatedAt = addwechatfriendlogDescCreatedAt.Default.(func() int64)
+	// addwechatfriendlogDescUpdatedAt is the schema descriptor for updated_at field.
+	addwechatfriendlogDescUpdatedAt := addwechatfriendlogFields[11].Descriptor()
+	// addwechatfriendlog.DefaultUpdatedAt holds the default value on creation for the updated_at field.
+	addwechatfriendlog.DefaultUpdatedAt = addwechatfriendlogDescUpdatedAt.Default.(func() int64)
+	// addwechatfriendlog.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
+	addwechatfriendlog.UpdateDefaultUpdatedAt = addwechatfriendlogDescUpdatedAt.UpdateDefault.(func() int64)
 	agentMixin := schema.Agent{}.Mixin()
 	agentMixinHooks1 := agentMixin[1].Hooks()
 	agent.Hooks[0] = agentMixinHooks1[0]

+ 88 - 0
ent/schema/add_wechat_friend_log.go

@@ -0,0 +1,88 @@
+package schema
+
+import (
+	"entgo.io/ent"
+	"entgo.io/ent/schema"
+	"entgo.io/ent/schema/field"
+	"entgo.io/ent/schema/index"
+	"time"
+)
+
+// AddWechatFriendLog holds the schema definition for the AddWechatFriendLog entity.
+type AddWechatFriendLog struct {
+	ent.Schema
+}
+
+// Fields of the AddWechatFriendLog.
+func (AddWechatFriendLog) Fields() []ent.Field {
+	return []ent.Field{
+		field.Int64("id").
+			Comment("主键id").
+			Unique().
+			Immutable(),
+
+		field.String("owner_wx_id").
+			Default("").
+			NotEmpty().
+			MaxLen(64).
+			Comment("属主的wxid"),
+
+		field.Int("owner_wx_type").
+			Default(1).
+			Comment("属主的微信类型(1个微,2企微)"),
+
+		field.String("find_content").
+			Default("").
+			NotEmpty().
+			MaxLen(64).
+			Comment("手机号"),
+
+		field.JSON("find_request", map[string]interface{}{}).
+			Optional().
+			Comment("发起查询数据的时候json"),
+
+		field.JSON("find_result", map[string]interface{}{}).
+			Optional().
+			Comment("查询返回结果"),
+
+		field.Int("is_can_add").
+			Default(0).
+			Comment("是否可以添加好友(与属主账号非好友且其数据查询正常时 0 不可以,1 可以)"),
+		field.Int64("task_id").Default(0).Comment("添加时候的请求体"),
+		field.JSON("add_request", map[string]interface{}{}).
+			Optional().Comment("添加时候的请求体"),
+		field.JSON("add_result", map[string]interface{}{}).
+			Optional().Comment("添加请求的结果"),
+
+		field.Int64("created_at").
+			DefaultFunc(func() int64 {
+				return time.Now().Unix()
+			}).Comment("创建时间戳"),
+
+		field.Int64("updated_at").
+			DefaultFunc(func() int64 {
+				return time.Now().Unix()
+			}).
+			UpdateDefault(func() int64 {
+				return time.Now().Unix()
+			}).Comment("修改时间戳"),
+	}
+}
+
+// TableName sets the custom table name.
+func (AddWechatFriendLog) TableName() string {
+	return "add_wechat_friend_log"
+}
+
+// Indexes of the AddWechatFriendLog.
+func (AddWechatFriendLog) Indexes() []ent.Index {
+	return []ent.Index{
+		index.Fields("owner_wx_id", "is_can_add"),
+	}
+}
+
+func (AddWechatFriendLog) Annotations() []schema.Annotation {
+	return []schema.Annotation{
+		schema.Comment("微信添加好友记录"),
+	}
+}

+ 264 - 0
ent/set_not_nil.go

@@ -8,6 +8,270 @@ import (
 )
 
 // set field if value's pointer is not nil.
+func (awfl *AddWechatFriendLogUpdate) SetNotNilOwnerWxID(value *string) *AddWechatFriendLogUpdate {
+	if value != nil {
+		return awfl.SetOwnerWxID(*value)
+	}
+	return awfl
+}
+
+// set field if value's pointer is not nil.
+func (awfl *AddWechatFriendLogUpdateOne) SetNotNilOwnerWxID(value *string) *AddWechatFriendLogUpdateOne {
+	if value != nil {
+		return awfl.SetOwnerWxID(*value)
+	}
+	return awfl
+}
+
+// set field if value's pointer is not nil.
+func (awfl *AddWechatFriendLogCreate) SetNotNilOwnerWxID(value *string) *AddWechatFriendLogCreate {
+	if value != nil {
+		return awfl.SetOwnerWxID(*value)
+	}
+	return awfl
+}
+
+// set field if value's pointer is not nil.
+func (awfl *AddWechatFriendLogUpdate) SetNotNilOwnerWxType(value *int) *AddWechatFriendLogUpdate {
+	if value != nil {
+		return awfl.SetOwnerWxType(*value)
+	}
+	return awfl
+}
+
+// set field if value's pointer is not nil.
+func (awfl *AddWechatFriendLogUpdateOne) SetNotNilOwnerWxType(value *int) *AddWechatFriendLogUpdateOne {
+	if value != nil {
+		return awfl.SetOwnerWxType(*value)
+	}
+	return awfl
+}
+
+// set field if value's pointer is not nil.
+func (awfl *AddWechatFriendLogCreate) SetNotNilOwnerWxType(value *int) *AddWechatFriendLogCreate {
+	if value != nil {
+		return awfl.SetOwnerWxType(*value)
+	}
+	return awfl
+}
+
+// set field if value's pointer is not nil.
+func (awfl *AddWechatFriendLogUpdate) SetNotNilFindContent(value *string) *AddWechatFriendLogUpdate {
+	if value != nil {
+		return awfl.SetFindContent(*value)
+	}
+	return awfl
+}
+
+// set field if value's pointer is not nil.
+func (awfl *AddWechatFriendLogUpdateOne) SetNotNilFindContent(value *string) *AddWechatFriendLogUpdateOne {
+	if value != nil {
+		return awfl.SetFindContent(*value)
+	}
+	return awfl
+}
+
+// set field if value's pointer is not nil.
+func (awfl *AddWechatFriendLogCreate) SetNotNilFindContent(value *string) *AddWechatFriendLogCreate {
+	if value != nil {
+		return awfl.SetFindContent(*value)
+	}
+	return awfl
+}
+
+// set field if value's pointer is not nil.
+func (awfl *AddWechatFriendLogUpdate) SetNotNilFindRequest(value *map[string]interface{}) *AddWechatFriendLogUpdate {
+	if value != nil {
+		return awfl.SetFindRequest(*value)
+	}
+	return awfl
+}
+
+// set field if value's pointer is not nil.
+func (awfl *AddWechatFriendLogUpdateOne) SetNotNilFindRequest(value *map[string]interface{}) *AddWechatFriendLogUpdateOne {
+	if value != nil {
+		return awfl.SetFindRequest(*value)
+	}
+	return awfl
+}
+
+// set field if value's pointer is not nil.
+func (awfl *AddWechatFriendLogCreate) SetNotNilFindRequest(value *map[string]interface{}) *AddWechatFriendLogCreate {
+	if value != nil {
+		return awfl.SetFindRequest(*value)
+	}
+	return awfl
+}
+
+// set field if value's pointer is not nil.
+func (awfl *AddWechatFriendLogUpdate) SetNotNilFindResult(value *map[string]interface{}) *AddWechatFriendLogUpdate {
+	if value != nil {
+		return awfl.SetFindResult(*value)
+	}
+	return awfl
+}
+
+// set field if value's pointer is not nil.
+func (awfl *AddWechatFriendLogUpdateOne) SetNotNilFindResult(value *map[string]interface{}) *AddWechatFriendLogUpdateOne {
+	if value != nil {
+		return awfl.SetFindResult(*value)
+	}
+	return awfl
+}
+
+// set field if value's pointer is not nil.
+func (awfl *AddWechatFriendLogCreate) SetNotNilFindResult(value *map[string]interface{}) *AddWechatFriendLogCreate {
+	if value != nil {
+		return awfl.SetFindResult(*value)
+	}
+	return awfl
+}
+
+// set field if value's pointer is not nil.
+func (awfl *AddWechatFriendLogUpdate) SetNotNilIsCanAdd(value *int) *AddWechatFriendLogUpdate {
+	if value != nil {
+		return awfl.SetIsCanAdd(*value)
+	}
+	return awfl
+}
+
+// set field if value's pointer is not nil.
+func (awfl *AddWechatFriendLogUpdateOne) SetNotNilIsCanAdd(value *int) *AddWechatFriendLogUpdateOne {
+	if value != nil {
+		return awfl.SetIsCanAdd(*value)
+	}
+	return awfl
+}
+
+// set field if value's pointer is not nil.
+func (awfl *AddWechatFriendLogCreate) SetNotNilIsCanAdd(value *int) *AddWechatFriendLogCreate {
+	if value != nil {
+		return awfl.SetIsCanAdd(*value)
+	}
+	return awfl
+}
+
+// set field if value's pointer is not nil.
+func (awfl *AddWechatFriendLogUpdate) SetNotNilTaskID(value *int64) *AddWechatFriendLogUpdate {
+	if value != nil {
+		return awfl.SetTaskID(*value)
+	}
+	return awfl
+}
+
+// set field if value's pointer is not nil.
+func (awfl *AddWechatFriendLogUpdateOne) SetNotNilTaskID(value *int64) *AddWechatFriendLogUpdateOne {
+	if value != nil {
+		return awfl.SetTaskID(*value)
+	}
+	return awfl
+}
+
+// set field if value's pointer is not nil.
+func (awfl *AddWechatFriendLogCreate) SetNotNilTaskID(value *int64) *AddWechatFriendLogCreate {
+	if value != nil {
+		return awfl.SetTaskID(*value)
+	}
+	return awfl
+}
+
+// set field if value's pointer is not nil.
+func (awfl *AddWechatFriendLogUpdate) SetNotNilAddRequest(value *map[string]interface{}) *AddWechatFriendLogUpdate {
+	if value != nil {
+		return awfl.SetAddRequest(*value)
+	}
+	return awfl
+}
+
+// set field if value's pointer is not nil.
+func (awfl *AddWechatFriendLogUpdateOne) SetNotNilAddRequest(value *map[string]interface{}) *AddWechatFriendLogUpdateOne {
+	if value != nil {
+		return awfl.SetAddRequest(*value)
+	}
+	return awfl
+}
+
+// set field if value's pointer is not nil.
+func (awfl *AddWechatFriendLogCreate) SetNotNilAddRequest(value *map[string]interface{}) *AddWechatFriendLogCreate {
+	if value != nil {
+		return awfl.SetAddRequest(*value)
+	}
+	return awfl
+}
+
+// set field if value's pointer is not nil.
+func (awfl *AddWechatFriendLogUpdate) SetNotNilAddResult(value *map[string]interface{}) *AddWechatFriendLogUpdate {
+	if value != nil {
+		return awfl.SetAddResult(*value)
+	}
+	return awfl
+}
+
+// set field if value's pointer is not nil.
+func (awfl *AddWechatFriendLogUpdateOne) SetNotNilAddResult(value *map[string]interface{}) *AddWechatFriendLogUpdateOne {
+	if value != nil {
+		return awfl.SetAddResult(*value)
+	}
+	return awfl
+}
+
+// set field if value's pointer is not nil.
+func (awfl *AddWechatFriendLogCreate) SetNotNilAddResult(value *map[string]interface{}) *AddWechatFriendLogCreate {
+	if value != nil {
+		return awfl.SetAddResult(*value)
+	}
+	return awfl
+}
+
+// set field if value's pointer is not nil.
+func (awfl *AddWechatFriendLogUpdate) SetNotNilCreatedAt(value *int64) *AddWechatFriendLogUpdate {
+	if value != nil {
+		return awfl.SetCreatedAt(*value)
+	}
+	return awfl
+}
+
+// set field if value's pointer is not nil.
+func (awfl *AddWechatFriendLogUpdateOne) SetNotNilCreatedAt(value *int64) *AddWechatFriendLogUpdateOne {
+	if value != nil {
+		return awfl.SetCreatedAt(*value)
+	}
+	return awfl
+}
+
+// set field if value's pointer is not nil.
+func (awfl *AddWechatFriendLogCreate) SetNotNilCreatedAt(value *int64) *AddWechatFriendLogCreate {
+	if value != nil {
+		return awfl.SetCreatedAt(*value)
+	}
+	return awfl
+}
+
+// set field if value's pointer is not nil.
+func (awfl *AddWechatFriendLogUpdate) SetNotNilUpdatedAt(value *int64) *AddWechatFriendLogUpdate {
+	if value != nil {
+		return awfl.SetUpdatedAt(*value)
+	}
+	return awfl
+}
+
+// set field if value's pointer is not nil.
+func (awfl *AddWechatFriendLogUpdateOne) SetNotNilUpdatedAt(value *int64) *AddWechatFriendLogUpdateOne {
+	if value != nil {
+		return awfl.SetUpdatedAt(*value)
+	}
+	return awfl
+}
+
+// set field if value's pointer is not nil.
+func (awfl *AddWechatFriendLogCreate) SetNotNilUpdatedAt(value *int64) *AddWechatFriendLogCreate {
+	if value != nil {
+		return awfl.SetUpdatedAt(*value)
+	}
+	return awfl
+}
+
+// set field if value's pointer is not nil.
 func (a *AgentUpdate) SetNotNilUpdatedAt(value *time.Time) *AgentUpdate {
 	if value != nil {
 		return a.SetUpdatedAt(*value)

+ 4 - 1
ent/tx.go

@@ -14,6 +14,8 @@ import (
 // Tx is a transactional client that is created by calling Client.Tx().
 type Tx struct {
 	config
+	// AddWechatFriendLog is the client for interacting with the AddWechatFriendLog builders.
+	AddWechatFriendLog *AddWechatFriendLogClient
 	// Agent is the client for interacting with the Agent builders.
 	Agent *AgentClient
 	// AgentBase is the client for interacting with the AgentBase builders.
@@ -239,6 +241,7 @@ func (tx *Tx) Client() *Client {
 }
 
 func (tx *Tx) init() {
+	tx.AddWechatFriendLog = NewAddWechatFriendLogClient(tx.config)
 	tx.Agent = NewAgentClient(tx.config)
 	tx.AgentBase = NewAgentBaseClient(tx.config)
 	tx.AliyunAvatar = NewAliyunAvatarClient(tx.config)
@@ -295,7 +298,7 @@ func (tx *Tx) init() {
 // of them in order to commit or rollback the transaction.
 //
 // If a closed transaction is embedded in one of the generated entities, and the entity
-// applies a query, for example: Agent.QueryXXX(), the query will be executed
+// applies a query, for example: AddWechatFriendLog.QueryXXX(), the query will be executed
 // through the driver which created this transaction.
 //
 // Note that txDriver is not goroutine safe.

+ 101 - 0
hook/contact.go

@@ -4,7 +4,9 @@ import (
 	"encoding/json"
 	"fmt"
 	"github.com/gorilla/websocket"
+	"github.com/zeromicro/go-zero/core/logx"
 	"strings"
+	"wechat-api/workphone"
 )
 
 // 获取标签信息
@@ -239,3 +241,102 @@ func (h *Hook) AddFriendInChatRoom(ChatRoomId, wxWxid, friendId, desc string) er
 
 	return nil
 }
+
+// AddFriendsTask AddFriendTask 用于添加好友任务的消息结构
+type AddFriendsTask struct {
+	WeChatId string   `json:"WeChatId"`
+	Phones   []string `json:"Phones"`
+	Message  string   `json:"message"`
+	Remark   string   `json:"Remark"`
+	TaskId   int64    `json:"TaskId"`
+}
+
+// FindContactTask 用于查找联系人任务的消息结构
+type FindContactTask struct {
+	WeChatId string `json:"WeChatId"`
+	Content  string `json:"Content"`
+}
+
+// MessagePayload 用于封装消息的负载结构
+type MessagePayload[T any] struct {
+	Id      workphone.EnumMsgType `json:"Id"`
+	MsgType string                `json:"MsgType"`
+	Content T                     `json:"Content"`
+}
+
+// SendMessage 函数用于发送消息
+func SendMessage[T any](hook *Hook, msgType workphone.EnumMsgType, msgTypeStr string, content T) (MessagePayload[T], error) {
+	conn, err := hook.connWorkPhone()
+	if err != nil {
+		logx.Errorf("WebSocket 连接失败: %v", err)
+		return MessagePayload[T]{}, err
+	}
+	defer func() {
+		if cerr := conn.Close(); cerr != nil {
+			logx.Errorf("WebSocket 关闭失败: %v", cerr)
+		}
+	}()
+
+	message := MessagePayload[T]{
+		Id:      msgType,
+		MsgType: msgTypeStr,
+		Content: content,
+	}
+
+	data, err := json.Marshal(message)
+	if err != nil {
+		return message, fmt.Errorf("JSON 序列化失败: %w", err)
+	}
+
+	if err := conn.WriteMessage(websocket.TextMessage, data); err != nil {
+		return message, fmt.Errorf("发送消息失败: %w", err)
+	}
+	return message, nil
+}
+
+// AddFriendTask 函数用于创建并发送一个添加好友的任务
+// 参数:
+//
+//	ownerWxId: 发起添加好友请求的微信ID
+//	phone: 目标手机号
+//	msg: 添加好友时附带的消息
+//	taskId: 任务ID
+//
+// 返回值:
+//
+//	成功时返回包含添加好友任务信息的消息负载和nil错误
+//	失败时返回空的消息负载和相应的错误
+func (h *Hook) AddFriendTask(ownerWxId, phone, msg string, taskId int64) (MessagePayload[AddFriendsTask], error) {
+	if ownerWxId == "" || phone == "" || msg == "" {
+		return MessagePayload[AddFriendsTask]{}, fmt.Errorf("invalid input parameters")
+	}
+	content := AddFriendsTask{
+		WeChatId: ownerWxId,
+		Phones:   []string{phone},
+		Message:  msg,
+		Remark:   "",
+		TaskId:   taskId,
+	}
+	return SendMessage(h, workphone.EnumMsgType_AddFriendsTask, "AddFriendsTask", content)
+}
+
+// FindContactByContent 函数用于创建并发送一个查找联系人的任务
+// 参数:
+//
+//	ownerWxId: 发起查找联系人请求的微信ID
+//	contentMessage: 查找联系人的查询内容
+//
+// 返回值:
+//
+//	成功时返回包含查找联系人任务信息的消息负载和nil错误
+//	失败时返回空的消息负载和相应的错误
+func (h *Hook) FindContactByContent(ownerWxId, contentMessage string) (MessagePayload[FindContactTask], error) {
+	if ownerWxId == "" || contentMessage == "" {
+		return MessagePayload[FindContactTask]{}, fmt.Errorf("invalid input parameters")
+	}
+	content := FindContactTask{
+		WeChatId: ownerWxId,
+		Content:  contentMessage,
+	}
+	return SendMessage(h, workphone.EnumMsgType_FindContactTask, "FindContactTask", content)
+}

+ 64 - 0
internal/service/MessageHandlers/find_contact_task_result_notice.go

@@ -0,0 +1,64 @@
+package MessageHandlers
+
+import (
+	"context"
+	"encoding/json"
+	"errors"
+	"github.com/zeromicro/go-zero/core/logx"
+	"time"
+	"wechat-api/ent/addwechatfriendlog"
+	"wechat-api/internal/pkg/wechat_ws"
+	"wechat-api/internal/svc"
+	"wechat-api/workphone"
+)
+
+type FindContactTaskResultNoticeHandler struct {
+	svcCtx *svc.ServiceContext
+}
+
+func NewFindContactTaskResultNoticeHandler(svcCtx *svc.ServiceContext) *FindContactTaskResultNoticeHandler {
+	return &FindContactTaskResultNoticeHandler{
+		svcCtx: svcCtx,
+	}
+}
+
+func (f *FindContactTaskResultNoticeHandler) Handle(ctx context.Context, msg *wechat_ws.MsgJsonObject, svcCtx *svc.ServiceContext) error {
+	var message workphone.FindContactTaskResultNoticeMessage
+	logx.Infof("msg.Message 的内容是:%s", msg.Message)
+	if err := json.Unmarshal([]byte(msg.Message), &message); err != nil {
+		return err
+	}
+	//logx.Infof("msg.Message 的内容是:%s", message)
+	//var isCanAdd int
+	m, err := ParseJSONStringToMap(msg.Message)
+	if err != nil {
+		logx.Errorf("解析 JSON 失败: %v", err)
+		return err
+	}
+	update := svcCtx.DB.AddWechatFriendLog.Update().
+		Where(addwechatfriendlog.OwnerWxIDEQ(message.WeChatId)).
+		Where(addwechatfriendlog.FindContentEQ(message.SearchText)).
+		SetFindResult(m).
+		SetUpdatedAt(time.Now().Unix())
+	if message.Success {
+		if message.IsFriend {
+			update = update.SetIsCanAdd(0)
+		} else {
+			update = update.SetIsCanAdd(1)
+		}
+	}
+	if _, err := update.Save(ctx); err != nil {
+		logx.Errorf("更新 AddWechatFriendLog 失败: %v", err)
+		return err
+	}
+	return nil
+}
+
+func ParseJSONStringToMap(jsonStr string) (map[string]interface{}, error) {
+	if !json.Valid([]byte(jsonStr)) {
+		return nil, errors.New("非法 JSON 字符串")
+	}
+	var result map[string]interface{}
+	err := json.Unmarshal([]byte(jsonStr), &result)
+	return result, err
+}

+ 2 - 1
internal/service/MessageHandlers/register_strategy.go

@@ -42,7 +42,8 @@ func (h *MessageHandler) RegisterStrategies() {
 	strategyMap := map[string]func(*svc.ServiceContext) MessageHandlerStrategy{
 		"FriendPushNotice": toStrategy(NewFriendPushNoticeTypeHandler),
 		//"ChatroomPushNotice":     toStrategy(NewChatroomPushNoticeTypeHandler),
-		"ContactLabelInfoNotice": toStrategy(NewContactLabelInfoNotice),
+		"ContactLabelInfoNotice":      toStrategy(NewContactLabelInfoNotice),
+		"FindContactTaskResultNotice": toStrategy(NewFindContactTaskResultNoticeHandler),
 	}
 	for msgType, strategyFunc := range strategyMap {
 		h.RegisterStrategy(msgType, strategyFunc(h.svcCtx))

+ 53 - 0
internal/service/MessageHandlers/task_result_notice.go

@@ -0,0 +1,53 @@
+package MessageHandlers
+
+import (
+	"context"
+	"encoding/json"
+	"github.com/zeromicro/go-zero/core/logx"
+	"time"
+	"wechat-api/ent/addwechatfriendlog"
+	"wechat-api/internal/pkg/wechat_ws"
+	"wechat-api/internal/svc"
+	"wechat-api/workphone"
+)
+
+type TaskResultNoticeHandler struct {
+	svcCtx *svc.ServiceContext
+}
+
+func NewTaskResultNoticeHandler(svcCtx *svc.ServiceContext) *TaskResultNoticeHandler {
+	return &TaskResultNoticeHandler{
+		svcCtx: svcCtx,
+	}
+}
+
+// Handle 实现 MessageHandlerStrategy 接口
+func (f *TaskResultNoticeHandler) Handle(ctx context.Context, msg *wechat_ws.MsgJsonObject, svcCtx *svc.ServiceContext) error {
+	message := workphone.TaskResultNoticeMessage{}
+	err := json.Unmarshal([]byte(msg.Message), &message)
+	logx.Infof("msg.Message 的内容是:%s", msg.Message)
+	if err != nil {
+		logx.Errorf("Unmarshal.fail")
+		return err
+	}
+	if message.TaskType != workphone.EnumMsgType_AddFriendsTask {
+		logx.Infof("不是添加好友任务的回执")
+		return nil
+	}
+	m, err := ParseJSONStringToMap(msg.Message)
+	if err != nil {
+		logx.Errorf("解析 JSON 失败: %v", err)
+		return err
+	}
+	update := svcCtx.DB.AddWechatFriendLog.Update().
+		Where(addwechatfriendlog.OwnerWxIDEQ(message.WeChatId)).
+		Where(addwechatfriendlog.TaskIDEQ(message.TaskId)).
+		//SetFindResult(m).
+		SetAddResult(m).
+		SetUpdatedAt(time.Now().Unix())
+	if _, err := update.Save(ctx); err != nil {
+		logx.Errorf("更新AddWechatFriendLog-field-add-result失败: %v", err)
+		return err
+	}
+	return nil
+}