|
@@ -8240,6 +8240,9 @@ type EmployeeMutation struct {
|
|
|
addcategory_id *int64
|
|
|
api_base *string
|
|
|
api_key *string
|
|
|
+ ai_info *string
|
|
|
+ is_vip *int
|
|
|
+ addis_vip *int
|
|
|
clearedFields map[string]struct{}
|
|
|
em_work_experiences map[uint64]struct{}
|
|
|
removedem_work_experiences map[uint64]struct{}
|
|
@@ -9189,6 +9192,111 @@ func (m *EmployeeMutation) ResetAPIKey() {
|
|
|
m.api_key = nil
|
|
|
}
|
|
|
|
|
|
+// SetAiInfo sets the "ai_info" field.
|
|
|
+func (m *EmployeeMutation) SetAiInfo(s string) {
|
|
|
+ m.ai_info = &s
|
|
|
+}
|
|
|
+
|
|
|
+// AiInfo returns the value of the "ai_info" field in the mutation.
|
|
|
+func (m *EmployeeMutation) AiInfo() (r string, exists bool) {
|
|
|
+ v := m.ai_info
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldAiInfo returns the old "ai_info" field's value of the Employee entity.
|
|
|
+// If the Employee 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 *EmployeeMutation) OldAiInfo(ctx context.Context) (v string, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldAiInfo is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldAiInfo requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldAiInfo: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.AiInfo, nil
|
|
|
+}
|
|
|
+
|
|
|
+// ClearAiInfo clears the value of the "ai_info" field.
|
|
|
+func (m *EmployeeMutation) ClearAiInfo() {
|
|
|
+ m.ai_info = nil
|
|
|
+ m.clearedFields[employee.FieldAiInfo] = struct{}{}
|
|
|
+}
|
|
|
+
|
|
|
+// AiInfoCleared returns if the "ai_info" field was cleared in this mutation.
|
|
|
+func (m *EmployeeMutation) AiInfoCleared() bool {
|
|
|
+ _, ok := m.clearedFields[employee.FieldAiInfo]
|
|
|
+ return ok
|
|
|
+}
|
|
|
+
|
|
|
+// ResetAiInfo resets all changes to the "ai_info" field.
|
|
|
+func (m *EmployeeMutation) ResetAiInfo() {
|
|
|
+ m.ai_info = nil
|
|
|
+ delete(m.clearedFields, employee.FieldAiInfo)
|
|
|
+}
|
|
|
+
|
|
|
+// SetIsVip sets the "is_vip" field.
|
|
|
+func (m *EmployeeMutation) SetIsVip(i int) {
|
|
|
+ m.is_vip = &i
|
|
|
+ m.addis_vip = nil
|
|
|
+}
|
|
|
+
|
|
|
+// IsVip returns the value of the "is_vip" field in the mutation.
|
|
|
+func (m *EmployeeMutation) IsVip() (r int, exists bool) {
|
|
|
+ v := m.is_vip
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldIsVip returns the old "is_vip" field's value of the Employee entity.
|
|
|
+// If the Employee 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 *EmployeeMutation) OldIsVip(ctx context.Context) (v int, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldIsVip is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldIsVip requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldIsVip: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.IsVip, nil
|
|
|
+}
|
|
|
+
|
|
|
+// AddIsVip adds i to the "is_vip" field.
|
|
|
+func (m *EmployeeMutation) AddIsVip(i int) {
|
|
|
+ if m.addis_vip != nil {
|
|
|
+ *m.addis_vip += i
|
|
|
+ } else {
|
|
|
+ m.addis_vip = &i
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// AddedIsVip returns the value that was added to the "is_vip" field in this mutation.
|
|
|
+func (m *EmployeeMutation) AddedIsVip() (r int, exists bool) {
|
|
|
+ v := m.addis_vip
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// ResetIsVip resets all changes to the "is_vip" field.
|
|
|
+func (m *EmployeeMutation) ResetIsVip() {
|
|
|
+ m.is_vip = nil
|
|
|
+ m.addis_vip = nil
|
|
|
+}
|
|
|
+
|
|
|
// AddEmWorkExperienceIDs adds the "em_work_experiences" edge to the WorkExperience entity by ids.
|
|
|
func (m *EmployeeMutation) AddEmWorkExperienceIDs(ids ...uint64) {
|
|
|
if m.em_work_experiences == nil {
|
|
@@ -9331,7 +9439,7 @@ func (m *EmployeeMutation) Type() string {
|
|
|
// order to get all numeric fields that were incremented/decremented, call
|
|
|
// AddedFields().
|
|
|
func (m *EmployeeMutation) Fields() []string {
|
|
|
- fields := make([]string, 0, 20)
|
|
|
+ fields := make([]string, 0, 22)
|
|
|
if m.created_at != nil {
|
|
|
fields = append(fields, employee.FieldCreatedAt)
|
|
|
}
|
|
@@ -9392,6 +9500,12 @@ func (m *EmployeeMutation) Fields() []string {
|
|
|
if m.api_key != nil {
|
|
|
fields = append(fields, employee.FieldAPIKey)
|
|
|
}
|
|
|
+ if m.ai_info != nil {
|
|
|
+ fields = append(fields, employee.FieldAiInfo)
|
|
|
+ }
|
|
|
+ if m.is_vip != nil {
|
|
|
+ fields = append(fields, employee.FieldIsVip)
|
|
|
+ }
|
|
|
return fields
|
|
|
}
|
|
|
|
|
@@ -9440,6 +9554,10 @@ func (m *EmployeeMutation) Field(name string) (ent.Value, bool) {
|
|
|
return m.APIBase()
|
|
|
case employee.FieldAPIKey:
|
|
|
return m.APIKey()
|
|
|
+ case employee.FieldAiInfo:
|
|
|
+ return m.AiInfo()
|
|
|
+ case employee.FieldIsVip:
|
|
|
+ return m.IsVip()
|
|
|
}
|
|
|
return nil, false
|
|
|
}
|
|
@@ -9489,6 +9607,10 @@ func (m *EmployeeMutation) OldField(ctx context.Context, name string) (ent.Value
|
|
|
return m.OldAPIBase(ctx)
|
|
|
case employee.FieldAPIKey:
|
|
|
return m.OldAPIKey(ctx)
|
|
|
+ case employee.FieldAiInfo:
|
|
|
+ return m.OldAiInfo(ctx)
|
|
|
+ case employee.FieldIsVip:
|
|
|
+ return m.OldIsVip(ctx)
|
|
|
}
|
|
|
return nil, fmt.Errorf("unknown Employee field %s", name)
|
|
|
}
|
|
@@ -9638,6 +9760,20 @@ func (m *EmployeeMutation) SetField(name string, value ent.Value) error {
|
|
|
}
|
|
|
m.SetAPIKey(v)
|
|
|
return nil
|
|
|
+ case employee.FieldAiInfo:
|
|
|
+ v, ok := value.(string)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetAiInfo(v)
|
|
|
+ return nil
|
|
|
+ case employee.FieldIsVip:
|
|
|
+ v, ok := value.(int)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetIsVip(v)
|
|
|
+ return nil
|
|
|
}
|
|
|
return fmt.Errorf("unknown Employee field %s", name)
|
|
|
}
|
|
@@ -9661,6 +9797,9 @@ func (m *EmployeeMutation) AddedFields() []string {
|
|
|
if m.addcategory_id != nil {
|
|
|
fields = append(fields, employee.FieldCategoryID)
|
|
|
}
|
|
|
+ if m.addis_vip != nil {
|
|
|
+ fields = append(fields, employee.FieldIsVip)
|
|
|
+ }
|
|
|
return fields
|
|
|
}
|
|
|
|
|
@@ -9679,6 +9818,8 @@ func (m *EmployeeMutation) AddedField(name string) (ent.Value, bool) {
|
|
|
return m.AddedOrganizationID()
|
|
|
case employee.FieldCategoryID:
|
|
|
return m.AddedCategoryID()
|
|
|
+ case employee.FieldIsVip:
|
|
|
+ return m.AddedIsVip()
|
|
|
}
|
|
|
return nil, false
|
|
|
}
|
|
@@ -9723,6 +9864,13 @@ func (m *EmployeeMutation) AddField(name string, value ent.Value) error {
|
|
|
}
|
|
|
m.AddCategoryID(v)
|
|
|
return nil
|
|
|
+ case employee.FieldIsVip:
|
|
|
+ v, ok := value.(int)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.AddIsVip(v)
|
|
|
+ return nil
|
|
|
}
|
|
|
return fmt.Errorf("unknown Employee numeric field %s", name)
|
|
|
}
|
|
@@ -9734,6 +9882,9 @@ func (m *EmployeeMutation) ClearedFields() []string {
|
|
|
if m.FieldCleared(employee.FieldDeletedAt) {
|
|
|
fields = append(fields, employee.FieldDeletedAt)
|
|
|
}
|
|
|
+ if m.FieldCleared(employee.FieldAiInfo) {
|
|
|
+ fields = append(fields, employee.FieldAiInfo)
|
|
|
+ }
|
|
|
return fields
|
|
|
}
|
|
|
|
|
@@ -9751,6 +9902,9 @@ func (m *EmployeeMutation) ClearField(name string) error {
|
|
|
case employee.FieldDeletedAt:
|
|
|
m.ClearDeletedAt()
|
|
|
return nil
|
|
|
+ case employee.FieldAiInfo:
|
|
|
+ m.ClearAiInfo()
|
|
|
+ return nil
|
|
|
}
|
|
|
return fmt.Errorf("unknown Employee nullable field %s", name)
|
|
|
}
|
|
@@ -9819,6 +9973,12 @@ func (m *EmployeeMutation) ResetField(name string) error {
|
|
|
case employee.FieldAPIKey:
|
|
|
m.ResetAPIKey()
|
|
|
return nil
|
|
|
+ case employee.FieldAiInfo:
|
|
|
+ m.ResetAiInfo()
|
|
|
+ return nil
|
|
|
+ case employee.FieldIsVip:
|
|
|
+ m.ResetIsVip()
|
|
|
+ return nil
|
|
|
}
|
|
|
return fmt.Errorf("unknown Employee field %s", name)
|
|
|
}
|
|
@@ -26670,6 +26830,8 @@ type WxCardUserMutation struct {
|
|
|
open_id *string
|
|
|
union_id *string
|
|
|
session_key *string
|
|
|
+ is_vip *int
|
|
|
+ addis_vip *int
|
|
|
clearedFields map[string]struct{}
|
|
|
done bool
|
|
|
oldValue func(context.Context) (*WxCardUser, error)
|
|
@@ -27225,6 +27387,62 @@ func (m *WxCardUserMutation) ResetSessionKey() {
|
|
|
m.session_key = nil
|
|
|
}
|
|
|
|
|
|
+// SetIsVip sets the "is_vip" field.
|
|
|
+func (m *WxCardUserMutation) SetIsVip(i int) {
|
|
|
+ m.is_vip = &i
|
|
|
+ m.addis_vip = nil
|
|
|
+}
|
|
|
+
|
|
|
+// IsVip returns the value of the "is_vip" field in the mutation.
|
|
|
+func (m *WxCardUserMutation) IsVip() (r int, exists bool) {
|
|
|
+ v := m.is_vip
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// OldIsVip returns the old "is_vip" field's value of the WxCardUser entity.
|
|
|
+// If the WxCardUser 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 *WxCardUserMutation) OldIsVip(ctx context.Context) (v int, err error) {
|
|
|
+ if !m.op.Is(OpUpdateOne) {
|
|
|
+ return v, errors.New("OldIsVip is only allowed on UpdateOne operations")
|
|
|
+ }
|
|
|
+ if m.id == nil || m.oldValue == nil {
|
|
|
+ return v, errors.New("OldIsVip requires an ID field in the mutation")
|
|
|
+ }
|
|
|
+ oldValue, err := m.oldValue(ctx)
|
|
|
+ if err != nil {
|
|
|
+ return v, fmt.Errorf("querying old value for OldIsVip: %w", err)
|
|
|
+ }
|
|
|
+ return oldValue.IsVip, nil
|
|
|
+}
|
|
|
+
|
|
|
+// AddIsVip adds i to the "is_vip" field.
|
|
|
+func (m *WxCardUserMutation) AddIsVip(i int) {
|
|
|
+ if m.addis_vip != nil {
|
|
|
+ *m.addis_vip += i
|
|
|
+ } else {
|
|
|
+ m.addis_vip = &i
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// AddedIsVip returns the value that was added to the "is_vip" field in this mutation.
|
|
|
+func (m *WxCardUserMutation) AddedIsVip() (r int, exists bool) {
|
|
|
+ v := m.addis_vip
|
|
|
+ if v == nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ return *v, true
|
|
|
+}
|
|
|
+
|
|
|
+// ResetIsVip resets all changes to the "is_vip" field.
|
|
|
+func (m *WxCardUserMutation) ResetIsVip() {
|
|
|
+ m.is_vip = nil
|
|
|
+ m.addis_vip = nil
|
|
|
+}
|
|
|
+
|
|
|
// Where appends a list predicates to the WxCardUserMutation builder.
|
|
|
func (m *WxCardUserMutation) Where(ps ...predicate.WxCardUser) {
|
|
|
m.predicates = append(m.predicates, ps...)
|
|
@@ -27259,7 +27477,7 @@ func (m *WxCardUserMutation) Type() string {
|
|
|
// order to get all numeric fields that were incremented/decremented, call
|
|
|
// AddedFields().
|
|
|
func (m *WxCardUserMutation) Fields() []string {
|
|
|
- fields := make([]string, 0, 12)
|
|
|
+ fields := make([]string, 0, 13)
|
|
|
if m.created_at != nil {
|
|
|
fields = append(fields, wxcarduser.FieldCreatedAt)
|
|
|
}
|
|
@@ -27296,6 +27514,9 @@ func (m *WxCardUserMutation) Fields() []string {
|
|
|
if m.session_key != nil {
|
|
|
fields = append(fields, wxcarduser.FieldSessionKey)
|
|
|
}
|
|
|
+ if m.is_vip != nil {
|
|
|
+ fields = append(fields, wxcarduser.FieldIsVip)
|
|
|
+ }
|
|
|
return fields
|
|
|
}
|
|
|
|
|
@@ -27328,6 +27549,8 @@ func (m *WxCardUserMutation) Field(name string) (ent.Value, bool) {
|
|
|
return m.UnionID()
|
|
|
case wxcarduser.FieldSessionKey:
|
|
|
return m.SessionKey()
|
|
|
+ case wxcarduser.FieldIsVip:
|
|
|
+ return m.IsVip()
|
|
|
}
|
|
|
return nil, false
|
|
|
}
|
|
@@ -27361,6 +27584,8 @@ func (m *WxCardUserMutation) OldField(ctx context.Context, name string) (ent.Val
|
|
|
return m.OldUnionID(ctx)
|
|
|
case wxcarduser.FieldSessionKey:
|
|
|
return m.OldSessionKey(ctx)
|
|
|
+ case wxcarduser.FieldIsVip:
|
|
|
+ return m.OldIsVip(ctx)
|
|
|
}
|
|
|
return nil, fmt.Errorf("unknown WxCardUser field %s", name)
|
|
|
}
|
|
@@ -27454,6 +27679,13 @@ func (m *WxCardUserMutation) SetField(name string, value ent.Value) error {
|
|
|
}
|
|
|
m.SetSessionKey(v)
|
|
|
return nil
|
|
|
+ case wxcarduser.FieldIsVip:
|
|
|
+ v, ok := value.(int)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.SetIsVip(v)
|
|
|
+ return nil
|
|
|
}
|
|
|
return fmt.Errorf("unknown WxCardUser field %s", name)
|
|
|
}
|
|
@@ -27461,13 +27693,21 @@ func (m *WxCardUserMutation) SetField(name string, value ent.Value) error {
|
|
|
// AddedFields returns all numeric fields that were incremented/decremented during
|
|
|
// this mutation.
|
|
|
func (m *WxCardUserMutation) AddedFields() []string {
|
|
|
- return nil
|
|
|
+ var fields []string
|
|
|
+ if m.addis_vip != nil {
|
|
|
+ fields = append(fields, wxcarduser.FieldIsVip)
|
|
|
+ }
|
|
|
+ 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 *WxCardUserMutation) AddedField(name string) (ent.Value, bool) {
|
|
|
+ switch name {
|
|
|
+ case wxcarduser.FieldIsVip:
|
|
|
+ return m.AddedIsVip()
|
|
|
+ }
|
|
|
return nil, false
|
|
|
}
|
|
|
|
|
@@ -27476,6 +27716,13 @@ func (m *WxCardUserMutation) AddedField(name string) (ent.Value, bool) {
|
|
|
// type.
|
|
|
func (m *WxCardUserMutation) AddField(name string, value ent.Value) error {
|
|
|
switch name {
|
|
|
+ case wxcarduser.FieldIsVip:
|
|
|
+ v, ok := value.(int)
|
|
|
+ if !ok {
|
|
|
+ return fmt.Errorf("unexpected type %T for field %s", value, name)
|
|
|
+ }
|
|
|
+ m.AddIsVip(v)
|
|
|
+ return nil
|
|
|
}
|
|
|
return fmt.Errorf("unknown WxCardUser numeric field %s", name)
|
|
|
}
|
|
@@ -27548,6 +27795,9 @@ func (m *WxCardUserMutation) ResetField(name string) error {
|
|
|
case wxcarduser.FieldSessionKey:
|
|
|
m.ResetSessionKey()
|
|
|
return nil
|
|
|
+ case wxcarduser.FieldIsVip:
|
|
|
+ m.ResetIsVip()
|
|
|
+ return nil
|
|
|
}
|
|
|
return fmt.Errorf("unknown WxCardUser field %s", name)
|
|
|
}
|