Browse Source

fix:修改whatsapp联系人字段

jimmyyem 1 month ago
parent
commit
60d31cd180

+ 1 - 2
desc/wechat/contact.api

@@ -91,10 +91,9 @@ type (
 
 		Ctype *uint64 `json:"ctype,optional"`
 		Cname *string `json:"cname,optional"`
-		Csex *int `json:"csex,optional"`
+		Sex *int `json:"sex,optional"`
 		Cage *int `json:"cage,optional"`
 		Carea *string `json:"carea,optional"`
-		Cmobile *string `json:"cmobile,optional"`
 		Cbirtyday *string `json:"cbirtyday,optional"`
 		Cbirtharea *string `json:"cbirtharea,optional"`
 		CidcardNo *string `json:"cidcardNo,optional"`

+ 0 - 2
desc/wechat/label_relationship.api

@@ -76,10 +76,8 @@ type (
 
 		Ctype *uint64 `json:"ctype,optional"`
 		Cname *string `json:"cname,optional"`
-		Csex *int `json:"csex,optional"`
 		Cage *int `json:"cage,optional"`
 		Carea *string `json:"carea,optional"`
-		Cmobile *string `json:"cmobile,optional"`
 		Cbirtyday *string `json:"cbirtyday,optional"`
 		Cbirtharea *string `json:"cbirtharea,optional"`
 		CidcardNo *string `json:"cidcardNo,optional"`

+ 2 - 24
ent/contact.go

@@ -59,16 +59,12 @@ type Contact struct {
 	OrganizationID uint64 `json:"organization_id,omitempty"`
 	// 内容类型:1-微信 2-whatsapp
 	Ctype uint64 `json:"ctype,omitempty"`
-	// 性别:1-男 2-女
-	Csex int `json:"csex,omitempty"`
 	// 年龄
 	Cage int `json:"cage,omitempty"`
 	// 姓名
 	Cname string `json:"cname,omitempty"`
 	// 地区
 	Carea string `json:"carea,omitempty"`
-	// 手机号
-	Cmobile string `json:"cmobile,omitempty"`
 	// 出生日期
 	Cbirthday string `json:"cbirthday,omitempty"`
 	// 出生地
@@ -121,9 +117,9 @@ func (*Contact) scanValues(columns []string) ([]any, error) {
 	values := make([]any, len(columns))
 	for i := range columns {
 		switch columns[i] {
-		case contact.FieldID, contact.FieldStatus, contact.FieldType, contact.FieldSex, contact.FieldDontseeit, contact.FieldDontseeme, contact.FieldOrganizationID, contact.FieldCtype, contact.FieldCsex, contact.FieldCage:
+		case contact.FieldID, contact.FieldStatus, contact.FieldType, contact.FieldSex, contact.FieldDontseeit, contact.FieldDontseeme, contact.FieldOrganizationID, contact.FieldCtype, contact.FieldCage:
 			values[i] = new(sql.NullInt64)
-		case contact.FieldWxWxid, contact.FieldWxid, contact.FieldAccount, contact.FieldNickname, contact.FieldMarkname, contact.FieldHeadimg, contact.FieldStarrole, contact.FieldLag, contact.FieldGid, contact.FieldGname, contact.FieldV3, contact.FieldCname, contact.FieldCarea, contact.FieldCmobile, contact.FieldCbirthday, contact.FieldCbirtharea, contact.FieldCidcardNo, contact.FieldCtitle, contact.FieldCc, contact.FieldPhone:
+		case contact.FieldWxWxid, contact.FieldWxid, contact.FieldAccount, contact.FieldNickname, contact.FieldMarkname, contact.FieldHeadimg, contact.FieldStarrole, contact.FieldLag, contact.FieldGid, contact.FieldGname, contact.FieldV3, contact.FieldCname, contact.FieldCarea, contact.FieldCbirthday, contact.FieldCbirtharea, contact.FieldCidcardNo, contact.FieldCtitle, contact.FieldCc, contact.FieldPhone:
 			values[i] = new(sql.NullString)
 		case contact.FieldCreatedAt, contact.FieldUpdatedAt, contact.FieldDeletedAt:
 			values[i] = new(sql.NullTime)
@@ -274,12 +270,6 @@ func (c *Contact) assignValues(columns []string, values []any) error {
 			} else if value.Valid {
 				c.Ctype = uint64(value.Int64)
 			}
-		case contact.FieldCsex:
-			if value, ok := values[i].(*sql.NullInt64); !ok {
-				return fmt.Errorf("unexpected type %T for field csex", values[i])
-			} else if value.Valid {
-				c.Csex = int(value.Int64)
-			}
 		case contact.FieldCage:
 			if value, ok := values[i].(*sql.NullInt64); !ok {
 				return fmt.Errorf("unexpected type %T for field cage", values[i])
@@ -298,12 +288,6 @@ func (c *Contact) assignValues(columns []string, values []any) error {
 			} else if value.Valid {
 				c.Carea = value.String
 			}
-		case contact.FieldCmobile:
-			if value, ok := values[i].(*sql.NullString); !ok {
-				return fmt.Errorf("unexpected type %T for field cmobile", values[i])
-			} else if value.Valid {
-				c.Cmobile = value.String
-			}
 		case contact.FieldCbirthday:
 			if value, ok := values[i].(*sql.NullString); !ok {
 				return fmt.Errorf("unexpected type %T for field cbirthday", values[i])
@@ -449,9 +433,6 @@ func (c *Contact) String() string {
 	builder.WriteString("ctype=")
 	builder.WriteString(fmt.Sprintf("%v", c.Ctype))
 	builder.WriteString(", ")
-	builder.WriteString("csex=")
-	builder.WriteString(fmt.Sprintf("%v", c.Csex))
-	builder.WriteString(", ")
 	builder.WriteString("cage=")
 	builder.WriteString(fmt.Sprintf("%v", c.Cage))
 	builder.WriteString(", ")
@@ -461,9 +442,6 @@ func (c *Contact) String() string {
 	builder.WriteString("carea=")
 	builder.WriteString(c.Carea)
 	builder.WriteString(", ")
-	builder.WriteString("cmobile=")
-	builder.WriteString(c.Cmobile)
-	builder.WriteString(", ")
 	builder.WriteString("cbirthday=")
 	builder.WriteString(c.Cbirthday)
 	builder.WriteString(", ")

+ 0 - 20
ent/contact/contact.go

@@ -57,16 +57,12 @@ const (
 	FieldOrganizationID = "organization_id"
 	// FieldCtype holds the string denoting the ctype field in the database.
 	FieldCtype = "ctype"
-	// FieldCsex holds the string denoting the csex field in the database.
-	FieldCsex = "csex"
 	// FieldCage holds the string denoting the cage field in the database.
 	FieldCage = "cage"
 	// FieldCname holds the string denoting the cname field in the database.
 	FieldCname = "cname"
 	// FieldCarea holds the string denoting the carea field in the database.
 	FieldCarea = "carea"
-	// FieldCmobile holds the string denoting the cmobile field in the database.
-	FieldCmobile = "cmobile"
 	// FieldCbirthday holds the string denoting the cbirthday field in the database.
 	FieldCbirthday = "cbirthday"
 	// FieldCbirtharea holds the string denoting the cbirtharea field in the database.
@@ -125,11 +121,9 @@ var Columns = []string{
 	FieldV3,
 	FieldOrganizationID,
 	FieldCtype,
-	FieldCsex,
 	FieldCage,
 	FieldCname,
 	FieldCarea,
-	FieldCmobile,
 	FieldCbirthday,
 	FieldCbirtharea,
 	FieldCidcardNo,
@@ -198,16 +192,12 @@ var (
 	DefaultOrganizationID uint64
 	// DefaultCtype holds the default value on creation for the "ctype" field.
 	DefaultCtype uint64
-	// DefaultCsex holds the default value on creation for the "csex" field.
-	DefaultCsex int
 	// DefaultCage holds the default value on creation for the "cage" field.
 	DefaultCage int
 	// DefaultCname holds the default value on creation for the "cname" field.
 	DefaultCname string
 	// DefaultCarea holds the default value on creation for the "carea" field.
 	DefaultCarea string
-	// DefaultCmobile holds the default value on creation for the "cmobile" field.
-	DefaultCmobile string
 	// DefaultCbirthday holds the default value on creation for the "cbirthday" field.
 	DefaultCbirthday string
 	// DefaultCbirtharea holds the default value on creation for the "cbirtharea" field.
@@ -335,11 +325,6 @@ func ByCtype(opts ...sql.OrderTermOption) OrderOption {
 	return sql.OrderByField(FieldCtype, opts...).ToFunc()
 }
 
-// ByCsex orders the results by the csex field.
-func ByCsex(opts ...sql.OrderTermOption) OrderOption {
-	return sql.OrderByField(FieldCsex, opts...).ToFunc()
-}
-
 // ByCage orders the results by the cage field.
 func ByCage(opts ...sql.OrderTermOption) OrderOption {
 	return sql.OrderByField(FieldCage, opts...).ToFunc()
@@ -355,11 +340,6 @@ func ByCarea(opts ...sql.OrderTermOption) OrderOption {
 	return sql.OrderByField(FieldCarea, opts...).ToFunc()
 }
 
-// ByCmobile orders the results by the cmobile field.
-func ByCmobile(opts ...sql.OrderTermOption) OrderOption {
-	return sql.OrderByField(FieldCmobile, opts...).ToFunc()
-}
-
 // ByCbirthday orders the results by the cbirthday field.
 func ByCbirthday(opts ...sql.OrderTermOption) OrderOption {
 	return sql.OrderByField(FieldCbirthday, opts...).ToFunc()

+ 0 - 115
ent/contact/where.go

@@ -160,11 +160,6 @@ func Ctype(v uint64) predicate.Contact {
 	return predicate.Contact(sql.FieldEQ(FieldCtype, v))
 }
 
-// Csex applies equality check predicate on the "csex" field. It's identical to CsexEQ.
-func Csex(v int) predicate.Contact {
-	return predicate.Contact(sql.FieldEQ(FieldCsex, v))
-}
-
 // Cage applies equality check predicate on the "cage" field. It's identical to CageEQ.
 func Cage(v int) predicate.Contact {
 	return predicate.Contact(sql.FieldEQ(FieldCage, v))
@@ -180,11 +175,6 @@ func Carea(v string) predicate.Contact {
 	return predicate.Contact(sql.FieldEQ(FieldCarea, v))
 }
 
-// Cmobile applies equality check predicate on the "cmobile" field. It's identical to CmobileEQ.
-func Cmobile(v string) predicate.Contact {
-	return predicate.Contact(sql.FieldEQ(FieldCmobile, v))
-}
-
 // Cbirthday applies equality check predicate on the "cbirthday" field. It's identical to CbirthdayEQ.
 func Cbirthday(v string) predicate.Contact {
 	return predicate.Contact(sql.FieldEQ(FieldCbirthday, v))
@@ -1370,46 +1360,6 @@ func CtypeLTE(v uint64) predicate.Contact {
 	return predicate.Contact(sql.FieldLTE(FieldCtype, v))
 }
 
-// CsexEQ applies the EQ predicate on the "csex" field.
-func CsexEQ(v int) predicate.Contact {
-	return predicate.Contact(sql.FieldEQ(FieldCsex, v))
-}
-
-// CsexNEQ applies the NEQ predicate on the "csex" field.
-func CsexNEQ(v int) predicate.Contact {
-	return predicate.Contact(sql.FieldNEQ(FieldCsex, v))
-}
-
-// CsexIn applies the In predicate on the "csex" field.
-func CsexIn(vs ...int) predicate.Contact {
-	return predicate.Contact(sql.FieldIn(FieldCsex, vs...))
-}
-
-// CsexNotIn applies the NotIn predicate on the "csex" field.
-func CsexNotIn(vs ...int) predicate.Contact {
-	return predicate.Contact(sql.FieldNotIn(FieldCsex, vs...))
-}
-
-// CsexGT applies the GT predicate on the "csex" field.
-func CsexGT(v int) predicate.Contact {
-	return predicate.Contact(sql.FieldGT(FieldCsex, v))
-}
-
-// CsexGTE applies the GTE predicate on the "csex" field.
-func CsexGTE(v int) predicate.Contact {
-	return predicate.Contact(sql.FieldGTE(FieldCsex, v))
-}
-
-// CsexLT applies the LT predicate on the "csex" field.
-func CsexLT(v int) predicate.Contact {
-	return predicate.Contact(sql.FieldLT(FieldCsex, v))
-}
-
-// CsexLTE applies the LTE predicate on the "csex" field.
-func CsexLTE(v int) predicate.Contact {
-	return predicate.Contact(sql.FieldLTE(FieldCsex, v))
-}
-
 // CageEQ applies the EQ predicate on the "cage" field.
 func CageEQ(v int) predicate.Contact {
 	return predicate.Contact(sql.FieldEQ(FieldCage, v))
@@ -1580,71 +1530,6 @@ func CareaContainsFold(v string) predicate.Contact {
 	return predicate.Contact(sql.FieldContainsFold(FieldCarea, v))
 }
 
-// CmobileEQ applies the EQ predicate on the "cmobile" field.
-func CmobileEQ(v string) predicate.Contact {
-	return predicate.Contact(sql.FieldEQ(FieldCmobile, v))
-}
-
-// CmobileNEQ applies the NEQ predicate on the "cmobile" field.
-func CmobileNEQ(v string) predicate.Contact {
-	return predicate.Contact(sql.FieldNEQ(FieldCmobile, v))
-}
-
-// CmobileIn applies the In predicate on the "cmobile" field.
-func CmobileIn(vs ...string) predicate.Contact {
-	return predicate.Contact(sql.FieldIn(FieldCmobile, vs...))
-}
-
-// CmobileNotIn applies the NotIn predicate on the "cmobile" field.
-func CmobileNotIn(vs ...string) predicate.Contact {
-	return predicate.Contact(sql.FieldNotIn(FieldCmobile, vs...))
-}
-
-// CmobileGT applies the GT predicate on the "cmobile" field.
-func CmobileGT(v string) predicate.Contact {
-	return predicate.Contact(sql.FieldGT(FieldCmobile, v))
-}
-
-// CmobileGTE applies the GTE predicate on the "cmobile" field.
-func CmobileGTE(v string) predicate.Contact {
-	return predicate.Contact(sql.FieldGTE(FieldCmobile, v))
-}
-
-// CmobileLT applies the LT predicate on the "cmobile" field.
-func CmobileLT(v string) predicate.Contact {
-	return predicate.Contact(sql.FieldLT(FieldCmobile, v))
-}
-
-// CmobileLTE applies the LTE predicate on the "cmobile" field.
-func CmobileLTE(v string) predicate.Contact {
-	return predicate.Contact(sql.FieldLTE(FieldCmobile, v))
-}
-
-// CmobileContains applies the Contains predicate on the "cmobile" field.
-func CmobileContains(v string) predicate.Contact {
-	return predicate.Contact(sql.FieldContains(FieldCmobile, v))
-}
-
-// CmobileHasPrefix applies the HasPrefix predicate on the "cmobile" field.
-func CmobileHasPrefix(v string) predicate.Contact {
-	return predicate.Contact(sql.FieldHasPrefix(FieldCmobile, v))
-}
-
-// CmobileHasSuffix applies the HasSuffix predicate on the "cmobile" field.
-func CmobileHasSuffix(v string) predicate.Contact {
-	return predicate.Contact(sql.FieldHasSuffix(FieldCmobile, v))
-}
-
-// CmobileEqualFold applies the EqualFold predicate on the "cmobile" field.
-func CmobileEqualFold(v string) predicate.Contact {
-	return predicate.Contact(sql.FieldEqualFold(FieldCmobile, v))
-}
-
-// CmobileContainsFold applies the ContainsFold predicate on the "cmobile" field.
-func CmobileContainsFold(v string) predicate.Contact {
-	return predicate.Contact(sql.FieldContainsFold(FieldCmobile, v))
-}
-
 // CbirthdayEQ applies the EQ predicate on the "cbirthday" field.
 func CbirthdayEQ(v string) predicate.Contact {
 	return predicate.Contact(sql.FieldEQ(FieldCbirthday, v))

+ 0 - 150
ent/contact_create.go

@@ -318,20 +318,6 @@ func (cc *ContactCreate) SetNillableCtype(u *uint64) *ContactCreate {
 	return cc
 }
 
-// SetCsex sets the "csex" field.
-func (cc *ContactCreate) SetCsex(i int) *ContactCreate {
-	cc.mutation.SetCsex(i)
-	return cc
-}
-
-// SetNillableCsex sets the "csex" field if the given value is not nil.
-func (cc *ContactCreate) SetNillableCsex(i *int) *ContactCreate {
-	if i != nil {
-		cc.SetCsex(*i)
-	}
-	return cc
-}
-
 // SetCage sets the "cage" field.
 func (cc *ContactCreate) SetCage(i int) *ContactCreate {
 	cc.mutation.SetCage(i)
@@ -374,20 +360,6 @@ func (cc *ContactCreate) SetNillableCarea(s *string) *ContactCreate {
 	return cc
 }
 
-// SetCmobile sets the "cmobile" field.
-func (cc *ContactCreate) SetCmobile(s string) *ContactCreate {
-	cc.mutation.SetCmobile(s)
-	return cc
-}
-
-// SetNillableCmobile sets the "cmobile" field if the given value is not nil.
-func (cc *ContactCreate) SetNillableCmobile(s *string) *ContactCreate {
-	if s != nil {
-		cc.SetCmobile(*s)
-	}
-	return cc
-}
-
 // SetCbirthday sets the "cbirthday" field.
 func (cc *ContactCreate) SetCbirthday(s string) *ContactCreate {
 	cc.mutation.SetCbirthday(s)
@@ -631,10 +603,6 @@ func (cc *ContactCreate) defaults() error {
 		v := contact.DefaultCtype
 		cc.mutation.SetCtype(v)
 	}
-	if _, ok := cc.mutation.Csex(); !ok {
-		v := contact.DefaultCsex
-		cc.mutation.SetCsex(v)
-	}
 	if _, ok := cc.mutation.Cage(); !ok {
 		v := contact.DefaultCage
 		cc.mutation.SetCage(v)
@@ -647,10 +615,6 @@ func (cc *ContactCreate) defaults() error {
 		v := contact.DefaultCarea
 		cc.mutation.SetCarea(v)
 	}
-	if _, ok := cc.mutation.Cmobile(); !ok {
-		v := contact.DefaultCmobile
-		cc.mutation.SetCmobile(v)
-	}
 	if _, ok := cc.mutation.Cbirthday(); !ok {
 		v := contact.DefaultCbirthday
 		cc.mutation.SetCbirthday(v)
@@ -731,9 +695,6 @@ func (cc *ContactCreate) check() error {
 	if _, ok := cc.mutation.Ctype(); !ok {
 		return &ValidationError{Name: "ctype", err: errors.New(`ent: missing required field "Contact.ctype"`)}
 	}
-	if _, ok := cc.mutation.Csex(); !ok {
-		return &ValidationError{Name: "csex", err: errors.New(`ent: missing required field "Contact.csex"`)}
-	}
 	if _, ok := cc.mutation.Cage(); !ok {
 		return &ValidationError{Name: "cage", err: errors.New(`ent: missing required field "Contact.cage"`)}
 	}
@@ -743,9 +704,6 @@ func (cc *ContactCreate) check() error {
 	if _, ok := cc.mutation.Carea(); !ok {
 		return &ValidationError{Name: "carea", err: errors.New(`ent: missing required field "Contact.carea"`)}
 	}
-	if _, ok := cc.mutation.Cmobile(); !ok {
-		return &ValidationError{Name: "cmobile", err: errors.New(`ent: missing required field "Contact.cmobile"`)}
-	}
 	if _, ok := cc.mutation.Cbirthday(); !ok {
 		return &ValidationError{Name: "cbirthday", err: errors.New(`ent: missing required field "Contact.cbirthday"`)}
 	}
@@ -881,10 +839,6 @@ func (cc *ContactCreate) createSpec() (*Contact, *sqlgraph.CreateSpec) {
 		_spec.SetField(contact.FieldCtype, field.TypeUint64, value)
 		_node.Ctype = value
 	}
-	if value, ok := cc.mutation.Csex(); ok {
-		_spec.SetField(contact.FieldCsex, field.TypeInt, value)
-		_node.Csex = value
-	}
 	if value, ok := cc.mutation.Cage(); ok {
 		_spec.SetField(contact.FieldCage, field.TypeInt, value)
 		_node.Cage = value
@@ -897,10 +851,6 @@ func (cc *ContactCreate) createSpec() (*Contact, *sqlgraph.CreateSpec) {
 		_spec.SetField(contact.FieldCarea, field.TypeString, value)
 		_node.Carea = value
 	}
-	if value, ok := cc.mutation.Cmobile(); ok {
-		_spec.SetField(contact.FieldCmobile, field.TypeString, value)
-		_node.Cmobile = value
-	}
 	if value, ok := cc.mutation.Cbirthday(); ok {
 		_spec.SetField(contact.FieldCbirthday, field.TypeString, value)
 		_node.Cbirthday = value
@@ -1315,24 +1265,6 @@ func (u *ContactUpsert) AddCtype(v uint64) *ContactUpsert {
 	return u
 }
 
-// SetCsex sets the "csex" field.
-func (u *ContactUpsert) SetCsex(v int) *ContactUpsert {
-	u.Set(contact.FieldCsex, v)
-	return u
-}
-
-// UpdateCsex sets the "csex" field to the value that was provided on create.
-func (u *ContactUpsert) UpdateCsex() *ContactUpsert {
-	u.SetExcluded(contact.FieldCsex)
-	return u
-}
-
-// AddCsex adds v to the "csex" field.
-func (u *ContactUpsert) AddCsex(v int) *ContactUpsert {
-	u.Add(contact.FieldCsex, v)
-	return u
-}
-
 // SetCage sets the "cage" field.
 func (u *ContactUpsert) SetCage(v int) *ContactUpsert {
 	u.Set(contact.FieldCage, v)
@@ -1375,18 +1307,6 @@ func (u *ContactUpsert) UpdateCarea() *ContactUpsert {
 	return u
 }
 
-// SetCmobile sets the "cmobile" field.
-func (u *ContactUpsert) SetCmobile(v string) *ContactUpsert {
-	u.Set(contact.FieldCmobile, v)
-	return u
-}
-
-// UpdateCmobile sets the "cmobile" field to the value that was provided on create.
-func (u *ContactUpsert) UpdateCmobile() *ContactUpsert {
-	u.SetExcluded(contact.FieldCmobile)
-	return u
-}
-
 // SetCbirthday sets the "cbirthday" field.
 func (u *ContactUpsert) SetCbirthday(v string) *ContactUpsert {
 	u.Set(contact.FieldCbirthday, v)
@@ -1867,27 +1787,6 @@ func (u *ContactUpsertOne) UpdateCtype() *ContactUpsertOne {
 	})
 }
 
-// SetCsex sets the "csex" field.
-func (u *ContactUpsertOne) SetCsex(v int) *ContactUpsertOne {
-	return u.Update(func(s *ContactUpsert) {
-		s.SetCsex(v)
-	})
-}
-
-// AddCsex adds v to the "csex" field.
-func (u *ContactUpsertOne) AddCsex(v int) *ContactUpsertOne {
-	return u.Update(func(s *ContactUpsert) {
-		s.AddCsex(v)
-	})
-}
-
-// UpdateCsex sets the "csex" field to the value that was provided on create.
-func (u *ContactUpsertOne) UpdateCsex() *ContactUpsertOne {
-	return u.Update(func(s *ContactUpsert) {
-		s.UpdateCsex()
-	})
-}
-
 // SetCage sets the "cage" field.
 func (u *ContactUpsertOne) SetCage(v int) *ContactUpsertOne {
 	return u.Update(func(s *ContactUpsert) {
@@ -1937,20 +1836,6 @@ func (u *ContactUpsertOne) UpdateCarea() *ContactUpsertOne {
 	})
 }
 
-// SetCmobile sets the "cmobile" field.
-func (u *ContactUpsertOne) SetCmobile(v string) *ContactUpsertOne {
-	return u.Update(func(s *ContactUpsert) {
-		s.SetCmobile(v)
-	})
-}
-
-// UpdateCmobile sets the "cmobile" field to the value that was provided on create.
-func (u *ContactUpsertOne) UpdateCmobile() *ContactUpsertOne {
-	return u.Update(func(s *ContactUpsert) {
-		s.UpdateCmobile()
-	})
-}
-
 // SetCbirthday sets the "cbirthday" field.
 func (u *ContactUpsertOne) SetCbirthday(v string) *ContactUpsertOne {
 	return u.Update(func(s *ContactUpsert) {
@@ -2609,27 +2494,6 @@ func (u *ContactUpsertBulk) UpdateCtype() *ContactUpsertBulk {
 	})
 }
 
-// SetCsex sets the "csex" field.
-func (u *ContactUpsertBulk) SetCsex(v int) *ContactUpsertBulk {
-	return u.Update(func(s *ContactUpsert) {
-		s.SetCsex(v)
-	})
-}
-
-// AddCsex adds v to the "csex" field.
-func (u *ContactUpsertBulk) AddCsex(v int) *ContactUpsertBulk {
-	return u.Update(func(s *ContactUpsert) {
-		s.AddCsex(v)
-	})
-}
-
-// UpdateCsex sets the "csex" field to the value that was provided on create.
-func (u *ContactUpsertBulk) UpdateCsex() *ContactUpsertBulk {
-	return u.Update(func(s *ContactUpsert) {
-		s.UpdateCsex()
-	})
-}
-
 // SetCage sets the "cage" field.
 func (u *ContactUpsertBulk) SetCage(v int) *ContactUpsertBulk {
 	return u.Update(func(s *ContactUpsert) {
@@ -2679,20 +2543,6 @@ func (u *ContactUpsertBulk) UpdateCarea() *ContactUpsertBulk {
 	})
 }
 
-// SetCmobile sets the "cmobile" field.
-func (u *ContactUpsertBulk) SetCmobile(v string) *ContactUpsertBulk {
-	return u.Update(func(s *ContactUpsert) {
-		s.SetCmobile(v)
-	})
-}
-
-// UpdateCmobile sets the "cmobile" field to the value that was provided on create.
-func (u *ContactUpsertBulk) UpdateCmobile() *ContactUpsertBulk {
-	return u.Update(func(s *ContactUpsert) {
-		s.UpdateCmobile()
-	})
-}
-
 // SetCbirthday sets the "cbirthday" field.
 func (u *ContactUpsertBulk) SetCbirthday(v string) *ContactUpsertBulk {
 	return u.Update(func(s *ContactUpsert) {

+ 0 - 88
ent/contact_update.go

@@ -375,27 +375,6 @@ func (cu *ContactUpdate) AddCtype(u int64) *ContactUpdate {
 	return cu
 }
 
-// SetCsex sets the "csex" field.
-func (cu *ContactUpdate) SetCsex(i int) *ContactUpdate {
-	cu.mutation.ResetCsex()
-	cu.mutation.SetCsex(i)
-	return cu
-}
-
-// SetNillableCsex sets the "csex" field if the given value is not nil.
-func (cu *ContactUpdate) SetNillableCsex(i *int) *ContactUpdate {
-	if i != nil {
-		cu.SetCsex(*i)
-	}
-	return cu
-}
-
-// AddCsex adds i to the "csex" field.
-func (cu *ContactUpdate) AddCsex(i int) *ContactUpdate {
-	cu.mutation.AddCsex(i)
-	return cu
-}
-
 // SetCage sets the "cage" field.
 func (cu *ContactUpdate) SetCage(i int) *ContactUpdate {
 	cu.mutation.ResetCage()
@@ -445,20 +424,6 @@ func (cu *ContactUpdate) SetNillableCarea(s *string) *ContactUpdate {
 	return cu
 }
 
-// SetCmobile sets the "cmobile" field.
-func (cu *ContactUpdate) SetCmobile(s string) *ContactUpdate {
-	cu.mutation.SetCmobile(s)
-	return cu
-}
-
-// SetNillableCmobile sets the "cmobile" field if the given value is not nil.
-func (cu *ContactUpdate) SetNillableCmobile(s *string) *ContactUpdate {
-	if s != nil {
-		cu.SetCmobile(*s)
-	}
-	return cu
-}
-
 // SetCbirthday sets the "cbirthday" field.
 func (cu *ContactUpdate) SetCbirthday(s string) *ContactUpdate {
 	cu.mutation.SetCbirthday(s)
@@ -764,12 +729,6 @@ func (cu *ContactUpdate) sqlSave(ctx context.Context) (n int, err error) {
 	if value, ok := cu.mutation.AddedCtype(); ok {
 		_spec.AddField(contact.FieldCtype, field.TypeUint64, value)
 	}
-	if value, ok := cu.mutation.Csex(); ok {
-		_spec.SetField(contact.FieldCsex, field.TypeInt, value)
-	}
-	if value, ok := cu.mutation.AddedCsex(); ok {
-		_spec.AddField(contact.FieldCsex, field.TypeInt, value)
-	}
 	if value, ok := cu.mutation.Cage(); ok {
 		_spec.SetField(contact.FieldCage, field.TypeInt, value)
 	}
@@ -782,9 +741,6 @@ func (cu *ContactUpdate) sqlSave(ctx context.Context) (n int, err error) {
 	if value, ok := cu.mutation.Carea(); ok {
 		_spec.SetField(contact.FieldCarea, field.TypeString, value)
 	}
-	if value, ok := cu.mutation.Cmobile(); ok {
-		_spec.SetField(contact.FieldCmobile, field.TypeString, value)
-	}
 	if value, ok := cu.mutation.Cbirthday(); ok {
 		_spec.SetField(contact.FieldCbirthday, field.TypeString, value)
 	}
@@ -1258,27 +1214,6 @@ func (cuo *ContactUpdateOne) AddCtype(u int64) *ContactUpdateOne {
 	return cuo
 }
 
-// SetCsex sets the "csex" field.
-func (cuo *ContactUpdateOne) SetCsex(i int) *ContactUpdateOne {
-	cuo.mutation.ResetCsex()
-	cuo.mutation.SetCsex(i)
-	return cuo
-}
-
-// SetNillableCsex sets the "csex" field if the given value is not nil.
-func (cuo *ContactUpdateOne) SetNillableCsex(i *int) *ContactUpdateOne {
-	if i != nil {
-		cuo.SetCsex(*i)
-	}
-	return cuo
-}
-
-// AddCsex adds i to the "csex" field.
-func (cuo *ContactUpdateOne) AddCsex(i int) *ContactUpdateOne {
-	cuo.mutation.AddCsex(i)
-	return cuo
-}
-
 // SetCage sets the "cage" field.
 func (cuo *ContactUpdateOne) SetCage(i int) *ContactUpdateOne {
 	cuo.mutation.ResetCage()
@@ -1328,20 +1263,6 @@ func (cuo *ContactUpdateOne) SetNillableCarea(s *string) *ContactUpdateOne {
 	return cuo
 }
 
-// SetCmobile sets the "cmobile" field.
-func (cuo *ContactUpdateOne) SetCmobile(s string) *ContactUpdateOne {
-	cuo.mutation.SetCmobile(s)
-	return cuo
-}
-
-// SetNillableCmobile sets the "cmobile" field if the given value is not nil.
-func (cuo *ContactUpdateOne) SetNillableCmobile(s *string) *ContactUpdateOne {
-	if s != nil {
-		cuo.SetCmobile(*s)
-	}
-	return cuo
-}
-
 // SetCbirthday sets the "cbirthday" field.
 func (cuo *ContactUpdateOne) SetCbirthday(s string) *ContactUpdateOne {
 	cuo.mutation.SetCbirthday(s)
@@ -1677,12 +1598,6 @@ func (cuo *ContactUpdateOne) sqlSave(ctx context.Context) (_node *Contact, err e
 	if value, ok := cuo.mutation.AddedCtype(); ok {
 		_spec.AddField(contact.FieldCtype, field.TypeUint64, value)
 	}
-	if value, ok := cuo.mutation.Csex(); ok {
-		_spec.SetField(contact.FieldCsex, field.TypeInt, value)
-	}
-	if value, ok := cuo.mutation.AddedCsex(); ok {
-		_spec.AddField(contact.FieldCsex, field.TypeInt, value)
-	}
 	if value, ok := cuo.mutation.Cage(); ok {
 		_spec.SetField(contact.FieldCage, field.TypeInt, value)
 	}
@@ -1695,9 +1610,6 @@ func (cuo *ContactUpdateOne) sqlSave(ctx context.Context) (_node *Contact, err e
 	if value, ok := cuo.mutation.Carea(); ok {
 		_spec.SetField(contact.FieldCarea, field.TypeString, value)
 	}
-	if value, ok := cuo.mutation.Cmobile(); ok {
-		_spec.SetField(contact.FieldCmobile, field.TypeString, value)
-	}
 	if value, ok := cuo.mutation.Cbirthday(); ok {
 		_spec.SetField(contact.FieldCbirthday, field.TypeString, value)
 	}

+ 0 - 2
ent/migrate/schema.go

@@ -258,11 +258,9 @@ var (
 		{Name: "v3", Type: field.TypeString, Comment: "v3数据", Default: ""},
 		{Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
 		{Name: "ctype", Type: field.TypeUint64, Comment: "内容类型:1-微信 2-whatsapp", Default: 1},
-		{Name: "csex", Type: field.TypeInt, Comment: "性别:1-男 2-女", Default: 0},
 		{Name: "cage", Type: field.TypeInt, Comment: "年龄", Default: 0},
 		{Name: "cname", Type: field.TypeString, Comment: "姓名", Default: ""},
 		{Name: "carea", Type: field.TypeString, Comment: "地区", Default: ""},
-		{Name: "cmobile", Type: field.TypeString, Comment: "手机号", Default: ""},
 		{Name: "cbirthday", Type: field.TypeString, Comment: "出生日期", Default: ""},
 		{Name: "cbirtharea", Type: field.TypeString, Comment: "出生地", Default: ""},
 		{Name: "cidcard_no", Type: field.TypeString, Comment: "身份证号", Default: ""},

+ 1 - 142
ent/mutation.go

@@ -8694,13 +8694,10 @@ type ContactMutation struct {
 	addorganization_id           *int64
 	ctype                        *uint64
 	addctype                     *int64
-	csex                         *int
-	addcsex                      *int
 	cage                         *int
 	addcage                      *int
 	cname                        *string
 	carea                        *string
-	cmobile                      *string
 	cbirthday                    *string
 	cbirtharea                   *string
 	cidcard_no                   *string
@@ -9774,62 +9771,6 @@ func (m *ContactMutation) ResetCtype() {
 	m.addctype = nil
 }
 
-// SetCsex sets the "csex" field.
-func (m *ContactMutation) SetCsex(i int) {
-	m.csex = &i
-	m.addcsex = nil
-}
-
-// Csex returns the value of the "csex" field in the mutation.
-func (m *ContactMutation) Csex() (r int, exists bool) {
-	v := m.csex
-	if v == nil {
-		return
-	}
-	return *v, true
-}
-
-// OldCsex returns the old "csex" field's value of the Contact entity.
-// If the Contact 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 *ContactMutation) OldCsex(ctx context.Context) (v int, err error) {
-	if !m.op.Is(OpUpdateOne) {
-		return v, errors.New("OldCsex is only allowed on UpdateOne operations")
-	}
-	if m.id == nil || m.oldValue == nil {
-		return v, errors.New("OldCsex requires an ID field in the mutation")
-	}
-	oldValue, err := m.oldValue(ctx)
-	if err != nil {
-		return v, fmt.Errorf("querying old value for OldCsex: %w", err)
-	}
-	return oldValue.Csex, nil
-}
-
-// AddCsex adds i to the "csex" field.
-func (m *ContactMutation) AddCsex(i int) {
-	if m.addcsex != nil {
-		*m.addcsex += i
-	} else {
-		m.addcsex = &i
-	}
-}
-
-// AddedCsex returns the value that was added to the "csex" field in this mutation.
-func (m *ContactMutation) AddedCsex() (r int, exists bool) {
-	v := m.addcsex
-	if v == nil {
-		return
-	}
-	return *v, true
-}
-
-// ResetCsex resets all changes to the "csex" field.
-func (m *ContactMutation) ResetCsex() {
-	m.csex = nil
-	m.addcsex = nil
-}
-
 // SetCage sets the "cage" field.
 func (m *ContactMutation) SetCage(i int) {
 	m.cage = &i
@@ -9958,42 +9899,6 @@ func (m *ContactMutation) ResetCarea() {
 	m.carea = nil
 }
 
-// SetCmobile sets the "cmobile" field.
-func (m *ContactMutation) SetCmobile(s string) {
-	m.cmobile = &s
-}
-
-// Cmobile returns the value of the "cmobile" field in the mutation.
-func (m *ContactMutation) Cmobile() (r string, exists bool) {
-	v := m.cmobile
-	if v == nil {
-		return
-	}
-	return *v, true
-}
-
-// OldCmobile returns the old "cmobile" field's value of the Contact entity.
-// If the Contact 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 *ContactMutation) OldCmobile(ctx context.Context) (v string, err error) {
-	if !m.op.Is(OpUpdateOne) {
-		return v, errors.New("OldCmobile is only allowed on UpdateOne operations")
-	}
-	if m.id == nil || m.oldValue == nil {
-		return v, errors.New("OldCmobile requires an ID field in the mutation")
-	}
-	oldValue, err := m.oldValue(ctx)
-	if err != nil {
-		return v, fmt.Errorf("querying old value for OldCmobile: %w", err)
-	}
-	return oldValue.Cmobile, nil
-}
-
-// ResetCmobile resets all changes to the "cmobile" field.
-func (m *ContactMutation) ResetCmobile() {
-	m.cmobile = nil
-}
-
 // SetCbirthday sets the "cbirthday" field.
 func (m *ContactMutation) SetCbirthday(s string) {
 	m.cbirthday = &s
@@ -10352,7 +10257,7 @@ func (m *ContactMutation) Type() string {
 // order to get all numeric fields that were incremented/decremented, call
 // AddedFields().
 func (m *ContactMutation) Fields() []string {
-	fields := make([]string, 0, 32)
+	fields := make([]string, 0, 30)
 	if m.created_at != nil {
 		fields = append(fields, contact.FieldCreatedAt)
 	}
@@ -10416,9 +10321,6 @@ func (m *ContactMutation) Fields() []string {
 	if m.ctype != nil {
 		fields = append(fields, contact.FieldCtype)
 	}
-	if m.csex != nil {
-		fields = append(fields, contact.FieldCsex)
-	}
 	if m.cage != nil {
 		fields = append(fields, contact.FieldCage)
 	}
@@ -10428,9 +10330,6 @@ func (m *ContactMutation) Fields() []string {
 	if m.carea != nil {
 		fields = append(fields, contact.FieldCarea)
 	}
-	if m.cmobile != nil {
-		fields = append(fields, contact.FieldCmobile)
-	}
 	if m.cbirthday != nil {
 		fields = append(fields, contact.FieldCbirthday)
 	}
@@ -10499,16 +10398,12 @@ func (m *ContactMutation) Field(name string) (ent.Value, bool) {
 		return m.OrganizationID()
 	case contact.FieldCtype:
 		return m.Ctype()
-	case contact.FieldCsex:
-		return m.Csex()
 	case contact.FieldCage:
 		return m.Cage()
 	case contact.FieldCname:
 		return m.Cname()
 	case contact.FieldCarea:
 		return m.Carea()
-	case contact.FieldCmobile:
-		return m.Cmobile()
 	case contact.FieldCbirthday:
 		return m.Cbirthday()
 	case contact.FieldCbirtharea:
@@ -10572,16 +10467,12 @@ func (m *ContactMutation) OldField(ctx context.Context, name string) (ent.Value,
 		return m.OldOrganizationID(ctx)
 	case contact.FieldCtype:
 		return m.OldCtype(ctx)
-	case contact.FieldCsex:
-		return m.OldCsex(ctx)
 	case contact.FieldCage:
 		return m.OldCage(ctx)
 	case contact.FieldCname:
 		return m.OldCname(ctx)
 	case contact.FieldCarea:
 		return m.OldCarea(ctx)
-	case contact.FieldCmobile:
-		return m.OldCmobile(ctx)
 	case contact.FieldCbirthday:
 		return m.OldCbirthday(ctx)
 	case contact.FieldCbirtharea:
@@ -10750,13 +10641,6 @@ func (m *ContactMutation) SetField(name string, value ent.Value) error {
 		}
 		m.SetCtype(v)
 		return nil
-	case contact.FieldCsex:
-		v, ok := value.(int)
-		if !ok {
-			return fmt.Errorf("unexpected type %T for field %s", value, name)
-		}
-		m.SetCsex(v)
-		return nil
 	case contact.FieldCage:
 		v, ok := value.(int)
 		if !ok {
@@ -10778,13 +10662,6 @@ func (m *ContactMutation) SetField(name string, value ent.Value) error {
 		}
 		m.SetCarea(v)
 		return nil
-	case contact.FieldCmobile:
-		v, ok := value.(string)
-		if !ok {
-			return fmt.Errorf("unexpected type %T for field %s", value, name)
-		}
-		m.SetCmobile(v)
-		return nil
 	case contact.FieldCbirthday:
 		v, ok := value.(string)
 		if !ok {
@@ -10856,9 +10733,6 @@ func (m *ContactMutation) AddedFields() []string {
 	if m.addctype != nil {
 		fields = append(fields, contact.FieldCtype)
 	}
-	if m.addcsex != nil {
-		fields = append(fields, contact.FieldCsex)
-	}
 	if m.addcage != nil {
 		fields = append(fields, contact.FieldCage)
 	}
@@ -10884,8 +10758,6 @@ func (m *ContactMutation) AddedField(name string) (ent.Value, bool) {
 		return m.AddedOrganizationID()
 	case contact.FieldCtype:
 		return m.AddedCtype()
-	case contact.FieldCsex:
-		return m.AddedCsex()
 	case contact.FieldCage:
 		return m.AddedCage()
 	}
@@ -10946,13 +10818,6 @@ func (m *ContactMutation) AddField(name string, value ent.Value) error {
 		}
 		m.AddCtype(v)
 		return nil
-	case contact.FieldCsex:
-		v, ok := value.(int)
-		if !ok {
-			return fmt.Errorf("unexpected type %T for field %s", value, name)
-		}
-		m.AddCsex(v)
-		return nil
 	case contact.FieldCage:
 		v, ok := value.(int)
 		if !ok {
@@ -11077,9 +10942,6 @@ func (m *ContactMutation) ResetField(name string) error {
 	case contact.FieldCtype:
 		m.ResetCtype()
 		return nil
-	case contact.FieldCsex:
-		m.ResetCsex()
-		return nil
 	case contact.FieldCage:
 		m.ResetCage()
 		return nil
@@ -11089,9 +10951,6 @@ func (m *ContactMutation) ResetField(name string) error {
 	case contact.FieldCarea:
 		m.ResetCarea()
 		return nil
-	case contact.FieldCmobile:
-		m.ResetCmobile()
-		return nil
 	case contact.FieldCbirthday:
 		m.ResetCbirthday()
 		return nil

+ 9 - 17
ent/runtime/runtime.go

@@ -419,48 +419,40 @@ func init() {
 	contactDescCtype := contactFields[16].Descriptor()
 	// contact.DefaultCtype holds the default value on creation for the ctype field.
 	contact.DefaultCtype = contactDescCtype.Default.(uint64)
-	// contactDescCsex is the schema descriptor for csex field.
-	contactDescCsex := contactFields[17].Descriptor()
-	// contact.DefaultCsex holds the default value on creation for the csex field.
-	contact.DefaultCsex = contactDescCsex.Default.(int)
 	// contactDescCage is the schema descriptor for cage field.
-	contactDescCage := contactFields[18].Descriptor()
+	contactDescCage := contactFields[17].Descriptor()
 	// contact.DefaultCage holds the default value on creation for the cage field.
 	contact.DefaultCage = contactDescCage.Default.(int)
 	// contactDescCname is the schema descriptor for cname field.
-	contactDescCname := contactFields[19].Descriptor()
+	contactDescCname := contactFields[18].Descriptor()
 	// contact.DefaultCname holds the default value on creation for the cname field.
 	contact.DefaultCname = contactDescCname.Default.(string)
 	// contactDescCarea is the schema descriptor for carea field.
-	contactDescCarea := contactFields[20].Descriptor()
+	contactDescCarea := contactFields[19].Descriptor()
 	// contact.DefaultCarea holds the default value on creation for the carea field.
 	contact.DefaultCarea = contactDescCarea.Default.(string)
-	// contactDescCmobile is the schema descriptor for cmobile field.
-	contactDescCmobile := contactFields[21].Descriptor()
-	// contact.DefaultCmobile holds the default value on creation for the cmobile field.
-	contact.DefaultCmobile = contactDescCmobile.Default.(string)
 	// contactDescCbirthday is the schema descriptor for cbirthday field.
-	contactDescCbirthday := contactFields[22].Descriptor()
+	contactDescCbirthday := contactFields[20].Descriptor()
 	// contact.DefaultCbirthday holds the default value on creation for the cbirthday field.
 	contact.DefaultCbirthday = contactDescCbirthday.Default.(string)
 	// contactDescCbirtharea is the schema descriptor for cbirtharea field.
-	contactDescCbirtharea := contactFields[23].Descriptor()
+	contactDescCbirtharea := contactFields[21].Descriptor()
 	// contact.DefaultCbirtharea holds the default value on creation for the cbirtharea field.
 	contact.DefaultCbirtharea = contactDescCbirtharea.Default.(string)
 	// contactDescCidcardNo is the schema descriptor for cidcard_no field.
-	contactDescCidcardNo := contactFields[24].Descriptor()
+	contactDescCidcardNo := contactFields[22].Descriptor()
 	// contact.DefaultCidcardNo holds the default value on creation for the cidcard_no field.
 	contact.DefaultCidcardNo = contactDescCidcardNo.Default.(string)
 	// contactDescCtitle is the schema descriptor for ctitle field.
-	contactDescCtitle := contactFields[25].Descriptor()
+	contactDescCtitle := contactFields[23].Descriptor()
 	// contact.DefaultCtitle holds the default value on creation for the ctitle field.
 	contact.DefaultCtitle = contactDescCtitle.Default.(string)
 	// contactDescCc is the schema descriptor for cc field.
-	contactDescCc := contactFields[26].Descriptor()
+	contactDescCc := contactFields[24].Descriptor()
 	// contact.DefaultCc holds the default value on creation for the cc field.
 	contact.DefaultCc = contactDescCc.Default.(string)
 	// contactDescPhone is the schema descriptor for phone field.
-	contactDescPhone := contactFields[27].Descriptor()
+	contactDescPhone := contactFields[25].Descriptor()
 	// contact.DefaultPhone holds the default value on creation for the phone field.
 	contact.DefaultPhone = contactDescPhone.Default.(string)
 	creditbalanceMixin := schema.CreditBalance{}.Mixin()

+ 0 - 2
ent/schema/contact.go

@@ -67,11 +67,9 @@ func (Contact) Fields() []ent.Field {
 			Comment("机构 ID").
 			Annotations(entsql.WithComments(true)),
 		field.Uint64("ctype").Default(1).Comment("内容类型:1-微信 2-whatsapp"),
-		field.Int("csex").Default(0).Comment("性别:1-男 2-女"),
 		field.Int("cage").Default(0).Comment("年龄"),
 		field.String("cname").Default("").Comment("姓名"),
 		field.String("carea").Default("").Comment("地区"),
-		field.String("cmobile").Default("").Comment("手机号"),
 		field.String("cbirthday").Default("").Comment("出生日期"),
 		field.String("cbirtharea").Default("").Comment("出生地"),
 		field.String("cidcard_no").Default("").Comment("身份证号"),

+ 0 - 48
ent/set_not_nil.go

@@ -2264,30 +2264,6 @@ func (c *ContactCreate) SetNotNilCtype(value *uint64) *ContactCreate {
 }
 
 // set field if value's pointer is not nil.
-func (c *ContactUpdate) SetNotNilCsex(value *int) *ContactUpdate {
-	if value != nil {
-		return c.SetCsex(*value)
-	}
-	return c
-}
-
-// set field if value's pointer is not nil.
-func (c *ContactUpdateOne) SetNotNilCsex(value *int) *ContactUpdateOne {
-	if value != nil {
-		return c.SetCsex(*value)
-	}
-	return c
-}
-
-// set field if value's pointer is not nil.
-func (c *ContactCreate) SetNotNilCsex(value *int) *ContactCreate {
-	if value != nil {
-		return c.SetCsex(*value)
-	}
-	return c
-}
-
-// set field if value's pointer is not nil.
 func (c *ContactUpdate) SetNotNilCage(value *int) *ContactUpdate {
 	if value != nil {
 		return c.SetCage(*value)
@@ -2360,30 +2336,6 @@ func (c *ContactCreate) SetNotNilCarea(value *string) *ContactCreate {
 }
 
 // set field if value's pointer is not nil.
-func (c *ContactUpdate) SetNotNilCmobile(value *string) *ContactUpdate {
-	if value != nil {
-		return c.SetCmobile(*value)
-	}
-	return c
-}
-
-// set field if value's pointer is not nil.
-func (c *ContactUpdateOne) SetNotNilCmobile(value *string) *ContactUpdateOne {
-	if value != nil {
-		return c.SetCmobile(*value)
-	}
-	return c
-}
-
-// set field if value's pointer is not nil.
-func (c *ContactCreate) SetNotNilCmobile(value *string) *ContactCreate {
-	if value != nil {
-		return c.SetCmobile(*value)
-	}
-	return c
-}
-
-// set field if value's pointer is not nil.
 func (c *ContactUpdate) SetNotNilCbirthday(value *string) *ContactUpdate {
 	if value != nil {
 		return c.SetCbirthday(*value)

+ 2 - 4
internal/logic/batch_msg/create_whatcapp_batch_msg_logic.go

@@ -92,8 +92,7 @@ func (l *CreateWhatcappBatchMsgLogic) CreateWhatcappBatchMsg(req *types.BatchMsg
 	if allContact {
 		// 获取 contact 表中  cc+phone 匹配的联系人
 		userList, err = l.svcCtx.DB.Contact.Query().Where(
-			contact.Phone(*req.Phone),
-			contact.Cc(*req.Cc),
+			contact.OrganizationID(organizationId),
 			contact.Ctype(2),
 		).All(l.ctx)
 		if err != nil {
@@ -113,8 +112,7 @@ func (l *CreateWhatcappBatchMsgLogic) CreateWhatcappBatchMsg(req *types.BatchMsg
 		if allContact { // 所有联系人
 			// 获取 contact 表中  wx_wxid 等于 req.Fromwxid 的 type 为1的数据
 			userList, err = l.svcCtx.DB.Contact.Query().Where(
-				contact.Cc(*req.Cc),
-				contact.Phone(*req.Phone),
+				contact.OrganizationID(organizationId),
 				contact.Ctype(2),
 			).All(l.ctx)
 			if err != nil {

+ 1 - 1
internal/logic/contact/create_whatsapp_contact_logic.go

@@ -39,7 +39,7 @@ func (l *CreateWhatsappContactLogic) CreateWhatsappContact(req *types.CreateWhat
 		SetOrganizationID(organizationId).
 		SetNotNilCarea(req.Carea).
 		SetNotNilCage(req.Cage).
-		SetNotNilCsex(req.Csex).
+		SetNotNilSex(req.Sex).
 		SetNotNilCbirtharea(req.Cbirtharea).
 		SetNotNilCbirthday(req.Cbirtyday).
 		SetNotNilCtitle(req.Ctitle).

+ 1 - 2
internal/logic/contact/get_whatsapp_contact_list_logic.go

@@ -91,10 +91,9 @@ func (l *GetWhatsappContactListLogic) GetWhatsappContactList(req *types.Whatsapp
 				OrganizationId:     &v.OrganizationID,
 				Ctype:              &v.Ctype,
 				Cname:              &v.Cname,
-				Csex:               &v.Csex,
+				Sex:                &v.Sex,
 				Cage:               &v.Cage,
 				Carea:              &v.Carea,
-				Cmobile:            &v.Cmobile,
 				Cbirtyday:          &v.Cbirthday,
 				Cbirtharea:         &v.Cbirtharea,
 				CidcardNo:          &v.CidcardNo,

+ 1 - 2
internal/logic/contact/get_whatsapp_contact_logic.go

@@ -73,10 +73,9 @@ func (l *GetWhatsappContactLogic) GetWhatsappContact(req *types.IDReq) (resp *ty
 			OrganizationId:     &data.OrganizationID,
 			Ctype:              &data.Ctype,
 			Cname:              &data.Cname,
-			Csex:               &data.Csex,
+			Sex:                &data.Sex,
 			Cage:               &data.Cage,
 			Carea:              &data.Carea,
-			Cmobile:            &data.Cmobile,
 			Cbirtyday:          &data.Cbirthday,
 			Cbirtharea:         &data.Cbirtharea,
 			CidcardNo:          &data.CidcardNo,

+ 2 - 2
internal/logic/contact/import_whatsapp_contact_logic.go

@@ -48,7 +48,7 @@ func (l *ImportWhatsappContactLogic) ImportWhatsappContact(req *types.ImportWhat
 		total++
 
 		uuidstr := uuidx.NewUUID().String()
-		csex, _ := strconv.Atoi(trim(record[5]))
+		sex, _ := strconv.Atoi(trim(record[5]))
 		cage, _ := strconv.Atoi(trim(record[7]))
 		newContact, err := l.svcCtx.DB.Contact.Create().SetCtype(2).
 			SetCc(record[0]).
@@ -58,7 +58,7 @@ func (l *ImportWhatsappContactLogic) ImportWhatsappContact(req *types.ImportWhat
 			SetWxid(uuidstr).
 			SetCname(trim(record[2])).
 			SetMarkname(trim(record[3])).
-			SetCsex(csex).
+			SetSex(sex).
 			SetCage(cage).
 			SetCtitle(trim(record[6])).
 			SetCarea(trim(record[9])).

+ 1 - 1
internal/logic/contact/update_whatsapp_contact_logic.go

@@ -35,7 +35,7 @@ func (l *UpdateWhatsappContactLogic) UpdateWhatsappContact(req *types.CreateWhat
 		SetOrganizationID(organizationId).
 		SetNotNilCarea(req.Carea).
 		SetNotNilCage(req.Cage).
-		SetNotNilCsex(req.Csex).
+		SetNotNilSex(req.Sex).
 		SetNotNilCbirtharea(req.Cbirtharea).
 		SetNotNilCbirthday(req.Cbirtyday).
 		SetNotNilCtitle(req.Ctitle).

+ 1 - 4
internal/types/types.go

@@ -798,10 +798,8 @@ type ContactInfo struct {
 	IsInBlockList *bool   `json:"isInBlockList,optional"`
 	Ctype         *uint64 `json:"ctype,optional"`
 	Cname         *string `json:"cname,optional"`
-	Csex          *int    `json:"csex,optional"`
 	Cage          *int    `json:"cage,optional"`
 	Carea         *string `json:"carea,optional"`
-	Cmobile       *string `json:"cmobile,optional"`
 	Cbirtyday     *string `json:"cbirtyday,optional"`
 	Cbirtharea    *string `json:"cbirtharea,optional"`
 	CidcardNo     *string `json:"cidcardNo,optional"`
@@ -1052,10 +1050,9 @@ type CreateWhatsappContactReq struct {
 	Markname   *string `json:"markname,optional"`
 	Ctype      *uint64 `json:"ctype,optional"`
 	Cname      *string `json:"cname,optional"`
-	Csex       *int    `json:"csex,optional"`
+	Sex        *int    `json:"sex,optional"`
 	Cage       *int    `json:"cage,optional"`
 	Carea      *string `json:"carea,optional"`
-	Cmobile    *string `json:"cmobile,optional"`
 	Cbirtyday  *string `json:"cbirtyday,optional"`
 	Cbirtharea *string `json:"cbirtharea,optional"`
 	CidcardNo  *string `json:"cidcardNo,optional"`