Parcourir la source

fix:add new sop API for desktop app

jimmyyem il y a 4 mois
Parent
commit
2107825ae7

+ 15 - 0
desc/wechat/sop_node.api

@@ -34,6 +34,11 @@ type (
         StageId  *uint64 `json:"stageId"`
     }
 
+	// Get sop node list request params | SopNode列表请求参数
+	BatchSopNodeListReq {
+		StageIds  []uint64 `json:"stageIds"`
+	}
+
     // SopNode information response | SopNode信息返回体
     SopNodeInfoResp {
         BaseDataInfo
@@ -52,6 +57,16 @@ type (
 )
 
 @server(
+	group: sop_node
+)
+
+service Wechat {
+	// Get api sop node list | 获取SopNode列表
+	@handler getApiSopNodeList
+	post /api/sop_node/list (BatchSopNodeListReq) returns (SopNodeListResp)
+}
+
+@server(
     jwt: Auth
     group: sop_node
     middleware: Authority

+ 15 - 2
desc/wechat/sop_stage.api

@@ -142,6 +142,11 @@ type (
         TaskId  *uint64 `json:"taskId"`
     }
 
+	// Batch get sop stage list request params | SopStage列表请求参数
+	BatchSopStageListReq {
+		TaskIds  []uint64 `json:"taskIds"`
+	}
+
     // SopStage information response | SopStage信息返回体
     SopStageInfoResp {
         BaseDataInfo
@@ -168,9 +173,17 @@ type (
 )
 
 @server(
-    jwt: Auth
+	group: sop_stage
+)
+
+service Wechat {
+	// Get sop stage list | 获取SopStage列表
+	@handler getApiSopStageList
+	post /api/sop_stage/list (BatchSopStageListReq) returns (SopStageListResp)
+}
+
+@server(
     group: sop_stage
-    middleware: Authority
 )
 
 service Wechat {

+ 10 - 0
desc/wechat/sop_task.api

@@ -140,6 +140,16 @@ type (
 )
 
 @server(
+	group: sop_task
+)
+
+service Wechat {
+	// Get sop task list | 获取SopTask列表
+	@handler getApiSopTaskList
+	post /api/sop_task/list () returns (SopTaskListResp)
+}
+
+@server(
     jwt: Auth
     group: sop_task
     middleware: Authority

+ 3 - 0
desc/wechat/token.api

@@ -14,6 +14,9 @@ type (
 
         // Mac地址 
         Mac  *string `json:"mac,optional"`
+
+		// 租户ID
+		OrganizationId *uint64 `json:"organization_id,optional"`
     }
 
     // The response data of token list | Token列表数据

+ 1 - 0
ent/migrate/schema.go

@@ -639,6 +639,7 @@ var (
 		{Name: "expire_at", Type: field.TypeTime, Nullable: true, Comment: "过期时间"},
 		{Name: "token", Type: field.TypeString, Nullable: true, Comment: "Token", Default: ""},
 		{Name: "mac", Type: field.TypeString, Comment: "Mac地址", Default: ""},
+		{Name: "organization_id", Type: field.TypeUint64, Comment: "租户ID", Default: 0},
 	}
 	// TokenTable holds the schema information for the "token" table.
 	TokenTable = &schema.Table{

+ 105 - 15
ent/mutation.go

@@ -22201,19 +22201,21 @@ func (m *SopTaskMutation) ResetEdge(name string) error {
 // TokenMutation represents an operation that mutates the Token nodes in the graph.
 type TokenMutation struct {
 	config
-	op            Op
-	typ           string
-	id            *uint64
-	created_at    *time.Time
-	updated_at    *time.Time
-	deleted_at    *time.Time
-	expire_at     *time.Time
-	token         *string
-	mac           *string
-	clearedFields map[string]struct{}
-	done          bool
-	oldValue      func(context.Context) (*Token, error)
-	predicates    []predicate.Token
+	op                 Op
+	typ                string
+	id                 *uint64
+	created_at         *time.Time
+	updated_at         *time.Time
+	deleted_at         *time.Time
+	expire_at          *time.Time
+	token              *string
+	mac                *string
+	organization_id    *uint64
+	addorganization_id *int64
+	clearedFields      map[string]struct{}
+	done               bool
+	oldValue           func(context.Context) (*Token, error)
+	predicates         []predicate.Token
 }
 
 var _ ent.Mutation = (*TokenMutation)(nil)
@@ -22575,6 +22577,62 @@ func (m *TokenMutation) ResetMAC() {
 	m.mac = nil
 }
 
+// SetOrganizationID sets the "organization_id" field.
+func (m *TokenMutation) 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 *TokenMutation) 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 Token entity.
+// If the Token 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 *TokenMutation) 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 *TokenMutation) 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 *TokenMutation) AddedOrganizationID() (r int64, exists bool) {
+	v := m.addorganization_id
+	if v == nil {
+		return
+	}
+	return *v, true
+}
+
+// ResetOrganizationID resets all changes to the "organization_id" field.
+func (m *TokenMutation) ResetOrganizationID() {
+	m.organization_id = nil
+	m.addorganization_id = nil
+}
+
 // Where appends a list predicates to the TokenMutation builder.
 func (m *TokenMutation) Where(ps ...predicate.Token) {
 	m.predicates = append(m.predicates, ps...)
@@ -22609,7 +22667,7 @@ func (m *TokenMutation) Type() string {
 // order to get all numeric fields that were incremented/decremented, call
 // AddedFields().
 func (m *TokenMutation) Fields() []string {
-	fields := make([]string, 0, 6)
+	fields := make([]string, 0, 7)
 	if m.created_at != nil {
 		fields = append(fields, token.FieldCreatedAt)
 	}
@@ -22628,6 +22686,9 @@ func (m *TokenMutation) Fields() []string {
 	if m.mac != nil {
 		fields = append(fields, token.FieldMAC)
 	}
+	if m.organization_id != nil {
+		fields = append(fields, token.FieldOrganizationID)
+	}
 	return fields
 }
 
@@ -22648,6 +22709,8 @@ func (m *TokenMutation) Field(name string) (ent.Value, bool) {
 		return m.Token()
 	case token.FieldMAC:
 		return m.MAC()
+	case token.FieldOrganizationID:
+		return m.OrganizationID()
 	}
 	return nil, false
 }
@@ -22669,6 +22732,8 @@ func (m *TokenMutation) OldField(ctx context.Context, name string) (ent.Value, e
 		return m.OldToken(ctx)
 	case token.FieldMAC:
 		return m.OldMAC(ctx)
+	case token.FieldOrganizationID:
+		return m.OldOrganizationID(ctx)
 	}
 	return nil, fmt.Errorf("unknown Token field %s", name)
 }
@@ -22720,6 +22785,13 @@ func (m *TokenMutation) SetField(name string, value ent.Value) error {
 		}
 		m.SetMAC(v)
 		return nil
+	case token.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 Token field %s", name)
 }
@@ -22727,13 +22799,21 @@ func (m *TokenMutation) SetField(name string, value ent.Value) error {
 // AddedFields returns all numeric fields that were incremented/decremented during
 // this mutation.
 func (m *TokenMutation) AddedFields() []string {
-	return nil
+	var fields []string
+	if m.addorganization_id != nil {
+		fields = append(fields, token.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 *TokenMutation) AddedField(name string) (ent.Value, bool) {
+	switch name {
+	case token.FieldOrganizationID:
+		return m.AddedOrganizationID()
+	}
 	return nil, false
 }
 
@@ -22742,6 +22822,13 @@ func (m *TokenMutation) AddedField(name string) (ent.Value, bool) {
 // type.
 func (m *TokenMutation) AddField(name string, value ent.Value) error {
 	switch name {
+	case token.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 Token numeric field %s", name)
 }
@@ -22808,6 +22895,9 @@ func (m *TokenMutation) ResetField(name string) error {
 	case token.FieldMAC:
 		m.ResetMAC()
 		return nil
+	case token.FieldOrganizationID:
+		m.ResetOrganizationID()
+		return nil
 	}
 	return fmt.Errorf("unknown Token field %s", name)
 }

+ 4 - 0
ent/runtime/runtime.go

@@ -855,6 +855,10 @@ func init() {
 	tokenDescMAC := tokenFields[2].Descriptor()
 	// token.DefaultMAC holds the default value on creation for the mac field.
 	token.DefaultMAC = tokenDescMAC.Default.(string)
+	// tokenDescOrganizationID is the schema descriptor for organization_id field.
+	tokenDescOrganizationID := tokenFields[3].Descriptor()
+	// token.DefaultOrganizationID holds the default value on creation for the organization_id field.
+	token.DefaultOrganizationID = tokenDescOrganizationID.Default.(uint64)
 	tutorialMixin := schema.Tutorial{}.Mixin()
 	tutorialMixinHooks1 := tutorialMixin[1].Hooks()
 	tutorial.Hooks[0] = tutorialMixinHooks1[0]

+ 1 - 0
ent/schema/token.go

@@ -20,6 +20,7 @@ func (Token) Fields() []ent.Field {
 		field.Time("expire_at").Optional().Default(nil).Comment("过期时间"),
 		field.String("token").Optional().Default("").Comment("Token"),
 		field.String("mac").Default("").Comment("Mac地址"),
+		field.Uint64("organization_id").Default(0).Comment("租户ID"),
 	}
 }
 

+ 24 - 0
ent/set_not_nil.go

@@ -4808,6 +4808,30 @@ func (t *TokenCreate) SetNotNilMAC(value *string) *TokenCreate {
 }
 
 // set field if value's pointer is not nil.
+func (t *TokenUpdate) SetNotNilOrganizationID(value *uint64) *TokenUpdate {
+	if value != nil {
+		return t.SetOrganizationID(*value)
+	}
+	return t
+}
+
+// set field if value's pointer is not nil.
+func (t *TokenUpdateOne) SetNotNilOrganizationID(value *uint64) *TokenUpdateOne {
+	if value != nil {
+		return t.SetOrganizationID(*value)
+	}
+	return t
+}
+
+// set field if value's pointer is not nil.
+func (t *TokenCreate) SetNotNilOrganizationID(value *uint64) *TokenCreate {
+	if value != nil {
+		return t.SetOrganizationID(*value)
+	}
+	return t
+}
+
+// set field if value's pointer is not nil.
 func (t *TutorialUpdate) SetNotNilUpdatedAt(value *time.Time) *TutorialUpdate {
 	if value != nil {
 		return t.SetUpdatedAt(*value)

+ 14 - 3
ent/token.go

@@ -28,8 +28,10 @@ type Token struct {
 	// Token
 	Token string `json:"token,omitempty"`
 	// Mac地址
-	MAC          string `json:"mac,omitempty"`
-	selectValues sql.SelectValues
+	MAC string `json:"mac,omitempty"`
+	// 租户ID
+	OrganizationID uint64 `json:"organization_id,omitempty"`
+	selectValues   sql.SelectValues
 }
 
 // scanValues returns the types for scanning values from sql.Rows.
@@ -37,7 +39,7 @@ func (*Token) scanValues(columns []string) ([]any, error) {
 	values := make([]any, len(columns))
 	for i := range columns {
 		switch columns[i] {
-		case token.FieldID:
+		case token.FieldID, token.FieldOrganizationID:
 			values[i] = new(sql.NullInt64)
 		case token.FieldToken, token.FieldMAC:
 			values[i] = new(sql.NullString)
@@ -100,6 +102,12 @@ func (t *Token) assignValues(columns []string, values []any) error {
 			} else if value.Valid {
 				t.MAC = value.String
 			}
+		case token.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 {
+				t.OrganizationID = uint64(value.Int64)
+			}
 		default:
 			t.selectValues.Set(columns[i], values[i])
 		}
@@ -153,6 +161,9 @@ func (t *Token) String() string {
 	builder.WriteString(", ")
 	builder.WriteString("mac=")
 	builder.WriteString(t.MAC)
+	builder.WriteString(", ")
+	builder.WriteString("organization_id=")
+	builder.WriteString(fmt.Sprintf("%v", t.OrganizationID))
 	builder.WriteByte(')')
 	return builder.String()
 }

+ 10 - 0
ent/token/token.go

@@ -26,6 +26,8 @@ const (
 	FieldToken = "token"
 	// FieldMAC holds the string denoting the mac field in the database.
 	FieldMAC = "mac"
+	// FieldOrganizationID holds the string denoting the organization_id field in the database.
+	FieldOrganizationID = "organization_id"
 	// Table holds the table name of the token in the database.
 	Table = "token"
 )
@@ -39,6 +41,7 @@ var Columns = []string{
 	FieldExpireAt,
 	FieldToken,
 	FieldMAC,
+	FieldOrganizationID,
 }
 
 // ValidColumn reports if the column name is valid (part of the table columns).
@@ -69,6 +72,8 @@ var (
 	DefaultToken string
 	// DefaultMAC holds the default value on creation for the "mac" field.
 	DefaultMAC string
+	// DefaultOrganizationID holds the default value on creation for the "organization_id" field.
+	DefaultOrganizationID uint64
 )
 
 // OrderOption defines the ordering options for the Token queries.
@@ -108,3 +113,8 @@ func ByToken(opts ...sql.OrderTermOption) OrderOption {
 func ByMAC(opts ...sql.OrderTermOption) OrderOption {
 	return sql.OrderByField(FieldMAC, opts...).ToFunc()
 }
+
+// ByOrganizationID orders the results by the organization_id field.
+func ByOrganizationID(opts ...sql.OrderTermOption) OrderOption {
+	return sql.OrderByField(FieldOrganizationID, opts...).ToFunc()
+}

+ 45 - 0
ent/token/where.go

@@ -84,6 +84,11 @@ func MAC(v string) predicate.Token {
 	return predicate.Token(sql.FieldEQ(FieldMAC, v))
 }
 
+// OrganizationID applies equality check predicate on the "organization_id" field. It's identical to OrganizationIDEQ.
+func OrganizationID(v uint64) predicate.Token {
+	return predicate.Token(sql.FieldEQ(FieldOrganizationID, v))
+}
+
 // CreatedAtEQ applies the EQ predicate on the "created_at" field.
 func CreatedAtEQ(v time.Time) predicate.Token {
 	return predicate.Token(sql.FieldEQ(FieldCreatedAt, v))
@@ -404,6 +409,46 @@ func MACContainsFold(v string) predicate.Token {
 	return predicate.Token(sql.FieldContainsFold(FieldMAC, v))
 }
 
+// OrganizationIDEQ applies the EQ predicate on the "organization_id" field.
+func OrganizationIDEQ(v uint64) predicate.Token {
+	return predicate.Token(sql.FieldEQ(FieldOrganizationID, v))
+}
+
+// OrganizationIDNEQ applies the NEQ predicate on the "organization_id" field.
+func OrganizationIDNEQ(v uint64) predicate.Token {
+	return predicate.Token(sql.FieldNEQ(FieldOrganizationID, v))
+}
+
+// OrganizationIDIn applies the In predicate on the "organization_id" field.
+func OrganizationIDIn(vs ...uint64) predicate.Token {
+	return predicate.Token(sql.FieldIn(FieldOrganizationID, vs...))
+}
+
+// OrganizationIDNotIn applies the NotIn predicate on the "organization_id" field.
+func OrganizationIDNotIn(vs ...uint64) predicate.Token {
+	return predicate.Token(sql.FieldNotIn(FieldOrganizationID, vs...))
+}
+
+// OrganizationIDGT applies the GT predicate on the "organization_id" field.
+func OrganizationIDGT(v uint64) predicate.Token {
+	return predicate.Token(sql.FieldGT(FieldOrganizationID, v))
+}
+
+// OrganizationIDGTE applies the GTE predicate on the "organization_id" field.
+func OrganizationIDGTE(v uint64) predicate.Token {
+	return predicate.Token(sql.FieldGTE(FieldOrganizationID, v))
+}
+
+// OrganizationIDLT applies the LT predicate on the "organization_id" field.
+func OrganizationIDLT(v uint64) predicate.Token {
+	return predicate.Token(sql.FieldLT(FieldOrganizationID, v))
+}
+
+// OrganizationIDLTE applies the LTE predicate on the "organization_id" field.
+func OrganizationIDLTE(v uint64) predicate.Token {
+	return predicate.Token(sql.FieldLTE(FieldOrganizationID, v))
+}
+
 // And groups predicates with the AND operator between them.
 func And(predicates ...predicate.Token) predicate.Token {
 	return predicate.Token(sql.AndPredicates(predicates...))

+ 85 - 0
ent/token_create.go

@@ -106,6 +106,20 @@ func (tc *TokenCreate) SetNillableMAC(s *string) *TokenCreate {
 	return tc
 }
 
+// SetOrganizationID sets the "organization_id" field.
+func (tc *TokenCreate) SetOrganizationID(u uint64) *TokenCreate {
+	tc.mutation.SetOrganizationID(u)
+	return tc
+}
+
+// SetNillableOrganizationID sets the "organization_id" field if the given value is not nil.
+func (tc *TokenCreate) SetNillableOrganizationID(u *uint64) *TokenCreate {
+	if u != nil {
+		tc.SetOrganizationID(*u)
+	}
+	return tc
+}
+
 // SetID sets the "id" field.
 func (tc *TokenCreate) SetID(u uint64) *TokenCreate {
 	tc.mutation.SetID(u)
@@ -171,6 +185,10 @@ func (tc *TokenCreate) defaults() error {
 		v := token.DefaultMAC
 		tc.mutation.SetMAC(v)
 	}
+	if _, ok := tc.mutation.OrganizationID(); !ok {
+		v := token.DefaultOrganizationID
+		tc.mutation.SetOrganizationID(v)
+	}
 	return nil
 }
 
@@ -185,6 +203,9 @@ func (tc *TokenCreate) check() error {
 	if _, ok := tc.mutation.MAC(); !ok {
 		return &ValidationError{Name: "mac", err: errors.New(`ent: missing required field "Token.mac"`)}
 	}
+	if _, ok := tc.mutation.OrganizationID(); !ok {
+		return &ValidationError{Name: "organization_id", err: errors.New(`ent: missing required field "Token.organization_id"`)}
+	}
 	return nil
 }
 
@@ -242,6 +263,10 @@ func (tc *TokenCreate) createSpec() (*Token, *sqlgraph.CreateSpec) {
 		_spec.SetField(token.FieldMAC, field.TypeString, value)
 		_node.MAC = value
 	}
+	if value, ok := tc.mutation.OrganizationID(); ok {
+		_spec.SetField(token.FieldOrganizationID, field.TypeUint64, value)
+		_node.OrganizationID = value
+	}
 	return _node, _spec
 }
 
@@ -372,6 +397,24 @@ func (u *TokenUpsert) UpdateMAC() *TokenUpsert {
 	return u
 }
 
+// SetOrganizationID sets the "organization_id" field.
+func (u *TokenUpsert) SetOrganizationID(v uint64) *TokenUpsert {
+	u.Set(token.FieldOrganizationID, v)
+	return u
+}
+
+// UpdateOrganizationID sets the "organization_id" field to the value that was provided on create.
+func (u *TokenUpsert) UpdateOrganizationID() *TokenUpsert {
+	u.SetExcluded(token.FieldOrganizationID)
+	return u
+}
+
+// AddOrganizationID adds v to the "organization_id" field.
+func (u *TokenUpsert) AddOrganizationID(v uint64) *TokenUpsert {
+	u.Add(token.FieldOrganizationID, v)
+	return u
+}
+
 // UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field.
 // Using this option is equivalent to using:
 //
@@ -514,6 +557,27 @@ func (u *TokenUpsertOne) UpdateMAC() *TokenUpsertOne {
 	})
 }
 
+// SetOrganizationID sets the "organization_id" field.
+func (u *TokenUpsertOne) SetOrganizationID(v uint64) *TokenUpsertOne {
+	return u.Update(func(s *TokenUpsert) {
+		s.SetOrganizationID(v)
+	})
+}
+
+// AddOrganizationID adds v to the "organization_id" field.
+func (u *TokenUpsertOne) AddOrganizationID(v uint64) *TokenUpsertOne {
+	return u.Update(func(s *TokenUpsert) {
+		s.AddOrganizationID(v)
+	})
+}
+
+// UpdateOrganizationID sets the "organization_id" field to the value that was provided on create.
+func (u *TokenUpsertOne) UpdateOrganizationID() *TokenUpsertOne {
+	return u.Update(func(s *TokenUpsert) {
+		s.UpdateOrganizationID()
+	})
+}
+
 // Exec executes the query.
 func (u *TokenUpsertOne) Exec(ctx context.Context) error {
 	if len(u.create.conflict) == 0 {
@@ -822,6 +886,27 @@ func (u *TokenUpsertBulk) UpdateMAC() *TokenUpsertBulk {
 	})
 }
 
+// SetOrganizationID sets the "organization_id" field.
+func (u *TokenUpsertBulk) SetOrganizationID(v uint64) *TokenUpsertBulk {
+	return u.Update(func(s *TokenUpsert) {
+		s.SetOrganizationID(v)
+	})
+}
+
+// AddOrganizationID adds v to the "organization_id" field.
+func (u *TokenUpsertBulk) AddOrganizationID(v uint64) *TokenUpsertBulk {
+	return u.Update(func(s *TokenUpsert) {
+		s.AddOrganizationID(v)
+	})
+}
+
+// UpdateOrganizationID sets the "organization_id" field to the value that was provided on create.
+func (u *TokenUpsertBulk) UpdateOrganizationID() *TokenUpsertBulk {
+	return u.Update(func(s *TokenUpsert) {
+		s.UpdateOrganizationID()
+	})
+}
+
 // Exec executes the query.
 func (u *TokenUpsertBulk) Exec(ctx context.Context) error {
 	if u.create.err != nil {

+ 54 - 0
ent/token_update.go

@@ -108,6 +108,27 @@ func (tu *TokenUpdate) SetNillableMAC(s *string) *TokenUpdate {
 	return tu
 }
 
+// SetOrganizationID sets the "organization_id" field.
+func (tu *TokenUpdate) SetOrganizationID(u uint64) *TokenUpdate {
+	tu.mutation.ResetOrganizationID()
+	tu.mutation.SetOrganizationID(u)
+	return tu
+}
+
+// SetNillableOrganizationID sets the "organization_id" field if the given value is not nil.
+func (tu *TokenUpdate) SetNillableOrganizationID(u *uint64) *TokenUpdate {
+	if u != nil {
+		tu.SetOrganizationID(*u)
+	}
+	return tu
+}
+
+// AddOrganizationID adds u to the "organization_id" field.
+func (tu *TokenUpdate) AddOrganizationID(u int64) *TokenUpdate {
+	tu.mutation.AddOrganizationID(u)
+	return tu
+}
+
 // Mutation returns the TokenMutation object of the builder.
 func (tu *TokenUpdate) Mutation() *TokenMutation {
 	return tu.mutation
@@ -188,6 +209,12 @@ func (tu *TokenUpdate) sqlSave(ctx context.Context) (n int, err error) {
 	if value, ok := tu.mutation.MAC(); ok {
 		_spec.SetField(token.FieldMAC, field.TypeString, value)
 	}
+	if value, ok := tu.mutation.OrganizationID(); ok {
+		_spec.SetField(token.FieldOrganizationID, field.TypeUint64, value)
+	}
+	if value, ok := tu.mutation.AddedOrganizationID(); ok {
+		_spec.AddField(token.FieldOrganizationID, field.TypeUint64, value)
+	}
 	if n, err = sqlgraph.UpdateNodes(ctx, tu.driver, _spec); err != nil {
 		if _, ok := err.(*sqlgraph.NotFoundError); ok {
 			err = &NotFoundError{token.Label}
@@ -288,6 +315,27 @@ func (tuo *TokenUpdateOne) SetNillableMAC(s *string) *TokenUpdateOne {
 	return tuo
 }
 
+// SetOrganizationID sets the "organization_id" field.
+func (tuo *TokenUpdateOne) SetOrganizationID(u uint64) *TokenUpdateOne {
+	tuo.mutation.ResetOrganizationID()
+	tuo.mutation.SetOrganizationID(u)
+	return tuo
+}
+
+// SetNillableOrganizationID sets the "organization_id" field if the given value is not nil.
+func (tuo *TokenUpdateOne) SetNillableOrganizationID(u *uint64) *TokenUpdateOne {
+	if u != nil {
+		tuo.SetOrganizationID(*u)
+	}
+	return tuo
+}
+
+// AddOrganizationID adds u to the "organization_id" field.
+func (tuo *TokenUpdateOne) AddOrganizationID(u int64) *TokenUpdateOne {
+	tuo.mutation.AddOrganizationID(u)
+	return tuo
+}
+
 // Mutation returns the TokenMutation object of the builder.
 func (tuo *TokenUpdateOne) Mutation() *TokenMutation {
 	return tuo.mutation
@@ -398,6 +446,12 @@ func (tuo *TokenUpdateOne) sqlSave(ctx context.Context) (_node *Token, err error
 	if value, ok := tuo.mutation.MAC(); ok {
 		_spec.SetField(token.FieldMAC, field.TypeString, value)
 	}
+	if value, ok := tuo.mutation.OrganizationID(); ok {
+		_spec.SetField(token.FieldOrganizationID, field.TypeUint64, value)
+	}
+	if value, ok := tuo.mutation.AddedOrganizationID(); ok {
+		_spec.AddField(token.FieldOrganizationID, field.TypeUint64, value)
+	}
 	_node = &Token{config: tuo.config}
 	_spec.Assign = _node.assignValues
 	_spec.ScanValues = _node.scanValues

+ 20 - 0
hook/authcheck.go

@@ -0,0 +1,20 @@
+package hook
+
+import (
+	"context"
+	"errors"
+	"wechat-api/ent"
+)
+
+// CheckDesktopAuth 检查token是否合法同时返回token实例
+func CheckDesktopAuth(tokenStr string, client *ent.Client) (*ent.Token, error) {
+	if tokenStr == "" {
+		return nil, errors.New("check auth failed")
+	}
+	
+	token, err := client.Token.Query().Where().Only(context.Background())
+	if err != nil {
+		return nil, err
+	}
+	return token, nil
+}

+ 67 - 41
internal/handler/routes.go

@@ -420,6 +420,16 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 	)
 
 	server.AddRoutes(
+		[]rest.Route{
+			{
+				Method:  http.MethodPost,
+				Path:    "/api/sop_task/list",
+				Handler: sop_task.GetApiSopTaskListHandler(serverCtx),
+			},
+		},
+	)
+
+	server.AddRoutes(
 		rest.WithMiddlewares(
 			[]rest.Middleware{serverCtx.Authority},
 			[]rest.Route{
@@ -499,47 +509,63 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
 	)
 
 	server.AddRoutes(
-		rest.WithMiddlewares(
-			[]rest.Middleware{serverCtx.Authority},
-			[]rest.Route{
-				{
-					Method:  http.MethodPost,
-					Path:    "/sop_stage/create",
-					Handler: sop_stage.CreateSopStageHandler(serverCtx),
-				},
-				{
-					Method:  http.MethodPost,
-					Path:    "/sop_stage/update",
-					Handler: sop_stage.UpdateSopStageHandler(serverCtx),
-				},
-				{
-					Method:  http.MethodPost,
-					Path:    "/sop_stage/delete",
-					Handler: sop_stage.DeleteSopStageHandler(serverCtx),
-				},
-				{
-					Method:  http.MethodPost,
-					Path:    "/sop_stage/list",
-					Handler: sop_stage.GetSopStageListHandler(serverCtx),
-				},
-				{
-					Method:  http.MethodPost,
-					Path:    "/sop_stage",
-					Handler: sop_stage.GetSopStageByIdHandler(serverCtx),
-				},
-				{
-					Method:  http.MethodPost,
-					Path:    "/sop_stage/detail",
-					Handler: sop_stage.GetSopStageDetailHandler(serverCtx),
-				},
-				{
-					Method:  http.MethodPost,
-					Path:    "/sop_stage/move",
-					Handler: sop_stage.MoveSopStageHandler(serverCtx),
-				},
-			}...,
-		),
-		rest.WithJwt(serverCtx.Config.Auth.AccessSecret),
+		[]rest.Route{
+			{
+				Method:  http.MethodPost,
+				Path:    "/api/sop_stage/list",
+				Handler: sop_stage.GetApiSopStageListHandler(serverCtx),
+			},
+		},
+	)
+
+	server.AddRoutes(
+		[]rest.Route{
+			{
+				Method:  http.MethodPost,
+				Path:    "/sop_stage/create",
+				Handler: sop_stage.CreateSopStageHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/sop_stage/update",
+				Handler: sop_stage.UpdateSopStageHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/sop_stage/delete",
+				Handler: sop_stage.DeleteSopStageHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/sop_stage/list",
+				Handler: sop_stage.GetSopStageListHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/sop_stage",
+				Handler: sop_stage.GetSopStageByIdHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/sop_stage/detail",
+				Handler: sop_stage.GetSopStageDetailHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/sop_stage/move",
+				Handler: sop_stage.MoveSopStageHandler(serverCtx),
+			},
+		},
+	)
+
+	server.AddRoutes(
+		[]rest.Route{
+			{
+				Method:  http.MethodPost,
+				Path:    "/api/sop_node/list",
+				Handler: sop_node.GetApiSopNodeListHandler(serverCtx),
+			},
+		},
 	)
 
 	server.AddRoutes(

+ 44 - 0
internal/handler/sop_node/get_api_sop_node_list_handler.go

@@ -0,0 +1,44 @@
+package sop_node
+
+import (
+	"net/http"
+
+	"github.com/zeromicro/go-zero/rest/httpx"
+
+	"wechat-api/internal/logic/sop_node"
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+)
+
+// swagger:route post /api/sop_node/list sop_node GetApiSopNodeList
+//
+// Get api sop node list | 获取SopNode列表
+//
+// Get api sop node list | 获取SopNode列表
+//
+// Parameters:
+//  + name: body
+//    require: true
+//    in: body
+//    type: BatchSopNodeListReq
+//
+// Responses:
+//  200: SopNodeListResp
+
+func GetApiSopNodeListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.BatchSopNodeListReq
+		if err := httpx.Parse(r, &req, true); err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+			return
+		}
+
+		l := sop_node.NewGetApiSopNodeListLogic(r.Context(), svcCtx)
+		resp, err := l.GetApiSopNodeList(&req, r)
+		if err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+		} else {
+			httpx.OkJsonCtx(r.Context(), w, resp)
+		}
+	}
+}

+ 44 - 0
internal/handler/sop_stage/get_api_sop_stage_list_handler.go

@@ -0,0 +1,44 @@
+package sop_stage
+
+import (
+	"net/http"
+
+	"github.com/zeromicro/go-zero/rest/httpx"
+
+	"wechat-api/internal/logic/sop_stage"
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+)
+
+// swagger:route post /api/sop_stage/list sop_stage GetApiSopStageList
+//
+// Get sop stage list | 获取SopStage列表
+//
+// Get sop stage list | 获取SopStage列表
+//
+// Parameters:
+//  + name: body
+//    require: true
+//    in: body
+//    type: BatchSopStageListReq
+//
+// Responses:
+//  200: SopStageListResp
+
+func GetApiSopStageListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.BatchSopStageListReq
+		if err := httpx.Parse(r, &req, true); err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+			return
+		}
+
+		l := sop_stage.NewGetApiSopStageListLogic(r.Context(), svcCtx)
+		resp, err := l.GetApiSopStageList(&req, r)
+		if err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+		} else {
+			httpx.OkJsonCtx(r.Context(), w, resp)
+		}
+	}
+}

+ 31 - 0
internal/handler/sop_task/get_api_sop_task_list_handler.go

@@ -0,0 +1,31 @@
+package sop_task
+
+import (
+	"net/http"
+
+	"github.com/zeromicro/go-zero/rest/httpx"
+
+	"wechat-api/internal/logic/sop_task"
+	"wechat-api/internal/svc"
+)
+
+// swagger:route post /api/sop_task/list sop_task GetApiSopTaskList
+//
+// Get sop task list | 获取SopTask列表
+//
+// Get sop task list | 获取SopTask列表
+//
+// Responses:
+//  200: SopTaskListResp
+
+func GetApiSopTaskListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		l := sop_task.NewGetApiSopTaskListLogic(r.Context(), svcCtx)
+		resp, err := l.GetApiSopTaskList(r)
+		if err != nil {
+			httpx.ErrorCtx(r.Context(), w, err)
+		} else {
+			httpx.OkJsonCtx(r.Context(), w, resp)
+		}
+	}
+}

+ 60 - 0
internal/logic/sop_node/get_api_sop_node_list_logic.go

@@ -0,0 +1,60 @@
+package sop_node
+
+import (
+	"context"
+	"fmt"
+	"github.com/suyuan32/simple-admin-common/msg/errormsg"
+	"github.com/zeromicro/go-zero/core/errorx"
+	"net/http"
+	"wechat-api/ent/predicate"
+	"wechat-api/ent/sopnode"
+	"wechat-api/hook"
+	"wechat-api/internal/utils/dberrorhandler"
+
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type GetApiSopNodeListLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewGetApiSopNodeListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetApiSopNodeListLogic {
+	return &GetApiSopNodeListLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx}
+}
+
+func (l *GetApiSopNodeListLogic) GetApiSopNodeList(req *types.BatchSopNodeListReq, r *http.Request) (*types.SopNodeListResp, error) {
+	tokenStr := r.Header.Get("Authorization")
+	_, err := hook.CheckDesktopAuth(tokenStr, l.svcCtx.DB)
+	if err != nil {
+		return nil, errorx.NewCodeInvalidArgumentError("check auth failed")
+	}
+
+	var predicates []predicate.SopNode
+	if req.StageIds != nil && len(req.StageIds) > 0 {
+		predicates = append(predicates, sopnode.StageIDIn(req.StageIds...))
+	} else {
+		return nil, dberrorhandler.DefaultEntError(l.Logger, fmt.Errorf("StageIds 不能为空"), req)
+	}
+	data, err := l.svcCtx.DB.SopNode.Query().Where(predicates...).All(l.ctx)
+
+	if err != nil {
+		return nil, dberrorhandler.DefaultEntError(l.Logger, err, req)
+	}
+
+	resp := &types.SopNodeListResp{}
+	resp.Msg = errormsg.Success
+
+	childNodeList, _ := GetSopNodeListByParentId(0, data)
+
+	resp.Data = childNodeList
+
+	return resp, nil
+}

+ 111 - 0
internal/logic/sop_stage/get_api_sop_stage_list_logic.go

@@ -0,0 +1,111 @@
+package sop_stage
+
+import (
+	"context"
+	"github.com/suyuan32/simple-admin-common/msg/errormsg"
+	"github.com/suyuan32/simple-admin-common/utils/pointy"
+	"github.com/zeromicro/go-zero/core/errorx"
+	"net/http"
+	"wechat-api/ent/sopstage"
+	"wechat-api/hook"
+	"wechat-api/internal/utils/dberrorhandler"
+
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type GetApiSopStageListLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewGetApiSopStageListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetApiSopStageListLogic {
+	return &GetApiSopStageListLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx}
+}
+
+func (l *GetApiSopStageListLogic) GetApiSopStageList(req *types.BatchSopStageListReq, r *http.Request) (*types.SopStageListResp, error) {
+	tokenStr := r.Header.Get("Authorization")
+	_, err := hook.CheckDesktopAuth(tokenStr, l.svcCtx.DB)
+	if err != nil {
+		return nil, errorx.NewCodeInvalidArgumentError("check auth failed")
+	}
+
+	data, err := l.svcCtx.DB.SopStage.Query().Where(sopstage.TaskIDIn(req.TaskIds...)).All(l.ctx)
+
+	if err != nil {
+		return nil, dberrorhandler.DefaultEntError(l.Logger, err, req)
+	}
+
+	resp := &types.SopStageListResp{}
+	resp.Msg = errormsg.Success
+
+	for _, v := range data {
+		var conditionList []types.Condition
+		if len(v.ConditionList) > 0 {
+			conditionList = make([]types.Condition, len(v.ConditionList))
+			for i, condition := range v.ConditionList {
+				conditionList[i] = types.Condition{
+					Equal:       condition.Equal,
+					LabelIdList: condition.LabelIdList,
+				}
+			}
+		}
+
+		var actionMessage []types.Action
+		if len(v.ActionMessage) > 0 {
+			actionMessage = make([]types.Action, len(v.ActionMessage))
+			for i, condition := range v.ActionMessage {
+				actionMessage[i] = types.Action{
+					Type:    condition.Type,
+					Content: condition.Content,
+				}
+			}
+		}
+
+		var actionForward *types.ActionForward
+		if v.ActionForward != nil {
+			actionForward = &types.ActionForward{}
+			actionForward.Wxid = v.ActionForward.Wxid
+			if len(v.ActionForward.Action) > 0 {
+				forwardAction := make([]types.Action, len(v.ActionForward.Action))
+				for i, condition := range v.ActionForward.Action {
+					forwardAction[i] = types.Action{
+						Type:    condition.Type,
+						Content: condition.Content,
+					}
+				}
+				actionForward.Action = forwardAction
+			}
+		} else {
+			actionForward = nil
+		}
+
+		resp.Data.Data = append(resp.Data.Data,
+			types.SopStageInfo{
+				BaseIDInfo: types.BaseIDInfo{
+					Id:        &v.ID,
+					CreatedAt: pointy.GetPointer(v.CreatedAt.UnixMilli()),
+					UpdatedAt: pointy.GetPointer(v.UpdatedAt.UnixMilli()),
+				},
+				Status:            &v.Status,
+				TaskId:            &v.TaskID,
+				Name:              &v.Name,
+				ConditionType:     &v.ConditionType,
+				ConditionOperator: &v.ConditionOperator,
+				ConditionList:     conditionList,
+				ActionMessage:     actionMessage,
+				ActionLabelAdd:    v.ActionLabelAdd,
+				ActionLabelDel:    v.ActionLabelDel,
+				ActionForward:     actionForward,
+				IndexSort:         &v.IndexSort,
+			})
+	}
+
+	return resp, nil
+}

+ 78 - 0
internal/logic/sop_task/get_api_sop_task_list_logic.go

@@ -0,0 +1,78 @@
+package sop_task
+
+import (
+	"context"
+	"github.com/suyuan32/simple-admin-common/msg/errormsg"
+	"github.com/suyuan32/simple-admin-common/utils/pointy"
+	"github.com/zeromicro/go-zero/core/errorx"
+	"net/http"
+	"wechat-api/ent/predicate"
+	"wechat-api/ent/soptask"
+	"wechat-api/ent/wx"
+	"wechat-api/hook"
+	"wechat-api/internal/utils/dberrorhandler"
+
+	"wechat-api/internal/svc"
+	"wechat-api/internal/types"
+
+	"github.com/zeromicro/go-zero/core/logx"
+)
+
+type GetApiSopTaskListLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewGetApiSopTaskListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetApiSopTaskListLogic {
+	return &GetApiSopTaskListLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+	}
+}
+
+func (l *GetApiSopTaskListLogic) GetApiSopTaskList(r *http.Request) (*types.SopTaskListResp, error) {
+	tokenStr := r.Header.Get("Authorization")
+	token, err := hook.CheckDesktopAuth(tokenStr, l.svcCtx.DB)
+	if err != nil {
+		return nil, errorx.NewCodeInvalidArgumentError("check auth failed")
+	}
+
+	var predicates []predicate.SopTask
+	predicates = append(predicates, soptask.OrganizationIDEQ(token.OrganizationID))
+	predicates = append(predicates, soptask.StatusEQ(uint8(3)))
+	data, err := l.svcCtx.DB.SopTask.Query().Where(predicates...).Page(l.ctx, 1, 1000)
+
+	if err != nil {
+		return nil, dberrorhandler.DefaultEntError(l.Logger, err, nil)
+	}
+
+	resp := &types.SopTaskListResp{}
+	resp.Msg = errormsg.Success
+	resp.Data.Total = data.PageDetails.Total
+
+	for _, v := range data.List {
+		wxInfos, _ := l.svcCtx.DB.Wx.Query().Where(wx.WxidIn(v.BotWxidList...)).All(l.ctx)
+		var botWxidList []string
+		for _, b := range wxInfos {
+			botWxidList = append(botWxidList, b.Nickname)
+		}
+		resp.Data.Data = append(resp.Data.Data, types.SopTaskInfo{
+			BaseIDInfo: types.BaseIDInfo{
+				Id:        &v.ID,
+				CreatedAt: pointy.GetPointer(v.CreatedAt.UnixMilli()),
+				UpdatedAt: pointy.GetPointer(v.UpdatedAt.UnixMilli()),
+			},
+			Status:        &v.Status,
+			Name:          &v.Name,
+			BotWxidList:   botWxidList,
+			Type:          &v.Type,
+			PlanStartTime: pointy.GetUnixMilliPointer(v.PlanStartTime.UnixMilli()),
+			PlanEndTime:   pointy.GetUnixMilliPointer(v.PlanEndTime.UnixMilli()),
+			CreatorId:     &v.CreatorID,
+		})
+	}
+
+	return resp, nil
+}

+ 1 - 0
internal/logic/token/create_token_logic.go

@@ -51,6 +51,7 @@ func (l *CreateTokenLogic) CreateToken(req *types.TokenInfo) (*types.BaseMsgResp
 		SetNotNilExpireAt(&expireAt).
 		SetNotNilToken(req.Token).
 		SetNotNilMAC(req.Mac).
+		SetNotNilOrganizationID(req.OrganizationId).
 		Save(l.ctx)
 
 	if err != nil {

+ 5 - 4
internal/logic/token/get_token_by_id_logic.go

@@ -45,10 +45,11 @@ func (l *GetTokenByIdLogic) GetTokenById(req *types.IDReq) (*types.TokenInfoResp
 				CreatedAt: pointy.GetPointer(data.CreatedAt.UnixMilli()),
 				UpdatedAt: pointy.GetPointer(data.UpdatedAt.UnixMilli()),
 			},
-			ExpireAt:    pointy.GetUnixMilliPointer(data.ExpireAt.UnixMilli()),
-			ExpireAtStr: &expireAtStr,
-			Token:       &data.Token,
-			Mac:         &data.MAC,
+			ExpireAt:       pointy.GetUnixMilliPointer(data.ExpireAt.UnixMilli()),
+			ExpireAtStr:    &expireAtStr,
+			Token:          &data.Token,
+			Mac:            &data.MAC,
+			OrganizationId: &data.OrganizationID,
 		},
 	}, nil
 }

+ 5 - 4
internal/logic/token/get_token_list_logic.go

@@ -56,10 +56,11 @@ func (l *GetTokenListLogic) GetTokenList(req *types.TokenListReq) (*types.TokenL
 					CreatedAt: pointy.GetPointer(v.CreatedAt.UnixMilli()),
 					UpdatedAt: pointy.GetPointer(v.UpdatedAt.UnixMilli()),
 				},
-				ExpireAt:    pointy.GetUnixMilliPointer(v.ExpireAt.UnixMilli()),
-				ExpireAtStr: &expireAtStr,
-				Token:       &v.Token,
-				Mac:         &v.MAC,
+				ExpireAt:       pointy.GetUnixMilliPointer(v.ExpireAt.UnixMilli()),
+				ExpireAtStr:    &expireAtStr,
+				Token:          &v.Token,
+				Mac:            &v.MAC,
+				OrganizationId: &v.OrganizationID,
 			})
 	}
 

+ 1 - 0
internal/logic/token/update_token_logic.go

@@ -51,6 +51,7 @@ func (l *UpdateTokenLogic) UpdateToken(req *types.TokenInfo) (*types.BaseMsgResp
 		SetNotNilExpireAt(&expireAt).
 		SetNotNilToken(req.Token).
 		SetNotNilMAC(req.Mac).
+		SetNotNilOrganizationID(req.OrganizationId).
 		Exec(l.ctx)
 
 	if err != nil {

+ 14 - 0
internal/types/types.go

@@ -1318,6 +1318,12 @@ type SopStageListReq struct {
 	TaskId *uint64 `json:"taskId"`
 }
 
+// Batch get sop stage list request params | SopStage列表请求参数
+// swagger:model BatchSopStageListReq
+type BatchSopStageListReq struct {
+	TaskIds []uint64 `json:"taskIds"`
+}
+
 // SopStage information response | SopStage信息返回体
 // swagger:model SopStageInfoResp
 type SopStageInfoResp struct {
@@ -1374,6 +1380,12 @@ type SopNodeListReq struct {
 	StageId *uint64 `json:"stageId"`
 }
 
+// Get sop node list request params | SopNode列表请求参数
+// swagger:model BatchSopNodeListReq
+type BatchSopNodeListReq struct {
+	StageIds []uint64 `json:"stageIds"`
+}
+
 // SopNode information response | SopNode信息返回体
 // swagger:model SopNodeInfoResp
 type SopNodeInfoResp struct {
@@ -2002,6 +2014,8 @@ type TokenInfo struct {
 	Token *string `json:"token,optional"`
 	// Mac地址
 	Mac *string `json:"mac,optional"`
+	// 租户ID
+	OrganizationId *uint64 `json:"organization_id,optional"`
 }
 
 // The response data of token list | Token列表数据