修改状态机的写法

This commit is contained in:
eson
2023-08-09 16:54:52 +08:00
parent ca80a94f72
commit 1913beb3f7
24 changed files with 55 additions and 60 deletions

View File

@@ -1,9 +1,9 @@
package svc
import (
"fusenapi/fsm"
"fusenapi/initalize"
"fusenapi/model/gmodel"
"fusenapi/shared"
"fusenapi/utils/autoconfig"
"github.com/golang-jwt/jwt"
@@ -17,7 +17,7 @@ import (
type ServiceContext struct {
Config config.Config
SharedState *fsm.SharedState
SharedState *shared.SharedState
MysqlConn *gorm.DB
AllModels *gmodel.AllModelsGen
@@ -25,7 +25,7 @@ type ServiceContext struct {
func NewServiceContext(c config.Config) *ServiceContext {
conn := initalize.InitMysql(c.SourceMysql)
StateServer := fsm.StartNode(c.ReplicaId, autoconfig.AutoGetAllServerConfig(), conn)
StateServer := shared.StartNode(c.ReplicaId, autoconfig.AutoGetAllServerConfig(), conn)
return &ServiceContext{
Config: c,