感动中国

This commit is contained in:
eson
2023-08-10 12:04:36 +08:00
parent 68488da99c
commit 440f13bee8
102 changed files with 146 additions and 125 deletions

View File

@@ -1,6 +1,7 @@
Name: render
Host: 0.0.0.0
Port: 9919
ReplicaId: 55
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
Auth:
AccessSecret: fusen2023

View File

@@ -15,7 +15,7 @@ func GetFaceSliceHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
userinfo, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
if err != nil {
return
}

View File

@@ -15,7 +15,7 @@ func RenderNotifyHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.RenderNotifyReq
userinfo, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
if err != nil {
return
}

View File

@@ -5,7 +5,6 @@ import (
"fmt"
"fusenapi/server/render/internal/config"
"fusenapi/shared"
"fusenapi/utils/autoconfig"
"net/http"
"github.com/aws/aws-sdk-go/aws"
@@ -31,14 +30,14 @@ type ServiceContext struct {
func NewServiceContext(c config.Config) *ServiceContext {
conn := initalize.InitMysql(c.SourceMysql)
StateServer := shared.StartNode(c.ReplicaId, autoconfig.AutoGetAllServerConfig(), conn)
// StateServer := shared.StartNode(c.ReplicaId, autoconfig.AutoGetAllServerConfig(), conn)
config := aws.Config{
Credentials: credentials.NewStaticCredentials(c.AWS.S3.Credentials.AccessKeyID, c.AWS.S3.Credentials.Secret, c.AWS.S3.Credentials.Token),
}
return &ServiceContext{
Config: c,
MysqlConn: conn,
SharedState: StateServer,
SharedState: nil,
AllModels: gmodel.NewAllModels(initalize.InitMysql(c.SourceMysql)),
RabbitMq: initalize.InitRabbitMq(c.SourceRabbitMq, nil),
AwsSession: session.Must(session.NewSession(&config)),