Kaynağa Gözat

fix:submit employee_config AI

jimmyyem 6 ay önce
ebeveyn
işleme
f3faa4865a

+ 2 - 1
desc/all.api

@@ -19,4 +19,5 @@ import "./wechat/agent.api"
 import "./wechat/employee.api"
 import "./wechat/work_experience.api"
 import "./wechat/tutorial.api"
-import "./wechat/token.api"
+import "./wechat/token.api"
+import "./wechat/employee_config.api"

+ 57 - 0
desc/wechat/employee_config.api

@@ -0,0 +1,57 @@
+import "../base.api"
+
+type (
+    // The data of employee config information | EmployeeConfig信息
+    EmployeeConfigInfo {
+        BaseIDInfo
+
+        // 类型:scene-场景 switch_in-接入方式 
+        Stype  *string `json:"stype,optional"`
+
+        // 标题
+        Title  *string `json:"title,optional"`
+
+        // 图片地址 
+        Photo  *string `json:"photo,optional"`
+    }
+
+    // EmployeeConfig list data | EmployeeConfig列表数据
+    EmployeeConfigListInfo {
+        BaseListInfo
+
+        // The API list data | EmployeeConfig列表数据
+        Data  []EmployeeConfigInfo  `json:"data"`
+    }
+
+	// Employee config response | Employee配置信息返回体
+	EmployeeConfigListReq {
+		/// 类型:scene-场景 switch_in-接入方式
+		Stype  *string `json:"stype,optional"`
+	}
+
+    // EmployeeConfig information response | EmployeeConfig信息返回体
+	EmployeeConfig {
+		Scene []EmployeeConfigInfo `json:"scene"`
+		SwitchIn []EmployeeConfigInfo `json:"switchIn"`
+	}
+
+	// Employee config response | Employee配置信息返回体
+	EmployeeConfigListResp {
+		BaseDataInfo
+
+		// Employee information | Employee数据
+		Data EmployeeConfig `json:"data"`
+	}
+)
+
+@server(
+    jwt: Auth
+    group: employee_config
+    middleware: Authority
+)
+
+service Wechat {
+	// Get employee config list | 获取EmployeeConfig列表
+	@handler getEmployeeListConfig
+	get /employee_config/list (EmployeeConfigListReq) returns (EmployeeConfigListResp)
+}

+ 155 - 12
ent/client.go

@@ -15,6 +15,7 @@ import (
 	"wechat-api/ent/batchmsg"
 	"wechat-api/ent/contact"
 	"wechat-api/ent/employee"
+	"wechat-api/ent/employeeconfig"
 	"wechat-api/ent/label"
 	"wechat-api/ent/labelrelationship"
 	"wechat-api/ent/message"
@@ -50,6 +51,8 @@ type Client struct {
 	Contact *ContactClient
 	// Employee is the client for interacting with the Employee builders.
 	Employee *EmployeeClient
+	// EmployeeConfig is the client for interacting with the EmployeeConfig builders.
+	EmployeeConfig *EmployeeConfigClient
 	// Label is the client for interacting with the Label builders.
 	Label *LabelClient
 	// LabelRelationship is the client for interacting with the LabelRelationship builders.
@@ -91,6 +94,7 @@ func (c *Client) init() {
 	c.BatchMsg = NewBatchMsgClient(c.config)
 	c.Contact = NewContactClient(c.config)
 	c.Employee = NewEmployeeClient(c.config)
+	c.EmployeeConfig = NewEmployeeConfigClient(c.config)
 	c.Label = NewLabelClient(c.config)
 	c.LabelRelationship = NewLabelRelationshipClient(c.config)
 	c.Message = NewMessageClient(c.config)
@@ -200,6 +204,7 @@ func (c *Client) Tx(ctx context.Context) (*Tx, error) {
 		BatchMsg:          NewBatchMsgClient(cfg),
 		Contact:           NewContactClient(cfg),
 		Employee:          NewEmployeeClient(cfg),
+		EmployeeConfig:    NewEmployeeConfigClient(cfg),
 		Label:             NewLabelClient(cfg),
 		LabelRelationship: NewLabelRelationshipClient(cfg),
 		Message:           NewMessageClient(cfg),
@@ -236,6 +241,7 @@ func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)
 		BatchMsg:          NewBatchMsgClient(cfg),
 		Contact:           NewContactClient(cfg),
 		Employee:          NewEmployeeClient(cfg),
+		EmployeeConfig:    NewEmployeeConfigClient(cfg),
 		Label:             NewLabelClient(cfg),
 		LabelRelationship: NewLabelRelationshipClient(cfg),
 		Message:           NewMessageClient(cfg),
@@ -278,9 +284,9 @@ func (c *Client) Close() error {
 // In order to add hooks to a specific client, call: `client.Node.Use(...)`.
 func (c *Client) Use(hooks ...Hook) {
 	for _, n := range []interface{ Use(...Hook) }{
-		c.Agent, c.BatchMsg, c.Contact, c.Employee, c.Label, c.LabelRelationship,
-		c.Message, c.MessageRecords, c.Msg, c.Server, c.SopNode, c.SopStage, c.SopTask,
-		c.Token, c.Tutorial, c.WorkExperience, c.Wx,
+		c.Agent, c.BatchMsg, c.Contact, c.Employee, c.EmployeeConfig, c.Label,
+		c.LabelRelationship, c.Message, c.MessageRecords, c.Msg, c.Server, c.SopNode,
+		c.SopStage, c.SopTask, c.Token, c.Tutorial, c.WorkExperience, c.Wx,
 	} {
 		n.Use(hooks...)
 	}
@@ -290,9 +296,9 @@ func (c *Client) Use(hooks ...Hook) {
 // In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.
 func (c *Client) Intercept(interceptors ...Interceptor) {
 	for _, n := range []interface{ Intercept(...Interceptor) }{
-		c.Agent, c.BatchMsg, c.Contact, c.Employee, c.Label, c.LabelRelationship,
-		c.Message, c.MessageRecords, c.Msg, c.Server, c.SopNode, c.SopStage, c.SopTask,
-		c.Token, c.Tutorial, c.WorkExperience, c.Wx,
+		c.Agent, c.BatchMsg, c.Contact, c.Employee, c.EmployeeConfig, c.Label,
+		c.LabelRelationship, c.Message, c.MessageRecords, c.Msg, c.Server, c.SopNode,
+		c.SopStage, c.SopTask, c.Token, c.Tutorial, c.WorkExperience, c.Wx,
 	} {
 		n.Intercept(interceptors...)
 	}
@@ -309,6 +315,8 @@ func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error) {
 		return c.Contact.mutate(ctx, m)
 	case *EmployeeMutation:
 		return c.Employee.mutate(ctx, m)
+	case *EmployeeConfigMutation:
+		return c.EmployeeConfig.mutate(ctx, m)
 	case *LabelMutation:
 		return c.Label.mutate(ctx, m)
 	case *LabelRelationshipMutation:
@@ -960,6 +968,141 @@ func (c *EmployeeClient) mutate(ctx context.Context, m *EmployeeMutation) (Value
 	}
 }
 
+// EmployeeConfigClient is a client for the EmployeeConfig schema.
+type EmployeeConfigClient struct {
+	config
+}
+
+// NewEmployeeConfigClient returns a client for the EmployeeConfig from the given config.
+func NewEmployeeConfigClient(c config) *EmployeeConfigClient {
+	return &EmployeeConfigClient{config: c}
+}
+
+// Use adds a list of mutation hooks to the hooks stack.
+// A call to `Use(f, g, h)` equals to `employeeconfig.Hooks(f(g(h())))`.
+func (c *EmployeeConfigClient) Use(hooks ...Hook) {
+	c.hooks.EmployeeConfig = append(c.hooks.EmployeeConfig, hooks...)
+}
+
+// Intercept adds a list of query interceptors to the interceptors stack.
+// A call to `Intercept(f, g, h)` equals to `employeeconfig.Intercept(f(g(h())))`.
+func (c *EmployeeConfigClient) Intercept(interceptors ...Interceptor) {
+	c.inters.EmployeeConfig = append(c.inters.EmployeeConfig, interceptors...)
+}
+
+// Create returns a builder for creating a EmployeeConfig entity.
+func (c *EmployeeConfigClient) Create() *EmployeeConfigCreate {
+	mutation := newEmployeeConfigMutation(c.config, OpCreate)
+	return &EmployeeConfigCreate{config: c.config, hooks: c.Hooks(), mutation: mutation}
+}
+
+// CreateBulk returns a builder for creating a bulk of EmployeeConfig entities.
+func (c *EmployeeConfigClient) CreateBulk(builders ...*EmployeeConfigCreate) *EmployeeConfigCreateBulk {
+	return &EmployeeConfigCreateBulk{config: c.config, builders: builders}
+}
+
+// MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates
+// a builder and applies setFunc on it.
+func (c *EmployeeConfigClient) MapCreateBulk(slice any, setFunc func(*EmployeeConfigCreate, int)) *EmployeeConfigCreateBulk {
+	rv := reflect.ValueOf(slice)
+	if rv.Kind() != reflect.Slice {
+		return &EmployeeConfigCreateBulk{err: fmt.Errorf("calling to EmployeeConfigClient.MapCreateBulk with wrong type %T, need slice", slice)}
+	}
+	builders := make([]*EmployeeConfigCreate, rv.Len())
+	for i := 0; i < rv.Len(); i++ {
+		builders[i] = c.Create()
+		setFunc(builders[i], i)
+	}
+	return &EmployeeConfigCreateBulk{config: c.config, builders: builders}
+}
+
+// Update returns an update builder for EmployeeConfig.
+func (c *EmployeeConfigClient) Update() *EmployeeConfigUpdate {
+	mutation := newEmployeeConfigMutation(c.config, OpUpdate)
+	return &EmployeeConfigUpdate{config: c.config, hooks: c.Hooks(), mutation: mutation}
+}
+
+// UpdateOne returns an update builder for the given entity.
+func (c *EmployeeConfigClient) UpdateOne(ec *EmployeeConfig) *EmployeeConfigUpdateOne {
+	mutation := newEmployeeConfigMutation(c.config, OpUpdateOne, withEmployeeConfig(ec))
+	return &EmployeeConfigUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
+}
+
+// UpdateOneID returns an update builder for the given id.
+func (c *EmployeeConfigClient) UpdateOneID(id uint64) *EmployeeConfigUpdateOne {
+	mutation := newEmployeeConfigMutation(c.config, OpUpdateOne, withEmployeeConfigID(id))
+	return &EmployeeConfigUpdateOne{config: c.config, hooks: c.Hooks(), mutation: mutation}
+}
+
+// Delete returns a delete builder for EmployeeConfig.
+func (c *EmployeeConfigClient) Delete() *EmployeeConfigDelete {
+	mutation := newEmployeeConfigMutation(c.config, OpDelete)
+	return &EmployeeConfigDelete{config: c.config, hooks: c.Hooks(), mutation: mutation}
+}
+
+// DeleteOne returns a builder for deleting the given entity.
+func (c *EmployeeConfigClient) DeleteOne(ec *EmployeeConfig) *EmployeeConfigDeleteOne {
+	return c.DeleteOneID(ec.ID)
+}
+
+// DeleteOneID returns a builder for deleting the given entity by its id.
+func (c *EmployeeConfigClient) DeleteOneID(id uint64) *EmployeeConfigDeleteOne {
+	builder := c.Delete().Where(employeeconfig.ID(id))
+	builder.mutation.id = &id
+	builder.mutation.op = OpDeleteOne
+	return &EmployeeConfigDeleteOne{builder}
+}
+
+// Query returns a query builder for EmployeeConfig.
+func (c *EmployeeConfigClient) Query() *EmployeeConfigQuery {
+	return &EmployeeConfigQuery{
+		config: c.config,
+		ctx:    &QueryContext{Type: TypeEmployeeConfig},
+		inters: c.Interceptors(),
+	}
+}
+
+// Get returns a EmployeeConfig entity by its id.
+func (c *EmployeeConfigClient) Get(ctx context.Context, id uint64) (*EmployeeConfig, error) {
+	return c.Query().Where(employeeconfig.ID(id)).Only(ctx)
+}
+
+// GetX is like Get, but panics if an error occurs.
+func (c *EmployeeConfigClient) GetX(ctx context.Context, id uint64) *EmployeeConfig {
+	obj, err := c.Get(ctx, id)
+	if err != nil {
+		panic(err)
+	}
+	return obj
+}
+
+// Hooks returns the client hooks.
+func (c *EmployeeConfigClient) Hooks() []Hook {
+	hooks := c.hooks.EmployeeConfig
+	return append(hooks[:len(hooks):len(hooks)], employeeconfig.Hooks[:]...)
+}
+
+// Interceptors returns the client interceptors.
+func (c *EmployeeConfigClient) Interceptors() []Interceptor {
+	inters := c.inters.EmployeeConfig
+	return append(inters[:len(inters):len(inters)], employeeconfig.Interceptors[:]...)
+}
+
+func (c *EmployeeConfigClient) mutate(ctx context.Context, m *EmployeeConfigMutation) (Value, error) {
+	switch m.Op() {
+	case OpCreate:
+		return (&EmployeeConfigCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
+	case OpUpdate:
+		return (&EmployeeConfigUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
+	case OpUpdateOne:
+		return (&EmployeeConfigUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
+	case OpDelete, OpDeleteOne:
+		return (&EmployeeConfigDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx)
+	default:
+		return nil, fmt.Errorf("ent: unknown EmployeeConfig mutation op: %q", m.Op())
+	}
+}
+
 // LabelClient is a client for the Label schema.
 type LabelClient struct {
 	config
@@ -2986,14 +3129,14 @@ func (c *WxClient) mutate(ctx context.Context, m *WxMutation) (Value, error) {
 // hooks and interceptors per client, for fast access.
 type (
 	hooks struct {
-		Agent, BatchMsg, Contact, Employee, Label, LabelRelationship, Message,
-		MessageRecords, Msg, Server, SopNode, SopStage, SopTask, Token, Tutorial,
-		WorkExperience, Wx []ent.Hook
+		Agent, BatchMsg, Contact, Employee, EmployeeConfig, Label, LabelRelationship,
+		Message, MessageRecords, Msg, Server, SopNode, SopStage, SopTask, Token,
+		Tutorial, WorkExperience, Wx []ent.Hook
 	}
 	inters struct {
-		Agent, BatchMsg, Contact, Employee, Label, LabelRelationship, Message,
-		MessageRecords, Msg, Server, SopNode, SopStage, SopTask, Token, Tutorial,
-		WorkExperience, Wx []ent.Interceptor
+		Agent, BatchMsg, Contact, Employee, EmployeeConfig, Label, LabelRelationship,
+		Message, MessageRecords, Msg, Server, SopNode, SopStage, SopTask, Token,
+		Tutorial, WorkExperience, Wx []ent.Interceptor
 	}
 )
 

+ 172 - 0
ent/employeeconfig.go

@@ -0,0 +1,172 @@
+// Code generated by ent, DO NOT EDIT.
+
+package ent
+
+import (
+	"fmt"
+	"strings"
+	"time"
+	"wechat-api/ent/employeeconfig"
+
+	"entgo.io/ent"
+	"entgo.io/ent/dialect/sql"
+)
+
+// EmployeeConfig is the model entity for the EmployeeConfig schema.
+type EmployeeConfig struct {
+	config `json:"-"`
+	// ID of the ent.
+	ID uint64 `json:"id,omitempty"`
+	// Create Time | 创建日期
+	CreatedAt time.Time `json:"created_at,omitempty"`
+	// Update Time | 修改日期
+	UpdatedAt time.Time `json:"updated_at,omitempty"`
+	// Delete Time | 删除日期
+	DeletedAt time.Time `json:"deleted_at,omitempty"`
+	// 类型:scene-场景 switch_in-接入方式
+	Stype string `json:"stype,omitempty"`
+	// 标题
+	Title string `json:"title,omitempty"`
+	// 图片地址
+	Photo string `json:"photo,omitempty"`
+	// 机构 ID
+	OrganizationID uint64 `json:"organization_id,omitempty"`
+	selectValues   sql.SelectValues
+}
+
+// scanValues returns the types for scanning values from sql.Rows.
+func (*EmployeeConfig) scanValues(columns []string) ([]any, error) {
+	values := make([]any, len(columns))
+	for i := range columns {
+		switch columns[i] {
+		case employeeconfig.FieldID, employeeconfig.FieldOrganizationID:
+			values[i] = new(sql.NullInt64)
+		case employeeconfig.FieldStype, employeeconfig.FieldTitle, employeeconfig.FieldPhoto:
+			values[i] = new(sql.NullString)
+		case employeeconfig.FieldCreatedAt, employeeconfig.FieldUpdatedAt, employeeconfig.FieldDeletedAt:
+			values[i] = new(sql.NullTime)
+		default:
+			values[i] = new(sql.UnknownType)
+		}
+	}
+	return values, nil
+}
+
+// assignValues assigns the values that were returned from sql.Rows (after scanning)
+// to the EmployeeConfig fields.
+func (ec *EmployeeConfig) assignValues(columns []string, values []any) error {
+	if m, n := len(values), len(columns); m < n {
+		return fmt.Errorf("mismatch number of scan values: %d != %d", m, n)
+	}
+	for i := range columns {
+		switch columns[i] {
+		case employeeconfig.FieldID:
+			value, ok := values[i].(*sql.NullInt64)
+			if !ok {
+				return fmt.Errorf("unexpected type %T for field id", value)
+			}
+			ec.ID = uint64(value.Int64)
+		case employeeconfig.FieldCreatedAt:
+			if value, ok := values[i].(*sql.NullTime); !ok {
+				return fmt.Errorf("unexpected type %T for field created_at", values[i])
+			} else if value.Valid {
+				ec.CreatedAt = value.Time
+			}
+		case employeeconfig.FieldUpdatedAt:
+			if value, ok := values[i].(*sql.NullTime); !ok {
+				return fmt.Errorf("unexpected type %T for field updated_at", values[i])
+			} else if value.Valid {
+				ec.UpdatedAt = value.Time
+			}
+		case employeeconfig.FieldDeletedAt:
+			if value, ok := values[i].(*sql.NullTime); !ok {
+				return fmt.Errorf("unexpected type %T for field deleted_at", values[i])
+			} else if value.Valid {
+				ec.DeletedAt = value.Time
+			}
+		case employeeconfig.FieldStype:
+			if value, ok := values[i].(*sql.NullString); !ok {
+				return fmt.Errorf("unexpected type %T for field stype", values[i])
+			} else if value.Valid {
+				ec.Stype = value.String
+			}
+		case employeeconfig.FieldTitle:
+			if value, ok := values[i].(*sql.NullString); !ok {
+				return fmt.Errorf("unexpected type %T for field title", values[i])
+			} else if value.Valid {
+				ec.Title = value.String
+			}
+		case employeeconfig.FieldPhoto:
+			if value, ok := values[i].(*sql.NullString); !ok {
+				return fmt.Errorf("unexpected type %T for field photo", values[i])
+			} else if value.Valid {
+				ec.Photo = value.String
+			}
+		case employeeconfig.FieldOrganizationID:
+			if value, ok := values[i].(*sql.NullInt64); !ok {
+				return fmt.Errorf("unexpected type %T for field organization_id", values[i])
+			} else if value.Valid {
+				ec.OrganizationID = uint64(value.Int64)
+			}
+		default:
+			ec.selectValues.Set(columns[i], values[i])
+		}
+	}
+	return nil
+}
+
+// Value returns the ent.Value that was dynamically selected and assigned to the EmployeeConfig.
+// This includes values selected through modifiers, order, etc.
+func (ec *EmployeeConfig) Value(name string) (ent.Value, error) {
+	return ec.selectValues.Get(name)
+}
+
+// Update returns a builder for updating this EmployeeConfig.
+// Note that you need to call EmployeeConfig.Unwrap() before calling this method if this EmployeeConfig
+// was returned from a transaction, and the transaction was committed or rolled back.
+func (ec *EmployeeConfig) Update() *EmployeeConfigUpdateOne {
+	return NewEmployeeConfigClient(ec.config).UpdateOne(ec)
+}
+
+// Unwrap unwraps the EmployeeConfig entity that was returned from a transaction after it was closed,
+// so that all future queries will be executed through the driver which created the transaction.
+func (ec *EmployeeConfig) Unwrap() *EmployeeConfig {
+	_tx, ok := ec.config.driver.(*txDriver)
+	if !ok {
+		panic("ent: EmployeeConfig is not a transactional entity")
+	}
+	ec.config.driver = _tx.drv
+	return ec
+}
+
+// String implements the fmt.Stringer.
+func (ec *EmployeeConfig) String() string {
+	var builder strings.Builder
+	builder.WriteString("EmployeeConfig(")
+	builder.WriteString(fmt.Sprintf("id=%v, ", ec.ID))
+	builder.WriteString("created_at=")
+	builder.WriteString(ec.CreatedAt.Format(time.ANSIC))
+	builder.WriteString(", ")
+	builder.WriteString("updated_at=")
+	builder.WriteString(ec.UpdatedAt.Format(time.ANSIC))
+	builder.WriteString(", ")
+	builder.WriteString("deleted_at=")
+	builder.WriteString(ec.DeletedAt.Format(time.ANSIC))
+	builder.WriteString(", ")
+	builder.WriteString("stype=")
+	builder.WriteString(ec.Stype)
+	builder.WriteString(", ")
+	builder.WriteString("title=")
+	builder.WriteString(ec.Title)
+	builder.WriteString(", ")
+	builder.WriteString("photo=")
+	builder.WriteString(ec.Photo)
+	builder.WriteString(", ")
+	builder.WriteString("organization_id=")
+	builder.WriteString(fmt.Sprintf("%v", ec.OrganizationID))
+	builder.WriteByte(')')
+	return builder.String()
+}
+
+// EmployeeConfigs is a parsable slice of EmployeeConfig.
+type EmployeeConfigs []*EmployeeConfig

+ 122 - 0
ent/employeeconfig/employeeconfig.go

@@ -0,0 +1,122 @@
+// Code generated by ent, DO NOT EDIT.
+
+package employeeconfig
+
+import (
+	"time"
+
+	"entgo.io/ent"
+	"entgo.io/ent/dialect/sql"
+)
+
+const (
+	// Label holds the string label denoting the employeeconfig type in the database.
+	Label = "employee_config"
+	// FieldID holds the string denoting the id field in the database.
+	FieldID = "id"
+	// FieldCreatedAt holds the string denoting the created_at field in the database.
+	FieldCreatedAt = "created_at"
+	// FieldUpdatedAt holds the string denoting the updated_at field in the database.
+	FieldUpdatedAt = "updated_at"
+	// FieldDeletedAt holds the string denoting the deleted_at field in the database.
+	FieldDeletedAt = "deleted_at"
+	// FieldStype holds the string denoting the stype field in the database.
+	FieldStype = "stype"
+	// FieldTitle holds the string denoting the title field in the database.
+	FieldTitle = "title"
+	// FieldPhoto holds the string denoting the photo field in the database.
+	FieldPhoto = "photo"
+	// FieldOrganizationID holds the string denoting the organization_id field in the database.
+	FieldOrganizationID = "organization_id"
+	// Table holds the table name of the employeeconfig in the database.
+	Table = "employee_config"
+)
+
+// Columns holds all SQL columns for employeeconfig fields.
+var Columns = []string{
+	FieldID,
+	FieldCreatedAt,
+	FieldUpdatedAt,
+	FieldDeletedAt,
+	FieldStype,
+	FieldTitle,
+	FieldPhoto,
+	FieldOrganizationID,
+}
+
+// ValidColumn reports if the column name is valid (part of the table columns).
+func ValidColumn(column string) bool {
+	for i := range Columns {
+		if column == Columns[i] {
+			return true
+		}
+	}
+	return false
+}
+
+// Note that the variables below are initialized by the runtime
+// package on the initialization of the application. Therefore,
+// it should be imported in the main as follows:
+//
+//	import _ "wechat-api/ent/runtime"
+var (
+	Hooks        [1]ent.Hook
+	Interceptors [1]ent.Interceptor
+	// DefaultCreatedAt holds the default value on creation for the "created_at" field.
+	DefaultCreatedAt func() time.Time
+	// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
+	DefaultUpdatedAt func() time.Time
+	// UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
+	UpdateDefaultUpdatedAt func() time.Time
+	// DefaultStype holds the default value on creation for the "stype" field.
+	DefaultStype string
+	// DefaultTitle holds the default value on creation for the "title" field.
+	DefaultTitle string
+	// DefaultPhoto holds the default value on creation for the "photo" field.
+	DefaultPhoto string
+	// DefaultOrganizationID holds the default value on creation for the "organization_id" field.
+	DefaultOrganizationID uint64
+)
+
+// OrderOption defines the ordering options for the EmployeeConfig queries.
+type OrderOption func(*sql.Selector)
+
+// ByID orders the results by the id field.
+func ByID(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldID, opts...).ToFunc()
+}
+
+// ByCreatedAt orders the results by the created_at field.
+func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
+}
+
+// ByUpdatedAt orders the results by the updated_at field.
+func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
+}
+
+// ByDeletedAt orders the results by the deleted_at field.
+func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
+}
+
+// ByStype orders the results by the stype field.
+func ByStype(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldStype, opts...).ToFunc()
+}
+
+// ByTitle orders the results by the title field.
+func ByTitle(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldTitle, opts...).ToFunc()
+}
+
+// ByPhoto orders the results by the photo field.
+func ByPhoto(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldPhoto, opts...).ToFunc()
+}
+
+// ByOrganizationID orders the results by the organization_id field.
+func ByOrganizationID(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldOrganizationID, opts...).ToFunc()
+}

+ 480 - 0
ent/employeeconfig/where.go

@@ -0,0 +1,480 @@
+// Code generated by ent, DO NOT EDIT.
+
+package employeeconfig
+
+import (
+	"time"
+	"wechat-api/ent/predicate"
+
+	"entgo.io/ent/dialect/sql"
+)
+
+// ID filters vertices based on their ID field.
+func ID(id uint64) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldEQ(FieldID, id))
+}
+
+// IDEQ applies the EQ predicate on the ID field.
+func IDEQ(id uint64) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldEQ(FieldID, id))
+}
+
+// IDNEQ applies the NEQ predicate on the ID field.
+func IDNEQ(id uint64) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldNEQ(FieldID, id))
+}
+
+// IDIn applies the In predicate on the ID field.
+func IDIn(ids ...uint64) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldIn(FieldID, ids...))
+}
+
+// IDNotIn applies the NotIn predicate on the ID field.
+func IDNotIn(ids ...uint64) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldNotIn(FieldID, ids...))
+}
+
+// IDGT applies the GT predicate on the ID field.
+func IDGT(id uint64) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldGT(FieldID, id))
+}
+
+// IDGTE applies the GTE predicate on the ID field.
+func IDGTE(id uint64) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldGTE(FieldID, id))
+}
+
+// IDLT applies the LT predicate on the ID field.
+func IDLT(id uint64) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldLT(FieldID, id))
+}
+
+// IDLTE applies the LTE predicate on the ID field.
+func IDLTE(id uint64) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldLTE(FieldID, id))
+}
+
+// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
+func CreatedAt(v time.Time) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldEQ(FieldCreatedAt, v))
+}
+
+// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ.
+func UpdatedAt(v time.Time) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldEQ(FieldUpdatedAt, v))
+}
+
+// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ.
+func DeletedAt(v time.Time) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldEQ(FieldDeletedAt, v))
+}
+
+// Stype applies equality check predicate on the "stype" field. It's identical to StypeEQ.
+func Stype(v string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldEQ(FieldStype, v))
+}
+
+// Title applies equality check predicate on the "title" field. It's identical to TitleEQ.
+func Title(v string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldEQ(FieldTitle, v))
+}
+
+// Photo applies equality check predicate on the "photo" field. It's identical to PhotoEQ.
+func Photo(v string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldEQ(FieldPhoto, v))
+}
+
+// OrganizationID applies equality check predicate on the "organization_id" field. It's identical to OrganizationIDEQ.
+func OrganizationID(v uint64) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldEQ(FieldOrganizationID, v))
+}
+
+// CreatedAtEQ applies the EQ predicate on the "created_at" field.
+func CreatedAtEQ(v time.Time) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldEQ(FieldCreatedAt, v))
+}
+
+// CreatedAtNEQ applies the NEQ predicate on the "created_at" field.
+func CreatedAtNEQ(v time.Time) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldNEQ(FieldCreatedAt, v))
+}
+
+// CreatedAtIn applies the In predicate on the "created_at" field.
+func CreatedAtIn(vs ...time.Time) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldIn(FieldCreatedAt, vs...))
+}
+
+// CreatedAtNotIn applies the NotIn predicate on the "created_at" field.
+func CreatedAtNotIn(vs ...time.Time) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldNotIn(FieldCreatedAt, vs...))
+}
+
+// CreatedAtGT applies the GT predicate on the "created_at" field.
+func CreatedAtGT(v time.Time) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldGT(FieldCreatedAt, v))
+}
+
+// CreatedAtGTE applies the GTE predicate on the "created_at" field.
+func CreatedAtGTE(v time.Time) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldGTE(FieldCreatedAt, v))
+}
+
+// CreatedAtLT applies the LT predicate on the "created_at" field.
+func CreatedAtLT(v time.Time) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldLT(FieldCreatedAt, v))
+}
+
+// CreatedAtLTE applies the LTE predicate on the "created_at" field.
+func CreatedAtLTE(v time.Time) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldLTE(FieldCreatedAt, v))
+}
+
+// UpdatedAtEQ applies the EQ predicate on the "updated_at" field.
+func UpdatedAtEQ(v time.Time) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldEQ(FieldUpdatedAt, v))
+}
+
+// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.
+func UpdatedAtNEQ(v time.Time) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldNEQ(FieldUpdatedAt, v))
+}
+
+// UpdatedAtIn applies the In predicate on the "updated_at" field.
+func UpdatedAtIn(vs ...time.Time) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldIn(FieldUpdatedAt, vs...))
+}
+
+// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field.
+func UpdatedAtNotIn(vs ...time.Time) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldNotIn(FieldUpdatedAt, vs...))
+}
+
+// UpdatedAtGT applies the GT predicate on the "updated_at" field.
+func UpdatedAtGT(v time.Time) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldGT(FieldUpdatedAt, v))
+}
+
+// UpdatedAtGTE applies the GTE predicate on the "updated_at" field.
+func UpdatedAtGTE(v time.Time) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldGTE(FieldUpdatedAt, v))
+}
+
+// UpdatedAtLT applies the LT predicate on the "updated_at" field.
+func UpdatedAtLT(v time.Time) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldLT(FieldUpdatedAt, v))
+}
+
+// UpdatedAtLTE applies the LTE predicate on the "updated_at" field.
+func UpdatedAtLTE(v time.Time) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldLTE(FieldUpdatedAt, v))
+}
+
+// DeletedAtEQ applies the EQ predicate on the "deleted_at" field.
+func DeletedAtEQ(v time.Time) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldEQ(FieldDeletedAt, v))
+}
+
+// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field.
+func DeletedAtNEQ(v time.Time) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldNEQ(FieldDeletedAt, v))
+}
+
+// DeletedAtIn applies the In predicate on the "deleted_at" field.
+func DeletedAtIn(vs ...time.Time) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldIn(FieldDeletedAt, vs...))
+}
+
+// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field.
+func DeletedAtNotIn(vs ...time.Time) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldNotIn(FieldDeletedAt, vs...))
+}
+
+// DeletedAtGT applies the GT predicate on the "deleted_at" field.
+func DeletedAtGT(v time.Time) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldGT(FieldDeletedAt, v))
+}
+
+// DeletedAtGTE applies the GTE predicate on the "deleted_at" field.
+func DeletedAtGTE(v time.Time) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldGTE(FieldDeletedAt, v))
+}
+
+// DeletedAtLT applies the LT predicate on the "deleted_at" field.
+func DeletedAtLT(v time.Time) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldLT(FieldDeletedAt, v))
+}
+
+// DeletedAtLTE applies the LTE predicate on the "deleted_at" field.
+func DeletedAtLTE(v time.Time) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldLTE(FieldDeletedAt, v))
+}
+
+// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field.
+func DeletedAtIsNil() predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldIsNull(FieldDeletedAt))
+}
+
+// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field.
+func DeletedAtNotNil() predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldNotNull(FieldDeletedAt))
+}
+
+// StypeEQ applies the EQ predicate on the "stype" field.
+func StypeEQ(v string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldEQ(FieldStype, v))
+}
+
+// StypeNEQ applies the NEQ predicate on the "stype" field.
+func StypeNEQ(v string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldNEQ(FieldStype, v))
+}
+
+// StypeIn applies the In predicate on the "stype" field.
+func StypeIn(vs ...string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldIn(FieldStype, vs...))
+}
+
+// StypeNotIn applies the NotIn predicate on the "stype" field.
+func StypeNotIn(vs ...string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldNotIn(FieldStype, vs...))
+}
+
+// StypeGT applies the GT predicate on the "stype" field.
+func StypeGT(v string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldGT(FieldStype, v))
+}
+
+// StypeGTE applies the GTE predicate on the "stype" field.
+func StypeGTE(v string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldGTE(FieldStype, v))
+}
+
+// StypeLT applies the LT predicate on the "stype" field.
+func StypeLT(v string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldLT(FieldStype, v))
+}
+
+// StypeLTE applies the LTE predicate on the "stype" field.
+func StypeLTE(v string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldLTE(FieldStype, v))
+}
+
+// StypeContains applies the Contains predicate on the "stype" field.
+func StypeContains(v string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldContains(FieldStype, v))
+}
+
+// StypeHasPrefix applies the HasPrefix predicate on the "stype" field.
+func StypeHasPrefix(v string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldHasPrefix(FieldStype, v))
+}
+
+// StypeHasSuffix applies the HasSuffix predicate on the "stype" field.
+func StypeHasSuffix(v string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldHasSuffix(FieldStype, v))
+}
+
+// StypeEqualFold applies the EqualFold predicate on the "stype" field.
+func StypeEqualFold(v string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldEqualFold(FieldStype, v))
+}
+
+// StypeContainsFold applies the ContainsFold predicate on the "stype" field.
+func StypeContainsFold(v string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldContainsFold(FieldStype, v))
+}
+
+// TitleEQ applies the EQ predicate on the "title" field.
+func TitleEQ(v string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldEQ(FieldTitle, v))
+}
+
+// TitleNEQ applies the NEQ predicate on the "title" field.
+func TitleNEQ(v string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldNEQ(FieldTitle, v))
+}
+
+// TitleIn applies the In predicate on the "title" field.
+func TitleIn(vs ...string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldIn(FieldTitle, vs...))
+}
+
+// TitleNotIn applies the NotIn predicate on the "title" field.
+func TitleNotIn(vs ...string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldNotIn(FieldTitle, vs...))
+}
+
+// TitleGT applies the GT predicate on the "title" field.
+func TitleGT(v string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldGT(FieldTitle, v))
+}
+
+// TitleGTE applies the GTE predicate on the "title" field.
+func TitleGTE(v string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldGTE(FieldTitle, v))
+}
+
+// TitleLT applies the LT predicate on the "title" field.
+func TitleLT(v string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldLT(FieldTitle, v))
+}
+
+// TitleLTE applies the LTE predicate on the "title" field.
+func TitleLTE(v string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldLTE(FieldTitle, v))
+}
+
+// TitleContains applies the Contains predicate on the "title" field.
+func TitleContains(v string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldContains(FieldTitle, v))
+}
+
+// TitleHasPrefix applies the HasPrefix predicate on the "title" field.
+func TitleHasPrefix(v string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldHasPrefix(FieldTitle, v))
+}
+
+// TitleHasSuffix applies the HasSuffix predicate on the "title" field.
+func TitleHasSuffix(v string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldHasSuffix(FieldTitle, v))
+}
+
+// TitleEqualFold applies the EqualFold predicate on the "title" field.
+func TitleEqualFold(v string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldEqualFold(FieldTitle, v))
+}
+
+// TitleContainsFold applies the ContainsFold predicate on the "title" field.
+func TitleContainsFold(v string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldContainsFold(FieldTitle, v))
+}
+
+// PhotoEQ applies the EQ predicate on the "photo" field.
+func PhotoEQ(v string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldEQ(FieldPhoto, v))
+}
+
+// PhotoNEQ applies the NEQ predicate on the "photo" field.
+func PhotoNEQ(v string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldNEQ(FieldPhoto, v))
+}
+
+// PhotoIn applies the In predicate on the "photo" field.
+func PhotoIn(vs ...string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldIn(FieldPhoto, vs...))
+}
+
+// PhotoNotIn applies the NotIn predicate on the "photo" field.
+func PhotoNotIn(vs ...string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldNotIn(FieldPhoto, vs...))
+}
+
+// PhotoGT applies the GT predicate on the "photo" field.
+func PhotoGT(v string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldGT(FieldPhoto, v))
+}
+
+// PhotoGTE applies the GTE predicate on the "photo" field.
+func PhotoGTE(v string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldGTE(FieldPhoto, v))
+}
+
+// PhotoLT applies the LT predicate on the "photo" field.
+func PhotoLT(v string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldLT(FieldPhoto, v))
+}
+
+// PhotoLTE applies the LTE predicate on the "photo" field.
+func PhotoLTE(v string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldLTE(FieldPhoto, v))
+}
+
+// PhotoContains applies the Contains predicate on the "photo" field.
+func PhotoContains(v string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldContains(FieldPhoto, v))
+}
+
+// PhotoHasPrefix applies the HasPrefix predicate on the "photo" field.
+func PhotoHasPrefix(v string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldHasPrefix(FieldPhoto, v))
+}
+
+// PhotoHasSuffix applies the HasSuffix predicate on the "photo" field.
+func PhotoHasSuffix(v string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldHasSuffix(FieldPhoto, v))
+}
+
+// PhotoEqualFold applies the EqualFold predicate on the "photo" field.
+func PhotoEqualFold(v string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldEqualFold(FieldPhoto, v))
+}
+
+// PhotoContainsFold applies the ContainsFold predicate on the "photo" field.
+func PhotoContainsFold(v string) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldContainsFold(FieldPhoto, v))
+}
+
+// OrganizationIDEQ applies the EQ predicate on the "organization_id" field.
+func OrganizationIDEQ(v uint64) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldEQ(FieldOrganizationID, v))
+}
+
+// OrganizationIDNEQ applies the NEQ predicate on the "organization_id" field.
+func OrganizationIDNEQ(v uint64) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldNEQ(FieldOrganizationID, v))
+}
+
+// OrganizationIDIn applies the In predicate on the "organization_id" field.
+func OrganizationIDIn(vs ...uint64) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldIn(FieldOrganizationID, vs...))
+}
+
+// OrganizationIDNotIn applies the NotIn predicate on the "organization_id" field.
+func OrganizationIDNotIn(vs ...uint64) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldNotIn(FieldOrganizationID, vs...))
+}
+
+// OrganizationIDGT applies the GT predicate on the "organization_id" field.
+func OrganizationIDGT(v uint64) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldGT(FieldOrganizationID, v))
+}
+
+// OrganizationIDGTE applies the GTE predicate on the "organization_id" field.
+func OrganizationIDGTE(v uint64) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldGTE(FieldOrganizationID, v))
+}
+
+// OrganizationIDLT applies the LT predicate on the "organization_id" field.
+func OrganizationIDLT(v uint64) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldLT(FieldOrganizationID, v))
+}
+
+// OrganizationIDLTE applies the LTE predicate on the "organization_id" field.
+func OrganizationIDLTE(v uint64) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldLTE(FieldOrganizationID, v))
+}
+
+// OrganizationIDIsNil applies the IsNil predicate on the "organization_id" field.
+func OrganizationIDIsNil() predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldIsNull(FieldOrganizationID))
+}
+
+// OrganizationIDNotNil applies the NotNil predicate on the "organization_id" field.
+func OrganizationIDNotNil() predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.FieldNotNull(FieldOrganizationID))
+}
+
+// And groups predicates with the AND operator between them.
+func And(predicates ...predicate.EmployeeConfig) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.AndPredicates(predicates...))
+}
+
+// Or groups predicates with the OR operator between them.
+func Or(predicates ...predicate.EmployeeConfig) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.OrPredicates(predicates...))
+}
+
+// Not applies the not operator on the given predicate.
+func Not(p predicate.EmployeeConfig) predicate.EmployeeConfig {
+	return predicate.EmployeeConfig(sql.NotPredicates(p))
+}

+ 918 - 0
ent/employeeconfig_create.go

@@ -0,0 +1,918 @@
+// Code generated by ent, DO NOT EDIT.
+
+package ent
+
+import (
+	"context"
+	"errors"
+	"fmt"
+	"time"
+	"wechat-api/ent/employeeconfig"
+
+	"entgo.io/ent/dialect/sql"
+	"entgo.io/ent/dialect/sql/sqlgraph"
+	"entgo.io/ent/schema/field"
+)
+
+// EmployeeConfigCreate is the builder for creating a EmployeeConfig entity.
+type EmployeeConfigCreate struct {
+	config
+	mutation *EmployeeConfigMutation
+	hooks    []Hook
+	conflict []sql.ConflictOption
+}
+
+// SetCreatedAt sets the "created_at" field.
+func (ecc *EmployeeConfigCreate) SetCreatedAt(t time.Time) *EmployeeConfigCreate {
+	ecc.mutation.SetCreatedAt(t)
+	return ecc
+}
+
+// SetNillableCreatedAt sets the "created_at" field if the given value is not nil.
+func (ecc *EmployeeConfigCreate) SetNillableCreatedAt(t *time.Time) *EmployeeConfigCreate {
+	if t != nil {
+		ecc.SetCreatedAt(*t)
+	}
+	return ecc
+}
+
+// SetUpdatedAt sets the "updated_at" field.
+func (ecc *EmployeeConfigCreate) SetUpdatedAt(t time.Time) *EmployeeConfigCreate {
+	ecc.mutation.SetUpdatedAt(t)
+	return ecc
+}
+
+// SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.
+func (ecc *EmployeeConfigCreate) SetNillableUpdatedAt(t *time.Time) *EmployeeConfigCreate {
+	if t != nil {
+		ecc.SetUpdatedAt(*t)
+	}
+	return ecc
+}
+
+// SetDeletedAt sets the "deleted_at" field.
+func (ecc *EmployeeConfigCreate) SetDeletedAt(t time.Time) *EmployeeConfigCreate {
+	ecc.mutation.SetDeletedAt(t)
+	return ecc
+}
+
+// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
+func (ecc *EmployeeConfigCreate) SetNillableDeletedAt(t *time.Time) *EmployeeConfigCreate {
+	if t != nil {
+		ecc.SetDeletedAt(*t)
+	}
+	return ecc
+}
+
+// SetStype sets the "stype" field.
+func (ecc *EmployeeConfigCreate) SetStype(s string) *EmployeeConfigCreate {
+	ecc.mutation.SetStype(s)
+	return ecc
+}
+
+// SetNillableStype sets the "stype" field if the given value is not nil.
+func (ecc *EmployeeConfigCreate) SetNillableStype(s *string) *EmployeeConfigCreate {
+	if s != nil {
+		ecc.SetStype(*s)
+	}
+	return ecc
+}
+
+// SetTitle sets the "title" field.
+func (ecc *EmployeeConfigCreate) SetTitle(s string) *EmployeeConfigCreate {
+	ecc.mutation.SetTitle(s)
+	return ecc
+}
+
+// SetNillableTitle sets the "title" field if the given value is not nil.
+func (ecc *EmployeeConfigCreate) SetNillableTitle(s *string) *EmployeeConfigCreate {
+	if s != nil {
+		ecc.SetTitle(*s)
+	}
+	return ecc
+}
+
+// SetPhoto sets the "photo" field.
+func (ecc *EmployeeConfigCreate) SetPhoto(s string) *EmployeeConfigCreate {
+	ecc.mutation.SetPhoto(s)
+	return ecc
+}
+
+// SetNillablePhoto sets the "photo" field if the given value is not nil.
+func (ecc *EmployeeConfigCreate) SetNillablePhoto(s *string) *EmployeeConfigCreate {
+	if s != nil {
+		ecc.SetPhoto(*s)
+	}
+	return ecc
+}
+
+// SetOrganizationID sets the "organization_id" field.
+func (ecc *EmployeeConfigCreate) SetOrganizationID(u uint64) *EmployeeConfigCreate {
+	ecc.mutation.SetOrganizationID(u)
+	return ecc
+}
+
+// SetNillableOrganizationID sets the "organization_id" field if the given value is not nil.
+func (ecc *EmployeeConfigCreate) SetNillableOrganizationID(u *uint64) *EmployeeConfigCreate {
+	if u != nil {
+		ecc.SetOrganizationID(*u)
+	}
+	return ecc
+}
+
+// SetID sets the "id" field.
+func (ecc *EmployeeConfigCreate) SetID(u uint64) *EmployeeConfigCreate {
+	ecc.mutation.SetID(u)
+	return ecc
+}
+
+// Mutation returns the EmployeeConfigMutation object of the builder.
+func (ecc *EmployeeConfigCreate) Mutation() *EmployeeConfigMutation {
+	return ecc.mutation
+}
+
+// Save creates the EmployeeConfig in the database.
+func (ecc *EmployeeConfigCreate) Save(ctx context.Context) (*EmployeeConfig, error) {
+	if err := ecc.defaults(); err != nil {
+		return nil, err
+	}
+	return withHooks(ctx, ecc.sqlSave, ecc.mutation, ecc.hooks)
+}
+
+// SaveX calls Save and panics if Save returns an error.
+func (ecc *EmployeeConfigCreate) SaveX(ctx context.Context) *EmployeeConfig {
+	v, err := ecc.Save(ctx)
+	if err != nil {
+		panic(err)
+	}
+	return v
+}
+
+// Exec executes the query.
+func (ecc *EmployeeConfigCreate) Exec(ctx context.Context) error {
+	_, err := ecc.Save(ctx)
+	return err
+}
+
+// ExecX is like Exec, but panics if an error occurs.
+func (ecc *EmployeeConfigCreate) ExecX(ctx context.Context) {
+	if err := ecc.Exec(ctx); err != nil {
+		panic(err)
+	}
+}
+
+// defaults sets the default values of the builder before save.
+func (ecc *EmployeeConfigCreate) defaults() error {
+	if _, ok := ecc.mutation.CreatedAt(); !ok {
+		if employeeconfig.DefaultCreatedAt == nil {
+			return fmt.Errorf("ent: uninitialized employeeconfig.DefaultCreatedAt (forgotten import ent/runtime?)")
+		}
+		v := employeeconfig.DefaultCreatedAt()
+		ecc.mutation.SetCreatedAt(v)
+	}
+	if _, ok := ecc.mutation.UpdatedAt(); !ok {
+		if employeeconfig.DefaultUpdatedAt == nil {
+			return fmt.Errorf("ent: uninitialized employeeconfig.DefaultUpdatedAt (forgotten import ent/runtime?)")
+		}
+		v := employeeconfig.DefaultUpdatedAt()
+		ecc.mutation.SetUpdatedAt(v)
+	}
+	if _, ok := ecc.mutation.Stype(); !ok {
+		v := employeeconfig.DefaultStype
+		ecc.mutation.SetStype(v)
+	}
+	if _, ok := ecc.mutation.Title(); !ok {
+		v := employeeconfig.DefaultTitle
+		ecc.mutation.SetTitle(v)
+	}
+	if _, ok := ecc.mutation.Photo(); !ok {
+		v := employeeconfig.DefaultPhoto
+		ecc.mutation.SetPhoto(v)
+	}
+	if _, ok := ecc.mutation.OrganizationID(); !ok {
+		v := employeeconfig.DefaultOrganizationID
+		ecc.mutation.SetOrganizationID(v)
+	}
+	return nil
+}
+
+// check runs all checks and user-defined validators on the builder.
+func (ecc *EmployeeConfigCreate) check() error {
+	if _, ok := ecc.mutation.CreatedAt(); !ok {
+		return &ValidationError{Name: "created_at", err: errors.New(`ent: missing required field "EmployeeConfig.created_at"`)}
+	}
+	if _, ok := ecc.mutation.UpdatedAt(); !ok {
+		return &ValidationError{Name: "updated_at", err: errors.New(`ent: missing required field "EmployeeConfig.updated_at"`)}
+	}
+	if _, ok := ecc.mutation.Stype(); !ok {
+		return &ValidationError{Name: "stype", err: errors.New(`ent: missing required field "EmployeeConfig.stype"`)}
+	}
+	if _, ok := ecc.mutation.Title(); !ok {
+		return &ValidationError{Name: "title", err: errors.New(`ent: missing required field "EmployeeConfig.title"`)}
+	}
+	if _, ok := ecc.mutation.Photo(); !ok {
+		return &ValidationError{Name: "photo", err: errors.New(`ent: missing required field "EmployeeConfig.photo"`)}
+	}
+	return nil
+}
+
+func (ecc *EmployeeConfigCreate) sqlSave(ctx context.Context) (*EmployeeConfig, error) {
+	if err := ecc.check(); err != nil {
+		return nil, err
+	}
+	_node, _spec := ecc.createSpec()
+	if err := sqlgraph.CreateNode(ctx, ecc.driver, _spec); err != nil {
+		if sqlgraph.IsConstraintError(err) {
+			err = &ConstraintError{msg: err.Error(), wrap: err}
+		}
+		return nil, err
+	}
+	if _spec.ID.Value != _node.ID {
+		id := _spec.ID.Value.(int64)
+		_node.ID = uint64(id)
+	}
+	ecc.mutation.id = &_node.ID
+	ecc.mutation.done = true
+	return _node, nil
+}
+
+func (ecc *EmployeeConfigCreate) createSpec() (*EmployeeConfig, *sqlgraph.CreateSpec) {
+	var (
+		_node = &EmployeeConfig{config: ecc.config}
+		_spec = sqlgraph.NewCreateSpec(employeeconfig.Table, sqlgraph.NewFieldSpec(employeeconfig.FieldID, field.TypeUint64))
+	)
+	_spec.OnConflict = ecc.conflict
+	if id, ok := ecc.mutation.ID(); ok {
+		_node.ID = id
+		_spec.ID.Value = id
+	}
+	if value, ok := ecc.mutation.CreatedAt(); ok {
+		_spec.SetField(employeeconfig.FieldCreatedAt, field.TypeTime, value)
+		_node.CreatedAt = value
+	}
+	if value, ok := ecc.mutation.UpdatedAt(); ok {
+		_spec.SetField(employeeconfig.FieldUpdatedAt, field.TypeTime, value)
+		_node.UpdatedAt = value
+	}
+	if value, ok := ecc.mutation.DeletedAt(); ok {
+		_spec.SetField(employeeconfig.FieldDeletedAt, field.TypeTime, value)
+		_node.DeletedAt = value
+	}
+	if value, ok := ecc.mutation.Stype(); ok {
+		_spec.SetField(employeeconfig.FieldStype, field.TypeString, value)
+		_node.Stype = value
+	}
+	if value, ok := ecc.mutation.Title(); ok {
+		_spec.SetField(employeeconfig.FieldTitle, field.TypeString, value)
+		_node.Title = value
+	}
+	if value, ok := ecc.mutation.Photo(); ok {
+		_spec.SetField(employeeconfig.FieldPhoto, field.TypeString, value)
+		_node.Photo = value
+	}
+	if value, ok := ecc.mutation.OrganizationID(); ok {
+		_spec.SetField(employeeconfig.FieldOrganizationID, field.TypeUint64, value)
+		_node.OrganizationID = value
+	}
+	return _node, _spec
+}
+
+// OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause
+// of the `INSERT` statement. For example:
+//
+//	client.EmployeeConfig.Create().
+//		SetCreatedAt(v).
+//		OnConflict(
+//			// Update the row with the new values
+//			// the was proposed for insertion.
+//			sql.ResolveWithNewValues(),
+//		).
+//		// Override some of the fields with custom
+//		// update values.
+//		Update(func(u *ent.EmployeeConfigUpsert) {
+//			SetCreatedAt(v+v).
+//		}).
+//		Exec(ctx)
+func (ecc *EmployeeConfigCreate) OnConflict(opts ...sql.ConflictOption) *EmployeeConfigUpsertOne {
+	ecc.conflict = opts
+	return &EmployeeConfigUpsertOne{
+		create: ecc,
+	}
+}
+
+// OnConflictColumns calls `OnConflict` and configures the columns
+// as conflict target. Using this option is equivalent to using:
+//
+//	client.EmployeeConfig.Create().
+//		OnConflict(sql.ConflictColumns(columns...)).
+//		Exec(ctx)
+func (ecc *EmployeeConfigCreate) OnConflictColumns(columns ...string) *EmployeeConfigUpsertOne {
+	ecc.conflict = append(ecc.conflict, sql.ConflictColumns(columns...))
+	return &EmployeeConfigUpsertOne{
+		create: ecc,
+	}
+}
+
+type (
+	// EmployeeConfigUpsertOne is the builder for "upsert"-ing
+	//  one EmployeeConfig node.
+	EmployeeConfigUpsertOne struct {
+		create *EmployeeConfigCreate
+	}
+
+	// EmployeeConfigUpsert is the "OnConflict" setter.
+	EmployeeConfigUpsert struct {
+		*sql.UpdateSet
+	}
+)
+
+// SetUpdatedAt sets the "updated_at" field.
+func (u *EmployeeConfigUpsert) SetUpdatedAt(v time.Time) *EmployeeConfigUpsert {
+	u.Set(employeeconfig.FieldUpdatedAt, v)
+	return u
+}
+
+// UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
+func (u *EmployeeConfigUpsert) UpdateUpdatedAt() *EmployeeConfigUpsert {
+	u.SetExcluded(employeeconfig.FieldUpdatedAt)
+	return u
+}
+
+// SetDeletedAt sets the "deleted_at" field.
+func (u *EmployeeConfigUpsert) SetDeletedAt(v time.Time) *EmployeeConfigUpsert {
+	u.Set(employeeconfig.FieldDeletedAt, v)
+	return u
+}
+
+// UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
+func (u *EmployeeConfigUpsert) UpdateDeletedAt() *EmployeeConfigUpsert {
+	u.SetExcluded(employeeconfig.FieldDeletedAt)
+	return u
+}
+
+// ClearDeletedAt clears the value of the "deleted_at" field.
+func (u *EmployeeConfigUpsert) ClearDeletedAt() *EmployeeConfigUpsert {
+	u.SetNull(employeeconfig.FieldDeletedAt)
+	return u
+}
+
+// SetStype sets the "stype" field.
+func (u *EmployeeConfigUpsert) SetStype(v string) *EmployeeConfigUpsert {
+	u.Set(employeeconfig.FieldStype, v)
+	return u
+}
+
+// UpdateStype sets the "stype" field to the value that was provided on create.
+func (u *EmployeeConfigUpsert) UpdateStype() *EmployeeConfigUpsert {
+	u.SetExcluded(employeeconfig.FieldStype)
+	return u
+}
+
+// SetTitle sets the "title" field.
+func (u *EmployeeConfigUpsert) SetTitle(v string) *EmployeeConfigUpsert {
+	u.Set(employeeconfig.FieldTitle, v)
+	return u
+}
+
+// UpdateTitle sets the "title" field to the value that was provided on create.
+func (u *EmployeeConfigUpsert) UpdateTitle() *EmployeeConfigUpsert {
+	u.SetExcluded(employeeconfig.FieldTitle)
+	return u
+}
+
+// SetPhoto sets the "photo" field.
+func (u *EmployeeConfigUpsert) SetPhoto(v string) *EmployeeConfigUpsert {
+	u.Set(employeeconfig.FieldPhoto, v)
+	return u
+}
+
+// UpdatePhoto sets the "photo" field to the value that was provided on create.
+func (u *EmployeeConfigUpsert) UpdatePhoto() *EmployeeConfigUpsert {
+	u.SetExcluded(employeeconfig.FieldPhoto)
+	return u
+}
+
+// SetOrganizationID sets the "organization_id" field.
+func (u *EmployeeConfigUpsert) SetOrganizationID(v uint64) *EmployeeConfigUpsert {
+	u.Set(employeeconfig.FieldOrganizationID, v)
+	return u
+}
+
+// UpdateOrganizationID sets the "organization_id" field to the value that was provided on create.
+func (u *EmployeeConfigUpsert) UpdateOrganizationID() *EmployeeConfigUpsert {
+	u.SetExcluded(employeeconfig.FieldOrganizationID)
+	return u
+}
+
+// AddOrganizationID adds v to the "organization_id" field.
+func (u *EmployeeConfigUpsert) AddOrganizationID(v uint64) *EmployeeConfigUpsert {
+	u.Add(employeeconfig.FieldOrganizationID, v)
+	return u
+}
+
+// ClearOrganizationID clears the value of the "organization_id" field.
+func (u *EmployeeConfigUpsert) ClearOrganizationID() *EmployeeConfigUpsert {
+	u.SetNull(employeeconfig.FieldOrganizationID)
+	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:
+//
+//	client.EmployeeConfig.Create().
+//		OnConflict(
+//			sql.ResolveWithNewValues(),
+//			sql.ResolveWith(func(u *sql.UpdateSet) {
+//				u.SetIgnore(employeeconfig.FieldID)
+//			}),
+//		).
+//		Exec(ctx)
+func (u *EmployeeConfigUpsertOne) UpdateNewValues() *EmployeeConfigUpsertOne {
+	u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues())
+	u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) {
+		if _, exists := u.create.mutation.ID(); exists {
+			s.SetIgnore(employeeconfig.FieldID)
+		}
+		if _, exists := u.create.mutation.CreatedAt(); exists {
+			s.SetIgnore(employeeconfig.FieldCreatedAt)
+		}
+	}))
+	return u
+}
+
+// Ignore sets each column to itself in case of conflict.
+// Using this option is equivalent to using:
+//
+//	client.EmployeeConfig.Create().
+//	    OnConflict(sql.ResolveWithIgnore()).
+//	    Exec(ctx)
+func (u *EmployeeConfigUpsertOne) Ignore() *EmployeeConfigUpsertOne {
+	u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore())
+	return u
+}
+
+// DoNothing configures the conflict_action to `DO NOTHING`.
+// Supported only by SQLite and PostgreSQL.
+func (u *EmployeeConfigUpsertOne) DoNothing() *EmployeeConfigUpsertOne {
+	u.create.conflict = append(u.create.conflict, sql.DoNothing())
+	return u
+}
+
+// Update allows overriding fields `UPDATE` values. See the EmployeeConfigCreate.OnConflict
+// documentation for more info.
+func (u *EmployeeConfigUpsertOne) Update(set func(*EmployeeConfigUpsert)) *EmployeeConfigUpsertOne {
+	u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) {
+		set(&EmployeeConfigUpsert{UpdateSet: update})
+	}))
+	return u
+}
+
+// SetUpdatedAt sets the "updated_at" field.
+func (u *EmployeeConfigUpsertOne) SetUpdatedAt(v time.Time) *EmployeeConfigUpsertOne {
+	return u.Update(func(s *EmployeeConfigUpsert) {
+		s.SetUpdatedAt(v)
+	})
+}
+
+// UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
+func (u *EmployeeConfigUpsertOne) UpdateUpdatedAt() *EmployeeConfigUpsertOne {
+	return u.Update(func(s *EmployeeConfigUpsert) {
+		s.UpdateUpdatedAt()
+	})
+}
+
+// SetDeletedAt sets the "deleted_at" field.
+func (u *EmployeeConfigUpsertOne) SetDeletedAt(v time.Time) *EmployeeConfigUpsertOne {
+	return u.Update(func(s *EmployeeConfigUpsert) {
+		s.SetDeletedAt(v)
+	})
+}
+
+// UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
+func (u *EmployeeConfigUpsertOne) UpdateDeletedAt() *EmployeeConfigUpsertOne {
+	return u.Update(func(s *EmployeeConfigUpsert) {
+		s.UpdateDeletedAt()
+	})
+}
+
+// ClearDeletedAt clears the value of the "deleted_at" field.
+func (u *EmployeeConfigUpsertOne) ClearDeletedAt() *EmployeeConfigUpsertOne {
+	return u.Update(func(s *EmployeeConfigUpsert) {
+		s.ClearDeletedAt()
+	})
+}
+
+// SetStype sets the "stype" field.
+func (u *EmployeeConfigUpsertOne) SetStype(v string) *EmployeeConfigUpsertOne {
+	return u.Update(func(s *EmployeeConfigUpsert) {
+		s.SetStype(v)
+	})
+}
+
+// UpdateStype sets the "stype" field to the value that was provided on create.
+func (u *EmployeeConfigUpsertOne) UpdateStype() *EmployeeConfigUpsertOne {
+	return u.Update(func(s *EmployeeConfigUpsert) {
+		s.UpdateStype()
+	})
+}
+
+// SetTitle sets the "title" field.
+func (u *EmployeeConfigUpsertOne) SetTitle(v string) *EmployeeConfigUpsertOne {
+	return u.Update(func(s *EmployeeConfigUpsert) {
+		s.SetTitle(v)
+	})
+}
+
+// UpdateTitle sets the "title" field to the value that was provided on create.
+func (u *EmployeeConfigUpsertOne) UpdateTitle() *EmployeeConfigUpsertOne {
+	return u.Update(func(s *EmployeeConfigUpsert) {
+		s.UpdateTitle()
+	})
+}
+
+// SetPhoto sets the "photo" field.
+func (u *EmployeeConfigUpsertOne) SetPhoto(v string) *EmployeeConfigUpsertOne {
+	return u.Update(func(s *EmployeeConfigUpsert) {
+		s.SetPhoto(v)
+	})
+}
+
+// UpdatePhoto sets the "photo" field to the value that was provided on create.
+func (u *EmployeeConfigUpsertOne) UpdatePhoto() *EmployeeConfigUpsertOne {
+	return u.Update(func(s *EmployeeConfigUpsert) {
+		s.UpdatePhoto()
+	})
+}
+
+// SetOrganizationID sets the "organization_id" field.
+func (u *EmployeeConfigUpsertOne) SetOrganizationID(v uint64) *EmployeeConfigUpsertOne {
+	return u.Update(func(s *EmployeeConfigUpsert) {
+		s.SetOrganizationID(v)
+	})
+}
+
+// AddOrganizationID adds v to the "organization_id" field.
+func (u *EmployeeConfigUpsertOne) AddOrganizationID(v uint64) *EmployeeConfigUpsertOne {
+	return u.Update(func(s *EmployeeConfigUpsert) {
+		s.AddOrganizationID(v)
+	})
+}
+
+// UpdateOrganizationID sets the "organization_id" field to the value that was provided on create.
+func (u *EmployeeConfigUpsertOne) UpdateOrganizationID() *EmployeeConfigUpsertOne {
+	return u.Update(func(s *EmployeeConfigUpsert) {
+		s.UpdateOrganizationID()
+	})
+}
+
+// ClearOrganizationID clears the value of the "organization_id" field.
+func (u *EmployeeConfigUpsertOne) ClearOrganizationID() *EmployeeConfigUpsertOne {
+	return u.Update(func(s *EmployeeConfigUpsert) {
+		s.ClearOrganizationID()
+	})
+}
+
+// Exec executes the query.
+func (u *EmployeeConfigUpsertOne) Exec(ctx context.Context) error {
+	if len(u.create.conflict) == 0 {
+		return errors.New("ent: missing options for EmployeeConfigCreate.OnConflict")
+	}
+	return u.create.Exec(ctx)
+}
+
+// ExecX is like Exec, but panics if an error occurs.
+func (u *EmployeeConfigUpsertOne) ExecX(ctx context.Context) {
+	if err := u.create.Exec(ctx); err != nil {
+		panic(err)
+	}
+}
+
+// Exec executes the UPSERT query and returns the inserted/updated ID.
+func (u *EmployeeConfigUpsertOne) ID(ctx context.Context) (id uint64, err error) {
+	node, err := u.create.Save(ctx)
+	if err != nil {
+		return id, err
+	}
+	return node.ID, nil
+}
+
+// IDX is like ID, but panics if an error occurs.
+func (u *EmployeeConfigUpsertOne) IDX(ctx context.Context) uint64 {
+	id, err := u.ID(ctx)
+	if err != nil {
+		panic(err)
+	}
+	return id
+}
+
+// EmployeeConfigCreateBulk is the builder for creating many EmployeeConfig entities in bulk.
+type EmployeeConfigCreateBulk struct {
+	config
+	err      error
+	builders []*EmployeeConfigCreate
+	conflict []sql.ConflictOption
+}
+
+// Save creates the EmployeeConfig entities in the database.
+func (eccb *EmployeeConfigCreateBulk) Save(ctx context.Context) ([]*EmployeeConfig, error) {
+	if eccb.err != nil {
+		return nil, eccb.err
+	}
+	specs := make([]*sqlgraph.CreateSpec, len(eccb.builders))
+	nodes := make([]*EmployeeConfig, len(eccb.builders))
+	mutators := make([]Mutator, len(eccb.builders))
+	for i := range eccb.builders {
+		func(i int, root context.Context) {
+			builder := eccb.builders[i]
+			builder.defaults()
+			var mut Mutator = MutateFunc(func(ctx context.Context, m Mutation) (Value, error) {
+				mutation, ok := m.(*EmployeeConfigMutation)
+				if !ok {
+					return nil, fmt.Errorf("unexpected mutation type %T", m)
+				}
+				if err := builder.check(); err != nil {
+					return nil, err
+				}
+				builder.mutation = mutation
+				var err error
+				nodes[i], specs[i] = builder.createSpec()
+				if i < len(mutators)-1 {
+					_, err = mutators[i+1].Mutate(root, eccb.builders[i+1].mutation)
+				} else {
+					spec := &sqlgraph.BatchCreateSpec{Nodes: specs}
+					spec.OnConflict = eccb.conflict
+					// Invoke the actual operation on the latest mutation in the chain.
+					if err = sqlgraph.BatchCreate(ctx, eccb.driver, spec); err != nil {
+						if sqlgraph.IsConstraintError(err) {
+							err = &ConstraintError{msg: err.Error(), wrap: err}
+						}
+					}
+				}
+				if err != nil {
+					return nil, err
+				}
+				mutation.id = &nodes[i].ID
+				if specs[i].ID.Value != nil && nodes[i].ID == 0 {
+					id := specs[i].ID.Value.(int64)
+					nodes[i].ID = uint64(id)
+				}
+				mutation.done = true
+				return nodes[i], nil
+			})
+			for i := len(builder.hooks) - 1; i >= 0; i-- {
+				mut = builder.hooks[i](mut)
+			}
+			mutators[i] = mut
+		}(i, ctx)
+	}
+	if len(mutators) > 0 {
+		if _, err := mutators[0].Mutate(ctx, eccb.builders[0].mutation); err != nil {
+			return nil, err
+		}
+	}
+	return nodes, nil
+}
+
+// SaveX is like Save, but panics if an error occurs.
+func (eccb *EmployeeConfigCreateBulk) SaveX(ctx context.Context) []*EmployeeConfig {
+	v, err := eccb.Save(ctx)
+	if err != nil {
+		panic(err)
+	}
+	return v
+}
+
+// Exec executes the query.
+func (eccb *EmployeeConfigCreateBulk) Exec(ctx context.Context) error {
+	_, err := eccb.Save(ctx)
+	return err
+}
+
+// ExecX is like Exec, but panics if an error occurs.
+func (eccb *EmployeeConfigCreateBulk) ExecX(ctx context.Context) {
+	if err := eccb.Exec(ctx); err != nil {
+		panic(err)
+	}
+}
+
+// OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause
+// of the `INSERT` statement. For example:
+//
+//	client.EmployeeConfig.CreateBulk(builders...).
+//		OnConflict(
+//			// Update the row with the new values
+//			// the was proposed for insertion.
+//			sql.ResolveWithNewValues(),
+//		).
+//		// Override some of the fields with custom
+//		// update values.
+//		Update(func(u *ent.EmployeeConfigUpsert) {
+//			SetCreatedAt(v+v).
+//		}).
+//		Exec(ctx)
+func (eccb *EmployeeConfigCreateBulk) OnConflict(opts ...sql.ConflictOption) *EmployeeConfigUpsertBulk {
+	eccb.conflict = opts
+	return &EmployeeConfigUpsertBulk{
+		create: eccb,
+	}
+}
+
+// OnConflictColumns calls `OnConflict` and configures the columns
+// as conflict target. Using this option is equivalent to using:
+//
+//	client.EmployeeConfig.Create().
+//		OnConflict(sql.ConflictColumns(columns...)).
+//		Exec(ctx)
+func (eccb *EmployeeConfigCreateBulk) OnConflictColumns(columns ...string) *EmployeeConfigUpsertBulk {
+	eccb.conflict = append(eccb.conflict, sql.ConflictColumns(columns...))
+	return &EmployeeConfigUpsertBulk{
+		create: eccb,
+	}
+}
+
+// EmployeeConfigUpsertBulk is the builder for "upsert"-ing
+// a bulk of EmployeeConfig nodes.
+type EmployeeConfigUpsertBulk struct {
+	create *EmployeeConfigCreateBulk
+}
+
+// UpdateNewValues updates the mutable fields using the new values that
+// were set on create. Using this option is equivalent to using:
+//
+//	client.EmployeeConfig.Create().
+//		OnConflict(
+//			sql.ResolveWithNewValues(),
+//			sql.ResolveWith(func(u *sql.UpdateSet) {
+//				u.SetIgnore(employeeconfig.FieldID)
+//			}),
+//		).
+//		Exec(ctx)
+func (u *EmployeeConfigUpsertBulk) UpdateNewValues() *EmployeeConfigUpsertBulk {
+	u.create.conflict = append(u.create.conflict, sql.ResolveWithNewValues())
+	u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(s *sql.UpdateSet) {
+		for _, b := range u.create.builders {
+			if _, exists := b.mutation.ID(); exists {
+				s.SetIgnore(employeeconfig.FieldID)
+			}
+			if _, exists := b.mutation.CreatedAt(); exists {
+				s.SetIgnore(employeeconfig.FieldCreatedAt)
+			}
+		}
+	}))
+	return u
+}
+
+// Ignore sets each column to itself in case of conflict.
+// Using this option is equivalent to using:
+//
+//	client.EmployeeConfig.Create().
+//		OnConflict(sql.ResolveWithIgnore()).
+//		Exec(ctx)
+func (u *EmployeeConfigUpsertBulk) Ignore() *EmployeeConfigUpsertBulk {
+	u.create.conflict = append(u.create.conflict, sql.ResolveWithIgnore())
+	return u
+}
+
+// DoNothing configures the conflict_action to `DO NOTHING`.
+// Supported only by SQLite and PostgreSQL.
+func (u *EmployeeConfigUpsertBulk) DoNothing() *EmployeeConfigUpsertBulk {
+	u.create.conflict = append(u.create.conflict, sql.DoNothing())
+	return u
+}
+
+// Update allows overriding fields `UPDATE` values. See the EmployeeConfigCreateBulk.OnConflict
+// documentation for more info.
+func (u *EmployeeConfigUpsertBulk) Update(set func(*EmployeeConfigUpsert)) *EmployeeConfigUpsertBulk {
+	u.create.conflict = append(u.create.conflict, sql.ResolveWith(func(update *sql.UpdateSet) {
+		set(&EmployeeConfigUpsert{UpdateSet: update})
+	}))
+	return u
+}
+
+// SetUpdatedAt sets the "updated_at" field.
+func (u *EmployeeConfigUpsertBulk) SetUpdatedAt(v time.Time) *EmployeeConfigUpsertBulk {
+	return u.Update(func(s *EmployeeConfigUpsert) {
+		s.SetUpdatedAt(v)
+	})
+}
+
+// UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.
+func (u *EmployeeConfigUpsertBulk) UpdateUpdatedAt() *EmployeeConfigUpsertBulk {
+	return u.Update(func(s *EmployeeConfigUpsert) {
+		s.UpdateUpdatedAt()
+	})
+}
+
+// SetDeletedAt sets the "deleted_at" field.
+func (u *EmployeeConfigUpsertBulk) SetDeletedAt(v time.Time) *EmployeeConfigUpsertBulk {
+	return u.Update(func(s *EmployeeConfigUpsert) {
+		s.SetDeletedAt(v)
+	})
+}
+
+// UpdateDeletedAt sets the "deleted_at" field to the value that was provided on create.
+func (u *EmployeeConfigUpsertBulk) UpdateDeletedAt() *EmployeeConfigUpsertBulk {
+	return u.Update(func(s *EmployeeConfigUpsert) {
+		s.UpdateDeletedAt()
+	})
+}
+
+// ClearDeletedAt clears the value of the "deleted_at" field.
+func (u *EmployeeConfigUpsertBulk) ClearDeletedAt() *EmployeeConfigUpsertBulk {
+	return u.Update(func(s *EmployeeConfigUpsert) {
+		s.ClearDeletedAt()
+	})
+}
+
+// SetStype sets the "stype" field.
+func (u *EmployeeConfigUpsertBulk) SetStype(v string) *EmployeeConfigUpsertBulk {
+	return u.Update(func(s *EmployeeConfigUpsert) {
+		s.SetStype(v)
+	})
+}
+
+// UpdateStype sets the "stype" field to the value that was provided on create.
+func (u *EmployeeConfigUpsertBulk) UpdateStype() *EmployeeConfigUpsertBulk {
+	return u.Update(func(s *EmployeeConfigUpsert) {
+		s.UpdateStype()
+	})
+}
+
+// SetTitle sets the "title" field.
+func (u *EmployeeConfigUpsertBulk) SetTitle(v string) *EmployeeConfigUpsertBulk {
+	return u.Update(func(s *EmployeeConfigUpsert) {
+		s.SetTitle(v)
+	})
+}
+
+// UpdateTitle sets the "title" field to the value that was provided on create.
+func (u *EmployeeConfigUpsertBulk) UpdateTitle() *EmployeeConfigUpsertBulk {
+	return u.Update(func(s *EmployeeConfigUpsert) {
+		s.UpdateTitle()
+	})
+}
+
+// SetPhoto sets the "photo" field.
+func (u *EmployeeConfigUpsertBulk) SetPhoto(v string) *EmployeeConfigUpsertBulk {
+	return u.Update(func(s *EmployeeConfigUpsert) {
+		s.SetPhoto(v)
+	})
+}
+
+// UpdatePhoto sets the "photo" field to the value that was provided on create.
+func (u *EmployeeConfigUpsertBulk) UpdatePhoto() *EmployeeConfigUpsertBulk {
+	return u.Update(func(s *EmployeeConfigUpsert) {
+		s.UpdatePhoto()
+	})
+}
+
+// SetOrganizationID sets the "organization_id" field.
+func (u *EmployeeConfigUpsertBulk) SetOrganizationID(v uint64) *EmployeeConfigUpsertBulk {
+	return u.Update(func(s *EmployeeConfigUpsert) {
+		s.SetOrganizationID(v)
+	})
+}
+
+// AddOrganizationID adds v to the "organization_id" field.
+func (u *EmployeeConfigUpsertBulk) AddOrganizationID(v uint64) *EmployeeConfigUpsertBulk {
+	return u.Update(func(s *EmployeeConfigUpsert) {
+		s.AddOrganizationID(v)
+	})
+}
+
+// UpdateOrganizationID sets the "organization_id" field to the value that was provided on create.
+func (u *EmployeeConfigUpsertBulk) UpdateOrganizationID() *EmployeeConfigUpsertBulk {
+	return u.Update(func(s *EmployeeConfigUpsert) {
+		s.UpdateOrganizationID()
+	})
+}
+
+// ClearOrganizationID clears the value of the "organization_id" field.
+func (u *EmployeeConfigUpsertBulk) ClearOrganizationID() *EmployeeConfigUpsertBulk {
+	return u.Update(func(s *EmployeeConfigUpsert) {
+		s.ClearOrganizationID()
+	})
+}
+
+// Exec executes the query.
+func (u *EmployeeConfigUpsertBulk) Exec(ctx context.Context) error {
+	if u.create.err != nil {
+		return u.create.err
+	}
+	for i, b := range u.create.builders {
+		if len(b.conflict) != 0 {
+			return fmt.Errorf("ent: OnConflict was set for builder %d. Set it on the EmployeeConfigCreateBulk instead", i)
+		}
+	}
+	if len(u.create.conflict) == 0 {
+		return errors.New("ent: missing options for EmployeeConfigCreateBulk.OnConflict")
+	}
+	return u.create.Exec(ctx)
+}
+
+// ExecX is like Exec, but panics if an error occurs.
+func (u *EmployeeConfigUpsertBulk) ExecX(ctx context.Context) {
+	if err := u.create.Exec(ctx); err != nil {
+		panic(err)
+	}
+}

+ 88 - 0
ent/employeeconfig_delete.go

@@ -0,0 +1,88 @@
+// Code generated by ent, DO NOT EDIT.
+
+package ent
+
+import (
+	"context"
+	"wechat-api/ent/employeeconfig"
+	"wechat-api/ent/predicate"
+
+	"entgo.io/ent/dialect/sql"
+	"entgo.io/ent/dialect/sql/sqlgraph"
+	"entgo.io/ent/schema/field"
+)
+
+// EmployeeConfigDelete is the builder for deleting a EmployeeConfig entity.
+type EmployeeConfigDelete struct {
+	config
+	hooks    []Hook
+	mutation *EmployeeConfigMutation
+}
+
+// Where appends a list predicates to the EmployeeConfigDelete builder.
+func (ecd *EmployeeConfigDelete) Where(ps ...predicate.EmployeeConfig) *EmployeeConfigDelete {
+	ecd.mutation.Where(ps...)
+	return ecd
+}
+
+// Exec executes the deletion query and returns how many vertices were deleted.
+func (ecd *EmployeeConfigDelete) Exec(ctx context.Context) (int, error) {
+	return withHooks(ctx, ecd.sqlExec, ecd.mutation, ecd.hooks)
+}
+
+// ExecX is like Exec, but panics if an error occurs.
+func (ecd *EmployeeConfigDelete) ExecX(ctx context.Context) int {
+	n, err := ecd.Exec(ctx)
+	if err != nil {
+		panic(err)
+	}
+	return n
+}
+
+func (ecd *EmployeeConfigDelete) sqlExec(ctx context.Context) (int, error) {
+	_spec := sqlgraph.NewDeleteSpec(employeeconfig.Table, sqlgraph.NewFieldSpec(employeeconfig.FieldID, field.TypeUint64))
+	if ps := ecd.mutation.predicates; len(ps) > 0 {
+		_spec.Predicate = func(selector *sql.Selector) {
+			for i := range ps {
+				ps[i](selector)
+			}
+		}
+	}
+	affected, err := sqlgraph.DeleteNodes(ctx, ecd.driver, _spec)
+	if err != nil && sqlgraph.IsConstraintError(err) {
+		err = &ConstraintError{msg: err.Error(), wrap: err}
+	}
+	ecd.mutation.done = true
+	return affected, err
+}
+
+// EmployeeConfigDeleteOne is the builder for deleting a single EmployeeConfig entity.
+type EmployeeConfigDeleteOne struct {
+	ecd *EmployeeConfigDelete
+}
+
+// Where appends a list predicates to the EmployeeConfigDelete builder.
+func (ecdo *EmployeeConfigDeleteOne) Where(ps ...predicate.EmployeeConfig) *EmployeeConfigDeleteOne {
+	ecdo.ecd.mutation.Where(ps...)
+	return ecdo
+}
+
+// Exec executes the deletion query.
+func (ecdo *EmployeeConfigDeleteOne) Exec(ctx context.Context) error {
+	n, err := ecdo.ecd.Exec(ctx)
+	switch {
+	case err != nil:
+		return err
+	case n == 0:
+		return &NotFoundError{employeeconfig.Label}
+	default:
+		return nil
+	}
+}
+
+// ExecX is like Exec, but panics if an error occurs.
+func (ecdo *EmployeeConfigDeleteOne) ExecX(ctx context.Context) {
+	if err := ecdo.Exec(ctx); err != nil {
+		panic(err)
+	}
+}

+ 526 - 0
ent/employeeconfig_query.go

@@ -0,0 +1,526 @@
+// Code generated by ent, DO NOT EDIT.
+
+package ent
+
+import (
+	"context"
+	"fmt"
+	"math"
+	"wechat-api/ent/employeeconfig"
+	"wechat-api/ent/predicate"
+
+	"entgo.io/ent/dialect/sql"
+	"entgo.io/ent/dialect/sql/sqlgraph"
+	"entgo.io/ent/schema/field"
+)
+
+// EmployeeConfigQuery is the builder for querying EmployeeConfig entities.
+type EmployeeConfigQuery struct {
+	config
+	ctx        *QueryContext
+	order      []employeeconfig.OrderOption
+	inters     []Interceptor
+	predicates []predicate.EmployeeConfig
+	// intermediate query (i.e. traversal path).
+	sql  *sql.Selector
+	path func(context.Context) (*sql.Selector, error)
+}
+
+// Where adds a new predicate for the EmployeeConfigQuery builder.
+func (ecq *EmployeeConfigQuery) Where(ps ...predicate.EmployeeConfig) *EmployeeConfigQuery {
+	ecq.predicates = append(ecq.predicates, ps...)
+	return ecq
+}
+
+// Limit the number of records to be returned by this query.
+func (ecq *EmployeeConfigQuery) Limit(limit int) *EmployeeConfigQuery {
+	ecq.ctx.Limit = &limit
+	return ecq
+}
+
+// Offset to start from.
+func (ecq *EmployeeConfigQuery) Offset(offset int) *EmployeeConfigQuery {
+	ecq.ctx.Offset = &offset
+	return ecq
+}
+
+// Unique configures the query builder to filter duplicate records on query.
+// By default, unique is set to true, and can be disabled using this method.
+func (ecq *EmployeeConfigQuery) Unique(unique bool) *EmployeeConfigQuery {
+	ecq.ctx.Unique = &unique
+	return ecq
+}
+
+// Order specifies how the records should be ordered.
+func (ecq *EmployeeConfigQuery) Order(o ...employeeconfig.OrderOption) *EmployeeConfigQuery {
+	ecq.order = append(ecq.order, o...)
+	return ecq
+}
+
+// First returns the first EmployeeConfig entity from the query.
+// Returns a *NotFoundError when no EmployeeConfig was found.
+func (ecq *EmployeeConfigQuery) First(ctx context.Context) (*EmployeeConfig, error) {
+	nodes, err := ecq.Limit(1).All(setContextOp(ctx, ecq.ctx, "First"))
+	if err != nil {
+		return nil, err
+	}
+	if len(nodes) == 0 {
+		return nil, &NotFoundError{employeeconfig.Label}
+	}
+	return nodes[0], nil
+}
+
+// FirstX is like First, but panics if an error occurs.
+func (ecq *EmployeeConfigQuery) FirstX(ctx context.Context) *EmployeeConfig {
+	node, err := ecq.First(ctx)
+	if err != nil && !IsNotFound(err) {
+		panic(err)
+	}
+	return node
+}
+
+// FirstID returns the first EmployeeConfig ID from the query.
+// Returns a *NotFoundError when no EmployeeConfig ID was found.
+func (ecq *EmployeeConfigQuery) FirstID(ctx context.Context) (id uint64, err error) {
+	var ids []uint64
+	if ids, err = ecq.Limit(1).IDs(setContextOp(ctx, ecq.ctx, "FirstID")); err != nil {
+		return
+	}
+	if len(ids) == 0 {
+		err = &NotFoundError{employeeconfig.Label}
+		return
+	}
+	return ids[0], nil
+}
+
+// FirstIDX is like FirstID, but panics if an error occurs.
+func (ecq *EmployeeConfigQuery) FirstIDX(ctx context.Context) uint64 {
+	id, err := ecq.FirstID(ctx)
+	if err != nil && !IsNotFound(err) {
+		panic(err)
+	}
+	return id
+}
+
+// Only returns a single EmployeeConfig entity found by the query, ensuring it only returns one.
+// Returns a *NotSingularError when more than one EmployeeConfig entity is found.
+// Returns a *NotFoundError when no EmployeeConfig entities are found.
+func (ecq *EmployeeConfigQuery) Only(ctx context.Context) (*EmployeeConfig, error) {
+	nodes, err := ecq.Limit(2).All(setContextOp(ctx, ecq.ctx, "Only"))
+	if err != nil {
+		return nil, err
+	}
+	switch len(nodes) {
+	case 1:
+		return nodes[0], nil
+	case 0:
+		return nil, &NotFoundError{employeeconfig.Label}
+	default:
+		return nil, &NotSingularError{employeeconfig.Label}
+	}
+}
+
+// OnlyX is like Only, but panics if an error occurs.
+func (ecq *EmployeeConfigQuery) OnlyX(ctx context.Context) *EmployeeConfig {
+	node, err := ecq.Only(ctx)
+	if err != nil {
+		panic(err)
+	}
+	return node
+}
+
+// OnlyID is like Only, but returns the only EmployeeConfig ID in the query.
+// Returns a *NotSingularError when more than one EmployeeConfig ID is found.
+// Returns a *NotFoundError when no entities are found.
+func (ecq *EmployeeConfigQuery) OnlyID(ctx context.Context) (id uint64, err error) {
+	var ids []uint64
+	if ids, err = ecq.Limit(2).IDs(setContextOp(ctx, ecq.ctx, "OnlyID")); err != nil {
+		return
+	}
+	switch len(ids) {
+	case 1:
+		id = ids[0]
+	case 0:
+		err = &NotFoundError{employeeconfig.Label}
+	default:
+		err = &NotSingularError{employeeconfig.Label}
+	}
+	return
+}
+
+// OnlyIDX is like OnlyID, but panics if an error occurs.
+func (ecq *EmployeeConfigQuery) OnlyIDX(ctx context.Context) uint64 {
+	id, err := ecq.OnlyID(ctx)
+	if err != nil {
+		panic(err)
+	}
+	return id
+}
+
+// All executes the query and returns a list of EmployeeConfigs.
+func (ecq *EmployeeConfigQuery) All(ctx context.Context) ([]*EmployeeConfig, error) {
+	ctx = setContextOp(ctx, ecq.ctx, "All")
+	if err := ecq.prepareQuery(ctx); err != nil {
+		return nil, err
+	}
+	qr := querierAll[[]*EmployeeConfig, *EmployeeConfigQuery]()
+	return withInterceptors[[]*EmployeeConfig](ctx, ecq, qr, ecq.inters)
+}
+
+// AllX is like All, but panics if an error occurs.
+func (ecq *EmployeeConfigQuery) AllX(ctx context.Context) []*EmployeeConfig {
+	nodes, err := ecq.All(ctx)
+	if err != nil {
+		panic(err)
+	}
+	return nodes
+}
+
+// IDs executes the query and returns a list of EmployeeConfig IDs.
+func (ecq *EmployeeConfigQuery) IDs(ctx context.Context) (ids []uint64, err error) {
+	if ecq.ctx.Unique == nil && ecq.path != nil {
+		ecq.Unique(true)
+	}
+	ctx = setContextOp(ctx, ecq.ctx, "IDs")
+	if err = ecq.Select(employeeconfig.FieldID).Scan(ctx, &ids); err != nil {
+		return nil, err
+	}
+	return ids, nil
+}
+
+// IDsX is like IDs, but panics if an error occurs.
+func (ecq *EmployeeConfigQuery) IDsX(ctx context.Context) []uint64 {
+	ids, err := ecq.IDs(ctx)
+	if err != nil {
+		panic(err)
+	}
+	return ids
+}
+
+// Count returns the count of the given query.
+func (ecq *EmployeeConfigQuery) Count(ctx context.Context) (int, error) {
+	ctx = setContextOp(ctx, ecq.ctx, "Count")
+	if err := ecq.prepareQuery(ctx); err != nil {
+		return 0, err
+	}
+	return withInterceptors[int](ctx, ecq, querierCount[*EmployeeConfigQuery](), ecq.inters)
+}
+
+// CountX is like Count, but panics if an error occurs.
+func (ecq *EmployeeConfigQuery) CountX(ctx context.Context) int {
+	count, err := ecq.Count(ctx)
+	if err != nil {
+		panic(err)
+	}
+	return count
+}
+
+// Exist returns true if the query has elements in the graph.
+func (ecq *EmployeeConfigQuery) Exist(ctx context.Context) (bool, error) {
+	ctx = setContextOp(ctx, ecq.ctx, "Exist")
+	switch _, err := ecq.FirstID(ctx); {
+	case IsNotFound(err):
+		return false, nil
+	case err != nil:
+		return false, fmt.Errorf("ent: check existence: %w", err)
+	default:
+		return true, nil
+	}
+}
+
+// ExistX is like Exist, but panics if an error occurs.
+func (ecq *EmployeeConfigQuery) ExistX(ctx context.Context) bool {
+	exist, err := ecq.Exist(ctx)
+	if err != nil {
+		panic(err)
+	}
+	return exist
+}
+
+// Clone returns a duplicate of the EmployeeConfigQuery builder, including all associated steps. It can be
+// used to prepare common query builders and use them differently after the clone is made.
+func (ecq *EmployeeConfigQuery) Clone() *EmployeeConfigQuery {
+	if ecq == nil {
+		return nil
+	}
+	return &EmployeeConfigQuery{
+		config:     ecq.config,
+		ctx:        ecq.ctx.Clone(),
+		order:      append([]employeeconfig.OrderOption{}, ecq.order...),
+		inters:     append([]Interceptor{}, ecq.inters...),
+		predicates: append([]predicate.EmployeeConfig{}, ecq.predicates...),
+		// clone intermediate query.
+		sql:  ecq.sql.Clone(),
+		path: ecq.path,
+	}
+}
+
+// GroupBy is used to group vertices by one or more fields/columns.
+// It is often used with aggregate functions, like: count, max, mean, min, sum.
+//
+// Example:
+//
+//	var v []struct {
+//		CreatedAt time.Time `json:"created_at,omitempty"`
+//		Count int `json:"count,omitempty"`
+//	}
+//
+//	client.EmployeeConfig.Query().
+//		GroupBy(employeeconfig.FieldCreatedAt).
+//		Aggregate(ent.Count()).
+//		Scan(ctx, &v)
+func (ecq *EmployeeConfigQuery) GroupBy(field string, fields ...string) *EmployeeConfigGroupBy {
+	ecq.ctx.Fields = append([]string{field}, fields...)
+	grbuild := &EmployeeConfigGroupBy{build: ecq}
+	grbuild.flds = &ecq.ctx.Fields
+	grbuild.label = employeeconfig.Label
+	grbuild.scan = grbuild.Scan
+	return grbuild
+}
+
+// Select allows the selection one or more fields/columns for the given query,
+// instead of selecting all fields in the entity.
+//
+// Example:
+//
+//	var v []struct {
+//		CreatedAt time.Time `json:"created_at,omitempty"`
+//	}
+//
+//	client.EmployeeConfig.Query().
+//		Select(employeeconfig.FieldCreatedAt).
+//		Scan(ctx, &v)
+func (ecq *EmployeeConfigQuery) Select(fields ...string) *EmployeeConfigSelect {
+	ecq.ctx.Fields = append(ecq.ctx.Fields, fields...)
+	sbuild := &EmployeeConfigSelect{EmployeeConfigQuery: ecq}
+	sbuild.label = employeeconfig.Label
+	sbuild.flds, sbuild.scan = &ecq.ctx.Fields, sbuild.Scan
+	return sbuild
+}
+
+// Aggregate returns a EmployeeConfigSelect configured with the given aggregations.
+func (ecq *EmployeeConfigQuery) Aggregate(fns ...AggregateFunc) *EmployeeConfigSelect {
+	return ecq.Select().Aggregate(fns...)
+}
+
+func (ecq *EmployeeConfigQuery) prepareQuery(ctx context.Context) error {
+	for _, inter := range ecq.inters {
+		if inter == nil {
+			return fmt.Errorf("ent: uninitialized interceptor (forgotten import ent/runtime?)")
+		}
+		if trv, ok := inter.(Traverser); ok {
+			if err := trv.Traverse(ctx, ecq); err != nil {
+				return err
+			}
+		}
+	}
+	for _, f := range ecq.ctx.Fields {
+		if !employeeconfig.ValidColumn(f) {
+			return &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)}
+		}
+	}
+	if ecq.path != nil {
+		prev, err := ecq.path(ctx)
+		if err != nil {
+			return err
+		}
+		ecq.sql = prev
+	}
+	return nil
+}
+
+func (ecq *EmployeeConfigQuery) sqlAll(ctx context.Context, hooks ...queryHook) ([]*EmployeeConfig, error) {
+	var (
+		nodes = []*EmployeeConfig{}
+		_spec = ecq.querySpec()
+	)
+	_spec.ScanValues = func(columns []string) ([]any, error) {
+		return (*EmployeeConfig).scanValues(nil, columns)
+	}
+	_spec.Assign = func(columns []string, values []any) error {
+		node := &EmployeeConfig{config: ecq.config}
+		nodes = append(nodes, node)
+		return node.assignValues(columns, values)
+	}
+	for i := range hooks {
+		hooks[i](ctx, _spec)
+	}
+	if err := sqlgraph.QueryNodes(ctx, ecq.driver, _spec); err != nil {
+		return nil, err
+	}
+	if len(nodes) == 0 {
+		return nodes, nil
+	}
+	return nodes, nil
+}
+
+func (ecq *EmployeeConfigQuery) sqlCount(ctx context.Context) (int, error) {
+	_spec := ecq.querySpec()
+	_spec.Node.Columns = ecq.ctx.Fields
+	if len(ecq.ctx.Fields) > 0 {
+		_spec.Unique = ecq.ctx.Unique != nil && *ecq.ctx.Unique
+	}
+	return sqlgraph.CountNodes(ctx, ecq.driver, _spec)
+}
+
+func (ecq *EmployeeConfigQuery) querySpec() *sqlgraph.QuerySpec {
+	_spec := sqlgraph.NewQuerySpec(employeeconfig.Table, employeeconfig.Columns, sqlgraph.NewFieldSpec(employeeconfig.FieldID, field.TypeUint64))
+	_spec.From = ecq.sql
+	if unique := ecq.ctx.Unique; unique != nil {
+		_spec.Unique = *unique
+	} else if ecq.path != nil {
+		_spec.Unique = true
+	}
+	if fields := ecq.ctx.Fields; len(fields) > 0 {
+		_spec.Node.Columns = make([]string, 0, len(fields))
+		_spec.Node.Columns = append(_spec.Node.Columns, employeeconfig.FieldID)
+		for i := range fields {
+			if fields[i] != employeeconfig.FieldID {
+				_spec.Node.Columns = append(_spec.Node.Columns, fields[i])
+			}
+		}
+	}
+	if ps := ecq.predicates; len(ps) > 0 {
+		_spec.Predicate = func(selector *sql.Selector) {
+			for i := range ps {
+				ps[i](selector)
+			}
+		}
+	}
+	if limit := ecq.ctx.Limit; limit != nil {
+		_spec.Limit = *limit
+	}
+	if offset := ecq.ctx.Offset; offset != nil {
+		_spec.Offset = *offset
+	}
+	if ps := ecq.order; len(ps) > 0 {
+		_spec.Order = func(selector *sql.Selector) {
+			for i := range ps {
+				ps[i](selector)
+			}
+		}
+	}
+	return _spec
+}
+
+func (ecq *EmployeeConfigQuery) sqlQuery(ctx context.Context) *sql.Selector {
+	builder := sql.Dialect(ecq.driver.Dialect())
+	t1 := builder.Table(employeeconfig.Table)
+	columns := ecq.ctx.Fields
+	if len(columns) == 0 {
+		columns = employeeconfig.Columns
+	}
+	selector := builder.Select(t1.Columns(columns...)...).From(t1)
+	if ecq.sql != nil {
+		selector = ecq.sql
+		selector.Select(selector.Columns(columns...)...)
+	}
+	if ecq.ctx.Unique != nil && *ecq.ctx.Unique {
+		selector.Distinct()
+	}
+	for _, p := range ecq.predicates {
+		p(selector)
+	}
+	for _, p := range ecq.order {
+		p(selector)
+	}
+	if offset := ecq.ctx.Offset; offset != nil {
+		// limit is mandatory for offset clause. We start
+		// with default value, and override it below if needed.
+		selector.Offset(*offset).Limit(math.MaxInt32)
+	}
+	if limit := ecq.ctx.Limit; limit != nil {
+		selector.Limit(*limit)
+	}
+	return selector
+}
+
+// EmployeeConfigGroupBy is the group-by builder for EmployeeConfig entities.
+type EmployeeConfigGroupBy struct {
+	selector
+	build *EmployeeConfigQuery
+}
+
+// Aggregate adds the given aggregation functions to the group-by query.
+func (ecgb *EmployeeConfigGroupBy) Aggregate(fns ...AggregateFunc) *EmployeeConfigGroupBy {
+	ecgb.fns = append(ecgb.fns, fns...)
+	return ecgb
+}
+
+// Scan applies the selector query and scans the result into the given value.
+func (ecgb *EmployeeConfigGroupBy) Scan(ctx context.Context, v any) error {
+	ctx = setContextOp(ctx, ecgb.build.ctx, "GroupBy")
+	if err := ecgb.build.prepareQuery(ctx); err != nil {
+		return err
+	}
+	return scanWithInterceptors[*EmployeeConfigQuery, *EmployeeConfigGroupBy](ctx, ecgb.build, ecgb, ecgb.build.inters, v)
+}
+
+func (ecgb *EmployeeConfigGroupBy) sqlScan(ctx context.Context, root *EmployeeConfigQuery, v any) error {
+	selector := root.sqlQuery(ctx).Select()
+	aggregation := make([]string, 0, len(ecgb.fns))
+	for _, fn := range ecgb.fns {
+		aggregation = append(aggregation, fn(selector))
+	}
+	if len(selector.SelectedColumns()) == 0 {
+		columns := make([]string, 0, len(*ecgb.flds)+len(ecgb.fns))
+		for _, f := range *ecgb.flds {
+			columns = append(columns, selector.C(f))
+		}
+		columns = append(columns, aggregation...)
+		selector.Select(columns...)
+	}
+	selector.GroupBy(selector.Columns(*ecgb.flds...)...)
+	if err := selector.Err(); err != nil {
+		return err
+	}
+	rows := &sql.Rows{}
+	query, args := selector.Query()
+	if err := ecgb.build.driver.Query(ctx, query, args, rows); err != nil {
+		return err
+	}
+	defer rows.Close()
+	return sql.ScanSlice(rows, v)
+}
+
+// EmployeeConfigSelect is the builder for selecting fields of EmployeeConfig entities.
+type EmployeeConfigSelect struct {
+	*EmployeeConfigQuery
+	selector
+}
+
+// Aggregate adds the given aggregation functions to the selector query.
+func (ecs *EmployeeConfigSelect) Aggregate(fns ...AggregateFunc) *EmployeeConfigSelect {
+	ecs.fns = append(ecs.fns, fns...)
+	return ecs
+}
+
+// Scan applies the selector query and scans the result into the given value.
+func (ecs *EmployeeConfigSelect) Scan(ctx context.Context, v any) error {
+	ctx = setContextOp(ctx, ecs.ctx, "Select")
+	if err := ecs.prepareQuery(ctx); err != nil {
+		return err
+	}
+	return scanWithInterceptors[*EmployeeConfigQuery, *EmployeeConfigSelect](ctx, ecs.EmployeeConfigQuery, ecs, ecs.inters, v)
+}
+
+func (ecs *EmployeeConfigSelect) sqlScan(ctx context.Context, root *EmployeeConfigQuery, v any) error {
+	selector := root.sqlQuery(ctx)
+	aggregation := make([]string, 0, len(ecs.fns))
+	for _, fn := range ecs.fns {
+		aggregation = append(aggregation, fn(selector))
+	}
+	switch n := len(*ecs.selector.flds); {
+	case n == 0 && len(aggregation) > 0:
+		selector.Select(aggregation...)
+	case n != 0 && len(aggregation) > 0:
+		selector.AppendSelect(aggregation...)
+	}
+	rows := &sql.Rows{}
+	query, args := selector.Query()
+	if err := ecs.driver.Query(ctx, query, args, rows); err != nil {
+		return err
+	}
+	defer rows.Close()
+	return sql.ScanSlice(rows, v)
+}

+ 450 - 0
ent/employeeconfig_update.go

@@ -0,0 +1,450 @@
+// Code generated by ent, DO NOT EDIT.
+
+package ent
+
+import (
+	"context"
+	"errors"
+	"fmt"
+	"time"
+	"wechat-api/ent/employeeconfig"
+	"wechat-api/ent/predicate"
+
+	"entgo.io/ent/dialect/sql"
+	"entgo.io/ent/dialect/sql/sqlgraph"
+	"entgo.io/ent/schema/field"
+)
+
+// EmployeeConfigUpdate is the builder for updating EmployeeConfig entities.
+type EmployeeConfigUpdate struct {
+	config
+	hooks    []Hook
+	mutation *EmployeeConfigMutation
+}
+
+// Where appends a list predicates to the EmployeeConfigUpdate builder.
+func (ecu *EmployeeConfigUpdate) Where(ps ...predicate.EmployeeConfig) *EmployeeConfigUpdate {
+	ecu.mutation.Where(ps...)
+	return ecu
+}
+
+// SetUpdatedAt sets the "updated_at" field.
+func (ecu *EmployeeConfigUpdate) SetUpdatedAt(t time.Time) *EmployeeConfigUpdate {
+	ecu.mutation.SetUpdatedAt(t)
+	return ecu
+}
+
+// SetDeletedAt sets the "deleted_at" field.
+func (ecu *EmployeeConfigUpdate) SetDeletedAt(t time.Time) *EmployeeConfigUpdate {
+	ecu.mutation.SetDeletedAt(t)
+	return ecu
+}
+
+// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
+func (ecu *EmployeeConfigUpdate) SetNillableDeletedAt(t *time.Time) *EmployeeConfigUpdate {
+	if t != nil {
+		ecu.SetDeletedAt(*t)
+	}
+	return ecu
+}
+
+// ClearDeletedAt clears the value of the "deleted_at" field.
+func (ecu *EmployeeConfigUpdate) ClearDeletedAt() *EmployeeConfigUpdate {
+	ecu.mutation.ClearDeletedAt()
+	return ecu
+}
+
+// SetStype sets the "stype" field.
+func (ecu *EmployeeConfigUpdate) SetStype(s string) *EmployeeConfigUpdate {
+	ecu.mutation.SetStype(s)
+	return ecu
+}
+
+// SetNillableStype sets the "stype" field if the given value is not nil.
+func (ecu *EmployeeConfigUpdate) SetNillableStype(s *string) *EmployeeConfigUpdate {
+	if s != nil {
+		ecu.SetStype(*s)
+	}
+	return ecu
+}
+
+// SetTitle sets the "title" field.
+func (ecu *EmployeeConfigUpdate) SetTitle(s string) *EmployeeConfigUpdate {
+	ecu.mutation.SetTitle(s)
+	return ecu
+}
+
+// SetNillableTitle sets the "title" field if the given value is not nil.
+func (ecu *EmployeeConfigUpdate) SetNillableTitle(s *string) *EmployeeConfigUpdate {
+	if s != nil {
+		ecu.SetTitle(*s)
+	}
+	return ecu
+}
+
+// SetPhoto sets the "photo" field.
+func (ecu *EmployeeConfigUpdate) SetPhoto(s string) *EmployeeConfigUpdate {
+	ecu.mutation.SetPhoto(s)
+	return ecu
+}
+
+// SetNillablePhoto sets the "photo" field if the given value is not nil.
+func (ecu *EmployeeConfigUpdate) SetNillablePhoto(s *string) *EmployeeConfigUpdate {
+	if s != nil {
+		ecu.SetPhoto(*s)
+	}
+	return ecu
+}
+
+// SetOrganizationID sets the "organization_id" field.
+func (ecu *EmployeeConfigUpdate) SetOrganizationID(u uint64) *EmployeeConfigUpdate {
+	ecu.mutation.ResetOrganizationID()
+	ecu.mutation.SetOrganizationID(u)
+	return ecu
+}
+
+// SetNillableOrganizationID sets the "organization_id" field if the given value is not nil.
+func (ecu *EmployeeConfigUpdate) SetNillableOrganizationID(u *uint64) *EmployeeConfigUpdate {
+	if u != nil {
+		ecu.SetOrganizationID(*u)
+	}
+	return ecu
+}
+
+// AddOrganizationID adds u to the "organization_id" field.
+func (ecu *EmployeeConfigUpdate) AddOrganizationID(u int64) *EmployeeConfigUpdate {
+	ecu.mutation.AddOrganizationID(u)
+	return ecu
+}
+
+// ClearOrganizationID clears the value of the "organization_id" field.
+func (ecu *EmployeeConfigUpdate) ClearOrganizationID() *EmployeeConfigUpdate {
+	ecu.mutation.ClearOrganizationID()
+	return ecu
+}
+
+// Mutation returns the EmployeeConfigMutation object of the builder.
+func (ecu *EmployeeConfigUpdate) Mutation() *EmployeeConfigMutation {
+	return ecu.mutation
+}
+
+// Save executes the query and returns the number of nodes affected by the update operation.
+func (ecu *EmployeeConfigUpdate) Save(ctx context.Context) (int, error) {
+	if err := ecu.defaults(); err != nil {
+		return 0, err
+	}
+	return withHooks(ctx, ecu.sqlSave, ecu.mutation, ecu.hooks)
+}
+
+// SaveX is like Save, but panics if an error occurs.
+func (ecu *EmployeeConfigUpdate) SaveX(ctx context.Context) int {
+	affected, err := ecu.Save(ctx)
+	if err != nil {
+		panic(err)
+	}
+	return affected
+}
+
+// Exec executes the query.
+func (ecu *EmployeeConfigUpdate) Exec(ctx context.Context) error {
+	_, err := ecu.Save(ctx)
+	return err
+}
+
+// ExecX is like Exec, but panics if an error occurs.
+func (ecu *EmployeeConfigUpdate) ExecX(ctx context.Context) {
+	if err := ecu.Exec(ctx); err != nil {
+		panic(err)
+	}
+}
+
+// defaults sets the default values of the builder before save.
+func (ecu *EmployeeConfigUpdate) defaults() error {
+	if _, ok := ecu.mutation.UpdatedAt(); !ok {
+		if employeeconfig.UpdateDefaultUpdatedAt == nil {
+			return fmt.Errorf("ent: uninitialized employeeconfig.UpdateDefaultUpdatedAt (forgotten import ent/runtime?)")
+		}
+		v := employeeconfig.UpdateDefaultUpdatedAt()
+		ecu.mutation.SetUpdatedAt(v)
+	}
+	return nil
+}
+
+func (ecu *EmployeeConfigUpdate) sqlSave(ctx context.Context) (n int, err error) {
+	_spec := sqlgraph.NewUpdateSpec(employeeconfig.Table, employeeconfig.Columns, sqlgraph.NewFieldSpec(employeeconfig.FieldID, field.TypeUint64))
+	if ps := ecu.mutation.predicates; len(ps) > 0 {
+		_spec.Predicate = func(selector *sql.Selector) {
+			for i := range ps {
+				ps[i](selector)
+			}
+		}
+	}
+	if value, ok := ecu.mutation.UpdatedAt(); ok {
+		_spec.SetField(employeeconfig.FieldUpdatedAt, field.TypeTime, value)
+	}
+	if value, ok := ecu.mutation.DeletedAt(); ok {
+		_spec.SetField(employeeconfig.FieldDeletedAt, field.TypeTime, value)
+	}
+	if ecu.mutation.DeletedAtCleared() {
+		_spec.ClearField(employeeconfig.FieldDeletedAt, field.TypeTime)
+	}
+	if value, ok := ecu.mutation.Stype(); ok {
+		_spec.SetField(employeeconfig.FieldStype, field.TypeString, value)
+	}
+	if value, ok := ecu.mutation.Title(); ok {
+		_spec.SetField(employeeconfig.FieldTitle, field.TypeString, value)
+	}
+	if value, ok := ecu.mutation.Photo(); ok {
+		_spec.SetField(employeeconfig.FieldPhoto, field.TypeString, value)
+	}
+	if value, ok := ecu.mutation.OrganizationID(); ok {
+		_spec.SetField(employeeconfig.FieldOrganizationID, field.TypeUint64, value)
+	}
+	if value, ok := ecu.mutation.AddedOrganizationID(); ok {
+		_spec.AddField(employeeconfig.FieldOrganizationID, field.TypeUint64, value)
+	}
+	if ecu.mutation.OrganizationIDCleared() {
+		_spec.ClearField(employeeconfig.FieldOrganizationID, field.TypeUint64)
+	}
+	if n, err = sqlgraph.UpdateNodes(ctx, ecu.driver, _spec); err != nil {
+		if _, ok := err.(*sqlgraph.NotFoundError); ok {
+			err = &NotFoundError{employeeconfig.Label}
+		} else if sqlgraph.IsConstraintError(err) {
+			err = &ConstraintError{msg: err.Error(), wrap: err}
+		}
+		return 0, err
+	}
+	ecu.mutation.done = true
+	return n, nil
+}
+
+// EmployeeConfigUpdateOne is the builder for updating a single EmployeeConfig entity.
+type EmployeeConfigUpdateOne struct {
+	config
+	fields   []string
+	hooks    []Hook
+	mutation *EmployeeConfigMutation
+}
+
+// SetUpdatedAt sets the "updated_at" field.
+func (ecuo *EmployeeConfigUpdateOne) SetUpdatedAt(t time.Time) *EmployeeConfigUpdateOne {
+	ecuo.mutation.SetUpdatedAt(t)
+	return ecuo
+}
+
+// SetDeletedAt sets the "deleted_at" field.
+func (ecuo *EmployeeConfigUpdateOne) SetDeletedAt(t time.Time) *EmployeeConfigUpdateOne {
+	ecuo.mutation.SetDeletedAt(t)
+	return ecuo
+}
+
+// SetNillableDeletedAt sets the "deleted_at" field if the given value is not nil.
+func (ecuo *EmployeeConfigUpdateOne) SetNillableDeletedAt(t *time.Time) *EmployeeConfigUpdateOne {
+	if t != nil {
+		ecuo.SetDeletedAt(*t)
+	}
+	return ecuo
+}
+
+// ClearDeletedAt clears the value of the "deleted_at" field.
+func (ecuo *EmployeeConfigUpdateOne) ClearDeletedAt() *EmployeeConfigUpdateOne {
+	ecuo.mutation.ClearDeletedAt()
+	return ecuo
+}
+
+// SetStype sets the "stype" field.
+func (ecuo *EmployeeConfigUpdateOne) SetStype(s string) *EmployeeConfigUpdateOne {
+	ecuo.mutation.SetStype(s)
+	return ecuo
+}
+
+// SetNillableStype sets the "stype" field if the given value is not nil.
+func (ecuo *EmployeeConfigUpdateOne) SetNillableStype(s *string) *EmployeeConfigUpdateOne {
+	if s != nil {
+		ecuo.SetStype(*s)
+	}
+	return ecuo
+}
+
+// SetTitle sets the "title" field.
+func (ecuo *EmployeeConfigUpdateOne) SetTitle(s string) *EmployeeConfigUpdateOne {
+	ecuo.mutation.SetTitle(s)
+	return ecuo
+}
+
+// SetNillableTitle sets the "title" field if the given value is not nil.
+func (ecuo *EmployeeConfigUpdateOne) SetNillableTitle(s *string) *EmployeeConfigUpdateOne {
+	if s != nil {
+		ecuo.SetTitle(*s)
+	}
+	return ecuo
+}
+
+// SetPhoto sets the "photo" field.
+func (ecuo *EmployeeConfigUpdateOne) SetPhoto(s string) *EmployeeConfigUpdateOne {
+	ecuo.mutation.SetPhoto(s)
+	return ecuo
+}
+
+// SetNillablePhoto sets the "photo" field if the given value is not nil.
+func (ecuo *EmployeeConfigUpdateOne) SetNillablePhoto(s *string) *EmployeeConfigUpdateOne {
+	if s != nil {
+		ecuo.SetPhoto(*s)
+	}
+	return ecuo
+}
+
+// SetOrganizationID sets the "organization_id" field.
+func (ecuo *EmployeeConfigUpdateOne) SetOrganizationID(u uint64) *EmployeeConfigUpdateOne {
+	ecuo.mutation.ResetOrganizationID()
+	ecuo.mutation.SetOrganizationID(u)
+	return ecuo
+}
+
+// SetNillableOrganizationID sets the "organization_id" field if the given value is not nil.
+func (ecuo *EmployeeConfigUpdateOne) SetNillableOrganizationID(u *uint64) *EmployeeConfigUpdateOne {
+	if u != nil {
+		ecuo.SetOrganizationID(*u)
+	}
+	return ecuo
+}
+
+// AddOrganizationID adds u to the "organization_id" field.
+func (ecuo *EmployeeConfigUpdateOne) AddOrganizationID(u int64) *EmployeeConfigUpdateOne {
+	ecuo.mutation.AddOrganizationID(u)
+	return ecuo
+}
+
+// ClearOrganizationID clears the value of the "organization_id" field.
+func (ecuo *EmployeeConfigUpdateOne) ClearOrganizationID() *EmployeeConfigUpdateOne {
+	ecuo.mutation.ClearOrganizationID()
+	return ecuo
+}
+
+// Mutation returns the EmployeeConfigMutation object of the builder.
+func (ecuo *EmployeeConfigUpdateOne) Mutation() *EmployeeConfigMutation {
+	return ecuo.mutation
+}
+
+// Where appends a list predicates to the EmployeeConfigUpdate builder.
+func (ecuo *EmployeeConfigUpdateOne) Where(ps ...predicate.EmployeeConfig) *EmployeeConfigUpdateOne {
+	ecuo.mutation.Where(ps...)
+	return ecuo
+}
+
+// Select allows selecting one or more fields (columns) of the returned entity.
+// The default is selecting all fields defined in the entity schema.
+func (ecuo *EmployeeConfigUpdateOne) Select(field string, fields ...string) *EmployeeConfigUpdateOne {
+	ecuo.fields = append([]string{field}, fields...)
+	return ecuo
+}
+
+// Save executes the query and returns the updated EmployeeConfig entity.
+func (ecuo *EmployeeConfigUpdateOne) Save(ctx context.Context) (*EmployeeConfig, error) {
+	if err := ecuo.defaults(); err != nil {
+		return nil, err
+	}
+	return withHooks(ctx, ecuo.sqlSave, ecuo.mutation, ecuo.hooks)
+}
+
+// SaveX is like Save, but panics if an error occurs.
+func (ecuo *EmployeeConfigUpdateOne) SaveX(ctx context.Context) *EmployeeConfig {
+	node, err := ecuo.Save(ctx)
+	if err != nil {
+		panic(err)
+	}
+	return node
+}
+
+// Exec executes the query on the entity.
+func (ecuo *EmployeeConfigUpdateOne) Exec(ctx context.Context) error {
+	_, err := ecuo.Save(ctx)
+	return err
+}
+
+// ExecX is like Exec, but panics if an error occurs.
+func (ecuo *EmployeeConfigUpdateOne) ExecX(ctx context.Context) {
+	if err := ecuo.Exec(ctx); err != nil {
+		panic(err)
+	}
+}
+
+// defaults sets the default values of the builder before save.
+func (ecuo *EmployeeConfigUpdateOne) defaults() error {
+	if _, ok := ecuo.mutation.UpdatedAt(); !ok {
+		if employeeconfig.UpdateDefaultUpdatedAt == nil {
+			return fmt.Errorf("ent: uninitialized employeeconfig.UpdateDefaultUpdatedAt (forgotten import ent/runtime?)")
+		}
+		v := employeeconfig.UpdateDefaultUpdatedAt()
+		ecuo.mutation.SetUpdatedAt(v)
+	}
+	return nil
+}
+
+func (ecuo *EmployeeConfigUpdateOne) sqlSave(ctx context.Context) (_node *EmployeeConfig, err error) {
+	_spec := sqlgraph.NewUpdateSpec(employeeconfig.Table, employeeconfig.Columns, sqlgraph.NewFieldSpec(employeeconfig.FieldID, field.TypeUint64))
+	id, ok := ecuo.mutation.ID()
+	if !ok {
+		return nil, &ValidationError{Name: "id", err: errors.New(`ent: missing "EmployeeConfig.id" for update`)}
+	}
+	_spec.Node.ID.Value = id
+	if fields := ecuo.fields; len(fields) > 0 {
+		_spec.Node.Columns = make([]string, 0, len(fields))
+		_spec.Node.Columns = append(_spec.Node.Columns, employeeconfig.FieldID)
+		for _, f := range fields {
+			if !employeeconfig.ValidColumn(f) {
+				return nil, &ValidationError{Name: f, err: fmt.Errorf("ent: invalid field %q for query", f)}
+			}
+			if f != employeeconfig.FieldID {
+				_spec.Node.Columns = append(_spec.Node.Columns, f)
+			}
+		}
+	}
+	if ps := ecuo.mutation.predicates; len(ps) > 0 {
+		_spec.Predicate = func(selector *sql.Selector) {
+			for i := range ps {
+				ps[i](selector)
+			}
+		}
+	}
+	if value, ok := ecuo.mutation.UpdatedAt(); ok {
+		_spec.SetField(employeeconfig.FieldUpdatedAt, field.TypeTime, value)
+	}
+	if value, ok := ecuo.mutation.DeletedAt(); ok {
+		_spec.SetField(employeeconfig.FieldDeletedAt, field.TypeTime, value)
+	}
+	if ecuo.mutation.DeletedAtCleared() {
+		_spec.ClearField(employeeconfig.FieldDeletedAt, field.TypeTime)
+	}
+	if value, ok := ecuo.mutation.Stype(); ok {
+		_spec.SetField(employeeconfig.FieldStype, field.TypeString, value)
+	}
+	if value, ok := ecuo.mutation.Title(); ok {
+		_spec.SetField(employeeconfig.FieldTitle, field.TypeString, value)
+	}
+	if value, ok := ecuo.mutation.Photo(); ok {
+		_spec.SetField(employeeconfig.FieldPhoto, field.TypeString, value)
+	}
+	if value, ok := ecuo.mutation.OrganizationID(); ok {
+		_spec.SetField(employeeconfig.FieldOrganizationID, field.TypeUint64, value)
+	}
+	if value, ok := ecuo.mutation.AddedOrganizationID(); ok {
+		_spec.AddField(employeeconfig.FieldOrganizationID, field.TypeUint64, value)
+	}
+	if ecuo.mutation.OrganizationIDCleared() {
+		_spec.ClearField(employeeconfig.FieldOrganizationID, field.TypeUint64)
+	}
+	_node = &EmployeeConfig{config: ecuo.config}
+	_spec.Assign = _node.assignValues
+	_spec.ScanValues = _node.scanValues
+	if err = sqlgraph.UpdateNode(ctx, ecuo.driver, _spec); err != nil {
+		if _, ok := err.(*sqlgraph.NotFoundError); ok {
+			err = &NotFoundError{employeeconfig.Label}
+		} else if sqlgraph.IsConstraintError(err) {
+			err = &ConstraintError{msg: err.Error(), wrap: err}
+		}
+		return nil, err
+	}
+	ecuo.mutation.done = true
+	return _node, nil
+}

+ 2 - 0
ent/ent.go

@@ -12,6 +12,7 @@ import (
 	"wechat-api/ent/batchmsg"
 	"wechat-api/ent/contact"
 	"wechat-api/ent/employee"
+	"wechat-api/ent/employeeconfig"
 	"wechat-api/ent/label"
 	"wechat-api/ent/labelrelationship"
 	"wechat-api/ent/message"
@@ -93,6 +94,7 @@ func checkColumn(table, column string) error {
 			batchmsg.Table:          batchmsg.ValidColumn,
 			contact.Table:           contact.ValidColumn,
 			employee.Table:          employee.ValidColumn,
+			employeeconfig.Table:    employeeconfig.ValidColumn,
 			label.Table:             label.ValidColumn,
 			labelrelationship.Table: labelrelationship.ValidColumn,
 			message.Table:           message.ValidColumn,

+ 12 - 0
ent/hook/hook.go

@@ -56,6 +56,18 @@ func (f EmployeeFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, er
 	return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.EmployeeMutation", m)
 }
 
+// The EmployeeConfigFunc type is an adapter to allow the use of ordinary
+// function as EmployeeConfig mutator.
+type EmployeeConfigFunc func(context.Context, *ent.EmployeeConfigMutation) (ent.Value, error)
+
+// Mutate calls f(ctx, m).
+func (f EmployeeConfigFunc) Mutate(ctx context.Context, m ent.Mutation) (ent.Value, error) {
+	if mv, ok := m.(*ent.EmployeeConfigMutation); ok {
+		return f(ctx, mv)
+	}
+	return nil, fmt.Errorf("unexpected mutation type %T. expect *ent.EmployeeConfigMutation", m)
+}
+
 // The LabelFunc type is an adapter to allow the use of ordinary
 // function as Label mutator.
 type LabelFunc func(context.Context, *ent.LabelMutation) (ent.Value, error)

+ 30 - 0
ent/intercept/intercept.go

@@ -10,6 +10,7 @@ import (
 	"wechat-api/ent/batchmsg"
 	"wechat-api/ent/contact"
 	"wechat-api/ent/employee"
+	"wechat-api/ent/employeeconfig"
 	"wechat-api/ent/label"
 	"wechat-api/ent/labelrelationship"
 	"wechat-api/ent/message"
@@ -192,6 +193,33 @@ func (f TraverseEmployee) Traverse(ctx context.Context, q ent.Query) error {
 	return fmt.Errorf("unexpected query type %T. expect *ent.EmployeeQuery", q)
 }
 
+// The EmployeeConfigFunc type is an adapter to allow the use of ordinary function as a Querier.
+type EmployeeConfigFunc func(context.Context, *ent.EmployeeConfigQuery) (ent.Value, error)
+
+// Query calls f(ctx, q).
+func (f EmployeeConfigFunc) Query(ctx context.Context, q ent.Query) (ent.Value, error) {
+	if q, ok := q.(*ent.EmployeeConfigQuery); ok {
+		return f(ctx, q)
+	}
+	return nil, fmt.Errorf("unexpected query type %T. expect *ent.EmployeeConfigQuery", q)
+}
+
+// The TraverseEmployeeConfig type is an adapter to allow the use of ordinary function as Traverser.
+type TraverseEmployeeConfig func(context.Context, *ent.EmployeeConfigQuery) error
+
+// Intercept is a dummy implementation of Intercept that returns the next Querier in the pipeline.
+func (f TraverseEmployeeConfig) Intercept(next ent.Querier) ent.Querier {
+	return next
+}
+
+// Traverse calls f(ctx, q).
+func (f TraverseEmployeeConfig) Traverse(ctx context.Context, q ent.Query) error {
+	if q, ok := q.(*ent.EmployeeConfigQuery); ok {
+		return f(ctx, q)
+	}
+	return fmt.Errorf("unexpected query type %T. expect *ent.EmployeeConfigQuery", q)
+}
+
 // The LabelFunc type is an adapter to allow the use of ordinary function as a Querier.
 type LabelFunc func(context.Context, *ent.LabelQuery) (ent.Value, error)
 
@@ -554,6 +582,8 @@ func NewQuery(q ent.Query) (Query, error) {
 		return &query[*ent.ContactQuery, predicate.Contact, contact.OrderOption]{typ: ent.TypeContact, tq: q}, nil
 	case *ent.EmployeeQuery:
 		return &query[*ent.EmployeeQuery, predicate.Employee, employee.OrderOption]{typ: ent.TypeEmployee, tq: q}, nil
+	case *ent.EmployeeConfigQuery:
+		return &query[*ent.EmployeeConfigQuery, predicate.EmployeeConfig, employeeconfig.OrderOption]{typ: ent.TypeEmployeeConfig, tq: q}, nil
 	case *ent.LabelQuery:
 		return &query[*ent.LabelQuery, predicate.Label, label.OrderOption]{typ: ent.TypeLabel, tq: q}, nil
 	case *ent.LabelRelationshipQuery:

+ 28 - 0
ent/migrate/schema.go

@@ -159,6 +159,30 @@ var (
 			},
 		},
 	}
+	// EmployeeConfigColumns holds the columns for the "employee_config" table.
+	EmployeeConfigColumns = []*schema.Column{
+		{Name: "id", Type: field.TypeUint64, Increment: true},
+		{Name: "created_at", Type: field.TypeTime, Comment: "Create Time | 创建日期"},
+		{Name: "updated_at", Type: field.TypeTime, Comment: "Update Time | 修改日期"},
+		{Name: "deleted_at", Type: field.TypeTime, Nullable: true, Comment: "Delete Time | 删除日期"},
+		{Name: "stype", Type: field.TypeString, Comment: "类型:scene-场景 switch_in-接入方式", Default: ""},
+		{Name: "title", Type: field.TypeString, Comment: "标题", Default: ""},
+		{Name: "photo", Type: field.TypeString, Comment: "图片地址", Default: ""},
+		{Name: "organization_id", Type: field.TypeUint64, Nullable: true, Comment: "机构 ID", Default: 1},
+	}
+	// EmployeeConfigTable holds the schema information for the "employee_config" table.
+	EmployeeConfigTable = &schema.Table{
+		Name:       "employee_config",
+		Columns:    EmployeeConfigColumns,
+		PrimaryKey: []*schema.Column{EmployeeConfigColumns[0]},
+		Indexes: []*schema.Index{
+			{
+				Name:    "employeeconfig_stype",
+				Unique:  false,
+				Columns: []*schema.Column{EmployeeConfigColumns[4]},
+			},
+		},
+	}
 	// LabelColumns holds the columns for the "label" table.
 	LabelColumns = []*schema.Column{
 		{Name: "id", Type: field.TypeUint64, Increment: true},
@@ -630,6 +654,7 @@ var (
 		BatchMsgTable,
 		ContactTable,
 		EmployeeTable,
+		EmployeeConfigTable,
 		LabelTable,
 		LabelRelationshipTable,
 		MessagesTable,
@@ -659,6 +684,9 @@ func init() {
 	EmployeeTable.Annotation = &entsql.Annotation{
 		Table: "employee",
 	}
+	EmployeeConfigTable.Annotation = &entsql.Annotation{
+		Table: "employee_config",
+	}
 	LabelTable.Annotation = &entsql.Annotation{
 		Table: "label",
 	}

+ 736 - 0
ent/mutation.go

@@ -13,6 +13,7 @@ import (
 	"wechat-api/ent/contact"
 	"wechat-api/ent/custom_types"
 	"wechat-api/ent/employee"
+	"wechat-api/ent/employeeconfig"
 	"wechat-api/ent/label"
 	"wechat-api/ent/labelrelationship"
 	"wechat-api/ent/message"
@@ -45,6 +46,7 @@ const (
 	TypeBatchMsg          = "BatchMsg"
 	TypeContact           = "Contact"
 	TypeEmployee          = "Employee"
+	TypeEmployeeConfig    = "EmployeeConfig"
 	TypeLabel             = "Label"
 	TypeLabelRelationship = "LabelRelationship"
 	TypeMessage           = "Message"
@@ -6029,6 +6031,740 @@ func (m *EmployeeMutation) ResetEdge(name string) error {
 	return fmt.Errorf("unknown Employee edge %s", name)
 }
 
+// EmployeeConfigMutation represents an operation that mutates the EmployeeConfig nodes in the graph.
+type EmployeeConfigMutation struct {
+	config
+	op                 Op
+	typ                string
+	id                 *uint64
+	created_at         *time.Time
+	updated_at         *time.Time
+	deleted_at         *time.Time
+	stype              *string
+	title              *string
+	photo              *string
+	organization_id    *uint64
+	addorganization_id *int64
+	clearedFields      map[string]struct{}
+	done               bool
+	oldValue           func(context.Context) (*EmployeeConfig, error)
+	predicates         []predicate.EmployeeConfig
+}
+
+var _ ent.Mutation = (*EmployeeConfigMutation)(nil)
+
+// employeeconfigOption allows management of the mutation configuration using functional options.
+type employeeconfigOption func(*EmployeeConfigMutation)
+
+// newEmployeeConfigMutation creates new mutation for the EmployeeConfig entity.
+func newEmployeeConfigMutation(c config, op Op, opts ...employeeconfigOption) *EmployeeConfigMutation {
+	m := &EmployeeConfigMutation{
+		config:        c,
+		op:            op,
+		typ:           TypeEmployeeConfig,
+		clearedFields: make(map[string]struct{}),
+	}
+	for _, opt := range opts {
+		opt(m)
+	}
+	return m
+}
+
+// withEmployeeConfigID sets the ID field of the mutation.
+func withEmployeeConfigID(id uint64) employeeconfigOption {
+	return func(m *EmployeeConfigMutation) {
+		var (
+			err   error
+			once  sync.Once
+			value *EmployeeConfig
+		)
+		m.oldValue = func(ctx context.Context) (*EmployeeConfig, error) {
+			once.Do(func() {
+				if m.done {
+					err = errors.New("querying old values post mutation is not allowed")
+				} else {
+					value, err = m.Client().EmployeeConfig.Get(ctx, id)
+				}
+			})
+			return value, err
+		}
+		m.id = &id
+	}
+}
+
+// withEmployeeConfig sets the old EmployeeConfig of the mutation.
+func withEmployeeConfig(node *EmployeeConfig) employeeconfigOption {
+	return func(m *EmployeeConfigMutation) {
+		m.oldValue = func(context.Context) (*EmployeeConfig, error) {
+			return node, nil
+		}
+		m.id = &node.ID
+	}
+}
+
+// Client returns a new `ent.Client` from the mutation. If the mutation was
+// executed in a transaction (ent.Tx), a transactional client is returned.
+func (m EmployeeConfigMutation) Client() *Client {
+	client := &Client{config: m.config}
+	client.init()
+	return client
+}
+
+// Tx returns an `ent.Tx` for mutations that were executed in transactions;
+// it returns an error otherwise.
+func (m EmployeeConfigMutation) Tx() (*Tx, error) {
+	if _, ok := m.driver.(*txDriver); !ok {
+		return nil, errors.New("ent: mutation is not running in a transaction")
+	}
+	tx := &Tx{config: m.config}
+	tx.init()
+	return tx, nil
+}
+
+// SetID sets the value of the id field. Note that this
+// operation is only accepted on creation of EmployeeConfig entities.
+func (m *EmployeeConfigMutation) SetID(id uint64) {
+	m.id = &id
+}
+
+// ID returns the ID value in the mutation. Note that the ID is only available
+// if it was provided to the builder or after it was returned from the database.
+func (m *EmployeeConfigMutation) ID() (id uint64, exists bool) {
+	if m.id == nil {
+		return
+	}
+	return *m.id, true
+}
+
+// IDs queries the database and returns the entity ids that match the mutation's predicate.
+// That means, if the mutation is applied within a transaction with an isolation level such
+// as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated
+// or updated by the mutation.
+func (m *EmployeeConfigMutation) IDs(ctx context.Context) ([]uint64, error) {
+	switch {
+	case m.op.Is(OpUpdateOne | OpDeleteOne):
+		id, exists := m.ID()
+		if exists {
+			return []uint64{id}, nil
+		}
+		fallthrough
+	case m.op.Is(OpUpdate | OpDelete):
+		return m.Client().EmployeeConfig.Query().Where(m.predicates...).IDs(ctx)
+	default:
+		return nil, fmt.Errorf("IDs is not allowed on %s operations", m.op)
+	}
+}
+
+// SetCreatedAt sets the "created_at" field.
+func (m *EmployeeConfigMutation) SetCreatedAt(t time.Time) {
+	m.created_at = &t
+}
+
+// CreatedAt returns the value of the "created_at" field in the mutation.
+func (m *EmployeeConfigMutation) CreatedAt() (r time.Time, exists bool) {
+	v := m.created_at
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// OldCreatedAt returns the old "created_at" field's value of the EmployeeConfig entity.
+// If the EmployeeConfig 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 *EmployeeConfigMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error) {
+	if !m.op.Is(OpUpdateOne) {
+		return v, errors.New("OldCreatedAt is only allowed on UpdateOne operations")
+	}
+	if m.id == nil || m.oldValue == nil {
+		return v, errors.New("OldCreatedAt requires an ID field in the mutation")
+	}
+	oldValue, err := m.oldValue(ctx)
+	if err != nil {
+		return v, fmt.Errorf("querying old value for OldCreatedAt: %w", err)
+	}
+	return oldValue.CreatedAt, nil
+}
+
+// ResetCreatedAt resets all changes to the "created_at" field.
+func (m *EmployeeConfigMutation) ResetCreatedAt() {
+	m.created_at = nil
+}
+
+// SetUpdatedAt sets the "updated_at" field.
+func (m *EmployeeConfigMutation) SetUpdatedAt(t time.Time) {
+	m.updated_at = &t
+}
+
+// UpdatedAt returns the value of the "updated_at" field in the mutation.
+func (m *EmployeeConfigMutation) UpdatedAt() (r time.Time, exists bool) {
+	v := m.updated_at
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// OldUpdatedAt returns the old "updated_at" field's value of the EmployeeConfig entity.
+// If the EmployeeConfig 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 *EmployeeConfigMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error) {
+	if !m.op.Is(OpUpdateOne) {
+		return v, errors.New("OldUpdatedAt is only allowed on UpdateOne operations")
+	}
+	if m.id == nil || m.oldValue == nil {
+		return v, errors.New("OldUpdatedAt requires an ID field in the mutation")
+	}
+	oldValue, err := m.oldValue(ctx)
+	if err != nil {
+		return v, fmt.Errorf("querying old value for OldUpdatedAt: %w", err)
+	}
+	return oldValue.UpdatedAt, nil
+}
+
+// ResetUpdatedAt resets all changes to the "updated_at" field.
+func (m *EmployeeConfigMutation) ResetUpdatedAt() {
+	m.updated_at = nil
+}
+
+// SetDeletedAt sets the "deleted_at" field.
+func (m *EmployeeConfigMutation) SetDeletedAt(t time.Time) {
+	m.deleted_at = &t
+}
+
+// DeletedAt returns the value of the "deleted_at" field in the mutation.
+func (m *EmployeeConfigMutation) DeletedAt() (r time.Time, exists bool) {
+	v := m.deleted_at
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// OldDeletedAt returns the old "deleted_at" field's value of the EmployeeConfig entity.
+// If the EmployeeConfig 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 *EmployeeConfigMutation) OldDeletedAt(ctx context.Context) (v time.Time, err error) {
+	if !m.op.Is(OpUpdateOne) {
+		return v, errors.New("OldDeletedAt is only allowed on UpdateOne operations")
+	}
+	if m.id == nil || m.oldValue == nil {
+		return v, errors.New("OldDeletedAt requires an ID field in the mutation")
+	}
+	oldValue, err := m.oldValue(ctx)
+	if err != nil {
+		return v, fmt.Errorf("querying old value for OldDeletedAt: %w", err)
+	}
+	return oldValue.DeletedAt, nil
+}
+
+// ClearDeletedAt clears the value of the "deleted_at" field.
+func (m *EmployeeConfigMutation) ClearDeletedAt() {
+	m.deleted_at = nil
+	m.clearedFields[employeeconfig.FieldDeletedAt] = struct{}{}
+}
+
+// DeletedAtCleared returns if the "deleted_at" field was cleared in this mutation.
+func (m *EmployeeConfigMutation) DeletedAtCleared() bool {
+	_, ok := m.clearedFields[employeeconfig.FieldDeletedAt]
+	return ok
+}
+
+// ResetDeletedAt resets all changes to the "deleted_at" field.
+func (m *EmployeeConfigMutation) ResetDeletedAt() {
+	m.deleted_at = nil
+	delete(m.clearedFields, employeeconfig.FieldDeletedAt)
+}
+
+// SetStype sets the "stype" field.
+func (m *EmployeeConfigMutation) SetStype(s string) {
+	m.stype = &s
+}
+
+// Stype returns the value of the "stype" field in the mutation.
+func (m *EmployeeConfigMutation) Stype() (r string, exists bool) {
+	v := m.stype
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// OldStype returns the old "stype" field's value of the EmployeeConfig entity.
+// If the EmployeeConfig 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 *EmployeeConfigMutation) OldStype(ctx context.Context) (v string, err error) {
+	if !m.op.Is(OpUpdateOne) {
+		return v, errors.New("OldStype is only allowed on UpdateOne operations")
+	}
+	if m.id == nil || m.oldValue == nil {
+		return v, errors.New("OldStype requires an ID field in the mutation")
+	}
+	oldValue, err := m.oldValue(ctx)
+	if err != nil {
+		return v, fmt.Errorf("querying old value for OldStype: %w", err)
+	}
+	return oldValue.Stype, nil
+}
+
+// ResetStype resets all changes to the "stype" field.
+func (m *EmployeeConfigMutation) ResetStype() {
+	m.stype = nil
+}
+
+// SetTitle sets the "title" field.
+func (m *EmployeeConfigMutation) SetTitle(s string) {
+	m.title = &s
+}
+
+// Title returns the value of the "title" field in the mutation.
+func (m *EmployeeConfigMutation) Title() (r string, exists bool) {
+	v := m.title
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// OldTitle returns the old "title" field's value of the EmployeeConfig entity.
+// If the EmployeeConfig 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 *EmployeeConfigMutation) OldTitle(ctx context.Context) (v string, err error) {
+	if !m.op.Is(OpUpdateOne) {
+		return v, errors.New("OldTitle is only allowed on UpdateOne operations")
+	}
+	if m.id == nil || m.oldValue == nil {
+		return v, errors.New("OldTitle requires an ID field in the mutation")
+	}
+	oldValue, err := m.oldValue(ctx)
+	if err != nil {
+		return v, fmt.Errorf("querying old value for OldTitle: %w", err)
+	}
+	return oldValue.Title, nil
+}
+
+// ResetTitle resets all changes to the "title" field.
+func (m *EmployeeConfigMutation) ResetTitle() {
+	m.title = nil
+}
+
+// SetPhoto sets the "photo" field.
+func (m *EmployeeConfigMutation) SetPhoto(s string) {
+	m.photo = &s
+}
+
+// Photo returns the value of the "photo" field in the mutation.
+func (m *EmployeeConfigMutation) Photo() (r string, exists bool) {
+	v := m.photo
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// OldPhoto returns the old "photo" field's value of the EmployeeConfig entity.
+// If the EmployeeConfig 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 *EmployeeConfigMutation) OldPhoto(ctx context.Context) (v string, err error) {
+	if !m.op.Is(OpUpdateOne) {
+		return v, errors.New("OldPhoto is only allowed on UpdateOne operations")
+	}
+	if m.id == nil || m.oldValue == nil {
+		return v, errors.New("OldPhoto requires an ID field in the mutation")
+	}
+	oldValue, err := m.oldValue(ctx)
+	if err != nil {
+		return v, fmt.Errorf("querying old value for OldPhoto: %w", err)
+	}
+	return oldValue.Photo, nil
+}
+
+// ResetPhoto resets all changes to the "photo" field.
+func (m *EmployeeConfigMutation) ResetPhoto() {
+	m.photo = nil
+}
+
+// SetOrganizationID sets the "organization_id" field.
+func (m *EmployeeConfigMutation) SetOrganizationID(u uint64) {
+	m.organization_id = &u
+	m.addorganization_id = nil
+}
+
+// OrganizationID returns the value of the "organization_id" field in the mutation.
+func (m *EmployeeConfigMutation) OrganizationID() (r uint64, exists bool) {
+	v := m.organization_id
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// OldOrganizationID returns the old "organization_id" field's value of the EmployeeConfig entity.
+// If the EmployeeConfig 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 *EmployeeConfigMutation) OldOrganizationID(ctx context.Context) (v uint64, err error) {
+	if !m.op.Is(OpUpdateOne) {
+		return v, errors.New("OldOrganizationID is only allowed on UpdateOne operations")
+	}
+	if m.id == nil || m.oldValue == nil {
+		return v, errors.New("OldOrganizationID requires an ID field in the mutation")
+	}
+	oldValue, err := m.oldValue(ctx)
+	if err != nil {
+		return v, fmt.Errorf("querying old value for OldOrganizationID: %w", err)
+	}
+	return oldValue.OrganizationID, nil
+}
+
+// AddOrganizationID adds u to the "organization_id" field.
+func (m *EmployeeConfigMutation) AddOrganizationID(u int64) {
+	if m.addorganization_id != nil {
+		*m.addorganization_id += u
+	} else {
+		m.addorganization_id = &u
+	}
+}
+
+// AddedOrganizationID returns the value that was added to the "organization_id" field in this mutation.
+func (m *EmployeeConfigMutation) AddedOrganizationID() (r int64, exists bool) {
+	v := m.addorganization_id
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// ClearOrganizationID clears the value of the "organization_id" field.
+func (m *EmployeeConfigMutation) ClearOrganizationID() {
+	m.organization_id = nil
+	m.addorganization_id = nil
+	m.clearedFields[employeeconfig.FieldOrganizationID] = struct{}{}
+}
+
+// OrganizationIDCleared returns if the "organization_id" field was cleared in this mutation.
+func (m *EmployeeConfigMutation) OrganizationIDCleared() bool {
+	_, ok := m.clearedFields[employeeconfig.FieldOrganizationID]
+	return ok
+}
+
+// ResetOrganizationID resets all changes to the "organization_id" field.
+func (m *EmployeeConfigMutation) ResetOrganizationID() {
+	m.organization_id = nil
+	m.addorganization_id = nil
+	delete(m.clearedFields, employeeconfig.FieldOrganizationID)
+}
+
+// Where appends a list predicates to the EmployeeConfigMutation builder.
+func (m *EmployeeConfigMutation) Where(ps ...predicate.EmployeeConfig) {
+	m.predicates = append(m.predicates, ps...)
+}
+
+// WhereP appends storage-level predicates to the EmployeeConfigMutation builder. Using this method,
+// users can use type-assertion to append predicates that do not depend on any generated package.
+func (m *EmployeeConfigMutation) WhereP(ps ...func(*sql.Selector)) {
+	p := make([]predicate.EmployeeConfig, len(ps))
+	for i := range ps {
+		p[i] = ps[i]
+	}
+	m.Where(p...)
+}
+
+// Op returns the operation name.
+func (m *EmployeeConfigMutation) Op() Op {
+	return m.op
+}
+
+// SetOp allows setting the mutation operation.
+func (m *EmployeeConfigMutation) SetOp(op Op) {
+	m.op = op
+}
+
+// Type returns the node type of this mutation (EmployeeConfig).
+func (m *EmployeeConfigMutation) Type() string {
+	return m.typ
+}
+
+// Fields returns all fields that were changed during this mutation. Note that in
+// order to get all numeric fields that were incremented/decremented, call
+// AddedFields().
+func (m *EmployeeConfigMutation) Fields() []string {
+	fields := make([]string, 0, 7)
+	if m.created_at != nil {
+		fields = append(fields, employeeconfig.FieldCreatedAt)
+	}
+	if m.updated_at != nil {
+		fields = append(fields, employeeconfig.FieldUpdatedAt)
+	}
+	if m.deleted_at != nil {
+		fields = append(fields, employeeconfig.FieldDeletedAt)
+	}
+	if m.stype != nil {
+		fields = append(fields, employeeconfig.FieldStype)
+	}
+	if m.title != nil {
+		fields = append(fields, employeeconfig.FieldTitle)
+	}
+	if m.photo != nil {
+		fields = append(fields, employeeconfig.FieldPhoto)
+	}
+	if m.organization_id != nil {
+		fields = append(fields, employeeconfig.FieldOrganizationID)
+	}
+	return fields
+}
+
+// Field returns the value of 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 *EmployeeConfigMutation) Field(name string) (ent.Value, bool) {
+	switch name {
+	case employeeconfig.FieldCreatedAt:
+		return m.CreatedAt()
+	case employeeconfig.FieldUpdatedAt:
+		return m.UpdatedAt()
+	case employeeconfig.FieldDeletedAt:
+		return m.DeletedAt()
+	case employeeconfig.FieldStype:
+		return m.Stype()
+	case employeeconfig.FieldTitle:
+		return m.Title()
+	case employeeconfig.FieldPhoto:
+		return m.Photo()
+	case employeeconfig.FieldOrganizationID:
+		return m.OrganizationID()
+	}
+	return nil, false
+}
+
+// OldField returns the old value of the field from the database. An error is
+// returned if the mutation operation is not UpdateOne, or the query to the
+// database failed.
+func (m *EmployeeConfigMutation) OldField(ctx context.Context, name string) (ent.Value, error) {
+	switch name {
+	case employeeconfig.FieldCreatedAt:
+		return m.OldCreatedAt(ctx)
+	case employeeconfig.FieldUpdatedAt:
+		return m.OldUpdatedAt(ctx)
+	case employeeconfig.FieldDeletedAt:
+		return m.OldDeletedAt(ctx)
+	case employeeconfig.FieldStype:
+		return m.OldStype(ctx)
+	case employeeconfig.FieldTitle:
+		return m.OldTitle(ctx)
+	case employeeconfig.FieldPhoto:
+		return m.OldPhoto(ctx)
+	case employeeconfig.FieldOrganizationID:
+		return m.OldOrganizationID(ctx)
+	}
+	return nil, fmt.Errorf("unknown EmployeeConfig field %s", name)
+}
+
+// SetField sets the value of a field with the given name. It returns an error if
+// the field is not defined in the schema, or if the type mismatched the field
+// type.
+func (m *EmployeeConfigMutation) SetField(name string, value ent.Value) error {
+	switch name {
+	case employeeconfig.FieldCreatedAt:
+		v, ok := value.(time.Time)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.SetCreatedAt(v)
+		return nil
+	case employeeconfig.FieldUpdatedAt:
+		v, ok := value.(time.Time)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.SetUpdatedAt(v)
+		return nil
+	case employeeconfig.FieldDeletedAt:
+		v, ok := value.(time.Time)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.SetDeletedAt(v)
+		return nil
+	case employeeconfig.FieldStype:
+		v, ok := value.(string)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.SetStype(v)
+		return nil
+	case employeeconfig.FieldTitle:
+		v, ok := value.(string)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.SetTitle(v)
+		return nil
+	case employeeconfig.FieldPhoto:
+		v, ok := value.(string)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.SetPhoto(v)
+		return nil
+	case employeeconfig.FieldOrganizationID:
+		v, ok := value.(uint64)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.SetOrganizationID(v)
+		return nil
+	}
+	return fmt.Errorf("unknown EmployeeConfig field %s", name)
+}
+
+// AddedFields returns all numeric fields that were incremented/decremented during
+// this mutation.
+func (m *EmployeeConfigMutation) AddedFields() []string {
+	var fields []string
+	if m.addorganization_id != nil {
+		fields = append(fields, employeeconfig.FieldOrganizationID)
+	}
+	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 *EmployeeConfigMutation) AddedField(name string) (ent.Value, bool) {
+	switch name {
+	case employeeconfig.FieldOrganizationID:
+		return m.AddedOrganizationID()
+	}
+	return nil, false
+}
+
+// AddField adds the value to the field with the given name. It returns an error if
+// the field is not defined in the schema, or if the type mismatched the field
+// type.
+func (m *EmployeeConfigMutation) AddField(name string, value ent.Value) error {
+	switch name {
+	case employeeconfig.FieldOrganizationID:
+		v, ok := value.(int64)
+		if !ok {
+			return fmt.Errorf("unexpected type %T for field %s", value, name)
+		}
+		m.AddOrganizationID(v)
+		return nil
+	}
+	return fmt.Errorf("unknown EmployeeConfig numeric field %s", name)
+}
+
+// ClearedFields returns all nullable fields that were cleared during this
+// mutation.
+func (m *EmployeeConfigMutation) ClearedFields() []string {
+	var fields []string
+	if m.FieldCleared(employeeconfig.FieldDeletedAt) {
+		fields = append(fields, employeeconfig.FieldDeletedAt)
+	}
+	if m.FieldCleared(employeeconfig.FieldOrganizationID) {
+		fields = append(fields, employeeconfig.FieldOrganizationID)
+	}
+	return fields
+}
+
+// FieldCleared returns a boolean indicating if a field with the given name was
+// cleared in this mutation.
+func (m *EmployeeConfigMutation) FieldCleared(name string) bool {
+	_, ok := m.clearedFields[name]
+	return ok
+}
+
+// ClearField clears the value of the field with the given name. It returns an
+// error if the field is not defined in the schema.
+func (m *EmployeeConfigMutation) ClearField(name string) error {
+	switch name {
+	case employeeconfig.FieldDeletedAt:
+		m.ClearDeletedAt()
+		return nil
+	case employeeconfig.FieldOrganizationID:
+		m.ClearOrganizationID()
+		return nil
+	}
+	return fmt.Errorf("unknown EmployeeConfig nullable field %s", name)
+}
+
+// ResetField resets all changes in the mutation for the field with the given name.
+// It returns an error if the field is not defined in the schema.
+func (m *EmployeeConfigMutation) ResetField(name string) error {
+	switch name {
+	case employeeconfig.FieldCreatedAt:
+		m.ResetCreatedAt()
+		return nil
+	case employeeconfig.FieldUpdatedAt:
+		m.ResetUpdatedAt()
+		return nil
+	case employeeconfig.FieldDeletedAt:
+		m.ResetDeletedAt()
+		return nil
+	case employeeconfig.FieldStype:
+		m.ResetStype()
+		return nil
+	case employeeconfig.FieldTitle:
+		m.ResetTitle()
+		return nil
+	case employeeconfig.FieldPhoto:
+		m.ResetPhoto()
+		return nil
+	case employeeconfig.FieldOrganizationID:
+		m.ResetOrganizationID()
+		return nil
+	}
+	return fmt.Errorf("unknown EmployeeConfig field %s", name)
+}
+
+// AddedEdges returns all edge names that were set/added in this mutation.
+func (m *EmployeeConfigMutation) AddedEdges() []string {
+	edges := make([]string, 0, 0)
+	return edges
+}
+
+// AddedIDs returns all IDs (to other nodes) that were added for the given edge
+// name in this mutation.
+func (m *EmployeeConfigMutation) AddedIDs(name string) []ent.Value {
+	return nil
+}
+
+// RemovedEdges returns all edge names that were removed in this mutation.
+func (m *EmployeeConfigMutation) RemovedEdges() []string {
+	edges := make([]string, 0, 0)
+	return edges
+}
+
+// RemovedIDs returns all IDs (to other nodes) that were removed for the edge with
+// the given name in this mutation.
+func (m *EmployeeConfigMutation) RemovedIDs(name string) []ent.Value {
+	return nil
+}
+
+// ClearedEdges returns all edge names that were cleared in this mutation.
+func (m *EmployeeConfigMutation) ClearedEdges() []string {
+	edges := make([]string, 0, 0)
+	return edges
+}
+
+// EdgeCleared returns a boolean which indicates if the edge with the given name
+// was cleared in this mutation.
+func (m *EmployeeConfigMutation) EdgeCleared(name string) bool {
+	return false
+}
+
+// ClearEdge clears the value of the edge with the given name. It returns an error
+// if that edge is not defined in the schema.
+func (m *EmployeeConfigMutation) ClearEdge(name string) error {
+	return fmt.Errorf("unknown EmployeeConfig unique edge %s", name)
+}
+
+// ResetEdge resets all changes to the edge with the given name in this mutation.
+// It returns an error if the edge is not defined in the schema.
+func (m *EmployeeConfigMutation) ResetEdge(name string) error {
+	return fmt.Errorf("unknown EmployeeConfig edge %s", name)
+}
+
 // LabelMutation represents an operation that mutates the Label nodes in the graph.
 type LabelMutation struct {
 	config

+ 82 - 0
ent/pagination.go

@@ -9,6 +9,7 @@ import (
 	"wechat-api/ent/batchmsg"
 	"wechat-api/ent/contact"
 	"wechat-api/ent/employee"
+	"wechat-api/ent/employeeconfig"
 	"wechat-api/ent/label"
 	"wechat-api/ent/labelrelationship"
 	"wechat-api/ent/message"
@@ -394,6 +395,87 @@ func (e *EmployeeQuery) Page(
 	return ret, nil
 }
 
+type EmployeeConfigPager struct {
+	Order  employeeconfig.OrderOption
+	Filter func(*EmployeeConfigQuery) (*EmployeeConfigQuery, error)
+}
+
+// EmployeeConfigPaginateOption enables pagination customization.
+type EmployeeConfigPaginateOption func(*EmployeeConfigPager)
+
+// DefaultEmployeeConfigOrder is the default ordering of EmployeeConfig.
+var DefaultEmployeeConfigOrder = Desc(employeeconfig.FieldID)
+
+func newEmployeeConfigPager(opts []EmployeeConfigPaginateOption) (*EmployeeConfigPager, error) {
+	pager := &EmployeeConfigPager{}
+	for _, opt := range opts {
+		opt(pager)
+	}
+	if pager.Order == nil {
+		pager.Order = DefaultEmployeeConfigOrder
+	}
+	return pager, nil
+}
+
+func (p *EmployeeConfigPager) ApplyFilter(query *EmployeeConfigQuery) (*EmployeeConfigQuery, error) {
+	if p.Filter != nil {
+		return p.Filter(query)
+	}
+	return query, nil
+}
+
+// EmployeeConfigPageList is EmployeeConfig PageList result.
+type EmployeeConfigPageList struct {
+	List        []*EmployeeConfig `json:"list"`
+	PageDetails *PageDetails      `json:"pageDetails"`
+}
+
+func (ec *EmployeeConfigQuery) Page(
+	ctx context.Context, pageNum uint64, pageSize uint64, opts ...EmployeeConfigPaginateOption,
+) (*EmployeeConfigPageList, error) {
+
+	pager, err := newEmployeeConfigPager(opts)
+	if err != nil {
+		return nil, err
+	}
+
+	if ec, err = pager.ApplyFilter(ec); err != nil {
+		return nil, err
+	}
+
+	ret := &EmployeeConfigPageList{}
+
+	ret.PageDetails = &PageDetails{
+		Page: pageNum,
+		Size: pageSize,
+	}
+
+	query := ec.Clone()
+	query.ctx.Fields = nil
+	count, err := query.Count(ctx)
+
+	if err != nil {
+		return nil, err
+	}
+
+	ret.PageDetails.Total = uint64(count)
+
+	if pager.Order != nil {
+		ec = ec.Order(pager.Order)
+	} else {
+		ec = ec.Order(DefaultEmployeeConfigOrder)
+	}
+
+	ec = ec.Offset(int((pageNum - 1) * pageSize)).Limit(int(pageSize))
+	list, err := ec.All(ctx)
+	if err != nil {
+		return nil, err
+	}
+	ret.List = list
+
+	return ret, nil
+}
+
 type LabelPager struct {
 	Order  label.OrderOption
 	Filter func(*LabelQuery) (*LabelQuery, error)

+ 3 - 0
ent/predicate/predicate.go

@@ -18,6 +18,9 @@ type Contact func(*sql.Selector)
 // Employee is the predicate function for employee builders.
 type Employee func(*sql.Selector)
 
+// EmployeeConfig is the predicate function for employeeconfig builders.
+type EmployeeConfig func(*sql.Selector)
+
 // Label is the predicate function for label builders.
 type Label func(*sql.Selector)
 

+ 36 - 0
ent/runtime/runtime.go

@@ -8,6 +8,7 @@ import (
 	"wechat-api/ent/batchmsg"
 	"wechat-api/ent/contact"
 	"wechat-api/ent/employee"
+	"wechat-api/ent/employeeconfig"
 	"wechat-api/ent/label"
 	"wechat-api/ent/labelrelationship"
 	"wechat-api/ent/message"
@@ -282,6 +283,41 @@ func init() {
 	employeeDescOrganizationID := employeeFields[13].Descriptor()
 	// employee.OrganizationIDValidator is a validator for the "organization_id" field. It is called by the builders before save.
 	employee.OrganizationIDValidator = employeeDescOrganizationID.Validators[0].(func(uint64) error)
+	employeeconfigMixin := schema.EmployeeConfig{}.Mixin()
+	employeeconfigMixinHooks1 := employeeconfigMixin[1].Hooks()
+	employeeconfig.Hooks[0] = employeeconfigMixinHooks1[0]
+	employeeconfigMixinInters1 := employeeconfigMixin[1].Interceptors()
+	employeeconfig.Interceptors[0] = employeeconfigMixinInters1[0]
+	employeeconfigMixinFields0 := employeeconfigMixin[0].Fields()
+	_ = employeeconfigMixinFields0
+	employeeconfigFields := schema.EmployeeConfig{}.Fields()
+	_ = employeeconfigFields
+	// employeeconfigDescCreatedAt is the schema descriptor for created_at field.
+	employeeconfigDescCreatedAt := employeeconfigMixinFields0[1].Descriptor()
+	// employeeconfig.DefaultCreatedAt holds the default value on creation for the created_at field.
+	employeeconfig.DefaultCreatedAt = employeeconfigDescCreatedAt.Default.(func() time.Time)
+	// employeeconfigDescUpdatedAt is the schema descriptor for updated_at field.
+	employeeconfigDescUpdatedAt := employeeconfigMixinFields0[2].Descriptor()
+	// employeeconfig.DefaultUpdatedAt holds the default value on creation for the updated_at field.
+	employeeconfig.DefaultUpdatedAt = employeeconfigDescUpdatedAt.Default.(func() time.Time)
+	// employeeconfig.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
+	employeeconfig.UpdateDefaultUpdatedAt = employeeconfigDescUpdatedAt.UpdateDefault.(func() time.Time)
+	// employeeconfigDescStype is the schema descriptor for stype field.
+	employeeconfigDescStype := employeeconfigFields[0].Descriptor()
+	// employeeconfig.DefaultStype holds the default value on creation for the stype field.
+	employeeconfig.DefaultStype = employeeconfigDescStype.Default.(string)
+	// employeeconfigDescTitle is the schema descriptor for title field.
+	employeeconfigDescTitle := employeeconfigFields[1].Descriptor()
+	// employeeconfig.DefaultTitle holds the default value on creation for the title field.
+	employeeconfig.DefaultTitle = employeeconfigDescTitle.Default.(string)
+	// employeeconfigDescPhoto is the schema descriptor for photo field.
+	employeeconfigDescPhoto := employeeconfigFields[2].Descriptor()
+	// employeeconfig.DefaultPhoto holds the default value on creation for the photo field.
+	employeeconfig.DefaultPhoto = employeeconfigDescPhoto.Default.(string)
+	// employeeconfigDescOrganizationID is the schema descriptor for organization_id field.
+	employeeconfigDescOrganizationID := employeeconfigFields[3].Descriptor()
+	// employeeconfig.DefaultOrganizationID holds the default value on creation for the organization_id field.
+	employeeconfig.DefaultOrganizationID = employeeconfigDescOrganizationID.Default.(uint64)
 	labelMixin := schema.Label{}.Mixin()
 	labelMixinFields0 := labelMixin[0].Fields()
 	_ = labelMixinFields0

+ 48 - 0
ent/schema/employee_config.go

@@ -0,0 +1,48 @@
+package schema
+
+import (
+	"entgo.io/ent"
+	"entgo.io/ent/dialect/entsql"
+	"entgo.io/ent/schema"
+	"entgo.io/ent/schema/field"
+	"entgo.io/ent/schema/index"
+	"github.com/suyuan32/simple-admin-common/orm/ent/mixins"
+	"wechat-api/ent/schema/localmixin"
+)
+
+type EmployeeConfig struct {
+	ent.Schema
+}
+
+func (EmployeeConfig) Fields() []ent.Field {
+	return []ent.Field{
+		field.String("stype").Default("").Comment("类型:scene-场景 switch_in-接入方式"),
+		field.String("title").Default("").Comment("标题"),
+		field.String("photo").Default("").Comment("图片地址"),
+		field.Uint64("organization_id").Optional().Default(1).Comment("机构 ID"),
+	}
+}
+
+func (EmployeeConfig) Mixin() []ent.Mixin {
+	return []ent.Mixin{
+		mixins.IDMixin{},
+		localmixin.SoftDeleteMixin{},
+	}
+}
+
+func (EmployeeConfig) Indexes() []ent.Index {
+	return []ent.Index{
+		index.Fields("stype"),
+	}
+}
+
+func (EmployeeConfig) Edges() []ent.Edge {
+	return nil
+}
+
+func (EmployeeConfig) Annotations() []schema.Annotation {
+	return []schema.Annotation{
+		entsql.WithComments(true),
+		entsql.Annotation{Table: "employee_config"},
+	}
+}

+ 144 - 0
ent/set_not_nil.go

@@ -1400,6 +1400,150 @@ func (e *EmployeeCreate) SetNotNilOrganizationID(value *uint64) *EmployeeCreate
 }
 
 // set field if value's pointer is not nil.
+func (ec *EmployeeConfigUpdate) SetNotNilUpdatedAt(value *time.Time) *EmployeeConfigUpdate {
+	if value != nil {
+		return ec.SetUpdatedAt(*value)
+	}
+	return ec
+}
+
+// set field if value's pointer is not nil.
+func (ec *EmployeeConfigUpdateOne) SetNotNilUpdatedAt(value *time.Time) *EmployeeConfigUpdateOne {
+	if value != nil {
+		return ec.SetUpdatedAt(*value)
+	}
+	return ec
+}
+
+// set field if value's pointer is not nil.
+func (ec *EmployeeConfigCreate) SetNotNilUpdatedAt(value *time.Time) *EmployeeConfigCreate {
+	if value != nil {
+		return ec.SetUpdatedAt(*value)
+	}
+	return ec
+}
+
+// set field if value's pointer is not nil.
+func (ec *EmployeeConfigUpdate) SetNotNilDeletedAt(value *time.Time) *EmployeeConfigUpdate {
+	if value != nil {
+		return ec.SetDeletedAt(*value)
+	}
+	return ec
+}
+
+// set field if value's pointer is not nil.
+func (ec *EmployeeConfigUpdateOne) SetNotNilDeletedAt(value *time.Time) *EmployeeConfigUpdateOne {
+	if value != nil {
+		return ec.SetDeletedAt(*value)
+	}
+	return ec
+}
+
+// set field if value's pointer is not nil.
+func (ec *EmployeeConfigCreate) SetNotNilDeletedAt(value *time.Time) *EmployeeConfigCreate {
+	if value != nil {
+		return ec.SetDeletedAt(*value)
+	}
+	return ec
+}
+
+// set field if value's pointer is not nil.
+func (ec *EmployeeConfigUpdate) SetNotNilStype(value *string) *EmployeeConfigUpdate {
+	if value != nil {
+		return ec.SetStype(*value)
+	}
+	return ec
+}
+
+// set field if value's pointer is not nil.
+func (ec *EmployeeConfigUpdateOne) SetNotNilStype(value *string) *EmployeeConfigUpdateOne {
+	if value != nil {
+		return ec.SetStype(*value)
+	}
+	return ec
+}
+
+// set field if value's pointer is not nil.
+func (ec *EmployeeConfigCreate) SetNotNilStype(value *string) *EmployeeConfigCreate {
+	if value != nil {
+		return ec.SetStype(*value)
+	}
+	return ec
+}
+
+// set field if value's pointer is not nil.
+func (ec *EmployeeConfigUpdate) SetNotNilTitle(value *string) *EmployeeConfigUpdate {
+	if value != nil {
+		return ec.SetTitle(*value)
+	}
+	return ec
+}
+
+// set field if value's pointer is not nil.
+func (ec *EmployeeConfigUpdateOne) SetNotNilTitle(value *string) *EmployeeConfigUpdateOne {
+	if value != nil {
+		return ec.SetTitle(*value)
+	}
+	return ec
+}
+
+// set field if value's pointer is not nil.
+func (ec *EmployeeConfigCreate) SetNotNilTitle(value *string) *EmployeeConfigCreate {
+	if value != nil {
+		return ec.SetTitle(*value)
+	}
+	return ec
+}
+
+// set field if value's pointer is not nil.
+func (ec *EmployeeConfigUpdate) SetNotNilPhoto(value *string) *EmployeeConfigUpdate {
+	if value != nil {
+		return ec.SetPhoto(*value)
+	}
+	return ec
+}
+
+// set field if value's pointer is not nil.
+func (ec *EmployeeConfigUpdateOne) SetNotNilPhoto(value *string) *EmployeeConfigUpdateOne {
+	if value != nil {
+		return ec.SetPhoto(*value)
+	}
+	return ec
+}
+
+// set field if value's pointer is not nil.
+func (ec *EmployeeConfigCreate) SetNotNilPhoto(value *string) *EmployeeConfigCreate {
+	if value != nil {
+		return ec.SetPhoto(*value)
+	}
+	return ec
+}
+
+// set field if value's pointer is not nil.
+func (ec *EmployeeConfigUpdate) SetNotNilOrganizationID(value *uint64) *EmployeeConfigUpdate {
+	if value != nil {
+		return ec.SetOrganizationID(*value)
+	}
+	return ec
+}
+
+// set field if value's pointer is not nil.
+func (ec *EmployeeConfigUpdateOne) SetNotNilOrganizationID(value *uint64) *EmployeeConfigUpdateOne {
+	if value != nil {
+		return ec.SetOrganizationID(*value)
+	}
+	return ec
+}
+
+// set field if value's pointer is not nil.
+func (ec *EmployeeConfigCreate) SetNotNilOrganizationID(value *uint64) *EmployeeConfigCreate {
+	if value != nil {
+		return ec.SetOrganizationID(*value)
+	}
+	return ec
+}
+
+// set field if value's pointer is not nil.
 func (l *LabelUpdate) SetNotNilUpdatedAt(value *time.Time) *LabelUpdate {
 	if value != nil {
 		return l.SetUpdatedAt(*value)

+ 3 - 0
ent/tx.go

@@ -22,6 +22,8 @@ type Tx struct {
 	Contact *ContactClient
 	// Employee is the client for interacting with the Employee builders.
 	Employee *EmployeeClient
+	// EmployeeConfig is the client for interacting with the EmployeeConfig builders.
+	EmployeeConfig *EmployeeConfigClient
 	// Label is the client for interacting with the Label builders.
 	Label *LabelClient
 	// LabelRelationship is the client for interacting with the LabelRelationship builders.
@@ -183,6 +185,7 @@ func (tx *Tx) init() {
 	tx.BatchMsg = NewBatchMsgClient(tx.config)
 	tx.Contact = NewContactClient(tx.config)
 	tx.Employee = NewEmployeeClient(tx.config)
+	tx.EmployeeConfig = NewEmployeeConfigClient(tx.config)
 	tx.Label = NewLabelClient(tx.config)
 	tx.LabelRelationship = NewLabelRelationshipClient(tx.config)
 	tx.Message = NewMessageClient(tx.config)

+ 4 - 0
go.sum

@@ -364,6 +364,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=
@@ -394,6 +395,7 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW
 github.com/nicksnyder/go-i18n/v2 v2.4.0 h1:3IcvPOAvnCKwNm0TB0dLDTuawWEj+ax/RERNC+diLMM=
 github.com/nicksnyder/go-i18n/v2 v2.4.0/go.mod h1:nxYSZE9M0bf3Y70gPQjN9ha7XNHX7gMc814+6wVyEI4=
 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/v2 v2.17.1 h1:V++EzdbhI4ZV4ev0UTIj0PzhzOcReJFyJaLjtSF55M8=
 github.com/onsi/ginkgo/v2 v2.17.1/go.mod h1:llBI3WDLL9Z6taip6f33H76YcWtJv+7R3HigUjbIBOs=
@@ -474,6 +476,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=

+ 44 - 0
internal/handler/employee_config/get_employee_list_config_handler.go

@@ -0,0 +1,44 @@
+package employee_config
+
+import (
+	"net/http"
+
+	"github.com/zeromicro/go-zero/rest/httpx"
+
+	"wechat-api/internal/logic/employee_config"
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+)
+
+// swagger:route get /employee_config/list employee_config GetEmployeeListConfig
+//
+// Get employee config list | 获取EmployeeConfig列表
+//
+// Get employee config list | 获取EmployeeConfig列表
+//
+// Parameters:
+//  + name: body
+//    require: true
+//    in: body
+//    type: EmployeeConfigListReq
+//
+// Responses:
+//  200: EmployeeConfigListResp
+
+func GetEmployeeListConfigHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.EmployeeConfigListReq
+		if err := httpx.Parse(r, &req, true); err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+			return
+		}
+
+		l := employee_config.NewGetEmployeeListConfigLogic(r.Context(), svcCtx)
+		resp, err := l.GetEmployeeListConfig(&req)
+		if err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+		} else {
+			httpx.OkJsonCtx(r.Context(), w, resp)
+		}
+	}
+}

+ 15 - 0
internal/handler/routes.go

@@ -16,6 +16,7 @@ import (
 	batch_msg "wechat-api/internal/handler/batch_msg"
 	contact "wechat-api/internal/handler/contact"
 	employee "wechat-api/internal/handler/employee"
+	employee_config "wechat-api/internal/handler/employee_config"
 	label "wechat-api/internal/handler/label"
 	label_relationship "wechat-api/internal/handler/label_relationship"
 	message_records "wechat-api/internal/handler/message_records"
@@ -773,4 +774,18 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 			},
 		},
 	)
+
+	server.AddRoutes(
+		rest.WithMiddlewares(
+			[]rest.Middleware{serverCtx.Authority},
+			[]rest.Route{
+				{
+					Method:  http.MethodGet,
+					Path:    "/employee_config/list",
+					Handler: employee_config.GetEmployeeListConfigHandler(serverCtx),
+				},
+			}...,
+		),
+		rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
+	)
 }

+ 62 - 0
internal/logic/base/init_api_data.go

@@ -6,6 +6,68 @@ import (
 )
 
 func (l *InitDatabaseLogic) insertApiData() (err error) {
+	// EmployeeConfig
+
+	_, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
+		ServiceName: pointy.GetPointer("Wechat"),
+		Path:        pointy.GetPointer("/employee_config/create"),
+		Description: pointy.GetPointer("apiDesc.createEmployeeConfig"),
+		ApiGroup:    pointy.GetPointer("employee_config"),
+		Method:      pointy.GetPointer("POST"),
+	})
+
+	if err != nil {
+		return err
+	}
+
+	_, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
+		ServiceName: pointy.GetPointer("Wechat"),
+		Path:        pointy.GetPointer("/employee_config/update"),
+		Description: pointy.GetPointer("apiDesc.updateEmployeeConfig"),
+		ApiGroup:    pointy.GetPointer("employee_config"),
+		Method:      pointy.GetPointer("POST"),
+	})
+
+	if err != nil {
+		return err
+	}
+
+	_, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
+		ServiceName: pointy.GetPointer("Wechat"),
+		Path:        pointy.GetPointer("/employee_config/delete"),
+		Description: pointy.GetPointer("apiDesc.deleteEmployeeConfig"),
+		ApiGroup:    pointy.GetPointer("employee_config"),
+		Method:      pointy.GetPointer("POST"),
+	})
+
+	if err != nil {
+		return err
+	}
+
+	_, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
+		ServiceName: pointy.GetPointer("Wechat"),
+		Path:        pointy.GetPointer("/employee_config/list"),
+		Description: pointy.GetPointer("apiDesc.getEmployeeConfigList"),
+		ApiGroup:    pointy.GetPointer("employee_config"),
+		Method:      pointy.GetPointer("POST"),
+	})
+
+	if err != nil {
+		return err
+	}
+
+	_, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{
+		ServiceName: pointy.GetPointer("Wechat"),
+		Path:        pointy.GetPointer("/employee_config"),
+		Description: pointy.GetPointer("apiDesc.getEmployeeConfigById"),
+		ApiGroup:    pointy.GetPointer("employee_config"),
+		Method:      pointy.GetPointer("POST"),
+	})
+
+	if err != nil {
+		return err
+	}
+
 	// Msg
 
 	_, err = l.svcCtx.CoreRpc.CreateApi(l.ctx, &core.ApiInfo{

+ 70 - 0
internal/logic/employee_config/get_employee_list_config_logic.go

@@ -0,0 +1,70 @@
+package employee_config
+
+import (
+	"context"
+	"github.com/suyuan32/simple-admin-common/msg/errormsg"
+	"github.com/suyuan32/simple-admin-common/utils/pointy"
+	"wechat-api/ent/employeeconfig"
+	"wechat-api/internal/utils/dberrorhandler"
+
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type GetEmployeeListConfigLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewGetEmployeeListConfigLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetEmployeeListConfigLogic {
+	return &GetEmployeeListConfigLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx}
+}
+
+func (l *GetEmployeeListConfigLogic) GetEmployeeListConfig(req *types.EmployeeConfigListReq) (*types.EmployeeConfigListResp, error) {
+	resp := &types.EmployeeConfigListResp{}
+	resp.Code = 0
+	resp.Msg = errormsg.Success
+
+	sceneList, err := l.svcCtx.DB.EmployeeConfig.Query().Where(employeeconfig.StypeEQ("scene")).All(l.ctx)
+	if err != nil {
+		return nil, dberrorhandler.DefaultEntError(l.Logger, err, req)
+	}
+
+	switchInList, err := l.svcCtx.DB.EmployeeConfig.Query().Where(employeeconfig.StypeEQ("switch_in")).All(l.ctx)
+	if err != nil {
+		return nil, dberrorhandler.DefaultEntError(l.Logger, err, req)
+	}
+
+	for _, val := range sceneList {
+		resp.Data.Scene = append(resp.Data.Scene, types.EmployeeConfigInfo{
+			BaseIDInfo: types.BaseIDInfo{
+				Id:        &val.ID,
+				CreatedAt: pointy.GetPointer(val.CreatedAt.UnixMilli()),
+				UpdatedAt: pointy.GetPointer(val.UpdatedAt.UnixMilli()),
+			},
+			Stype: &val.Stype,
+			Title: &val.Title,
+			Photo: &val.Photo,
+		})
+	}
+	for _, val := range switchInList {
+		resp.Data.SwitchIn = append(resp.Data.SwitchIn, types.EmployeeConfigInfo{
+			BaseIDInfo: types.BaseIDInfo{
+				Id:        &val.ID,
+				CreatedAt: pointy.GetPointer(val.CreatedAt.UnixMilli()),
+				UpdatedAt: pointy.GetPointer(val.UpdatedAt.UnixMilli()),
+			},
+			Stype: &val.Stype,
+			Title: &val.Title,
+			Photo: &val.Photo,
+		})
+	}
+
+	return resp, nil
+}

+ 41 - 0
internal/types/types.go

@@ -1574,3 +1574,44 @@ type CheckTokenResp struct {
 	// Timestamp 时间戳
 	Timestamp *int64 `json:"timestamp"`
 }
+
+// The data of employee config information | EmployeeConfig信息
+// swagger:model EmployeeConfigInfo
+type EmployeeConfigInfo struct {
+	BaseIDInfo
+	// 类型:scene-场景 switch_in-接入方式
+	Stype *string `json:"stype,optional"`
+	// 标题
+	Title *string `json:"title,optional"`
+	// 图片地址
+	Photo *string `json:"photo,optional"`
+}
+
+// EmployeeConfig list data | EmployeeConfig列表数据
+// swagger:model EmployeeConfigListInfo
+type EmployeeConfigListInfo struct {
+	BaseListInfo
+	// The API list data | EmployeeConfig列表数据
+	Data []EmployeeConfigInfo `json:"data"`
+}
+
+// Employee config response | Employee配置信息返回体
+// swagger:model EmployeeConfigListReq
+type EmployeeConfigListReq struct {
+	/// 类型:scene-场景 switch_in-接入方式
+	Stype *string `json:"stype,optional"`
+}
+
+// EmployeeConfig information response | EmployeeConfig信息返回体
+type EmployeeConfig struct {
+	Scene    []EmployeeConfigInfo `json:"scene"`
+	SwitchIn []EmployeeConfigInfo `json:"switchIn"`
+}
+
+// Employee config response | Employee配置信息返回体
+// swagger:model EmployeeConfigListResp
+type EmployeeConfigListResp struct {
+	BaseDataInfo
+	// Employee information | Employee数据
+	Data EmployeeConfig `json:"data"`
+}