Переглянути джерело

fix:edit employee API add chatUrl field

jimmyyem 4 місяців тому
батько
коміт
7da90cb5ae

+ 2 - 0
desc/wechat/employee.api

@@ -65,6 +65,8 @@ type (
 
 		ShowChat *bool `json:"showChat,optional"`
 		IsVip *bool `json:"isVip,optional"`
+	
+		ChatUrl *string `json:"chatUrl"`
     }
 
     // The response data of employee list | Employee列表数据

+ 12 - 1
ent/employee.go

@@ -61,6 +61,8 @@ type Employee struct {
 	AiInfo string `json:"ai_info,omitempty"`
 	// 是否VIP:0-否 1-是
 	IsVip int `json:"is_vip,omitempty"`
+	// 聊天URL
+	ChatURL string `json:"chat_url,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"`
@@ -103,7 +105,7 @@ func (*Employee) scanValues(columns []string) ([]any, error) {
 		switch columns[i] {
 		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, employee.FieldAiInfo:
+		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, employee.FieldChatURL:
 			values[i] = new(sql.NullString)
 		case employee.FieldCreatedAt, employee.FieldUpdatedAt, employee.FieldDeletedAt:
 			values[i] = new(sql.NullTime)
@@ -260,6 +262,12 @@ func (e *Employee) assignValues(columns []string, values []any) error {
 			} else if value.Valid {
 				e.IsVip = int(value.Int64)
 			}
+		case employee.FieldChatURL:
+			if value, ok := values[i].(*sql.NullString); !ok {
+				return fmt.Errorf("unexpected type %T for field chat_url", values[i])
+			} else if value.Valid {
+				e.ChatURL = value.String
+			}
 		default:
 			e.selectValues.Set(columns[i], values[i])
 		}
@@ -371,6 +379,9 @@ func (e *Employee) String() string {
 	builder.WriteString(", ")
 	builder.WriteString("is_vip=")
 	builder.WriteString(fmt.Sprintf("%v", e.IsVip))
+	builder.WriteString(", ")
+	builder.WriteString("chat_url=")
+	builder.WriteString(e.ChatURL)
 	builder.WriteByte(')')
 	return builder.String()
 }

+ 8 - 0
ent/employee/employee.go

@@ -59,6 +59,8 @@ const (
 	FieldAiInfo = "ai_info"
 	// FieldIsVip holds the string denoting the is_vip field in the database.
 	FieldIsVip = "is_vip"
+	// FieldChatURL holds the string denoting the chat_url field in the database.
+	FieldChatURL = "chat_url"
 	// 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.
@@ -106,6 +108,7 @@ var Columns = []string{
 	FieldAPIKey,
 	FieldAiInfo,
 	FieldIsVip,
+	FieldChatURL,
 }
 
 // ValidColumn reports if the column name is valid (part of the table columns).
@@ -302,6 +305,11 @@ func ByIsVip(opts ...sql.OrderTermOption) OrderOption {
 	return sql.OrderByField(FieldIsVip, opts...).ToFunc()
 }
 
+// ByChatURL orders the results by the chat_url field.
+func ByChatURL(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldChatURL, opts...).ToFunc()
+}
+
 // ByEmWorkExperiencesCount orders the results by em_work_experiences count.
 func ByEmWorkExperiencesCount(opts ...sql.OrderTermOption) OrderOption {
 	return func(s *sql.Selector) {

+ 70 - 0
ent/employee/where.go

@@ -165,6 +165,11 @@ func IsVip(v int) predicate.Employee {
 	return predicate.Employee(sql.FieldEQ(FieldIsVip, v))
 }
 
+// ChatURL applies equality check predicate on the "chat_url" field. It's identical to ChatURLEQ.
+func ChatURL(v string) predicate.Employee {
+	return predicate.Employee(sql.FieldEQ(FieldChatURL, 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))
@@ -1390,6 +1395,71 @@ func IsVipLTE(v int) predicate.Employee {
 	return predicate.Employee(sql.FieldLTE(FieldIsVip, v))
 }
 
+// ChatURLEQ applies the EQ predicate on the "chat_url" field.
+func ChatURLEQ(v string) predicate.Employee {
+	return predicate.Employee(sql.FieldEQ(FieldChatURL, v))
+}
+
+// ChatURLNEQ applies the NEQ predicate on the "chat_url" field.
+func ChatURLNEQ(v string) predicate.Employee {
+	return predicate.Employee(sql.FieldNEQ(FieldChatURL, v))
+}
+
+// ChatURLIn applies the In predicate on the "chat_url" field.
+func ChatURLIn(vs ...string) predicate.Employee {
+	return predicate.Employee(sql.FieldIn(FieldChatURL, vs...))
+}
+
+// ChatURLNotIn applies the NotIn predicate on the "chat_url" field.
+func ChatURLNotIn(vs ...string) predicate.Employee {
+	return predicate.Employee(sql.FieldNotIn(FieldChatURL, vs...))
+}
+
+// ChatURLGT applies the GT predicate on the "chat_url" field.
+func ChatURLGT(v string) predicate.Employee {
+	return predicate.Employee(sql.FieldGT(FieldChatURL, v))
+}
+
+// ChatURLGTE applies the GTE predicate on the "chat_url" field.
+func ChatURLGTE(v string) predicate.Employee {
+	return predicate.Employee(sql.FieldGTE(FieldChatURL, v))
+}
+
+// ChatURLLT applies the LT predicate on the "chat_url" field.
+func ChatURLLT(v string) predicate.Employee {
+	return predicate.Employee(sql.FieldLT(FieldChatURL, v))
+}
+
+// ChatURLLTE applies the LTE predicate on the "chat_url" field.
+func ChatURLLTE(v string) predicate.Employee {
+	return predicate.Employee(sql.FieldLTE(FieldChatURL, v))
+}
+
+// ChatURLContains applies the Contains predicate on the "chat_url" field.
+func ChatURLContains(v string) predicate.Employee {
+	return predicate.Employee(sql.FieldContains(FieldChatURL, v))
+}
+
+// ChatURLHasPrefix applies the HasPrefix predicate on the "chat_url" field.
+func ChatURLHasPrefix(v string) predicate.Employee {
+	return predicate.Employee(sql.FieldHasPrefix(FieldChatURL, v))
+}
+
+// ChatURLHasSuffix applies the HasSuffix predicate on the "chat_url" field.
+func ChatURLHasSuffix(v string) predicate.Employee {
+	return predicate.Employee(sql.FieldHasSuffix(FieldChatURL, v))
+}
+
+// ChatURLEqualFold applies the EqualFold predicate on the "chat_url" field.
+func ChatURLEqualFold(v string) predicate.Employee {
+	return predicate.Employee(sql.FieldEqualFold(FieldChatURL, v))
+}
+
+// ChatURLContainsFold applies the ContainsFold predicate on the "chat_url" field.
+func ChatURLContainsFold(v string) predicate.Employee {
+	return predicate.Employee(sql.FieldContainsFold(FieldChatURL, v))
+}
+
 // HasEmWorkExperiences applies the HasEdge predicate on the "em_work_experiences" edge.
 func HasEmWorkExperiences() predicate.Employee {
 	return predicate.Employee(func(s *sql.Selector) {

+ 53 - 0
ent/employee_create.go

@@ -292,6 +292,12 @@ func (ec *EmployeeCreate) SetNillableIsVip(i *int) *EmployeeCreate {
 	return ec
 }
 
+// SetChatURL sets the "chat_url" field.
+func (ec *EmployeeCreate) SetChatURL(s string) *EmployeeCreate {
+	ec.mutation.SetChatURL(s)
+	return ec
+}
+
 // SetID sets the "id" field.
 func (ec *EmployeeCreate) SetID(u uint64) *EmployeeCreate {
 	ec.mutation.SetID(u)
@@ -556,6 +562,9 @@ func (ec *EmployeeCreate) check() error {
 	if _, ok := ec.mutation.IsVip(); !ok {
 		return &ValidationError{Name: "is_vip", err: errors.New(`ent: missing required field "Employee.is_vip"`)}
 	}
+	if _, ok := ec.mutation.ChatURL(); !ok {
+		return &ValidationError{Name: "chat_url", err: errors.New(`ent: missing required field "Employee.chat_url"`)}
+	}
 	return nil
 }
 
@@ -677,6 +686,10 @@ func (ec *EmployeeCreate) createSpec() (*Employee, *sqlgraph.CreateSpec) {
 		_spec.SetField(employee.FieldIsVip, field.TypeInt, value)
 		_node.IsVip = value
 	}
+	if value, ok := ec.mutation.ChatURL(); ok {
+		_spec.SetField(employee.FieldChatURL, field.TypeString, value)
+		_node.ChatURL = value
+	}
 	if nodes := ec.mutation.EmWorkExperiencesIDs(); len(nodes) > 0 {
 		edge := &sqlgraph.EdgeSpec{
 			Rel:     sqlgraph.O2M,
@@ -1061,6 +1074,18 @@ func (u *EmployeeUpsert) AddIsVip(v int) *EmployeeUpsert {
 	return u
 }
 
+// SetChatURL sets the "chat_url" field.
+func (u *EmployeeUpsert) SetChatURL(v string) *EmployeeUpsert {
+	u.Set(employee.FieldChatURL, v)
+	return u
+}
+
+// UpdateChatURL sets the "chat_url" field to the value that was provided on create.
+func (u *EmployeeUpsert) UpdateChatURL() *EmployeeUpsert {
+	u.SetExcluded(employee.FieldChatURL)
+	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:
 //
@@ -1462,6 +1487,20 @@ func (u *EmployeeUpsertOne) UpdateIsVip() *EmployeeUpsertOne {
 	})
 }
 
+// SetChatURL sets the "chat_url" field.
+func (u *EmployeeUpsertOne) SetChatURL(v string) *EmployeeUpsertOne {
+	return u.Update(func(s *EmployeeUpsert) {
+		s.SetChatURL(v)
+	})
+}
+
+// UpdateChatURL sets the "chat_url" field to the value that was provided on create.
+func (u *EmployeeUpsertOne) UpdateChatURL() *EmployeeUpsertOne {
+	return u.Update(func(s *EmployeeUpsert) {
+		s.UpdateChatURL()
+	})
+}
+
 // Exec executes the query.
 func (u *EmployeeUpsertOne) Exec(ctx context.Context) error {
 	if len(u.create.conflict) == 0 {
@@ -2029,6 +2068,20 @@ func (u *EmployeeUpsertBulk) UpdateIsVip() *EmployeeUpsertBulk {
 	})
 }
 
+// SetChatURL sets the "chat_url" field.
+func (u *EmployeeUpsertBulk) SetChatURL(v string) *EmployeeUpsertBulk {
+	return u.Update(func(s *EmployeeUpsert) {
+		s.SetChatURL(v)
+	})
+}
+
+// UpdateChatURL sets the "chat_url" field to the value that was provided on create.
+func (u *EmployeeUpsertBulk) UpdateChatURL() *EmployeeUpsertBulk {
+	return u.Update(func(s *EmployeeUpsert) {
+		s.UpdateChatURL()
+	})
+}
+
 // Exec executes the query.
 func (u *EmployeeUpsertBulk) Exec(ctx context.Context) error {
 	if u.create.err != nil {

+ 34 - 0
ent/employee_update.go

@@ -370,6 +370,20 @@ func (eu *EmployeeUpdate) AddIsVip(i int) *EmployeeUpdate {
 	return eu
 }
 
+// SetChatURL sets the "chat_url" field.
+func (eu *EmployeeUpdate) SetChatURL(s string) *EmployeeUpdate {
+	eu.mutation.SetChatURL(s)
+	return eu
+}
+
+// SetNillableChatURL sets the "chat_url" field if the given value is not nil.
+func (eu *EmployeeUpdate) SetNillableChatURL(s *string) *EmployeeUpdate {
+	if s != nil {
+		eu.SetChatURL(*s)
+	}
+	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...)
@@ -653,6 +667,9 @@ func (eu *EmployeeUpdate) sqlSave(ctx context.Context) (n int, err error) {
 	if value, ok := eu.mutation.AddedIsVip(); ok {
 		_spec.AddField(employee.FieldIsVip, field.TypeInt, value)
 	}
+	if value, ok := eu.mutation.ChatURL(); ok {
+		_spec.SetField(employee.FieldChatURL, field.TypeString, value)
+	}
 	if eu.mutation.EmWorkExperiencesCleared() {
 		edge := &sqlgraph.EdgeSpec{
 			Rel:     sqlgraph.O2M,
@@ -1103,6 +1120,20 @@ func (euo *EmployeeUpdateOne) AddIsVip(i int) *EmployeeUpdateOne {
 	return euo
 }
 
+// SetChatURL sets the "chat_url" field.
+func (euo *EmployeeUpdateOne) SetChatURL(s string) *EmployeeUpdateOne {
+	euo.mutation.SetChatURL(s)
+	return euo
+}
+
+// SetNillableChatURL sets the "chat_url" field if the given value is not nil.
+func (euo *EmployeeUpdateOne) SetNillableChatURL(s *string) *EmployeeUpdateOne {
+	if s != nil {
+		euo.SetChatURL(*s)
+	}
+	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...)
@@ -1416,6 +1447,9 @@ func (euo *EmployeeUpdateOne) sqlSave(ctx context.Context) (_node *Employee, err
 	if value, ok := euo.mutation.AddedIsVip(); ok {
 		_spec.AddField(employee.FieldIsVip, field.TypeInt, value)
 	}
+	if value, ok := euo.mutation.ChatURL(); ok {
+		_spec.SetField(employee.FieldChatURL, field.TypeString, value)
+	}
 	if euo.mutation.EmWorkExperiencesCleared() {
 		edge := &sqlgraph.EdgeSpec{
 			Rel:     sqlgraph.O2M,

+ 1 - 0
ent/migrate/schema.go

@@ -279,6 +279,7 @@ var (
 		{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},
+		{Name: "chat_url", Type: field.TypeString, Comment: "聊天URL"},
 	}
 	// EmployeeTable holds the schema information for the "employee" table.
 	EmployeeTable = &schema.Table{

+ 55 - 1
ent/mutation.go

@@ -9345,6 +9345,7 @@ type EmployeeMutation struct {
 	ai_info                    *string
 	is_vip                     *int
 	addis_vip                  *int
+	chat_url                   *string
 	clearedFields              map[string]struct{}
 	em_work_experiences        map[uint64]struct{}
 	removedem_work_experiences map[uint64]struct{}
@@ -10399,6 +10400,42 @@ func (m *EmployeeMutation) ResetIsVip() {
 	m.addis_vip = nil
 }
 
+// SetChatURL sets the "chat_url" field.
+func (m *EmployeeMutation) SetChatURL(s string) {
+	m.chat_url = &s
+}
+
+// ChatURL returns the value of the "chat_url" field in the mutation.
+func (m *EmployeeMutation) ChatURL() (r string, exists bool) {
+	v := m.chat_url
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// OldChatURL returns the old "chat_url" 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) OldChatURL(ctx context.Context) (v string, err error) {
+	if !m.op.Is(OpUpdateOne) {
+		return v, errors.New("OldChatURL is only allowed on UpdateOne operations")
+	}
+	if m.id == nil || m.oldValue == nil {
+		return v, errors.New("OldChatURL requires an ID field in the mutation")
+	}
+	oldValue, err := m.oldValue(ctx)
+	if err != nil {
+		return v, fmt.Errorf("querying old value for OldChatURL: %w", err)
+	}
+	return oldValue.ChatURL, nil
+}
+
+// ResetChatURL resets all changes to the "chat_url" field.
+func (m *EmployeeMutation) ResetChatURL() {
+	m.chat_url = 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 {
@@ -10541,7 +10578,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, 22)
+	fields := make([]string, 0, 23)
 	if m.created_at != nil {
 		fields = append(fields, employee.FieldCreatedAt)
 	}
@@ -10608,6 +10645,9 @@ func (m *EmployeeMutation) Fields() []string {
 	if m.is_vip != nil {
 		fields = append(fields, employee.FieldIsVip)
 	}
+	if m.chat_url != nil {
+		fields = append(fields, employee.FieldChatURL)
+	}
 	return fields
 }
 
@@ -10660,6 +10700,8 @@ func (m *EmployeeMutation) Field(name string) (ent.Value, bool) {
 		return m.AiInfo()
 	case employee.FieldIsVip:
 		return m.IsVip()
+	case employee.FieldChatURL:
+		return m.ChatURL()
 	}
 	return nil, false
 }
@@ -10713,6 +10755,8 @@ func (m *EmployeeMutation) OldField(ctx context.Context, name string) (ent.Value
 		return m.OldAiInfo(ctx)
 	case employee.FieldIsVip:
 		return m.OldIsVip(ctx)
+	case employee.FieldChatURL:
+		return m.OldChatURL(ctx)
 	}
 	return nil, fmt.Errorf("unknown Employee field %s", name)
 }
@@ -10876,6 +10920,13 @@ func (m *EmployeeMutation) SetField(name string, value ent.Value) error {
 		}
 		m.SetIsVip(v)
 		return nil
+	case employee.FieldChatURL:
+		v, ok := value.(string)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.SetChatURL(v)
+		return nil
 	}
 	return fmt.Errorf("unknown Employee field %s", name)
 }
@@ -11081,6 +11132,9 @@ func (m *EmployeeMutation) ResetField(name string) error {
 	case employee.FieldIsVip:
 		m.ResetIsVip()
 		return nil
+	case employee.FieldChatURL:
+		m.ResetChatURL()
+		return nil
 	}
 	return fmt.Errorf("unknown Employee field %s", name)
 }

+ 1 - 0
ent/schema/employee.go

@@ -37,6 +37,7 @@ func (Employee) Fields() []ent.Field {
 		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-是"),
+		field.String("chat_url").Comment("聊天URL"),
 	}
 }
 

+ 24 - 0
ent/set_not_nil.go

@@ -2528,6 +2528,30 @@ func (e *EmployeeCreate) SetNotNilIsVip(value *int) *EmployeeCreate {
 }
 
 // set field if value's pointer is not nil.
+func (e *EmployeeUpdate) SetNotNilChatURL(value *string) *EmployeeUpdate {
+	if value != nil {
+		return e.SetChatURL(*value)
+	}
+	return e
+}
+
+// set field if value's pointer is not nil.
+func (e *EmployeeUpdateOne) SetNotNilChatURL(value *string) *EmployeeUpdateOne {
+	if value != nil {
+		return e.SetChatURL(*value)
+	}
+	return e
+}
+
+// set field if value's pointer is not nil.
+func (e *EmployeeCreate) SetNotNilChatURL(value *string) *EmployeeCreate {
+	if value != nil {
+		return e.SetChatURL(*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)

+ 1 - 0
internal/logic/employee/create_employee_logic.go

@@ -51,6 +51,7 @@ func (l *CreateEmployeeLogic) CreateEmployee(req *types.EmployeeInfo) (*types.Ba
 		SetNotNilCategoryID(req.CategoryId).
 		SetNotNilAPIBase(req.ApiBase).
 		SetNotNilAPIKey(req.ApiKey).
+		SetNotNilChatURL(req.ChatUrl).
 		Save(l.ctx)
 
 	if err != nil {

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

@@ -68,6 +68,7 @@ func (l *GetApiEmployeeDetailLogic) GetApiEmployeeDetail(req *types.IDReq) (*typ
 			CategoryId:       &data.CategoryID,
 			ShowChat:         &showChat,
 			IsVip:            &isVip,
+			ChatUrl:          &data.ChatURL,
 		},
 	}, nil
 }

+ 1 - 0
internal/logic/employee/get_employee_by_id_logic.go

@@ -107,6 +107,7 @@ func (l *GetEmployeeByIdLogic) GetEmployeeById(req *types.IDReq) (*types.Employe
 			CategoryId:       &data.CategoryID,
 			ApiBase:          &data.APIBase,
 			ApiKey:           &data.APIKey,
+			ChatUrl:          &data.ChatURL,
 		},
 	}, nil
 }

+ 1 - 0
internal/logic/employee/get_employee_detail_logic.go

@@ -101,6 +101,7 @@ func (l *GetEmployeeDetailLogic) GetEmployeeDetail(req *types.IDReq) (*types.Emp
 			VideoUrl:         &data.VideoURL,
 			WorkExperience:   workExperience,
 			CategoryId:       &data.CategoryID,
+			ChatUrl:          &data.ChatURL,
 		},
 	}, nil
 }

+ 1 - 0
internal/logic/employee/get_employee_list_logic.go

@@ -116,6 +116,7 @@ func (l *GetEmployeeListLogic) GetEmployeeList(req *types.EmployeeListReq) (*typ
 				CategoryId:       &v.CategoryID,
 				ApiBase:          &v.APIBase,
 				ApiKey:           &v.APIKey,
+				ChatUrl:          &v.ChatURL,
 			})
 	}
 

+ 1 - 0
internal/logic/employee/update_employee_logic.go

@@ -46,6 +46,7 @@ func (l *UpdateEmployeeLogic) UpdateEmployee(req *types.EmployeeInfo) (*types.Ba
 		SetNotNilCategoryID(req.CategoryId).
 		SetNotNilAPIBase(req.ApiBase).
 		SetNotNilAPIKey(req.ApiKey).
+		SetNotNilChatURL(req.ChatUrl).
 		Save(l.ctx)
 
 	if err != nil {

+ 1 - 0
internal/types/types.go

@@ -1872,6 +1872,7 @@ type EmployeeInfo struct {
 	AiInfo   *string `json:"aiInfo,optional"`
 	ShowChat *bool   `json:"showChat,optional"`
 	IsVip    *bool   `json:"isVip,optional"`
+	ChatUrl  *string `json:"chatUrl"`
 }
 
 // The response data of employee list | Employee列表数据