jimmyyem 5 месяцев назад
Родитель
Сommit
3a8fc522cf

+ 7 - 0
desc/wechat/employee.api

@@ -59,6 +59,13 @@ type (
 
 		ApiBase *string `json:"apiBase,optional"`
 		ApiKey *string `json:"apiKey,optional"`
+
+		// AI信息
+		AiInfo  *string `json:"aiInfo,optional"`
+
+		ShowChat *bool `json:"showChat,optional"`
+		ShowAi *bool `json:"showAi,optional"`
+		IsVip *bool `json:"isVip,optional"`
     }
 
     // The response data of employee list | Employee列表数据

+ 3 - 2
desc/wechat/wx_card.api

@@ -48,8 +48,9 @@ type (
         // 个人介绍 
         Intro  *string `json:"intro,optional"`
 	
-		ShowChat *bool `json:"showChat"`
-		ShowAi *bool `json:"showAi"`
+		ShowChat *bool `json:"showChat,optioal"`
+		ShowAi *bool `json:"showAi,optional"`
+		IsVip *bool `json:"isVip,optional"`
     }
 
 	WxCardSimpleInfo {

+ 9 - 0
desc/wechat/wx_card_user.api

@@ -25,6 +25,15 @@ type (
 
         // OpenID 
         OpenId  *string `json:"openId,optional"`
+
+		// UnionID
+		UnionId  *string `json:"unionId,optional"`
+
+		// SessionKey
+		SessionKey  *string `json:"sessionKey,optional"`
+
+		// IsVip
+		IsVip  *string `json:"isVip,optional"`
     }
 
     // The response data of wx card user list | WxCardUser列表数据

+ 24 - 2
ent/employee.go

@@ -57,6 +57,10 @@ type Employee struct {
 	APIBase string `json:"api_base,omitempty"`
 	// api_key
 	APIKey string `json:"api_key,omitempty"`
+	// AI信息
+	AiInfo string `json:"ai_info,omitempty"`
+	// 是否VIP:0-否 1-是
+	IsVip int `json:"is_vip,omitempty"`
 	// Edges holds the relations/edges for other nodes in the graph.
 	// The values are being populated by the EmployeeQuery when eager-loading is set.
 	Edges        EmployeeEdges `json:"edges"`
@@ -97,9 +101,9 @@ func (*Employee) scanValues(columns []string) ([]any, error) {
 	values := make([]any, len(columns))
 	for i := range columns {
 		switch columns[i] {
-		case employee.FieldID, employee.FieldHireCount, employee.FieldServiceCount, employee.FieldAchievementCount, employee.FieldOrganizationID, employee.FieldCategoryID:
+		case employee.FieldID, employee.FieldHireCount, employee.FieldServiceCount, employee.FieldAchievementCount, employee.FieldOrganizationID, employee.FieldCategoryID, employee.FieldIsVip:
 			values[i] = new(sql.NullInt64)
-		case employee.FieldTitle, employee.FieldAvatar, employee.FieldTags, employee.FieldIntro, employee.FieldEstimate, employee.FieldSkill, employee.FieldAbilityType, employee.FieldScene, employee.FieldSwitchIn, employee.FieldVideoURL, employee.FieldAPIBase, employee.FieldAPIKey:
+		case employee.FieldTitle, employee.FieldAvatar, employee.FieldTags, employee.FieldIntro, employee.FieldEstimate, employee.FieldSkill, employee.FieldAbilityType, employee.FieldScene, employee.FieldSwitchIn, employee.FieldVideoURL, employee.FieldAPIBase, employee.FieldAPIKey, employee.FieldAiInfo:
 			values[i] = new(sql.NullString)
 		case employee.FieldCreatedAt, employee.FieldUpdatedAt, employee.FieldDeletedAt:
 			values[i] = new(sql.NullTime)
@@ -244,6 +248,18 @@ func (e *Employee) assignValues(columns []string, values []any) error {
 			} else if value.Valid {
 				e.APIKey = value.String
 			}
+		case employee.FieldAiInfo:
+			if value, ok := values[i].(*sql.NullString); !ok {
+				return fmt.Errorf("unexpected type %T for field ai_info", values[i])
+			} else if value.Valid {
+				e.AiInfo = value.String
+			}
+		case employee.FieldIsVip:
+			if value, ok := values[i].(*sql.NullInt64); !ok {
+				return fmt.Errorf("unexpected type %T for field is_vip", values[i])
+			} else if value.Valid {
+				e.IsVip = int(value.Int64)
+			}
 		default:
 			e.selectValues.Set(columns[i], values[i])
 		}
@@ -349,6 +365,12 @@ func (e *Employee) String() string {
 	builder.WriteString(", ")
 	builder.WriteString("api_key=")
 	builder.WriteString(e.APIKey)
+	builder.WriteString(", ")
+	builder.WriteString("ai_info=")
+	builder.WriteString(e.AiInfo)
+	builder.WriteString(", ")
+	builder.WriteString("is_vip=")
+	builder.WriteString(fmt.Sprintf("%v", e.IsVip))
 	builder.WriteByte(')')
 	return builder.String()
 }

+ 18 - 0
ent/employee/employee.go

@@ -55,6 +55,10 @@ const (
 	FieldAPIBase = "api_base"
 	// FieldAPIKey holds the string denoting the api_key field in the database.
 	FieldAPIKey = "api_key"
+	// FieldAiInfo holds the string denoting the ai_info field in the database.
+	FieldAiInfo = "ai_info"
+	// FieldIsVip holds the string denoting the is_vip field in the database.
+	FieldIsVip = "is_vip"
 	// EdgeEmWorkExperiences holds the string denoting the em_work_experiences edge name in mutations.
 	EdgeEmWorkExperiences = "em_work_experiences"
 	// EdgeEmTutorial holds the string denoting the em_tutorial edge name in mutations.
@@ -100,6 +104,8 @@ var Columns = []string{
 	FieldCategoryID,
 	FieldAPIBase,
 	FieldAPIKey,
+	FieldAiInfo,
+	FieldIsVip,
 }
 
 // ValidColumn reports if the column name is valid (part of the table columns).
@@ -174,6 +180,8 @@ var (
 	DefaultAPIBase string
 	// DefaultAPIKey holds the default value on creation for the "api_key" field.
 	DefaultAPIKey string
+	// DefaultIsVip holds the default value on creation for the "is_vip" field.
+	DefaultIsVip int
 )
 
 // OrderOption defines the ordering options for the Employee queries.
@@ -284,6 +292,16 @@ func ByAPIKey(opts ...sql.OrderTermOption) OrderOption {
 	return sql.OrderByField(FieldAPIKey, opts...).ToFunc()
 }
 
+// ByAiInfo orders the results by the ai_info field.
+func ByAiInfo(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldAiInfo, opts...).ToFunc()
+}
+
+// ByIsVip orders the results by the is_vip field.
+func ByIsVip(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldIsVip, opts...).ToFunc()
+}
+
 // ByEmWorkExperiencesCount orders the results by em_work_experiences count.
 func ByEmWorkExperiencesCount(opts ...sql.OrderTermOption) OrderOption {
 	return func(s *sql.Selector) {

+ 125 - 0
ent/employee/where.go

@@ -155,6 +155,16 @@ func APIKey(v string) predicate.Employee {
 	return predicate.Employee(sql.FieldEQ(FieldAPIKey, v))
 }
 
+// AiInfo applies equality check predicate on the "ai_info" field. It's identical to AiInfoEQ.
+func AiInfo(v string) predicate.Employee {
+	return predicate.Employee(sql.FieldEQ(FieldAiInfo, v))
+}
+
+// IsVip applies equality check predicate on the "is_vip" field. It's identical to IsVipEQ.
+func IsVip(v int) predicate.Employee {
+	return predicate.Employee(sql.FieldEQ(FieldIsVip, v))
+}
+
 // CreatedAtEQ applies the EQ predicate on the "created_at" field.
 func CreatedAtEQ(v time.Time) predicate.Employee {
 	return predicate.Employee(sql.FieldEQ(FieldCreatedAt, v))
@@ -1265,6 +1275,121 @@ func APIKeyContainsFold(v string) predicate.Employee {
 	return predicate.Employee(sql.FieldContainsFold(FieldAPIKey, v))
 }
 
+// AiInfoEQ applies the EQ predicate on the "ai_info" field.
+func AiInfoEQ(v string) predicate.Employee {
+	return predicate.Employee(sql.FieldEQ(FieldAiInfo, v))
+}
+
+// AiInfoNEQ applies the NEQ predicate on the "ai_info" field.
+func AiInfoNEQ(v string) predicate.Employee {
+	return predicate.Employee(sql.FieldNEQ(FieldAiInfo, v))
+}
+
+// AiInfoIn applies the In predicate on the "ai_info" field.
+func AiInfoIn(vs ...string) predicate.Employee {
+	return predicate.Employee(sql.FieldIn(FieldAiInfo, vs...))
+}
+
+// AiInfoNotIn applies the NotIn predicate on the "ai_info" field.
+func AiInfoNotIn(vs ...string) predicate.Employee {
+	return predicate.Employee(sql.FieldNotIn(FieldAiInfo, vs...))
+}
+
+// AiInfoGT applies the GT predicate on the "ai_info" field.
+func AiInfoGT(v string) predicate.Employee {
+	return predicate.Employee(sql.FieldGT(FieldAiInfo, v))
+}
+
+// AiInfoGTE applies the GTE predicate on the "ai_info" field.
+func AiInfoGTE(v string) predicate.Employee {
+	return predicate.Employee(sql.FieldGTE(FieldAiInfo, v))
+}
+
+// AiInfoLT applies the LT predicate on the "ai_info" field.
+func AiInfoLT(v string) predicate.Employee {
+	return predicate.Employee(sql.FieldLT(FieldAiInfo, v))
+}
+
+// AiInfoLTE applies the LTE predicate on the "ai_info" field.
+func AiInfoLTE(v string) predicate.Employee {
+	return predicate.Employee(sql.FieldLTE(FieldAiInfo, v))
+}
+
+// AiInfoContains applies the Contains predicate on the "ai_info" field.
+func AiInfoContains(v string) predicate.Employee {
+	return predicate.Employee(sql.FieldContains(FieldAiInfo, v))
+}
+
+// AiInfoHasPrefix applies the HasPrefix predicate on the "ai_info" field.
+func AiInfoHasPrefix(v string) predicate.Employee {
+	return predicate.Employee(sql.FieldHasPrefix(FieldAiInfo, v))
+}
+
+// AiInfoHasSuffix applies the HasSuffix predicate on the "ai_info" field.
+func AiInfoHasSuffix(v string) predicate.Employee {
+	return predicate.Employee(sql.FieldHasSuffix(FieldAiInfo, v))
+}
+
+// AiInfoIsNil applies the IsNil predicate on the "ai_info" field.
+func AiInfoIsNil() predicate.Employee {
+	return predicate.Employee(sql.FieldIsNull(FieldAiInfo))
+}
+
+// AiInfoNotNil applies the NotNil predicate on the "ai_info" field.
+func AiInfoNotNil() predicate.Employee {
+	return predicate.Employee(sql.FieldNotNull(FieldAiInfo))
+}
+
+// AiInfoEqualFold applies the EqualFold predicate on the "ai_info" field.
+func AiInfoEqualFold(v string) predicate.Employee {
+	return predicate.Employee(sql.FieldEqualFold(FieldAiInfo, v))
+}
+
+// AiInfoContainsFold applies the ContainsFold predicate on the "ai_info" field.
+func AiInfoContainsFold(v string) predicate.Employee {
+	return predicate.Employee(sql.FieldContainsFold(FieldAiInfo, v))
+}
+
+// IsVipEQ applies the EQ predicate on the "is_vip" field.
+func IsVipEQ(v int) predicate.Employee {
+	return predicate.Employee(sql.FieldEQ(FieldIsVip, v))
+}
+
+// IsVipNEQ applies the NEQ predicate on the "is_vip" field.
+func IsVipNEQ(v int) predicate.Employee {
+	return predicate.Employee(sql.FieldNEQ(FieldIsVip, v))
+}
+
+// IsVipIn applies the In predicate on the "is_vip" field.
+func IsVipIn(vs ...int) predicate.Employee {
+	return predicate.Employee(sql.FieldIn(FieldIsVip, vs...))
+}
+
+// IsVipNotIn applies the NotIn predicate on the "is_vip" field.
+func IsVipNotIn(vs ...int) predicate.Employee {
+	return predicate.Employee(sql.FieldNotIn(FieldIsVip, vs...))
+}
+
+// IsVipGT applies the GT predicate on the "is_vip" field.
+func IsVipGT(v int) predicate.Employee {
+	return predicate.Employee(sql.FieldGT(FieldIsVip, v))
+}
+
+// IsVipGTE applies the GTE predicate on the "is_vip" field.
+func IsVipGTE(v int) predicate.Employee {
+	return predicate.Employee(sql.FieldGTE(FieldIsVip, v))
+}
+
+// IsVipLT applies the LT predicate on the "is_vip" field.
+func IsVipLT(v int) predicate.Employee {
+	return predicate.Employee(sql.FieldLT(FieldIsVip, v))
+}
+
+// IsVipLTE applies the LTE predicate on the "is_vip" field.
+func IsVipLTE(v int) predicate.Employee {
+	return predicate.Employee(sql.FieldLTE(FieldIsVip, v))
+}
+
 // HasEmWorkExperiences applies the HasEdge predicate on the "em_work_experiences" edge.
 func HasEmWorkExperiences() predicate.Employee {
 	return predicate.Employee(func(s *sql.Selector) {

+ 163 - 0
ent/employee_create.go

@@ -264,6 +264,34 @@ func (ec *EmployeeCreate) SetNillableAPIKey(s *string) *EmployeeCreate {
 	return ec
 }
 
+// SetAiInfo sets the "ai_info" field.
+func (ec *EmployeeCreate) SetAiInfo(s string) *EmployeeCreate {
+	ec.mutation.SetAiInfo(s)
+	return ec
+}
+
+// SetNillableAiInfo sets the "ai_info" field if the given value is not nil.
+func (ec *EmployeeCreate) SetNillableAiInfo(s *string) *EmployeeCreate {
+	if s != nil {
+		ec.SetAiInfo(*s)
+	}
+	return ec
+}
+
+// SetIsVip sets the "is_vip" field.
+func (ec *EmployeeCreate) SetIsVip(i int) *EmployeeCreate {
+	ec.mutation.SetIsVip(i)
+	return ec
+}
+
+// SetNillableIsVip sets the "is_vip" field if the given value is not nil.
+func (ec *EmployeeCreate) SetNillableIsVip(i *int) *EmployeeCreate {
+	if i != nil {
+		ec.SetIsVip(*i)
+	}
+	return ec
+}
+
 // SetID sets the "id" field.
 func (ec *EmployeeCreate) SetID(u uint64) *EmployeeCreate {
 	ec.mutation.SetID(u)
@@ -399,6 +427,10 @@ func (ec *EmployeeCreate) defaults() error {
 		v := employee.DefaultAPIKey
 		ec.mutation.SetAPIKey(v)
 	}
+	if _, ok := ec.mutation.IsVip(); !ok {
+		v := employee.DefaultIsVip
+		ec.mutation.SetIsVip(v)
+	}
 	return nil
 }
 
@@ -521,6 +553,9 @@ func (ec *EmployeeCreate) check() error {
 	if _, ok := ec.mutation.APIKey(); !ok {
 		return &ValidationError{Name: "api_key", err: errors.New(`ent: missing required field "Employee.api_key"`)}
 	}
+	if _, ok := ec.mutation.IsVip(); !ok {
+		return &ValidationError{Name: "is_vip", err: errors.New(`ent: missing required field "Employee.is_vip"`)}
+	}
 	return nil
 }
 
@@ -634,6 +669,14 @@ func (ec *EmployeeCreate) createSpec() (*Employee, *sqlgraph.CreateSpec) {
 		_spec.SetField(employee.FieldAPIKey, field.TypeString, value)
 		_node.APIKey = value
 	}
+	if value, ok := ec.mutation.AiInfo(); ok {
+		_spec.SetField(employee.FieldAiInfo, field.TypeString, value)
+		_node.AiInfo = value
+	}
+	if value, ok := ec.mutation.IsVip(); ok {
+		_spec.SetField(employee.FieldIsVip, field.TypeInt, value)
+		_node.IsVip = value
+	}
 	if nodes := ec.mutation.EmWorkExperiencesIDs(); len(nodes) > 0 {
 		edge := &sqlgraph.EdgeSpec{
 			Rel:     sqlgraph.O2M,
@@ -982,6 +1025,42 @@ func (u *EmployeeUpsert) UpdateAPIKey() *EmployeeUpsert {
 	return u
 }
 
+// SetAiInfo sets the "ai_info" field.
+func (u *EmployeeUpsert) SetAiInfo(v string) *EmployeeUpsert {
+	u.Set(employee.FieldAiInfo, v)
+	return u
+}
+
+// UpdateAiInfo sets the "ai_info" field to the value that was provided on create.
+func (u *EmployeeUpsert) UpdateAiInfo() *EmployeeUpsert {
+	u.SetExcluded(employee.FieldAiInfo)
+	return u
+}
+
+// ClearAiInfo clears the value of the "ai_info" field.
+func (u *EmployeeUpsert) ClearAiInfo() *EmployeeUpsert {
+	u.SetNull(employee.FieldAiInfo)
+	return u
+}
+
+// SetIsVip sets the "is_vip" field.
+func (u *EmployeeUpsert) SetIsVip(v int) *EmployeeUpsert {
+	u.Set(employee.FieldIsVip, v)
+	return u
+}
+
+// UpdateIsVip sets the "is_vip" field to the value that was provided on create.
+func (u *EmployeeUpsert) UpdateIsVip() *EmployeeUpsert {
+	u.SetExcluded(employee.FieldIsVip)
+	return u
+}
+
+// AddIsVip adds v to the "is_vip" field.
+func (u *EmployeeUpsert) AddIsVip(v int) *EmployeeUpsert {
+	u.Add(employee.FieldIsVip, v)
+	return u
+}
+
 // UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field.
 // Using this option is equivalent to using:
 //
@@ -1341,6 +1420,48 @@ func (u *EmployeeUpsertOne) UpdateAPIKey() *EmployeeUpsertOne {
 	})
 }
 
+// SetAiInfo sets the "ai_info" field.
+func (u *EmployeeUpsertOne) SetAiInfo(v string) *EmployeeUpsertOne {
+	return u.Update(func(s *EmployeeUpsert) {
+		s.SetAiInfo(v)
+	})
+}
+
+// UpdateAiInfo sets the "ai_info" field to the value that was provided on create.
+func (u *EmployeeUpsertOne) UpdateAiInfo() *EmployeeUpsertOne {
+	return u.Update(func(s *EmployeeUpsert) {
+		s.UpdateAiInfo()
+	})
+}
+
+// ClearAiInfo clears the value of the "ai_info" field.
+func (u *EmployeeUpsertOne) ClearAiInfo() *EmployeeUpsertOne {
+	return u.Update(func(s *EmployeeUpsert) {
+		s.ClearAiInfo()
+	})
+}
+
+// SetIsVip sets the "is_vip" field.
+func (u *EmployeeUpsertOne) SetIsVip(v int) *EmployeeUpsertOne {
+	return u.Update(func(s *EmployeeUpsert) {
+		s.SetIsVip(v)
+	})
+}
+
+// AddIsVip adds v to the "is_vip" field.
+func (u *EmployeeUpsertOne) AddIsVip(v int) *EmployeeUpsertOne {
+	return u.Update(func(s *EmployeeUpsert) {
+		s.AddIsVip(v)
+	})
+}
+
+// UpdateIsVip sets the "is_vip" field to the value that was provided on create.
+func (u *EmployeeUpsertOne) UpdateIsVip() *EmployeeUpsertOne {
+	return u.Update(func(s *EmployeeUpsert) {
+		s.UpdateIsVip()
+	})
+}
+
 // Exec executes the query.
 func (u *EmployeeUpsertOne) Exec(ctx context.Context) error {
 	if len(u.create.conflict) == 0 {
@@ -1866,6 +1987,48 @@ func (u *EmployeeUpsertBulk) UpdateAPIKey() *EmployeeUpsertBulk {
 	})
 }
 
+// SetAiInfo sets the "ai_info" field.
+func (u *EmployeeUpsertBulk) SetAiInfo(v string) *EmployeeUpsertBulk {
+	return u.Update(func(s *EmployeeUpsert) {
+		s.SetAiInfo(v)
+	})
+}
+
+// UpdateAiInfo sets the "ai_info" field to the value that was provided on create.
+func (u *EmployeeUpsertBulk) UpdateAiInfo() *EmployeeUpsertBulk {
+	return u.Update(func(s *EmployeeUpsert) {
+		s.UpdateAiInfo()
+	})
+}
+
+// ClearAiInfo clears the value of the "ai_info" field.
+func (u *EmployeeUpsertBulk) ClearAiInfo() *EmployeeUpsertBulk {
+	return u.Update(func(s *EmployeeUpsert) {
+		s.ClearAiInfo()
+	})
+}
+
+// SetIsVip sets the "is_vip" field.
+func (u *EmployeeUpsertBulk) SetIsVip(v int) *EmployeeUpsertBulk {
+	return u.Update(func(s *EmployeeUpsert) {
+		s.SetIsVip(v)
+	})
+}
+
+// AddIsVip adds v to the "is_vip" field.
+func (u *EmployeeUpsertBulk) AddIsVip(v int) *EmployeeUpsertBulk {
+	return u.Update(func(s *EmployeeUpsert) {
+		s.AddIsVip(v)
+	})
+}
+
+// UpdateIsVip sets the "is_vip" field to the value that was provided on create.
+func (u *EmployeeUpsertBulk) UpdateIsVip() *EmployeeUpsertBulk {
+	return u.Update(func(s *EmployeeUpsert) {
+		s.UpdateIsVip()
+	})
+}
+
 // Exec executes the query.
 func (u *EmployeeUpsertBulk) Exec(ctx context.Context) error {
 	if u.create.err != nil {

+ 106 - 0
ent/employee_update.go

@@ -329,6 +329,47 @@ func (eu *EmployeeUpdate) SetNillableAPIKey(s *string) *EmployeeUpdate {
 	return eu
 }
 
+// SetAiInfo sets the "ai_info" field.
+func (eu *EmployeeUpdate) SetAiInfo(s string) *EmployeeUpdate {
+	eu.mutation.SetAiInfo(s)
+	return eu
+}
+
+// SetNillableAiInfo sets the "ai_info" field if the given value is not nil.
+func (eu *EmployeeUpdate) SetNillableAiInfo(s *string) *EmployeeUpdate {
+	if s != nil {
+		eu.SetAiInfo(*s)
+	}
+	return eu
+}
+
+// ClearAiInfo clears the value of the "ai_info" field.
+func (eu *EmployeeUpdate) ClearAiInfo() *EmployeeUpdate {
+	eu.mutation.ClearAiInfo()
+	return eu
+}
+
+// SetIsVip sets the "is_vip" field.
+func (eu *EmployeeUpdate) SetIsVip(i int) *EmployeeUpdate {
+	eu.mutation.ResetIsVip()
+	eu.mutation.SetIsVip(i)
+	return eu
+}
+
+// SetNillableIsVip sets the "is_vip" field if the given value is not nil.
+func (eu *EmployeeUpdate) SetNillableIsVip(i *int) *EmployeeUpdate {
+	if i != nil {
+		eu.SetIsVip(*i)
+	}
+	return eu
+}
+
+// AddIsVip adds i to the "is_vip" field.
+func (eu *EmployeeUpdate) AddIsVip(i int) *EmployeeUpdate {
+	eu.mutation.AddIsVip(i)
+	return eu
+}
+
 // AddEmWorkExperienceIDs adds the "em_work_experiences" edge to the WorkExperience entity by IDs.
 func (eu *EmployeeUpdate) AddEmWorkExperienceIDs(ids ...uint64) *EmployeeUpdate {
 	eu.mutation.AddEmWorkExperienceIDs(ids...)
@@ -600,6 +641,18 @@ func (eu *EmployeeUpdate) sqlSave(ctx context.Context) (n int, err error) {
 	if value, ok := eu.mutation.APIKey(); ok {
 		_spec.SetField(employee.FieldAPIKey, field.TypeString, value)
 	}
+	if value, ok := eu.mutation.AiInfo(); ok {
+		_spec.SetField(employee.FieldAiInfo, field.TypeString, value)
+	}
+	if eu.mutation.AiInfoCleared() {
+		_spec.ClearField(employee.FieldAiInfo, field.TypeString)
+	}
+	if value, ok := eu.mutation.IsVip(); ok {
+		_spec.SetField(employee.FieldIsVip, field.TypeInt, value)
+	}
+	if value, ok := eu.mutation.AddedIsVip(); ok {
+		_spec.AddField(employee.FieldIsVip, field.TypeInt, value)
+	}
 	if eu.mutation.EmWorkExperiencesCleared() {
 		edge := &sqlgraph.EdgeSpec{
 			Rel:     sqlgraph.O2M,
@@ -1009,6 +1062,47 @@ func (euo *EmployeeUpdateOne) SetNillableAPIKey(s *string) *EmployeeUpdateOne {
 	return euo
 }
 
+// SetAiInfo sets the "ai_info" field.
+func (euo *EmployeeUpdateOne) SetAiInfo(s string) *EmployeeUpdateOne {
+	euo.mutation.SetAiInfo(s)
+	return euo
+}
+
+// SetNillableAiInfo sets the "ai_info" field if the given value is not nil.
+func (euo *EmployeeUpdateOne) SetNillableAiInfo(s *string) *EmployeeUpdateOne {
+	if s != nil {
+		euo.SetAiInfo(*s)
+	}
+	return euo
+}
+
+// ClearAiInfo clears the value of the "ai_info" field.
+func (euo *EmployeeUpdateOne) ClearAiInfo() *EmployeeUpdateOne {
+	euo.mutation.ClearAiInfo()
+	return euo
+}
+
+// SetIsVip sets the "is_vip" field.
+func (euo *EmployeeUpdateOne) SetIsVip(i int) *EmployeeUpdateOne {
+	euo.mutation.ResetIsVip()
+	euo.mutation.SetIsVip(i)
+	return euo
+}
+
+// SetNillableIsVip sets the "is_vip" field if the given value is not nil.
+func (euo *EmployeeUpdateOne) SetNillableIsVip(i *int) *EmployeeUpdateOne {
+	if i != nil {
+		euo.SetIsVip(*i)
+	}
+	return euo
+}
+
+// AddIsVip adds i to the "is_vip" field.
+func (euo *EmployeeUpdateOne) AddIsVip(i int) *EmployeeUpdateOne {
+	euo.mutation.AddIsVip(i)
+	return euo
+}
+
 // AddEmWorkExperienceIDs adds the "em_work_experiences" edge to the WorkExperience entity by IDs.
 func (euo *EmployeeUpdateOne) AddEmWorkExperienceIDs(ids ...uint64) *EmployeeUpdateOne {
 	euo.mutation.AddEmWorkExperienceIDs(ids...)
@@ -1310,6 +1404,18 @@ func (euo *EmployeeUpdateOne) sqlSave(ctx context.Context) (_node *Employee, err
 	if value, ok := euo.mutation.APIKey(); ok {
 		_spec.SetField(employee.FieldAPIKey, field.TypeString, value)
 	}
+	if value, ok := euo.mutation.AiInfo(); ok {
+		_spec.SetField(employee.FieldAiInfo, field.TypeString, value)
+	}
+	if euo.mutation.AiInfoCleared() {
+		_spec.ClearField(employee.FieldAiInfo, field.TypeString)
+	}
+	if value, ok := euo.mutation.IsVip(); ok {
+		_spec.SetField(employee.FieldIsVip, field.TypeInt, value)
+	}
+	if value, ok := euo.mutation.AddedIsVip(); ok {
+		_spec.AddField(employee.FieldIsVip, field.TypeInt, value)
+	}
 	if euo.mutation.EmWorkExperiencesCleared() {
 		edge := &sqlgraph.EdgeSpec{
 			Rel:     sqlgraph.O2M,

+ 3 - 0
ent/migrate/schema.go

@@ -248,6 +248,8 @@ var (
 		{Name: "category_id", Type: field.TypeUint64, Comment: "category_id | 分类ID"},
 		{Name: "api_base", Type: field.TypeString, Comment: "api_base", Default: ""},
 		{Name: "api_key", Type: field.TypeString, Comment: "api_key", Default: ""},
+		{Name: "ai_info", Type: field.TypeString, Nullable: true, Comment: "AI信息"},
+		{Name: "is_vip", Type: field.TypeInt, Comment: "是否VIP:0-否 1-是", Default: 0},
 	}
 	// EmployeeTable holds the schema information for the "employee" table.
 	EmployeeTable = &schema.Table{
@@ -823,6 +825,7 @@ var (
 		{Name: "open_id", Type: field.TypeString, Comment: "OpenID", Default: ""},
 		{Name: "union_id", Type: field.TypeString, Comment: "UnionID", Default: ""},
 		{Name: "session_key", Type: field.TypeString, Comment: "SessionKey", Default: ""},
+		{Name: "is_vip", Type: field.TypeInt, Comment: "是否VIP:0-否 1-是", Default: 0},
 	}
 	// WxCardUserTable holds the schema information for the "wx_card_user" table.
 	WxCardUserTable = &schema.Table{

+ 253 - 3
ent/mutation.go

@@ -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)
 }

+ 8 - 0
ent/runtime/runtime.go

@@ -445,6 +445,10 @@ func init() {
 	employeeDescAPIKey := employeeFields[16].Descriptor()
 	// employee.DefaultAPIKey holds the default value on creation for the api_key field.
 	employee.DefaultAPIKey = employeeDescAPIKey.Default.(string)
+	// employeeDescIsVip is the schema descriptor for is_vip field.
+	employeeDescIsVip := employeeFields[18].Descriptor()
+	// employee.DefaultIsVip holds the default value on creation for the is_vip field.
+	employee.DefaultIsVip = employeeDescIsVip.Default.(int)
 	employeeconfigMixin := schema.EmployeeConfig{}.Mixin()
 	employeeconfigMixinHooks1 := employeeconfigMixin[1].Hooks()
 	employeeconfig.Hooks[0] = employeeconfigMixinHooks1[0]
@@ -1068,6 +1072,10 @@ func init() {
 	wxcarduserDescSessionKey := wxcarduserFields[8].Descriptor()
 	// wxcarduser.DefaultSessionKey holds the default value on creation for the session_key field.
 	wxcarduser.DefaultSessionKey = wxcarduserDescSessionKey.Default.(string)
+	// wxcarduserDescIsVip is the schema descriptor for is_vip field.
+	wxcarduserDescIsVip := wxcarduserFields[9].Descriptor()
+	// wxcarduser.DefaultIsVip holds the default value on creation for the is_vip field.
+	wxcarduser.DefaultIsVip = wxcarduserDescIsVip.Default.(int)
 	wxcardvisitMixin := schema.WxCardVisit{}.Mixin()
 	wxcardvisitMixinHooks1 := wxcardvisitMixin[1].Hooks()
 	wxcardvisit.Hooks[0] = wxcardvisitMixinHooks1[0]

+ 2 - 0
ent/schema/employee.go

@@ -35,6 +35,8 @@ func (Employee) Fields() []ent.Field {
 		field.Uint64("category_id").Positive().Comment("category_id | 分类ID"),
 		field.String("api_base").Default("").Comment("api_base"),
 		field.String("api_key").Default("").Comment("api_key"),
+		field.String("ai_info").Optional().Comment("AI信息"),
+		field.Int("is_vip").Default(0).Comment("是否VIP:0-否 1-是"),
 	}
 }
 

+ 1 - 0
ent/schema/wx_card_user.go

@@ -26,6 +26,7 @@ func (WxCardUser) Fields() []ent.Field {
 		field.String("open_id").Default("").Comment("OpenID"),
 		field.String("union_id").Default("").Comment("UnionID"),
 		field.String("session_key").Default("").Comment("SessionKey"),
+		field.Int("is_vip").Default(0).Comment("是否VIP:0-否 1-是"),
 	}
 }
 

+ 72 - 0
ent/set_not_nil.go

@@ -2216,6 +2216,54 @@ func (e *EmployeeCreate) SetNotNilAPIKey(value *string) *EmployeeCreate {
 }
 
 // set field if value's pointer is not nil.
+func (e *EmployeeUpdate) SetNotNilAiInfo(value *string) *EmployeeUpdate {
+	if value != nil {
+		return e.SetAiInfo(*value)
+	}
+	return e
+}
+
+// set field if value's pointer is not nil.
+func (e *EmployeeUpdateOne) SetNotNilAiInfo(value *string) *EmployeeUpdateOne {
+	if value != nil {
+		return e.SetAiInfo(*value)
+	}
+	return e
+}
+
+// set field if value's pointer is not nil.
+func (e *EmployeeCreate) SetNotNilAiInfo(value *string) *EmployeeCreate {
+	if value != nil {
+		return e.SetAiInfo(*value)
+	}
+	return e
+}
+
+// set field if value's pointer is not nil.
+func (e *EmployeeUpdate) SetNotNilIsVip(value *int) *EmployeeUpdate {
+	if value != nil {
+		return e.SetIsVip(*value)
+	}
+	return e
+}
+
+// set field if value's pointer is not nil.
+func (e *EmployeeUpdateOne) SetNotNilIsVip(value *int) *EmployeeUpdateOne {
+	if value != nil {
+		return e.SetIsVip(*value)
+	}
+	return e
+}
+
+// set field if value's pointer is not nil.
+func (e *EmployeeCreate) SetNotNilIsVip(value *int) *EmployeeCreate {
+	if value != nil {
+		return e.SetIsVip(*value)
+	}
+	return e
+}
+
+// set field if value's pointer is not nil.
 func (ec *EmployeeConfigUpdate) SetNotNilUpdatedAt(value *time.Time) *EmployeeConfigUpdate {
 	if value != nil {
 		return ec.SetUpdatedAt(*value)
@@ -6008,6 +6056,30 @@ func (wcu *WxCardUserCreate) SetNotNilSessionKey(value *string) *WxCardUserCreat
 }
 
 // set field if value's pointer is not nil.
+func (wcu *WxCardUserUpdate) SetNotNilIsVip(value *int) *WxCardUserUpdate {
+	if value != nil {
+		return wcu.SetIsVip(*value)
+	}
+	return wcu
+}
+
+// set field if value's pointer is not nil.
+func (wcu *WxCardUserUpdateOne) SetNotNilIsVip(value *int) *WxCardUserUpdateOne {
+	if value != nil {
+		return wcu.SetIsVip(*value)
+	}
+	return wcu
+}
+
+// set field if value's pointer is not nil.
+func (wcu *WxCardUserCreate) SetNotNilIsVip(value *int) *WxCardUserCreate {
+	if value != nil {
+		return wcu.SetIsVip(*value)
+	}
+	return wcu
+}
+
+// set field if value's pointer is not nil.
 func (wcv *WxCardVisitUpdate) SetNotNilUpdatedAt(value *time.Time) *WxCardVisitUpdate {
 	if value != nil {
 		return wcv.SetUpdatedAt(*value)

+ 13 - 2
ent/wxcarduser.go

@@ -40,7 +40,9 @@ type WxCardUser struct {
 	// UnionID
 	UnionID string `json:"union_id,omitempty"`
 	// SessionKey
-	SessionKey   string `json:"session_key,omitempty"`
+	SessionKey string `json:"session_key,omitempty"`
+	// 是否VIP:0-否 1-是
+	IsVip        int `json:"is_vip,omitempty"`
 	selectValues sql.SelectValues
 }
 
@@ -49,7 +51,7 @@ func (*WxCardUser) scanValues(columns []string) ([]any, error) {
 	values := make([]any, len(columns))
 	for i := range columns {
 		switch columns[i] {
-		case wxcarduser.FieldID:
+		case wxcarduser.FieldID, wxcarduser.FieldIsVip:
 			values[i] = new(sql.NullInt64)
 		case wxcarduser.FieldWxid, wxcarduser.FieldAccount, wxcarduser.FieldAvatar, wxcarduser.FieldNickname, wxcarduser.FieldRemark, wxcarduser.FieldPhone, wxcarduser.FieldOpenID, wxcarduser.FieldUnionID, wxcarduser.FieldSessionKey:
 			values[i] = new(sql.NullString)
@@ -148,6 +150,12 @@ func (wcu *WxCardUser) assignValues(columns []string, values []any) error {
 			} else if value.Valid {
 				wcu.SessionKey = value.String
 			}
+		case wxcarduser.FieldIsVip:
+			if value, ok := values[i].(*sql.NullInt64); !ok {
+				return fmt.Errorf("unexpected type %T for field is_vip", values[i])
+			} else if value.Valid {
+				wcu.IsVip = int(value.Int64)
+			}
 		default:
 			wcu.selectValues.Set(columns[i], values[i])
 		}
@@ -219,6 +227,9 @@ func (wcu *WxCardUser) String() string {
 	builder.WriteString(", ")
 	builder.WriteString("session_key=")
 	builder.WriteString(wcu.SessionKey)
+	builder.WriteString(", ")
+	builder.WriteString("is_vip=")
+	builder.WriteString(fmt.Sprintf("%v", wcu.IsVip))
 	builder.WriteByte(')')
 	return builder.String()
 }

+ 45 - 0
ent/wxcarduser/where.go

@@ -114,6 +114,11 @@ func SessionKey(v string) predicate.WxCardUser {
 	return predicate.WxCardUser(sql.FieldEQ(FieldSessionKey, v))
 }
 
+// IsVip applies equality check predicate on the "is_vip" field. It's identical to IsVipEQ.
+func IsVip(v int) predicate.WxCardUser {
+	return predicate.WxCardUser(sql.FieldEQ(FieldIsVip, v))
+}
+
 // CreatedAtEQ applies the EQ predicate on the "created_at" field.
 func CreatedAtEQ(v time.Time) predicate.WxCardUser {
 	return predicate.WxCardUser(sql.FieldEQ(FieldCreatedAt, v))
@@ -829,6 +834,46 @@ func SessionKeyContainsFold(v string) predicate.WxCardUser {
 	return predicate.WxCardUser(sql.FieldContainsFold(FieldSessionKey, v))
 }
 
+// IsVipEQ applies the EQ predicate on the "is_vip" field.
+func IsVipEQ(v int) predicate.WxCardUser {
+	return predicate.WxCardUser(sql.FieldEQ(FieldIsVip, v))
+}
+
+// IsVipNEQ applies the NEQ predicate on the "is_vip" field.
+func IsVipNEQ(v int) predicate.WxCardUser {
+	return predicate.WxCardUser(sql.FieldNEQ(FieldIsVip, v))
+}
+
+// IsVipIn applies the In predicate on the "is_vip" field.
+func IsVipIn(vs ...int) predicate.WxCardUser {
+	return predicate.WxCardUser(sql.FieldIn(FieldIsVip, vs...))
+}
+
+// IsVipNotIn applies the NotIn predicate on the "is_vip" field.
+func IsVipNotIn(vs ...int) predicate.WxCardUser {
+	return predicate.WxCardUser(sql.FieldNotIn(FieldIsVip, vs...))
+}
+
+// IsVipGT applies the GT predicate on the "is_vip" field.
+func IsVipGT(v int) predicate.WxCardUser {
+	return predicate.WxCardUser(sql.FieldGT(FieldIsVip, v))
+}
+
+// IsVipGTE applies the GTE predicate on the "is_vip" field.
+func IsVipGTE(v int) predicate.WxCardUser {
+	return predicate.WxCardUser(sql.FieldGTE(FieldIsVip, v))
+}
+
+// IsVipLT applies the LT predicate on the "is_vip" field.
+func IsVipLT(v int) predicate.WxCardUser {
+	return predicate.WxCardUser(sql.FieldLT(FieldIsVip, v))
+}
+
+// IsVipLTE applies the LTE predicate on the "is_vip" field.
+func IsVipLTE(v int) predicate.WxCardUser {
+	return predicate.WxCardUser(sql.FieldLTE(FieldIsVip, v))
+}
+
 // And groups predicates with the AND operator between them.
 func And(predicates ...predicate.WxCardUser) predicate.WxCardUser {
 	return predicate.WxCardUser(sql.AndPredicates(predicates...))

+ 10 - 0
ent/wxcarduser/wxcarduser.go

@@ -38,6 +38,8 @@ const (
 	FieldUnionID = "union_id"
 	// FieldSessionKey holds the string denoting the session_key field in the database.
 	FieldSessionKey = "session_key"
+	// FieldIsVip holds the string denoting the is_vip field in the database.
+	FieldIsVip = "is_vip"
 	// Table holds the table name of the wxcarduser in the database.
 	Table = "wx_card_user"
 )
@@ -57,6 +59,7 @@ var Columns = []string{
 	FieldOpenID,
 	FieldUnionID,
 	FieldSessionKey,
+	FieldIsVip,
 }
 
 // ValidColumn reports if the column name is valid (part of the table columns).
@@ -101,6 +104,8 @@ var (
 	DefaultUnionID string
 	// DefaultSessionKey holds the default value on creation for the "session_key" field.
 	DefaultSessionKey string
+	// DefaultIsVip holds the default value on creation for the "is_vip" field.
+	DefaultIsVip int
 )
 
 // OrderOption defines the ordering options for the WxCardUser queries.
@@ -170,3 +175,8 @@ func ByUnionID(opts ...sql.OrderTermOption) OrderOption {
 func BySessionKey(opts ...sql.OrderTermOption) OrderOption {
 	return sql.OrderByField(FieldSessionKey, opts...).ToFunc()
 }
+
+// ByIsVip orders the results by the is_vip field.
+func ByIsVip(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldIsVip, opts...).ToFunc()
+}

+ 85 - 0
ent/wxcarduser_create.go

@@ -190,6 +190,20 @@ func (wcuc *WxCardUserCreate) SetNillableSessionKey(s *string) *WxCardUserCreate
 	return wcuc
 }
 
+// SetIsVip sets the "is_vip" field.
+func (wcuc *WxCardUserCreate) SetIsVip(i int) *WxCardUserCreate {
+	wcuc.mutation.SetIsVip(i)
+	return wcuc
+}
+
+// SetNillableIsVip sets the "is_vip" field if the given value is not nil.
+func (wcuc *WxCardUserCreate) SetNillableIsVip(i *int) *WxCardUserCreate {
+	if i != nil {
+		wcuc.SetIsVip(*i)
+	}
+	return wcuc
+}
+
 // SetID sets the "id" field.
 func (wcuc *WxCardUserCreate) SetID(u uint64) *WxCardUserCreate {
 	wcuc.mutation.SetID(u)
@@ -283,6 +297,10 @@ func (wcuc *WxCardUserCreate) defaults() error {
 		v := wxcarduser.DefaultSessionKey
 		wcuc.mutation.SetSessionKey(v)
 	}
+	if _, ok := wcuc.mutation.IsVip(); !ok {
+		v := wxcarduser.DefaultIsVip
+		wcuc.mutation.SetIsVip(v)
+	}
 	return nil
 }
 
@@ -321,6 +339,9 @@ func (wcuc *WxCardUserCreate) check() error {
 	if _, ok := wcuc.mutation.SessionKey(); !ok {
 		return &ValidationError{Name: "session_key", err: errors.New(`ent: missing required field "WxCardUser.session_key"`)}
 	}
+	if _, ok := wcuc.mutation.IsVip(); !ok {
+		return &ValidationError{Name: "is_vip", err: errors.New(`ent: missing required field "WxCardUser.is_vip"`)}
+	}
 	return nil
 }
 
@@ -402,6 +423,10 @@ func (wcuc *WxCardUserCreate) createSpec() (*WxCardUser, *sqlgraph.CreateSpec) {
 		_spec.SetField(wxcarduser.FieldSessionKey, field.TypeString, value)
 		_node.SessionKey = value
 	}
+	if value, ok := wcuc.mutation.IsVip(); ok {
+		_spec.SetField(wxcarduser.FieldIsVip, field.TypeInt, value)
+		_node.IsVip = value
+	}
 	return _node, _spec
 }
 
@@ -592,6 +617,24 @@ func (u *WxCardUserUpsert) UpdateSessionKey() *WxCardUserUpsert {
 	return u
 }
 
+// SetIsVip sets the "is_vip" field.
+func (u *WxCardUserUpsert) SetIsVip(v int) *WxCardUserUpsert {
+	u.Set(wxcarduser.FieldIsVip, v)
+	return u
+}
+
+// UpdateIsVip sets the "is_vip" field to the value that was provided on create.
+func (u *WxCardUserUpsert) UpdateIsVip() *WxCardUserUpsert {
+	u.SetExcluded(wxcarduser.FieldIsVip)
+	return u
+}
+
+// AddIsVip adds v to the "is_vip" field.
+func (u *WxCardUserUpsert) AddIsVip(v int) *WxCardUserUpsert {
+	u.Add(wxcarduser.FieldIsVip, v)
+	return u
+}
+
 // UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field.
 // Using this option is equivalent to using:
 //
@@ -804,6 +847,27 @@ func (u *WxCardUserUpsertOne) UpdateSessionKey() *WxCardUserUpsertOne {
 	})
 }
 
+// SetIsVip sets the "is_vip" field.
+func (u *WxCardUserUpsertOne) SetIsVip(v int) *WxCardUserUpsertOne {
+	return u.Update(func(s *WxCardUserUpsert) {
+		s.SetIsVip(v)
+	})
+}
+
+// AddIsVip adds v to the "is_vip" field.
+func (u *WxCardUserUpsertOne) AddIsVip(v int) *WxCardUserUpsertOne {
+	return u.Update(func(s *WxCardUserUpsert) {
+		s.AddIsVip(v)
+	})
+}
+
+// UpdateIsVip sets the "is_vip" field to the value that was provided on create.
+func (u *WxCardUserUpsertOne) UpdateIsVip() *WxCardUserUpsertOne {
+	return u.Update(func(s *WxCardUserUpsert) {
+		s.UpdateIsVip()
+	})
+}
+
 // Exec executes the query.
 func (u *WxCardUserUpsertOne) Exec(ctx context.Context) error {
 	if len(u.create.conflict) == 0 {
@@ -1182,6 +1246,27 @@ func (u *WxCardUserUpsertBulk) UpdateSessionKey() *WxCardUserUpsertBulk {
 	})
 }
 
+// SetIsVip sets the "is_vip" field.
+func (u *WxCardUserUpsertBulk) SetIsVip(v int) *WxCardUserUpsertBulk {
+	return u.Update(func(s *WxCardUserUpsert) {
+		s.SetIsVip(v)
+	})
+}
+
+// AddIsVip adds v to the "is_vip" field.
+func (u *WxCardUserUpsertBulk) AddIsVip(v int) *WxCardUserUpsertBulk {
+	return u.Update(func(s *WxCardUserUpsert) {
+		s.AddIsVip(v)
+	})
+}
+
+// UpdateIsVip sets the "is_vip" field to the value that was provided on create.
+func (u *WxCardUserUpsertBulk) UpdateIsVip() *WxCardUserUpsertBulk {
+	return u.Update(func(s *WxCardUserUpsert) {
+		s.UpdateIsVip()
+	})
+}
+
 // Exec executes the query.
 func (u *WxCardUserUpsertBulk) Exec(ctx context.Context) error {
 	if u.create.err != nil {

+ 54 - 0
ent/wxcarduser_update.go

@@ -180,6 +180,27 @@ func (wcuu *WxCardUserUpdate) SetNillableSessionKey(s *string) *WxCardUserUpdate
 	return wcuu
 }
 
+// SetIsVip sets the "is_vip" field.
+func (wcuu *WxCardUserUpdate) SetIsVip(i int) *WxCardUserUpdate {
+	wcuu.mutation.ResetIsVip()
+	wcuu.mutation.SetIsVip(i)
+	return wcuu
+}
+
+// SetNillableIsVip sets the "is_vip" field if the given value is not nil.
+func (wcuu *WxCardUserUpdate) SetNillableIsVip(i *int) *WxCardUserUpdate {
+	if i != nil {
+		wcuu.SetIsVip(*i)
+	}
+	return wcuu
+}
+
+// AddIsVip adds i to the "is_vip" field.
+func (wcuu *WxCardUserUpdate) AddIsVip(i int) *WxCardUserUpdate {
+	wcuu.mutation.AddIsVip(i)
+	return wcuu
+}
+
 // Mutation returns the WxCardUserMutation object of the builder.
 func (wcuu *WxCardUserUpdate) Mutation() *WxCardUserMutation {
 	return wcuu.mutation
@@ -272,6 +293,12 @@ func (wcuu *WxCardUserUpdate) sqlSave(ctx context.Context) (n int, err error) {
 	if value, ok := wcuu.mutation.SessionKey(); ok {
 		_spec.SetField(wxcarduser.FieldSessionKey, field.TypeString, value)
 	}
+	if value, ok := wcuu.mutation.IsVip(); ok {
+		_spec.SetField(wxcarduser.FieldIsVip, field.TypeInt, value)
+	}
+	if value, ok := wcuu.mutation.AddedIsVip(); ok {
+		_spec.AddField(wxcarduser.FieldIsVip, field.TypeInt, value)
+	}
 	if n, err = sqlgraph.UpdateNodes(ctx, wcuu.driver, _spec); err != nil {
 		if _, ok := err.(*sqlgraph.NotFoundError); ok {
 			err = &NotFoundError{wxcarduser.Label}
@@ -444,6 +471,27 @@ func (wcuuo *WxCardUserUpdateOne) SetNillableSessionKey(s *string) *WxCardUserUp
 	return wcuuo
 }
 
+// SetIsVip sets the "is_vip" field.
+func (wcuuo *WxCardUserUpdateOne) SetIsVip(i int) *WxCardUserUpdateOne {
+	wcuuo.mutation.ResetIsVip()
+	wcuuo.mutation.SetIsVip(i)
+	return wcuuo
+}
+
+// SetNillableIsVip sets the "is_vip" field if the given value is not nil.
+func (wcuuo *WxCardUserUpdateOne) SetNillableIsVip(i *int) *WxCardUserUpdateOne {
+	if i != nil {
+		wcuuo.SetIsVip(*i)
+	}
+	return wcuuo
+}
+
+// AddIsVip adds i to the "is_vip" field.
+func (wcuuo *WxCardUserUpdateOne) AddIsVip(i int) *WxCardUserUpdateOne {
+	wcuuo.mutation.AddIsVip(i)
+	return wcuuo
+}
+
 // Mutation returns the WxCardUserMutation object of the builder.
 func (wcuuo *WxCardUserUpdateOne) Mutation() *WxCardUserMutation {
 	return wcuuo.mutation
@@ -566,6 +614,12 @@ func (wcuuo *WxCardUserUpdateOne) sqlSave(ctx context.Context) (_node *WxCardUse
 	if value, ok := wcuuo.mutation.SessionKey(); ok {
 		_spec.SetField(wxcarduser.FieldSessionKey, field.TypeString, value)
 	}
+	if value, ok := wcuuo.mutation.IsVip(); ok {
+		_spec.SetField(wxcarduser.FieldIsVip, field.TypeInt, value)
+	}
+	if value, ok := wcuuo.mutation.AddedIsVip(); ok {
+		_spec.AddField(wxcarduser.FieldIsVip, field.TypeInt, value)
+	}
 	_node = &WxCardUser{config: wcuuo.config}
 	_spec.Assign = _node.assignValues
 	_spec.ScanValues = _node.scanValues

+ 4 - 0
go.sum

@@ -435,6 +435,7 @@ github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Ky
 github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
 github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
 github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
+github.com/mattn/go-runewidth v0.0.9 h1:Lm995f3rfxdpd6TSmuVCHVb/QhupuXlYr8sCI/QdE+0=
 github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
 github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
 github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU=
@@ -468,6 +469,7 @@ github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLA
 github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78=
 github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
 github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
+github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
 github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
 github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
 github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
@@ -562,6 +564,8 @@ github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkU
 github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0=
 github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
 github.com/spf13/cobra v1.1.3/go.mod h1:pGADOWyqRD/YMrPZigI/zbliZ2wVD/23d+is3pSWzOo=
+github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
+github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=
 github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
 github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
 github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=

+ 13 - 3
internal/logic/chatrecords/submit_api_chat_logic.go

@@ -49,6 +49,10 @@ func NewSubmitApiChatLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Sub
 
 func (l *SubmitApiChatLogic) SubmitApiChat(req *types.ChatRecordsInfo, w http.ResponseWriter) {
 	userId := l.ctx.Value("userId").(uint64)
+	userInfo, err := l.svcCtx.DB.WxCardUser.Query().Where(wxcarduser.ID(userId)).Only(l.ctx)
+	if err != nil {
+		return
+	}
 
 	// session_id 字段确保必须有
 	var sessionId uint64
@@ -76,7 +80,7 @@ func (l *SubmitApiChatLogic) SubmitApiChat(req *types.ChatRecordsInfo, w http.Re
 	}
 
 	// 记录下问题
-	_, err := l.svcCtx.DB.ChatRecords.Create().
+	_, err = l.svcCtx.DB.ChatRecords.Create().
 		SetUserID(userId).
 		SetSessionID(sessionId).
 		SetBotType(*req.BotType).
@@ -95,11 +99,17 @@ func (l *SubmitApiChatLogic) SubmitApiChat(req *types.ChatRecordsInfo, w http.Re
 		}
 		fastgptSendChat(l, w, *req.Content, card.APIBase, card.APIKey, sessionId, userId, *req.BotId, *req.BotType)
 	} else if *req.BotType == 3 { // 从数字员工里获取回答
-		employee, err := l.svcCtx.DB.Employee.Query().Where(employee.ID(*req.BotId)).Only(l.ctx)
+		employeeRow, err := l.svcCtx.DB.Employee.Query().Where(employee.ID(*req.BotId)).Only(l.ctx)
 		if err != nil {
 			return
 		}
-		difySendChat(l, w, *req.Content, employee.APIBase, employee.APIKey, sessionId, userId, *req.BotId, *req.BotType)
+
+		//TODO 判断用户是否能与智能体聊天(智能体VIP, 要求用户也必须是VIP)
+		if employeeRow.IsVip > 0 && userInfo.IsVip == 0 {
+			return
+		}
+
+		difySendChat(l, w, *req.Content, employeeRow.APIBase, employeeRow.APIKey, sessionId, userId, *req.BotId, *req.BotType)
 	}
 }
 

+ 15 - 0
internal/logic/employee/get_api_employee_detail_logic.go

@@ -32,6 +32,18 @@ func (l *GetApiEmployeeDetailLogic) GetApiEmployeeDetail(req *types.IDReq) (*typ
 		return nil, dberrorhandler.DefaultEntError(l.Logger, err, req)
 	}
 
+	// 是否显示聊天,是否显示Ai连线,是否显示VIP
+	var showChat, showAi, isVip bool
+	if data.APIKey != "" && data.APIBase != "" {
+		showChat = true
+	}
+	if data.AiInfo != "" {
+		showAi = true
+	}
+	if data.IsVip != 0 {
+		isVip = true
+	}
+
 	return &types.EmployeeInfoResp{
 		BaseDataInfo: types.BaseDataInfo{
 			Code: 0,
@@ -57,6 +69,9 @@ func (l *GetApiEmployeeDetailLogic) GetApiEmployeeDetail(req *types.IDReq) (*typ
 			SwitchIn:         &data.SwitchIn,
 			VideoUrl:         &data.VideoURL,
 			CategoryId:       &data.CategoryID,
+			ShowChat:         &showChat,
+			ShowAi:           &showAi,
+			IsVip:            &isVip,
 		},
 	}, nil
 }

+ 14 - 0
internal/logic/employee/get_api_employee_list_logic.go

@@ -37,6 +37,17 @@ func (l *GetApiEmployeeListLogic) GetApiEmployeeList(req *types.EmployeeListReq)
 	resp.Data.Total = data.PageDetails.Total
 
 	for _, v := range data.List {
+		var showChat, showAi, isVip bool
+		if v.APIKey != "" && v.APIBase != "" {
+			showChat = true
+		}
+		if v.AiInfo != "" {
+			showAi = true
+		}
+		if v.IsVip != 0 {
+			isVip = true
+		}
+
 		resp.Data.Data = append(resp.Data.Data,
 			types.EmployeeInfo{
 				BaseIDInfo: types.BaseIDInfo{
@@ -58,6 +69,9 @@ func (l *GetApiEmployeeListLogic) GetApiEmployeeList(req *types.EmployeeListReq)
 				SwitchIn:         &v.SwitchIn,
 				VideoUrl:         &v.VideoURL,
 				CategoryId:       &v.CategoryID,
+				ShowChat:         &showChat,
+				ShowAi:           &showAi,
+				IsVip:            &isVip,
 			})
 	}
 

+ 14 - 2
internal/types/types.go

@@ -1783,6 +1783,11 @@ type EmployeeInfo struct {
 	WorkExperience []WorkExperienceInfo `json:"workExperience,optional"`
 	ApiBase        *string              `json:"apiBase,optional"`
 	ApiKey         *string              `json:"apiKey,optional"`
+	// AI信息
+	AiInfo   *string `json:"aiInfo,optional"`
+	ShowChat *bool   `json:"showChat,optional"`
+	ShowAi   *bool   `json:"showAi,optional"`
+	IsVip    *bool   `json:"isVip,optional"`
 }
 
 // The response data of employee list | Employee列表数据
@@ -2255,8 +2260,9 @@ type WxCardInfo struct {
 	AiInfo *string `json:"aiInfo,optional"`
 	// 个人介绍
 	Intro    *string `json:"intro,optional"`
-	ShowChat *bool   `json:"showChat"`
-	ShowAi   *bool   `json:"showAi"`
+	ShowChat *bool   `json:"showChat,optioal"`
+	ShowAi   *bool   `json:"showAi,optional"`
+	IsVip    *bool   `json:"isVip,optional"`
 }
 
 // swagger:model WxCardSimpleInfo
@@ -2329,6 +2335,12 @@ type WxCardUserInfo struct {
 	Phone *string `json:"phone,optional"`
 	// OpenID
 	OpenId *string `json:"openId,optional"`
+	// UnionID
+	UnionId *string `json:"unionId,optional"`
+	// SessionKey
+	SessionKey *string `json:"sessionKey,optional"`
+	// IsVip
+	IsVip *string `json:"isVip,optional"`
 }
 
 // The response data of wx card user list | WxCardUser列表数据