Merge branch 'develop' of https://gitee.com/fusenpack/fusenapi into feature/auth

This commit is contained in:
2023-07-30 15:54:34 +08:00
12 changed files with 170 additions and 14 deletions

View File

@@ -6,6 +6,7 @@ type Config struct {
rest.RestConf
SourceMysql string
Auth types.Auth
SourceRabbitMq string
{{.auth}}
{{.jwtTrans}}
}

View File

@@ -21,6 +21,7 @@ type ServiceContext struct {
SharedState *fsm.StateCluster
MysqlConn *gorm.DB
AllModels *gmodel.AllModelsGen
RabbitMq *initalize.RabbitMqHandle
}
func NewServiceContext(c {{.config}}) *ServiceContext {
@@ -32,6 +33,7 @@ func NewServiceContext(c {{.config}}) *ServiceContext {
MysqlConn: conn,
SharedState: StateServer,
AllModels: gmodel.NewAllModels(initalize.InitMysql(c.SourceMysql)),
RabbitMq:initalize.InitRabbitMq(c.SourceRabbitMq, nil),
{{.middlewareAssignment}}
}
}

View File

@@ -2,7 +2,8 @@ Name: {{.serviceName}}
Host: {{.host}}
Port: {{.port}}
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
SourceRabbitMq: amqp://rabbit001:rabbit001129@110.41.19.98:5672
Auth:
AccessSecret: fusen2023
AccessExpire: 2592000
RefreshAfter: 1592000
RefreshAfter: 1592000