Browse Source

fix:修改群发列表

jimmyyem 1 week ago
parent
commit
e4dac536b7

+ 1 - 0
desc/wechat/batch_msg.api

@@ -55,6 +55,7 @@ type (
 		Cc *string `json:"cc,optional"`
 		Phone *string `json:"phone,optional"`
 		TemplateCode *string `json:"templateCode,optional"`
+		TemplateName *string `json:"templateName,optional"`
 		Lang *string `json:"lang,optional"`
     }
 

+ 35 - 2
ent/batchmsg.go

@@ -58,7 +58,13 @@ type BatchMsg struct {
 	// 国家区号
 	Cc string `json:"cc,omitempty"`
 	// 手机号
-	Phone        string `json:"phone,omitempty"`
+	Phone string `json:"phone,omitempty"`
+	// 模板名
+	TemplateName string `json:"template_name,omitempty"`
+	// 模板code
+	TemplateCode string `json:"template_code,omitempty"`
+	// 语言
+	Lang         string `json:"lang,omitempty"`
 	selectValues sql.SelectValues
 }
 
@@ -69,7 +75,7 @@ func (*BatchMsg) scanValues(columns []string) ([]any, error) {
 		switch columns[i] {
 		case batchmsg.FieldID, batchmsg.FieldStatus, batchmsg.FieldTotal, batchmsg.FieldSuccess, batchmsg.FieldFail, batchmsg.FieldType, batchmsg.FieldOrganizationID, batchmsg.FieldCtype:
 			values[i] = new(sql.NullInt64)
-		case batchmsg.FieldBatchNo, batchmsg.FieldTaskName, batchmsg.FieldFromwxid, batchmsg.FieldMsg, batchmsg.FieldTag, batchmsg.FieldTagids, batchmsg.FieldCc, batchmsg.FieldPhone:
+		case batchmsg.FieldBatchNo, batchmsg.FieldTaskName, batchmsg.FieldFromwxid, batchmsg.FieldMsg, batchmsg.FieldTag, batchmsg.FieldTagids, batchmsg.FieldCc, batchmsg.FieldPhone, batchmsg.FieldTemplateName, batchmsg.FieldTemplateCode, batchmsg.FieldLang:
 			values[i] = new(sql.NullString)
 		case batchmsg.FieldCreatedAt, batchmsg.FieldUpdatedAt, batchmsg.FieldDeletedAt, batchmsg.FieldStartTime, batchmsg.FieldStopTime, batchmsg.FieldSendTime:
 			values[i] = new(sql.NullTime)
@@ -220,6 +226,24 @@ func (bm *BatchMsg) assignValues(columns []string, values []any) error {
 			} else if value.Valid {
 				bm.Phone = value.String
 			}
+		case batchmsg.FieldTemplateName:
+			if value, ok := values[i].(*sql.NullString); !ok {
+				return fmt.Errorf("unexpected type %T for field template_name", values[i])
+			} else if value.Valid {
+				bm.TemplateName = value.String
+			}
+		case batchmsg.FieldTemplateCode:
+			if value, ok := values[i].(*sql.NullString); !ok {
+				return fmt.Errorf("unexpected type %T for field template_code", values[i])
+			} else if value.Valid {
+				bm.TemplateCode = value.String
+			}
+		case batchmsg.FieldLang:
+			if value, ok := values[i].(*sql.NullString); !ok {
+				return fmt.Errorf("unexpected type %T for field lang", values[i])
+			} else if value.Valid {
+				bm.Lang = value.String
+			}
 		default:
 			bm.selectValues.Set(columns[i], values[i])
 		}
@@ -318,6 +342,15 @@ func (bm *BatchMsg) String() string {
 	builder.WriteString(", ")
 	builder.WriteString("phone=")
 	builder.WriteString(bm.Phone)
+	builder.WriteString(", ")
+	builder.WriteString("template_name=")
+	builder.WriteString(bm.TemplateName)
+	builder.WriteString(", ")
+	builder.WriteString("template_code=")
+	builder.WriteString(bm.TemplateCode)
+	builder.WriteString(", ")
+	builder.WriteString("lang=")
+	builder.WriteString(bm.Lang)
 	builder.WriteByte(')')
 	return builder.String()
 }

+ 24 - 0
ent/batchmsg/batchmsg.go

@@ -56,6 +56,12 @@ const (
 	FieldCc = "cc"
 	// FieldPhone holds the string denoting the phone field in the database.
 	FieldPhone = "phone"
+	// FieldTemplateName holds the string denoting the template_name field in the database.
+	FieldTemplateName = "template_name"
+	// FieldTemplateCode holds the string denoting the template_code field in the database.
+	FieldTemplateCode = "template_code"
+	// FieldLang holds the string denoting the lang field in the database.
+	FieldLang = "lang"
 	// Table holds the table name of the batchmsg in the database.
 	Table = "batch_msg"
 )
@@ -84,6 +90,9 @@ var Columns = []string{
 	FieldCtype,
 	FieldCc,
 	FieldPhone,
+	FieldTemplateName,
+	FieldTemplateCode,
+	FieldLang,
 }
 
 // ValidColumn reports if the column name is valid (part of the table columns).
@@ -230,3 +239,18 @@ func ByCc(opts ...sql.OrderTermOption) OrderOption {
 func ByPhone(opts ...sql.OrderTermOption) OrderOption {
 	return sql.OrderByField(FieldPhone, opts...).ToFunc()
 }
+
+// ByTemplateName orders the results by the template_name field.
+func ByTemplateName(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldTemplateName, opts...).ToFunc()
+}
+
+// ByTemplateCode orders the results by the template_code field.
+func ByTemplateCode(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldTemplateCode, opts...).ToFunc()
+}
+
+// ByLang orders the results by the lang field.
+func ByLang(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldLang, opts...).ToFunc()
+}

+ 240 - 0
ent/batchmsg/where.go

@@ -159,6 +159,21 @@ func Phone(v string) predicate.BatchMsg {
 	return predicate.BatchMsg(sql.FieldEQ(FieldPhone, v))
 }
 
+// TemplateName applies equality check predicate on the "template_name" field. It's identical to TemplateNameEQ.
+func TemplateName(v string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldEQ(FieldTemplateName, v))
+}
+
+// TemplateCode applies equality check predicate on the "template_code" field. It's identical to TemplateCodeEQ.
+func TemplateCode(v string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldEQ(FieldTemplateCode, v))
+}
+
+// Lang applies equality check predicate on the "lang" field. It's identical to LangEQ.
+func Lang(v string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldEQ(FieldLang, v))
+}
+
 // CreatedAtEQ applies the EQ predicate on the "created_at" field.
 func CreatedAtEQ(v time.Time) predicate.BatchMsg {
 	return predicate.BatchMsg(sql.FieldEQ(FieldCreatedAt, v))
@@ -1369,6 +1384,231 @@ func PhoneContainsFold(v string) predicate.BatchMsg {
 	return predicate.BatchMsg(sql.FieldContainsFold(FieldPhone, v))
 }
 
+// TemplateNameEQ applies the EQ predicate on the "template_name" field.
+func TemplateNameEQ(v string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldEQ(FieldTemplateName, v))
+}
+
+// TemplateNameNEQ applies the NEQ predicate on the "template_name" field.
+func TemplateNameNEQ(v string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldNEQ(FieldTemplateName, v))
+}
+
+// TemplateNameIn applies the In predicate on the "template_name" field.
+func TemplateNameIn(vs ...string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldIn(FieldTemplateName, vs...))
+}
+
+// TemplateNameNotIn applies the NotIn predicate on the "template_name" field.
+func TemplateNameNotIn(vs ...string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldNotIn(FieldTemplateName, vs...))
+}
+
+// TemplateNameGT applies the GT predicate on the "template_name" field.
+func TemplateNameGT(v string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldGT(FieldTemplateName, v))
+}
+
+// TemplateNameGTE applies the GTE predicate on the "template_name" field.
+func TemplateNameGTE(v string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldGTE(FieldTemplateName, v))
+}
+
+// TemplateNameLT applies the LT predicate on the "template_name" field.
+func TemplateNameLT(v string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldLT(FieldTemplateName, v))
+}
+
+// TemplateNameLTE applies the LTE predicate on the "template_name" field.
+func TemplateNameLTE(v string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldLTE(FieldTemplateName, v))
+}
+
+// TemplateNameContains applies the Contains predicate on the "template_name" field.
+func TemplateNameContains(v string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldContains(FieldTemplateName, v))
+}
+
+// TemplateNameHasPrefix applies the HasPrefix predicate on the "template_name" field.
+func TemplateNameHasPrefix(v string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldHasPrefix(FieldTemplateName, v))
+}
+
+// TemplateNameHasSuffix applies the HasSuffix predicate on the "template_name" field.
+func TemplateNameHasSuffix(v string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldHasSuffix(FieldTemplateName, v))
+}
+
+// TemplateNameIsNil applies the IsNil predicate on the "template_name" field.
+func TemplateNameIsNil() predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldIsNull(FieldTemplateName))
+}
+
+// TemplateNameNotNil applies the NotNil predicate on the "template_name" field.
+func TemplateNameNotNil() predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldNotNull(FieldTemplateName))
+}
+
+// TemplateNameEqualFold applies the EqualFold predicate on the "template_name" field.
+func TemplateNameEqualFold(v string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldEqualFold(FieldTemplateName, v))
+}
+
+// TemplateNameContainsFold applies the ContainsFold predicate on the "template_name" field.
+func TemplateNameContainsFold(v string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldContainsFold(FieldTemplateName, v))
+}
+
+// TemplateCodeEQ applies the EQ predicate on the "template_code" field.
+func TemplateCodeEQ(v string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldEQ(FieldTemplateCode, v))
+}
+
+// TemplateCodeNEQ applies the NEQ predicate on the "template_code" field.
+func TemplateCodeNEQ(v string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldNEQ(FieldTemplateCode, v))
+}
+
+// TemplateCodeIn applies the In predicate on the "template_code" field.
+func TemplateCodeIn(vs ...string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldIn(FieldTemplateCode, vs...))
+}
+
+// TemplateCodeNotIn applies the NotIn predicate on the "template_code" field.
+func TemplateCodeNotIn(vs ...string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldNotIn(FieldTemplateCode, vs...))
+}
+
+// TemplateCodeGT applies the GT predicate on the "template_code" field.
+func TemplateCodeGT(v string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldGT(FieldTemplateCode, v))
+}
+
+// TemplateCodeGTE applies the GTE predicate on the "template_code" field.
+func TemplateCodeGTE(v string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldGTE(FieldTemplateCode, v))
+}
+
+// TemplateCodeLT applies the LT predicate on the "template_code" field.
+func TemplateCodeLT(v string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldLT(FieldTemplateCode, v))
+}
+
+// TemplateCodeLTE applies the LTE predicate on the "template_code" field.
+func TemplateCodeLTE(v string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldLTE(FieldTemplateCode, v))
+}
+
+// TemplateCodeContains applies the Contains predicate on the "template_code" field.
+func TemplateCodeContains(v string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldContains(FieldTemplateCode, v))
+}
+
+// TemplateCodeHasPrefix applies the HasPrefix predicate on the "template_code" field.
+func TemplateCodeHasPrefix(v string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldHasPrefix(FieldTemplateCode, v))
+}
+
+// TemplateCodeHasSuffix applies the HasSuffix predicate on the "template_code" field.
+func TemplateCodeHasSuffix(v string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldHasSuffix(FieldTemplateCode, v))
+}
+
+// TemplateCodeIsNil applies the IsNil predicate on the "template_code" field.
+func TemplateCodeIsNil() predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldIsNull(FieldTemplateCode))
+}
+
+// TemplateCodeNotNil applies the NotNil predicate on the "template_code" field.
+func TemplateCodeNotNil() predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldNotNull(FieldTemplateCode))
+}
+
+// TemplateCodeEqualFold applies the EqualFold predicate on the "template_code" field.
+func TemplateCodeEqualFold(v string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldEqualFold(FieldTemplateCode, v))
+}
+
+// TemplateCodeContainsFold applies the ContainsFold predicate on the "template_code" field.
+func TemplateCodeContainsFold(v string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldContainsFold(FieldTemplateCode, v))
+}
+
+// LangEQ applies the EQ predicate on the "lang" field.
+func LangEQ(v string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldEQ(FieldLang, v))
+}
+
+// LangNEQ applies the NEQ predicate on the "lang" field.
+func LangNEQ(v string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldNEQ(FieldLang, v))
+}
+
+// LangIn applies the In predicate on the "lang" field.
+func LangIn(vs ...string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldIn(FieldLang, vs...))
+}
+
+// LangNotIn applies the NotIn predicate on the "lang" field.
+func LangNotIn(vs ...string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldNotIn(FieldLang, vs...))
+}
+
+// LangGT applies the GT predicate on the "lang" field.
+func LangGT(v string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldGT(FieldLang, v))
+}
+
+// LangGTE applies the GTE predicate on the "lang" field.
+func LangGTE(v string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldGTE(FieldLang, v))
+}
+
+// LangLT applies the LT predicate on the "lang" field.
+func LangLT(v string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldLT(FieldLang, v))
+}
+
+// LangLTE applies the LTE predicate on the "lang" field.
+func LangLTE(v string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldLTE(FieldLang, v))
+}
+
+// LangContains applies the Contains predicate on the "lang" field.
+func LangContains(v string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldContains(FieldLang, v))
+}
+
+// LangHasPrefix applies the HasPrefix predicate on the "lang" field.
+func LangHasPrefix(v string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldHasPrefix(FieldLang, v))
+}
+
+// LangHasSuffix applies the HasSuffix predicate on the "lang" field.
+func LangHasSuffix(v string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldHasSuffix(FieldLang, v))
+}
+
+// LangIsNil applies the IsNil predicate on the "lang" field.
+func LangIsNil() predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldIsNull(FieldLang))
+}
+
+// LangNotNil applies the NotNil predicate on the "lang" field.
+func LangNotNil() predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldNotNull(FieldLang))
+}
+
+// LangEqualFold applies the EqualFold predicate on the "lang" field.
+func LangEqualFold(v string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldEqualFold(FieldLang, v))
+}
+
+// LangContainsFold applies the ContainsFold predicate on the "lang" field.
+func LangContainsFold(v string) predicate.BatchMsg {
+	return predicate.BatchMsg(sql.FieldContainsFold(FieldLang, v))
+}
+
 // And groups predicates with the AND operator between them.
 func And(predicates ...predicate.BatchMsg) predicate.BatchMsg {
 	return predicate.BatchMsg(sql.AndPredicates(predicates...))

+ 234 - 0
ent/batchmsg_create.go

@@ -308,6 +308,48 @@ func (bmc *BatchMsgCreate) SetNillablePhone(s *string) *BatchMsgCreate {
 	return bmc
 }
 
+// SetTemplateName sets the "template_name" field.
+func (bmc *BatchMsgCreate) SetTemplateName(s string) *BatchMsgCreate {
+	bmc.mutation.SetTemplateName(s)
+	return bmc
+}
+
+// SetNillableTemplateName sets the "template_name" field if the given value is not nil.
+func (bmc *BatchMsgCreate) SetNillableTemplateName(s *string) *BatchMsgCreate {
+	if s != nil {
+		bmc.SetTemplateName(*s)
+	}
+	return bmc
+}
+
+// SetTemplateCode sets the "template_code" field.
+func (bmc *BatchMsgCreate) SetTemplateCode(s string) *BatchMsgCreate {
+	bmc.mutation.SetTemplateCode(s)
+	return bmc
+}
+
+// SetNillableTemplateCode sets the "template_code" field if the given value is not nil.
+func (bmc *BatchMsgCreate) SetNillableTemplateCode(s *string) *BatchMsgCreate {
+	if s != nil {
+		bmc.SetTemplateCode(*s)
+	}
+	return bmc
+}
+
+// SetLang sets the "lang" field.
+func (bmc *BatchMsgCreate) SetLang(s string) *BatchMsgCreate {
+	bmc.mutation.SetLang(s)
+	return bmc
+}
+
+// SetNillableLang sets the "lang" field if the given value is not nil.
+func (bmc *BatchMsgCreate) SetNillableLang(s *string) *BatchMsgCreate {
+	if s != nil {
+		bmc.SetLang(*s)
+	}
+	return bmc
+}
+
 // SetID sets the "id" field.
 func (bmc *BatchMsgCreate) SetID(u uint64) *BatchMsgCreate {
 	bmc.mutation.SetID(u)
@@ -512,6 +554,18 @@ func (bmc *BatchMsgCreate) createSpec() (*BatchMsg, *sqlgraph.CreateSpec) {
 		_spec.SetField(batchmsg.FieldPhone, field.TypeString, value)
 		_node.Phone = value
 	}
+	if value, ok := bmc.mutation.TemplateName(); ok {
+		_spec.SetField(batchmsg.FieldTemplateName, field.TypeString, value)
+		_node.TemplateName = value
+	}
+	if value, ok := bmc.mutation.TemplateCode(); ok {
+		_spec.SetField(batchmsg.FieldTemplateCode, field.TypeString, value)
+		_node.TemplateCode = value
+	}
+	if value, ok := bmc.mutation.Lang(); ok {
+		_spec.SetField(batchmsg.FieldLang, field.TypeString, value)
+		_node.Lang = value
+	}
 	return _node, _spec
 }
 
@@ -948,6 +1002,60 @@ func (u *BatchMsgUpsert) ClearPhone() *BatchMsgUpsert {
 	return u
 }
 
+// SetTemplateName sets the "template_name" field.
+func (u *BatchMsgUpsert) SetTemplateName(v string) *BatchMsgUpsert {
+	u.Set(batchmsg.FieldTemplateName, v)
+	return u
+}
+
+// UpdateTemplateName sets the "template_name" field to the value that was provided on create.
+func (u *BatchMsgUpsert) UpdateTemplateName() *BatchMsgUpsert {
+	u.SetExcluded(batchmsg.FieldTemplateName)
+	return u
+}
+
+// ClearTemplateName clears the value of the "template_name" field.
+func (u *BatchMsgUpsert) ClearTemplateName() *BatchMsgUpsert {
+	u.SetNull(batchmsg.FieldTemplateName)
+	return u
+}
+
+// SetTemplateCode sets the "template_code" field.
+func (u *BatchMsgUpsert) SetTemplateCode(v string) *BatchMsgUpsert {
+	u.Set(batchmsg.FieldTemplateCode, v)
+	return u
+}
+
+// UpdateTemplateCode sets the "template_code" field to the value that was provided on create.
+func (u *BatchMsgUpsert) UpdateTemplateCode() *BatchMsgUpsert {
+	u.SetExcluded(batchmsg.FieldTemplateCode)
+	return u
+}
+
+// ClearTemplateCode clears the value of the "template_code" field.
+func (u *BatchMsgUpsert) ClearTemplateCode() *BatchMsgUpsert {
+	u.SetNull(batchmsg.FieldTemplateCode)
+	return u
+}
+
+// SetLang sets the "lang" field.
+func (u *BatchMsgUpsert) SetLang(v string) *BatchMsgUpsert {
+	u.Set(batchmsg.FieldLang, v)
+	return u
+}
+
+// UpdateLang sets the "lang" field to the value that was provided on create.
+func (u *BatchMsgUpsert) UpdateLang() *BatchMsgUpsert {
+	u.SetExcluded(batchmsg.FieldLang)
+	return u
+}
+
+// ClearLang clears the value of the "lang" field.
+func (u *BatchMsgUpsert) ClearLang() *BatchMsgUpsert {
+	u.SetNull(batchmsg.FieldLang)
+	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:
 //
@@ -1447,6 +1555,69 @@ func (u *BatchMsgUpsertOne) ClearPhone() *BatchMsgUpsertOne {
 	})
 }
 
+// SetTemplateName sets the "template_name" field.
+func (u *BatchMsgUpsertOne) SetTemplateName(v string) *BatchMsgUpsertOne {
+	return u.Update(func(s *BatchMsgUpsert) {
+		s.SetTemplateName(v)
+	})
+}
+
+// UpdateTemplateName sets the "template_name" field to the value that was provided on create.
+func (u *BatchMsgUpsertOne) UpdateTemplateName() *BatchMsgUpsertOne {
+	return u.Update(func(s *BatchMsgUpsert) {
+		s.UpdateTemplateName()
+	})
+}
+
+// ClearTemplateName clears the value of the "template_name" field.
+func (u *BatchMsgUpsertOne) ClearTemplateName() *BatchMsgUpsertOne {
+	return u.Update(func(s *BatchMsgUpsert) {
+		s.ClearTemplateName()
+	})
+}
+
+// SetTemplateCode sets the "template_code" field.
+func (u *BatchMsgUpsertOne) SetTemplateCode(v string) *BatchMsgUpsertOne {
+	return u.Update(func(s *BatchMsgUpsert) {
+		s.SetTemplateCode(v)
+	})
+}
+
+// UpdateTemplateCode sets the "template_code" field to the value that was provided on create.
+func (u *BatchMsgUpsertOne) UpdateTemplateCode() *BatchMsgUpsertOne {
+	return u.Update(func(s *BatchMsgUpsert) {
+		s.UpdateTemplateCode()
+	})
+}
+
+// ClearTemplateCode clears the value of the "template_code" field.
+func (u *BatchMsgUpsertOne) ClearTemplateCode() *BatchMsgUpsertOne {
+	return u.Update(func(s *BatchMsgUpsert) {
+		s.ClearTemplateCode()
+	})
+}
+
+// SetLang sets the "lang" field.
+func (u *BatchMsgUpsertOne) SetLang(v string) *BatchMsgUpsertOne {
+	return u.Update(func(s *BatchMsgUpsert) {
+		s.SetLang(v)
+	})
+}
+
+// UpdateLang sets the "lang" field to the value that was provided on create.
+func (u *BatchMsgUpsertOne) UpdateLang() *BatchMsgUpsertOne {
+	return u.Update(func(s *BatchMsgUpsert) {
+		s.UpdateLang()
+	})
+}
+
+// ClearLang clears the value of the "lang" field.
+func (u *BatchMsgUpsertOne) ClearLang() *BatchMsgUpsertOne {
+	return u.Update(func(s *BatchMsgUpsert) {
+		s.ClearLang()
+	})
+}
+
 // Exec executes the query.
 func (u *BatchMsgUpsertOne) Exec(ctx context.Context) error {
 	if len(u.create.conflict) == 0 {
@@ -2112,6 +2283,69 @@ func (u *BatchMsgUpsertBulk) ClearPhone() *BatchMsgUpsertBulk {
 	})
 }
 
+// SetTemplateName sets the "template_name" field.
+func (u *BatchMsgUpsertBulk) SetTemplateName(v string) *BatchMsgUpsertBulk {
+	return u.Update(func(s *BatchMsgUpsert) {
+		s.SetTemplateName(v)
+	})
+}
+
+// UpdateTemplateName sets the "template_name" field to the value that was provided on create.
+func (u *BatchMsgUpsertBulk) UpdateTemplateName() *BatchMsgUpsertBulk {
+	return u.Update(func(s *BatchMsgUpsert) {
+		s.UpdateTemplateName()
+	})
+}
+
+// ClearTemplateName clears the value of the "template_name" field.
+func (u *BatchMsgUpsertBulk) ClearTemplateName() *BatchMsgUpsertBulk {
+	return u.Update(func(s *BatchMsgUpsert) {
+		s.ClearTemplateName()
+	})
+}
+
+// SetTemplateCode sets the "template_code" field.
+func (u *BatchMsgUpsertBulk) SetTemplateCode(v string) *BatchMsgUpsertBulk {
+	return u.Update(func(s *BatchMsgUpsert) {
+		s.SetTemplateCode(v)
+	})
+}
+
+// UpdateTemplateCode sets the "template_code" field to the value that was provided on create.
+func (u *BatchMsgUpsertBulk) UpdateTemplateCode() *BatchMsgUpsertBulk {
+	return u.Update(func(s *BatchMsgUpsert) {
+		s.UpdateTemplateCode()
+	})
+}
+
+// ClearTemplateCode clears the value of the "template_code" field.
+func (u *BatchMsgUpsertBulk) ClearTemplateCode() *BatchMsgUpsertBulk {
+	return u.Update(func(s *BatchMsgUpsert) {
+		s.ClearTemplateCode()
+	})
+}
+
+// SetLang sets the "lang" field.
+func (u *BatchMsgUpsertBulk) SetLang(v string) *BatchMsgUpsertBulk {
+	return u.Update(func(s *BatchMsgUpsert) {
+		s.SetLang(v)
+	})
+}
+
+// UpdateLang sets the "lang" field to the value that was provided on create.
+func (u *BatchMsgUpsertBulk) UpdateLang() *BatchMsgUpsertBulk {
+	return u.Update(func(s *BatchMsgUpsert) {
+		s.UpdateLang()
+	})
+}
+
+// ClearLang clears the value of the "lang" field.
+func (u *BatchMsgUpsertBulk) ClearLang() *BatchMsgUpsertBulk {
+	return u.Update(func(s *BatchMsgUpsert) {
+		s.ClearLang()
+	})
+}
+
 // Exec executes the query.
 func (u *BatchMsgUpsertBulk) Exec(ctx context.Context) error {
 	if u.create.err != nil {

+ 156 - 0
ent/batchmsg_update.go

@@ -451,6 +451,66 @@ func (bmu *BatchMsgUpdate) ClearPhone() *BatchMsgUpdate {
 	return bmu
 }
 
+// SetTemplateName sets the "template_name" field.
+func (bmu *BatchMsgUpdate) SetTemplateName(s string) *BatchMsgUpdate {
+	bmu.mutation.SetTemplateName(s)
+	return bmu
+}
+
+// SetNillableTemplateName sets the "template_name" field if the given value is not nil.
+func (bmu *BatchMsgUpdate) SetNillableTemplateName(s *string) *BatchMsgUpdate {
+	if s != nil {
+		bmu.SetTemplateName(*s)
+	}
+	return bmu
+}
+
+// ClearTemplateName clears the value of the "template_name" field.
+func (bmu *BatchMsgUpdate) ClearTemplateName() *BatchMsgUpdate {
+	bmu.mutation.ClearTemplateName()
+	return bmu
+}
+
+// SetTemplateCode sets the "template_code" field.
+func (bmu *BatchMsgUpdate) SetTemplateCode(s string) *BatchMsgUpdate {
+	bmu.mutation.SetTemplateCode(s)
+	return bmu
+}
+
+// SetNillableTemplateCode sets the "template_code" field if the given value is not nil.
+func (bmu *BatchMsgUpdate) SetNillableTemplateCode(s *string) *BatchMsgUpdate {
+	if s != nil {
+		bmu.SetTemplateCode(*s)
+	}
+	return bmu
+}
+
+// ClearTemplateCode clears the value of the "template_code" field.
+func (bmu *BatchMsgUpdate) ClearTemplateCode() *BatchMsgUpdate {
+	bmu.mutation.ClearTemplateCode()
+	return bmu
+}
+
+// SetLang sets the "lang" field.
+func (bmu *BatchMsgUpdate) SetLang(s string) *BatchMsgUpdate {
+	bmu.mutation.SetLang(s)
+	return bmu
+}
+
+// SetNillableLang sets the "lang" field if the given value is not nil.
+func (bmu *BatchMsgUpdate) SetNillableLang(s *string) *BatchMsgUpdate {
+	if s != nil {
+		bmu.SetLang(*s)
+	}
+	return bmu
+}
+
+// ClearLang clears the value of the "lang" field.
+func (bmu *BatchMsgUpdate) ClearLang() *BatchMsgUpdate {
+	bmu.mutation.ClearLang()
+	return bmu
+}
+
 // Mutation returns the BatchMsgMutation object of the builder.
 func (bmu *BatchMsgUpdate) Mutation() *BatchMsgMutation {
 	return bmu.mutation
@@ -652,6 +712,24 @@ func (bmu *BatchMsgUpdate) sqlSave(ctx context.Context) (n int, err error) {
 	if bmu.mutation.PhoneCleared() {
 		_spec.ClearField(batchmsg.FieldPhone, field.TypeString)
 	}
+	if value, ok := bmu.mutation.TemplateName(); ok {
+		_spec.SetField(batchmsg.FieldTemplateName, field.TypeString, value)
+	}
+	if bmu.mutation.TemplateNameCleared() {
+		_spec.ClearField(batchmsg.FieldTemplateName, field.TypeString)
+	}
+	if value, ok := bmu.mutation.TemplateCode(); ok {
+		_spec.SetField(batchmsg.FieldTemplateCode, field.TypeString, value)
+	}
+	if bmu.mutation.TemplateCodeCleared() {
+		_spec.ClearField(batchmsg.FieldTemplateCode, field.TypeString)
+	}
+	if value, ok := bmu.mutation.Lang(); ok {
+		_spec.SetField(batchmsg.FieldLang, field.TypeString, value)
+	}
+	if bmu.mutation.LangCleared() {
+		_spec.ClearField(batchmsg.FieldLang, field.TypeString)
+	}
 	if n, err = sqlgraph.UpdateNodes(ctx, bmu.driver, _spec); err != nil {
 		if _, ok := err.(*sqlgraph.NotFoundError); ok {
 			err = &NotFoundError{batchmsg.Label}
@@ -1095,6 +1173,66 @@ func (bmuo *BatchMsgUpdateOne) ClearPhone() *BatchMsgUpdateOne {
 	return bmuo
 }
 
+// SetTemplateName sets the "template_name" field.
+func (bmuo *BatchMsgUpdateOne) SetTemplateName(s string) *BatchMsgUpdateOne {
+	bmuo.mutation.SetTemplateName(s)
+	return bmuo
+}
+
+// SetNillableTemplateName sets the "template_name" field if the given value is not nil.
+func (bmuo *BatchMsgUpdateOne) SetNillableTemplateName(s *string) *BatchMsgUpdateOne {
+	if s != nil {
+		bmuo.SetTemplateName(*s)
+	}
+	return bmuo
+}
+
+// ClearTemplateName clears the value of the "template_name" field.
+func (bmuo *BatchMsgUpdateOne) ClearTemplateName() *BatchMsgUpdateOne {
+	bmuo.mutation.ClearTemplateName()
+	return bmuo
+}
+
+// SetTemplateCode sets the "template_code" field.
+func (bmuo *BatchMsgUpdateOne) SetTemplateCode(s string) *BatchMsgUpdateOne {
+	bmuo.mutation.SetTemplateCode(s)
+	return bmuo
+}
+
+// SetNillableTemplateCode sets the "template_code" field if the given value is not nil.
+func (bmuo *BatchMsgUpdateOne) SetNillableTemplateCode(s *string) *BatchMsgUpdateOne {
+	if s != nil {
+		bmuo.SetTemplateCode(*s)
+	}
+	return bmuo
+}
+
+// ClearTemplateCode clears the value of the "template_code" field.
+func (bmuo *BatchMsgUpdateOne) ClearTemplateCode() *BatchMsgUpdateOne {
+	bmuo.mutation.ClearTemplateCode()
+	return bmuo
+}
+
+// SetLang sets the "lang" field.
+func (bmuo *BatchMsgUpdateOne) SetLang(s string) *BatchMsgUpdateOne {
+	bmuo.mutation.SetLang(s)
+	return bmuo
+}
+
+// SetNillableLang sets the "lang" field if the given value is not nil.
+func (bmuo *BatchMsgUpdateOne) SetNillableLang(s *string) *BatchMsgUpdateOne {
+	if s != nil {
+		bmuo.SetLang(*s)
+	}
+	return bmuo
+}
+
+// ClearLang clears the value of the "lang" field.
+func (bmuo *BatchMsgUpdateOne) ClearLang() *BatchMsgUpdateOne {
+	bmuo.mutation.ClearLang()
+	return bmuo
+}
+
 // Mutation returns the BatchMsgMutation object of the builder.
 func (bmuo *BatchMsgUpdateOne) Mutation() *BatchMsgMutation {
 	return bmuo.mutation
@@ -1326,6 +1464,24 @@ func (bmuo *BatchMsgUpdateOne) sqlSave(ctx context.Context) (_node *BatchMsg, er
 	if bmuo.mutation.PhoneCleared() {
 		_spec.ClearField(batchmsg.FieldPhone, field.TypeString)
 	}
+	if value, ok := bmuo.mutation.TemplateName(); ok {
+		_spec.SetField(batchmsg.FieldTemplateName, field.TypeString, value)
+	}
+	if bmuo.mutation.TemplateNameCleared() {
+		_spec.ClearField(batchmsg.FieldTemplateName, field.TypeString)
+	}
+	if value, ok := bmuo.mutation.TemplateCode(); ok {
+		_spec.SetField(batchmsg.FieldTemplateCode, field.TypeString, value)
+	}
+	if bmuo.mutation.TemplateCodeCleared() {
+		_spec.ClearField(batchmsg.FieldTemplateCode, field.TypeString)
+	}
+	if value, ok := bmuo.mutation.Lang(); ok {
+		_spec.SetField(batchmsg.FieldLang, field.TypeString, value)
+	}
+	if bmuo.mutation.LangCleared() {
+		_spec.ClearField(batchmsg.FieldLang, field.TypeString)
+	}
 	_node = &BatchMsg{config: bmuo.config}
 	_spec.Assign = _node.assignValues
 	_spec.ScanValues = _node.scanValues

+ 3 - 0
ent/migrate/schema.go

@@ -138,6 +138,9 @@ var (
 		{Name: "ctype", Type: field.TypeUint64, Comment: "内容类型:1-微信 2-whatsapp", Default: 1},
 		{Name: "cc", Type: field.TypeString, Nullable: true, Comment: "国家区号"},
 		{Name: "phone", Type: field.TypeString, Nullable: true, Comment: "手机号"},
+		{Name: "template_name", Type: field.TypeString, Nullable: true, Comment: "模板名"},
+		{Name: "template_code", Type: field.TypeString, Nullable: true, Comment: "模板code"},
+		{Name: "lang", Type: field.TypeString, Nullable: true, Comment: "语言"},
 	}
 	// BatchMsgTable holds the schema information for the "batch_msg" table.
 	BatchMsgTable = &schema.Table{

+ 220 - 1
ent/mutation.go

@@ -4377,6 +4377,9 @@ type BatchMsgMutation struct {
 	addctype           *int64
 	cc                 *string
 	phone              *string
+	template_name      *string
+	template_code      *string
+	lang               *string
 	clearedFields      map[string]struct{}
 	done               bool
 	oldValue           func(context.Context) (*BatchMsg, error)
@@ -5609,6 +5612,153 @@ func (m *BatchMsgMutation) ResetPhone() {
 	delete(m.clearedFields, batchmsg.FieldPhone)
 }
 
+// SetTemplateName sets the "template_name" field.
+func (m *BatchMsgMutation) SetTemplateName(s string) {
+	m.template_name = &s
+}
+
+// TemplateName returns the value of the "template_name" field in the mutation.
+func (m *BatchMsgMutation) TemplateName() (r string, exists bool) {
+	v := m.template_name
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// OldTemplateName returns the old "template_name" field's value of the BatchMsg entity.
+// If the BatchMsg 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 *BatchMsgMutation) OldTemplateName(ctx context.Context) (v string, err error) {
+	if !m.op.Is(OpUpdateOne) {
+		return v, errors.New("OldTemplateName is only allowed on UpdateOne operations")
+	}
+	if m.id == nil || m.oldValue == nil {
+		return v, errors.New("OldTemplateName requires an ID field in the mutation")
+	}
+	oldValue, err := m.oldValue(ctx)
+	if err != nil {
+		return v, fmt.Errorf("querying old value for OldTemplateName: %w", err)
+	}
+	return oldValue.TemplateName, nil
+}
+
+// ClearTemplateName clears the value of the "template_name" field.
+func (m *BatchMsgMutation) ClearTemplateName() {
+	m.template_name = nil
+	m.clearedFields[batchmsg.FieldTemplateName] = struct{}{}
+}
+
+// TemplateNameCleared returns if the "template_name" field was cleared in this mutation.
+func (m *BatchMsgMutation) TemplateNameCleared() bool {
+	_, ok := m.clearedFields[batchmsg.FieldTemplateName]
+	return ok
+}
+
+// ResetTemplateName resets all changes to the "template_name" field.
+func (m *BatchMsgMutation) ResetTemplateName() {
+	m.template_name = nil
+	delete(m.clearedFields, batchmsg.FieldTemplateName)
+}
+
+// SetTemplateCode sets the "template_code" field.
+func (m *BatchMsgMutation) SetTemplateCode(s string) {
+	m.template_code = &s
+}
+
+// TemplateCode returns the value of the "template_code" field in the mutation.
+func (m *BatchMsgMutation) TemplateCode() (r string, exists bool) {
+	v := m.template_code
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// OldTemplateCode returns the old "template_code" field's value of the BatchMsg entity.
+// If the BatchMsg 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 *BatchMsgMutation) OldTemplateCode(ctx context.Context) (v string, err error) {
+	if !m.op.Is(OpUpdateOne) {
+		return v, errors.New("OldTemplateCode is only allowed on UpdateOne operations")
+	}
+	if m.id == nil || m.oldValue == nil {
+		return v, errors.New("OldTemplateCode requires an ID field in the mutation")
+	}
+	oldValue, err := m.oldValue(ctx)
+	if err != nil {
+		return v, fmt.Errorf("querying old value for OldTemplateCode: %w", err)
+	}
+	return oldValue.TemplateCode, nil
+}
+
+// ClearTemplateCode clears the value of the "template_code" field.
+func (m *BatchMsgMutation) ClearTemplateCode() {
+	m.template_code = nil
+	m.clearedFields[batchmsg.FieldTemplateCode] = struct{}{}
+}
+
+// TemplateCodeCleared returns if the "template_code" field was cleared in this mutation.
+func (m *BatchMsgMutation) TemplateCodeCleared() bool {
+	_, ok := m.clearedFields[batchmsg.FieldTemplateCode]
+	return ok
+}
+
+// ResetTemplateCode resets all changes to the "template_code" field.
+func (m *BatchMsgMutation) ResetTemplateCode() {
+	m.template_code = nil
+	delete(m.clearedFields, batchmsg.FieldTemplateCode)
+}
+
+// SetLang sets the "lang" field.
+func (m *BatchMsgMutation) SetLang(s string) {
+	m.lang = &s
+}
+
+// Lang returns the value of the "lang" field in the mutation.
+func (m *BatchMsgMutation) Lang() (r string, exists bool) {
+	v := m.lang
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// OldLang returns the old "lang" field's value of the BatchMsg entity.
+// If the BatchMsg 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 *BatchMsgMutation) OldLang(ctx context.Context) (v string, err error) {
+	if !m.op.Is(OpUpdateOne) {
+		return v, errors.New("OldLang is only allowed on UpdateOne operations")
+	}
+	if m.id == nil || m.oldValue == nil {
+		return v, errors.New("OldLang requires an ID field in the mutation")
+	}
+	oldValue, err := m.oldValue(ctx)
+	if err != nil {
+		return v, fmt.Errorf("querying old value for OldLang: %w", err)
+	}
+	return oldValue.Lang, nil
+}
+
+// ClearLang clears the value of the "lang" field.
+func (m *BatchMsgMutation) ClearLang() {
+	m.lang = nil
+	m.clearedFields[batchmsg.FieldLang] = struct{}{}
+}
+
+// LangCleared returns if the "lang" field was cleared in this mutation.
+func (m *BatchMsgMutation) LangCleared() bool {
+	_, ok := m.clearedFields[batchmsg.FieldLang]
+	return ok
+}
+
+// ResetLang resets all changes to the "lang" field.
+func (m *BatchMsgMutation) ResetLang() {
+	m.lang = nil
+	delete(m.clearedFields, batchmsg.FieldLang)
+}
+
 // Where appends a list predicates to the BatchMsgMutation builder.
 func (m *BatchMsgMutation) Where(ps ...predicate.BatchMsg) {
 	m.predicates = append(m.predicates, ps...)
@@ -5643,7 +5793,7 @@ func (m *BatchMsgMutation) Type() string {
 // order to get all numeric fields that were incremented/decremented, call
 // AddedFields().
 func (m *BatchMsgMutation) Fields() []string {
-	fields := make([]string, 0, 21)
+	fields := make([]string, 0, 24)
 	if m.created_at != nil {
 		fields = append(fields, batchmsg.FieldCreatedAt)
 	}
@@ -5707,6 +5857,15 @@ func (m *BatchMsgMutation) Fields() []string {
 	if m.phone != nil {
 		fields = append(fields, batchmsg.FieldPhone)
 	}
+	if m.template_name != nil {
+		fields = append(fields, batchmsg.FieldTemplateName)
+	}
+	if m.template_code != nil {
+		fields = append(fields, batchmsg.FieldTemplateCode)
+	}
+	if m.lang != nil {
+		fields = append(fields, batchmsg.FieldLang)
+	}
 	return fields
 }
 
@@ -5757,6 +5916,12 @@ func (m *BatchMsgMutation) Field(name string) (ent.Value, bool) {
 		return m.Cc()
 	case batchmsg.FieldPhone:
 		return m.Phone()
+	case batchmsg.FieldTemplateName:
+		return m.TemplateName()
+	case batchmsg.FieldTemplateCode:
+		return m.TemplateCode()
+	case batchmsg.FieldLang:
+		return m.Lang()
 	}
 	return nil, false
 }
@@ -5808,6 +5973,12 @@ func (m *BatchMsgMutation) OldField(ctx context.Context, name string) (ent.Value
 		return m.OldCc(ctx)
 	case batchmsg.FieldPhone:
 		return m.OldPhone(ctx)
+	case batchmsg.FieldTemplateName:
+		return m.OldTemplateName(ctx)
+	case batchmsg.FieldTemplateCode:
+		return m.OldTemplateCode(ctx)
+	case batchmsg.FieldLang:
+		return m.OldLang(ctx)
 	}
 	return nil, fmt.Errorf("unknown BatchMsg field %s", name)
 }
@@ -5964,6 +6135,27 @@ func (m *BatchMsgMutation) SetField(name string, value ent.Value) error {
 		}
 		m.SetPhone(v)
 		return nil
+	case batchmsg.FieldTemplateName:
+		v, ok := value.(string)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.SetTemplateName(v)
+		return nil
+	case batchmsg.FieldTemplateCode:
+		v, ok := value.(string)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.SetTemplateCode(v)
+		return nil
+	case batchmsg.FieldLang:
+		v, ok := value.(string)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.SetLang(v)
+		return nil
 	}
 	return fmt.Errorf("unknown BatchMsg field %s", name)
 }
@@ -6132,6 +6324,15 @@ func (m *BatchMsgMutation) ClearedFields() []string {
 	if m.FieldCleared(batchmsg.FieldPhone) {
 		fields = append(fields, batchmsg.FieldPhone)
 	}
+	if m.FieldCleared(batchmsg.FieldTemplateName) {
+		fields = append(fields, batchmsg.FieldTemplateName)
+	}
+	if m.FieldCleared(batchmsg.FieldTemplateCode) {
+		fields = append(fields, batchmsg.FieldTemplateCode)
+	}
+	if m.FieldCleared(batchmsg.FieldLang) {
+		fields = append(fields, batchmsg.FieldLang)
+	}
 	return fields
 }
 
@@ -6197,6 +6398,15 @@ func (m *BatchMsgMutation) ClearField(name string) error {
 	case batchmsg.FieldPhone:
 		m.ClearPhone()
 		return nil
+	case batchmsg.FieldTemplateName:
+		m.ClearTemplateName()
+		return nil
+	case batchmsg.FieldTemplateCode:
+		m.ClearTemplateCode()
+		return nil
+	case batchmsg.FieldLang:
+		m.ClearLang()
+		return nil
 	}
 	return fmt.Errorf("unknown BatchMsg nullable field %s", name)
 }
@@ -6268,6 +6478,15 @@ func (m *BatchMsgMutation) ResetField(name string) error {
 	case batchmsg.FieldPhone:
 		m.ResetPhone()
 		return nil
+	case batchmsg.FieldTemplateName:
+		m.ResetTemplateName()
+		return nil
+	case batchmsg.FieldTemplateCode:
+		m.ResetTemplateCode()
+		return nil
+	case batchmsg.FieldLang:
+		m.ResetLang()
+		return nil
 	}
 	return fmt.Errorf("unknown BatchMsg field %s", name)
 }

+ 3 - 0
ent/schema/batch_msg.go

@@ -35,6 +35,9 @@ func (BatchMsg) Fields() []ent.Field {
 		field.Uint64("ctype").Default(1).Comment("内容类型:1-微信 2-whatsapp"),
 		field.String("cc").Optional().Comment("国家区号"),
 		field.String("phone").Optional().Comment("手机号"),
+		field.String("template_name").Optional().Comment("模板名"),
+		field.String("template_code").Optional().Comment("模板code"),
+		field.String("lang").Optional().Comment("语言"),
 	}
 }
 func (BatchMsg) Mixin() []ent.Mixin {

+ 72 - 0
ent/set_not_nil.go

@@ -1352,6 +1352,78 @@ func (bm *BatchMsgCreate) SetNotNilPhone(value *string) *BatchMsgCreate {
 }
 
 // set field if value's pointer is not nil.
+func (bm *BatchMsgUpdate) SetNotNilTemplateName(value *string) *BatchMsgUpdate {
+	if value != nil {
+		return bm.SetTemplateName(*value)
+	}
+	return bm
+}
+
+// set field if value's pointer is not nil.
+func (bm *BatchMsgUpdateOne) SetNotNilTemplateName(value *string) *BatchMsgUpdateOne {
+	if value != nil {
+		return bm.SetTemplateName(*value)
+	}
+	return bm
+}
+
+// set field if value's pointer is not nil.
+func (bm *BatchMsgCreate) SetNotNilTemplateName(value *string) *BatchMsgCreate {
+	if value != nil {
+		return bm.SetTemplateName(*value)
+	}
+	return bm
+}
+
+// set field if value's pointer is not nil.
+func (bm *BatchMsgUpdate) SetNotNilTemplateCode(value *string) *BatchMsgUpdate {
+	if value != nil {
+		return bm.SetTemplateCode(*value)
+	}
+	return bm
+}
+
+// set field if value's pointer is not nil.
+func (bm *BatchMsgUpdateOne) SetNotNilTemplateCode(value *string) *BatchMsgUpdateOne {
+	if value != nil {
+		return bm.SetTemplateCode(*value)
+	}
+	return bm
+}
+
+// set field if value's pointer is not nil.
+func (bm *BatchMsgCreate) SetNotNilTemplateCode(value *string) *BatchMsgCreate {
+	if value != nil {
+		return bm.SetTemplateCode(*value)
+	}
+	return bm
+}
+
+// set field if value's pointer is not nil.
+func (bm *BatchMsgUpdate) SetNotNilLang(value *string) *BatchMsgUpdate {
+	if value != nil {
+		return bm.SetLang(*value)
+	}
+	return bm
+}
+
+// set field if value's pointer is not nil.
+func (bm *BatchMsgUpdateOne) SetNotNilLang(value *string) *BatchMsgUpdateOne {
+	if value != nil {
+		return bm.SetLang(*value)
+	}
+	return bm
+}
+
+// set field if value's pointer is not nil.
+func (bm *BatchMsgCreate) SetNotNilLang(value *string) *BatchMsgCreate {
+	if value != nil {
+		return bm.SetLang(*value)
+	}
+	return bm
+}
+
+// set field if value's pointer is not nil.
 func (c *CategoryUpdate) SetNotNilUpdatedAt(value *time.Time) *CategoryUpdate {
 	if value != nil {
 		return c.SetUpdatedAt(*value)

+ 3 - 0
internal/logic/batch_msg/create_whatcapp_batch_msg_logic.go

@@ -150,6 +150,9 @@ func (l *CreateWhatcappBatchMsgLogic) CreateWhatcappBatchMsg(req *types.BatchMsg
 		SetNotNilStartTime(&startTime).
 		SetNillableSendTime(sendTime).
 		SetType(3).
+		SetNotNilTemplateCode(req.TemplateCode).
+		SetNotNilTemplateName(req.TemplateName).
+		SetNotNilLang(req.Lang).
 		SetNotNilOrganizationID(&organizationId).
 		SetCtype(2).
 		SetSuccess(success).

+ 3 - 0
internal/logic/batch_msg/get_whatcapp_batch_msg_list_logic.go

@@ -72,6 +72,9 @@ func (l *GetWhatcappBatchMsgListLogic) GetWhatcappBatchMsgList(req *types.Whatsa
 				Success:      &v.Success,
 				Fail:         &v.Fail,
 				Type:         &v.Type,
+				TemplateName: &v.TemplateName,
+				TemplateCode: &v.TemplateCode,
+				Lang:         &v.Lang,
 				StartTime:    pointy.GetUnixMilliPointer(v.StartTime.UnixMilli()),
 				StopTime:     pointy.GetUnixMilliPointer(v.StopTime.UnixMilli()),
 				StartTimeStr: pointy.GetPointer(v.StartTime.Format("2006-01-02 15:04:05")),

+ 3 - 0
internal/logic/batch_msg/get_whatcapp_batch_msg_logic.go

@@ -77,6 +77,9 @@ func (l *GetWhatcappBatchMsgLogic) GetWhatcappBatchMsg(req *types.IDReq) (*types
 			Fail:         &data.Fail,
 			Type:         &data.Type,
 			Ctype:        &data.Ctype,
+			TemplateName: &data.TemplateName,
+			TemplateCode: &data.TemplateCode,
+			Lang:         &data.Lang,
 			StartTime:    pointy.GetUnixMilliPointer(data.StartTime.UnixMilli()),
 			StopTime:     pointy.GetUnixMilliPointer(data.StopTime.UnixMilli()),
 			SendTime:     pointy.GetUnixMilliPointer(data.SendTime.UnixMilli()),

+ 1 - 0
internal/types/types.go

@@ -1924,6 +1924,7 @@ type BatchMsgInfo struct {
 	Cc           *string `json:"cc,optional"`
 	Phone        *string `json:"phone,optional"`
 	TemplateCode *string `json:"templateCode,optional"`
+	TemplateName *string `json:"templateName,optional"`
 	Lang         *string `json:"lang,optional"`
 }