From edf89ea3019a562a6f81b29ca8d0c044d921212c Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Tue, 15 Aug 2023 12:34:41 +0800 Subject: [PATCH 1/5] fix --- server/assistant/assistant.go | 1 - server/assistant/etc/assistant.yaml | 1 + server/backend/backend.go | 1 - server/backend/etc/backend.yaml | 1 + server/base/base.go | 2 +- server/canteen/canteen.go | 2 -- server/canteen/etc/canteen.yaml | 1 + server/data-transfer/data-transfer.go | 1 - server/data-transfer/etc/data-transfer.yaml | 1 + server/home-user-auth/etc/home-user-auth.yaml | 1 + server/home-user-auth/home-user-auth.go | 1 - server/inventory/etc/inventory.yaml | 2 +- server/inventory/inventory.go | 1 - server/map-library/etc/map-library.yaml | 1 + server/map-library/map-library.go | 1 - server/orders/etc/orders.yaml | 1 + server/orders/orders.go | 1 - server/pay/etc/pay.yaml | 1 + server/pay/pay.go | 1 - server/product-model/product-model.go | 1 - server/product-template-tag/etc/product-template-tag.yaml | 1 + server/product-template-tag/product-template-tag.go | 1 - server/product-template/etc/product-template.yaml | 1 + server/product-template/product-template.go | 1 - server/product/etc/product.yaml | 1 + server/render/etc/render.yaml | 1 + server/render/render.go | 1 - server/resource/resource.go | 1 - .../etc/shopping-cart-confirmation.yaml | 1 + server/shopping-cart-confirmation/shopping-cart-confirmation.go | 1 - server/upload/etc/upload.yaml | 1 + server/upload/upload.go | 1 - server/webset/etc/webset.yaml | 1 + server/webset/webset.go | 1 - 34 files changed, 17 insertions(+), 20 deletions(-) diff --git a/server/assistant/assistant.go b/server/assistant/assistant.go index 8ae0cf8e..5ffd00da 100644 --- a/server/assistant/assistant.go +++ b/server/assistant/assistant.go @@ -23,7 +23,6 @@ func main() { var c config.Config conf.MustLoad(*configFile, &c) - c.Timeout = int64(time.Second * 15) server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) { })) defer server.Stop() diff --git a/server/assistant/etc/assistant.yaml b/server/assistant/etc/assistant.yaml index 3804fea1..f65d63af 100644 --- a/server/assistant/etc/assistant.yaml +++ b/server/assistant/etc/assistant.yaml @@ -1,6 +1,7 @@ Name: assistant Host: 0.0.0.0 Port: 9950 +Timeout: 15000 #服务超时时间 SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest Auth: AccessSecret: fusen2023 diff --git a/server/backend/backend.go b/server/backend/backend.go index 83ae4af9..f3f1672f 100644 --- a/server/backend/backend.go +++ b/server/backend/backend.go @@ -22,7 +22,6 @@ func main() { var c config.Config conf.MustLoad(*configFile, &c) - c.Timeout = int64(time.Second * 15) server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) { diff --git a/server/backend/etc/backend.yaml b/server/backend/etc/backend.yaml index 18f08394..f0cdc6c8 100644 --- a/server/backend/etc/backend.yaml +++ b/server/backend/etc/backend.yaml @@ -1,6 +1,7 @@ Name: backend Host: 0.0.0.0 Port: 9901 +Timeout: 15000 #服务超时时间 SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest Auth: AccessSecret: fusen_backend_2023 diff --git a/server/base/base.go b/server/base/base.go index df2962f3..c5880c16 100644 --- a/server/base/base.go +++ b/server/base/base.go @@ -23,7 +23,7 @@ func main() { var c config.Config conf.MustLoad(*configFile, &c) - c.Timeout = int64(time.Second * 15) + server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) { })) defer server.Stop() diff --git a/server/canteen/canteen.go b/server/canteen/canteen.go index 993573fb..774de30e 100644 --- a/server/canteen/canteen.go +++ b/server/canteen/canteen.go @@ -23,8 +23,6 @@ func main() { var c config.Config conf.MustLoad(*configFile, &c) - c.Timeout = int64(time.Second * 15) - c.Timeout = int64(time.Second * 15) server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) { diff --git a/server/canteen/etc/canteen.yaml b/server/canteen/etc/canteen.yaml index 4b363db8..16b26a52 100644 --- a/server/canteen/etc/canteen.yaml +++ b/server/canteen/etc/canteen.yaml @@ -1,6 +1,7 @@ Name: canteen Host: 0.0.0.0 Port: 9902 +Timeout: 15000 #服务超时时间 SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest Auth: AccessSecret: fusen2023 diff --git a/server/data-transfer/data-transfer.go b/server/data-transfer/data-transfer.go index af86ccc2..95147a0d 100644 --- a/server/data-transfer/data-transfer.go +++ b/server/data-transfer/data-transfer.go @@ -21,7 +21,6 @@ func main() { var c config2.Config conf.MustLoad(*configFile, &c) - c.Timeout = int64(time.Second * 15) server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) { diff --git a/server/data-transfer/etc/data-transfer.yaml b/server/data-transfer/etc/data-transfer.yaml index 4a3e767d..758542f8 100644 --- a/server/data-transfer/etc/data-transfer.yaml +++ b/server/data-transfer/etc/data-transfer.yaml @@ -1,6 +1,7 @@ Name: data-transfer Host: 0.0.0.0 Port: 9903 +Timeout: 15000 #服务超时时间 SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest Auth: AccessSecret: fusen2023 diff --git a/server/home-user-auth/etc/home-user-auth.yaml b/server/home-user-auth/etc/home-user-auth.yaml index 31722119..e9a7b8c8 100644 --- a/server/home-user-auth/etc/home-user-auth.yaml +++ b/server/home-user-auth/etc/home-user-auth.yaml @@ -1,6 +1,7 @@ Name: home-user-auth Host: 0.0.0.0 Port: 9904 +Timeout: 15000 #服务超时时间 MainAddress: "http://localhost:9900" SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest diff --git a/server/home-user-auth/home-user-auth.go b/server/home-user-auth/home-user-auth.go index 28598d4f..3ff860d2 100644 --- a/server/home-user-auth/home-user-auth.go +++ b/server/home-user-auth/home-user-auth.go @@ -23,7 +23,6 @@ func main() { var c config.Config conf.MustLoad(*configFile, &c) - c.Timeout = int64(time.Second * 15) server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) { diff --git a/server/inventory/etc/inventory.yaml b/server/inventory/etc/inventory.yaml index 3633f1b0..afd8bfa7 100644 --- a/server/inventory/etc/inventory.yaml +++ b/server/inventory/etc/inventory.yaml @@ -1,7 +1,7 @@ Name: inventory Host: 0.0.0.0 Port: 9905 - +Timeout: 15000 #服务超时时间 SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest Auth: AccessSecret: fusen2023 diff --git a/server/inventory/inventory.go b/server/inventory/inventory.go index f623a627..00645519 100644 --- a/server/inventory/inventory.go +++ b/server/inventory/inventory.go @@ -22,7 +22,6 @@ func main() { var c config.Config conf.MustLoad(*configFile, &c) - c.Timeout = int64(time.Second * 15) server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) { diff --git a/server/map-library/etc/map-library.yaml b/server/map-library/etc/map-library.yaml index 0dc22627..2ab101a4 100644 --- a/server/map-library/etc/map-library.yaml +++ b/server/map-library/etc/map-library.yaml @@ -1,6 +1,7 @@ Name: map-library Host: 0.0.0.0 Port: 9906 +Timeout: 15000 #服务超时时间 SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest Auth: AccessSecret: fusen2023 diff --git a/server/map-library/map-library.go b/server/map-library/map-library.go index 54ee66f6..254f2781 100644 --- a/server/map-library/map-library.go +++ b/server/map-library/map-library.go @@ -22,7 +22,6 @@ func main() { var c config.Config conf.MustLoad(*configFile, &c) - c.Timeout = int64(time.Second * 15) server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) { diff --git a/server/orders/etc/orders.yaml b/server/orders/etc/orders.yaml index 77573dcf..b8bc7a88 100644 --- a/server/orders/etc/orders.yaml +++ b/server/orders/etc/orders.yaml @@ -1,6 +1,7 @@ Name: orders Host: 0.0.0.0 Port: 9907 +Timeout: 15000 #服务超时时间 SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest Auth: AccessSecret: fusen2023 diff --git a/server/orders/orders.go b/server/orders/orders.go index a4707bea..3eda600a 100644 --- a/server/orders/orders.go +++ b/server/orders/orders.go @@ -22,7 +22,6 @@ func main() { var c config.Config conf.MustLoad(*configFile, &c) - c.Timeout = int64(time.Second * 15) server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) { diff --git a/server/pay/etc/pay.yaml b/server/pay/etc/pay.yaml index 831292a9..1d2b1f75 100644 --- a/server/pay/etc/pay.yaml +++ b/server/pay/etc/pay.yaml @@ -1,6 +1,7 @@ Name: pay Host: 0.0.0.0 Port: 9915 +Timeout: 15000 #服务超时时间 SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest Auth: AccessSecret: fusen2023 diff --git a/server/pay/pay.go b/server/pay/pay.go index 08c53e12..610b9d63 100644 --- a/server/pay/pay.go +++ b/server/pay/pay.go @@ -23,7 +23,6 @@ func main() { var c config.Config conf.MustLoad(*configFile, &c) - c.Timeout = int64(time.Second * 15) server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) { })) defer server.Stop() diff --git a/server/product-model/product-model.go b/server/product-model/product-model.go index e0cabc28..adb3846e 100644 --- a/server/product-model/product-model.go +++ b/server/product-model/product-model.go @@ -22,7 +22,6 @@ func main() { var c config.Config conf.MustLoad(*configFile, &c) - c.Timeout = int64(time.Second * 15) server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) { diff --git a/server/product-template-tag/etc/product-template-tag.yaml b/server/product-template-tag/etc/product-template-tag.yaml index 75f4d2d3..af29ff0a 100644 --- a/server/product-template-tag/etc/product-template-tag.yaml +++ b/server/product-template-tag/etc/product-template-tag.yaml @@ -1,6 +1,7 @@ Name: product-template-tag Host: 0.0.0.0 Port: 9917 +Timeout: 15000 #服务超时时间 SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest Auth: AccessSecret: fusen2023 diff --git a/server/product-template-tag/product-template-tag.go b/server/product-template-tag/product-template-tag.go index 18898784..ea3066d4 100644 --- a/server/product-template-tag/product-template-tag.go +++ b/server/product-template-tag/product-template-tag.go @@ -23,7 +23,6 @@ func main() { var c config.Config conf.MustLoad(*configFile, &c) - c.Timeout = int64(time.Second * 15) server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) { })) defer server.Stop() diff --git a/server/product-template/etc/product-template.yaml b/server/product-template/etc/product-template.yaml index 287b4a33..e8700c9c 100644 --- a/server/product-template/etc/product-template.yaml +++ b/server/product-template/etc/product-template.yaml @@ -1,6 +1,7 @@ Name: product-template Host: 0.0.0.0 Port: 9910 +Timeout: 15000 #服务超时时间 SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest Auth: AccessSecret: fusen2023 diff --git a/server/product-template/product-template.go b/server/product-template/product-template.go index 522be699..d189133d 100644 --- a/server/product-template/product-template.go +++ b/server/product-template/product-template.go @@ -22,7 +22,6 @@ func main() { var c config.Config conf.MustLoad(*configFile, &c) - c.Timeout = int64(time.Second * 15) server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) { diff --git a/server/product/etc/product.yaml b/server/product/etc/product.yaml index 658e5411..39181b84 100644 --- a/server/product/etc/product.yaml +++ b/server/product/etc/product.yaml @@ -1,6 +1,7 @@ Name: product Host: 0.0.0.0 Port: 9908 +Timeout: 15000 #服务超时时间 SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest Auth: AccessSecret: fusen2023 diff --git a/server/render/etc/render.yaml b/server/render/etc/render.yaml index a75711b8..ccacf731 100644 --- a/server/render/etc/render.yaml +++ b/server/render/etc/render.yaml @@ -1,6 +1,7 @@ Name: render Host: 0.0.0.0 Port: 9919 +Timeout: 15000 #服务超时时间 SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest Auth: AccessSecret: fusen2023 diff --git a/server/render/render.go b/server/render/render.go index f3cdafef..4088d424 100644 --- a/server/render/render.go +++ b/server/render/render.go @@ -26,7 +26,6 @@ func main() { var c config.Config conf.MustLoad(*configFile, &c) - c.Timeout = int64(time.Second * 15) server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) { })) defer server.Stop() diff --git a/server/resource/resource.go b/server/resource/resource.go index 6a09918b..2841e642 100644 --- a/server/resource/resource.go +++ b/server/resource/resource.go @@ -23,7 +23,6 @@ func main() { var c config.Config conf.MustLoad(*configFile, &c) - c.Timeout = int64(time.Second * 15) server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) { })) defer server.Stop() diff --git a/server/shopping-cart-confirmation/etc/shopping-cart-confirmation.yaml b/server/shopping-cart-confirmation/etc/shopping-cart-confirmation.yaml index fa40bb45..58a74824 100644 --- a/server/shopping-cart-confirmation/etc/shopping-cart-confirmation.yaml +++ b/server/shopping-cart-confirmation/etc/shopping-cart-confirmation.yaml @@ -1,6 +1,7 @@ Name: shopping-cart-confirmation Host: 0.0.0.0 Port: 9911 +Timeout: 15000 #服务超时时间 SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest Auth: AccessSecret: fusen2023 diff --git a/server/shopping-cart-confirmation/shopping-cart-confirmation.go b/server/shopping-cart-confirmation/shopping-cart-confirmation.go index 55f29602..b3d9386e 100644 --- a/server/shopping-cart-confirmation/shopping-cart-confirmation.go +++ b/server/shopping-cart-confirmation/shopping-cart-confirmation.go @@ -22,7 +22,6 @@ func main() { var c config.Config conf.MustLoad(*configFile, &c) - c.Timeout = int64(time.Second * 15) server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) { diff --git a/server/upload/etc/upload.yaml b/server/upload/etc/upload.yaml index 3e1c96f3..9d4ff5a2 100644 --- a/server/upload/etc/upload.yaml +++ b/server/upload/etc/upload.yaml @@ -1,6 +1,7 @@ Name: upload Host: 0.0.0.0 Port: 9912 +Timeout: 15000 #服务超时时间 SourceMysql: "fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest" Env: "test" Auth: diff --git a/server/upload/upload.go b/server/upload/upload.go index 603fe25a..2f5ef7f3 100644 --- a/server/upload/upload.go +++ b/server/upload/upload.go @@ -22,7 +22,6 @@ func main() { var c config.Config conf.MustLoad(*configFile, &c) - c.Timeout = int64(time.Second * 15) server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) { diff --git a/server/webset/etc/webset.yaml b/server/webset/etc/webset.yaml index 4d7bb858..828b657b 100644 --- a/server/webset/etc/webset.yaml +++ b/server/webset/etc/webset.yaml @@ -1,6 +1,7 @@ Name: webset Host: 0.0.0.0 Port: 9913 +Timeout: 15000 #服务超时时间 SourceMysql: "fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest" Auth: AccessSecret: fusen2023 diff --git a/server/webset/webset.go b/server/webset/webset.go index 0b8d0ea7..069a0e07 100644 --- a/server/webset/webset.go +++ b/server/webset/webset.go @@ -22,7 +22,6 @@ func main() { var c config.Config conf.MustLoad(*configFile, &c) - c.Timeout = int64(time.Second * 15) server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) { From 54568173af99f1559fad3e1ff1767e13a907375c Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Tue, 15 Aug 2023 13:35:23 +0800 Subject: [PATCH 2/5] fix --- server/assistant/assistant.go | 1 - server/backend/backend.go | 1 - server/base/base.go | 1 - server/canteen/canteen.go | 1 - server/data-transfer/data-transfer.go | 1 - server/home-user-auth/home-user-auth.go | 1 - server/inventory/inventory.go | 1 - server/map-library/map-library.go | 1 - server/orders/orders.go | 1 - server/pay/pay.go | 1 - server/product-model/product-model.go | 1 - server/product-template-tag/product-template-tag.go | 1 - server/product-template/product-template.go | 1 - server/product/product.go | 2 -- server/render/render.go | 1 - server/resource/resource.go | 1 - server/shopping-cart-confirmation/shopping-cart-confirmation.go | 1 - server/upload/upload.go | 1 - server/webset/webset.go | 1 - 19 files changed, 20 deletions(-) diff --git a/server/assistant/assistant.go b/server/assistant/assistant.go index 5ffd00da..2d1ab230 100644 --- a/server/assistant/assistant.go +++ b/server/assistant/assistant.go @@ -4,7 +4,6 @@ import ( "flag" "fmt" "net/http" - "time" "fusenapi/utils/auth" diff --git a/server/backend/backend.go b/server/backend/backend.go index f3f1672f..099cb974 100644 --- a/server/backend/backend.go +++ b/server/backend/backend.go @@ -4,7 +4,6 @@ import ( "flag" "fmt" "net/http" - "time" "fusenapi/server/backend/internal/config" "fusenapi/server/backend/internal/handler" diff --git a/server/base/base.go b/server/base/base.go index c5880c16..1d3f1af1 100644 --- a/server/base/base.go +++ b/server/base/base.go @@ -4,7 +4,6 @@ import ( "flag" "fmt" "net/http" - "time" "fusenapi/utils/auth" diff --git a/server/canteen/canteen.go b/server/canteen/canteen.go index 774de30e..eb2e1f27 100644 --- a/server/canteen/canteen.go +++ b/server/canteen/canteen.go @@ -4,7 +4,6 @@ import ( "flag" "fmt" "net/http" - "time" "fusenapi/server/canteen/internal/config" "fusenapi/server/canteen/internal/handler" diff --git a/server/data-transfer/data-transfer.go b/server/data-transfer/data-transfer.go index 95147a0d..8ad3fa67 100644 --- a/server/data-transfer/data-transfer.go +++ b/server/data-transfer/data-transfer.go @@ -8,7 +8,6 @@ import ( svc2 "fusenapi/server/data-transfer/internal/svc" "fusenapi/utils/auth" "net/http" - "time" "github.com/zeromicro/go-zero/core/conf" "github.com/zeromicro/go-zero/rest" diff --git a/server/home-user-auth/home-user-auth.go b/server/home-user-auth/home-user-auth.go index 3ff860d2..911ae5de 100644 --- a/server/home-user-auth/home-user-auth.go +++ b/server/home-user-auth/home-user-auth.go @@ -4,7 +4,6 @@ import ( "flag" "fmt" "net/http" - "time" "fusenapi/server/home-user-auth/internal/config" "fusenapi/server/home-user-auth/internal/handler" diff --git a/server/inventory/inventory.go b/server/inventory/inventory.go index 00645519..10661756 100644 --- a/server/inventory/inventory.go +++ b/server/inventory/inventory.go @@ -4,7 +4,6 @@ import ( "flag" "fmt" "net/http" - "time" "fusenapi/server/inventory/internal/config" "fusenapi/server/inventory/internal/handler" diff --git a/server/map-library/map-library.go b/server/map-library/map-library.go index 254f2781..b8f7e38b 100644 --- a/server/map-library/map-library.go +++ b/server/map-library/map-library.go @@ -4,7 +4,6 @@ import ( "flag" "fmt" "net/http" - "time" "fusenapi/server/map-library/internal/config" "fusenapi/server/map-library/internal/handler" diff --git a/server/orders/orders.go b/server/orders/orders.go index 3eda600a..fc951aa8 100644 --- a/server/orders/orders.go +++ b/server/orders/orders.go @@ -4,7 +4,6 @@ import ( "flag" "fmt" "net/http" - "time" "fusenapi/server/orders/internal/config" "fusenapi/server/orders/internal/handler" diff --git a/server/pay/pay.go b/server/pay/pay.go index 610b9d63..ecfedfef 100644 --- a/server/pay/pay.go +++ b/server/pay/pay.go @@ -4,7 +4,6 @@ import ( "flag" "fmt" "net/http" - "time" "fusenapi/utils/auth" diff --git a/server/product-model/product-model.go b/server/product-model/product-model.go index adb3846e..a6374de1 100644 --- a/server/product-model/product-model.go +++ b/server/product-model/product-model.go @@ -4,7 +4,6 @@ import ( "flag" "fmt" "net/http" - "time" "fusenapi/server/product-model/internal/config" "fusenapi/server/product-model/internal/handler" diff --git a/server/product-template-tag/product-template-tag.go b/server/product-template-tag/product-template-tag.go index ea3066d4..5f1bd6cd 100644 --- a/server/product-template-tag/product-template-tag.go +++ b/server/product-template-tag/product-template-tag.go @@ -4,7 +4,6 @@ import ( "flag" "fmt" "net/http" - "time" "fusenapi/utils/auth" diff --git a/server/product-template/product-template.go b/server/product-template/product-template.go index d189133d..3819752a 100644 --- a/server/product-template/product-template.go +++ b/server/product-template/product-template.go @@ -4,7 +4,6 @@ import ( "flag" "fmt" "net/http" - "time" "fusenapi/server/product-template/internal/config" "fusenapi/server/product-template/internal/handler" diff --git a/server/product/product.go b/server/product/product.go index 6b212bba..13fba403 100644 --- a/server/product/product.go +++ b/server/product/product.go @@ -4,7 +4,6 @@ import ( "flag" "fmt" "net/http" - "time" "fusenapi/server/product/internal/config" "fusenapi/server/product/internal/handler" @@ -22,7 +21,6 @@ func main() { var c config.Config conf.MustLoad(*configFile, &c) - c.Timeout = int64(time.Second * 15) server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) { diff --git a/server/render/render.go b/server/render/render.go index 4088d424..56fc25ee 100644 --- a/server/render/render.go +++ b/server/render/render.go @@ -7,7 +7,6 @@ import ( "fusenapi/constants" "fusenapi/server/render/consumer" "net/http" - "time" "fusenapi/utils/auth" diff --git a/server/resource/resource.go b/server/resource/resource.go index 2841e642..29887332 100644 --- a/server/resource/resource.go +++ b/server/resource/resource.go @@ -4,7 +4,6 @@ import ( "flag" "fmt" "net/http" - "time" "fusenapi/utils/auth" diff --git a/server/shopping-cart-confirmation/shopping-cart-confirmation.go b/server/shopping-cart-confirmation/shopping-cart-confirmation.go index b3d9386e..c5f6711c 100644 --- a/server/shopping-cart-confirmation/shopping-cart-confirmation.go +++ b/server/shopping-cart-confirmation/shopping-cart-confirmation.go @@ -4,7 +4,6 @@ import ( "flag" "fmt" "net/http" - "time" "fusenapi/server/shopping-cart-confirmation/internal/config" "fusenapi/server/shopping-cart-confirmation/internal/handler" diff --git a/server/upload/upload.go b/server/upload/upload.go index 2f5ef7f3..bea4af45 100644 --- a/server/upload/upload.go +++ b/server/upload/upload.go @@ -4,7 +4,6 @@ import ( "flag" "fmt" "net/http" - "time" "fusenapi/server/upload/internal/config" "fusenapi/server/upload/internal/handler" diff --git a/server/webset/webset.go b/server/webset/webset.go index 069a0e07..ab154b3b 100644 --- a/server/webset/webset.go +++ b/server/webset/webset.go @@ -4,7 +4,6 @@ import ( "flag" "fmt" "net/http" - "time" "fusenapi/server/webset/internal/config" "fusenapi/server/webset/internal/handler" From f4e3834d957e0b93ba2891a5b88ed5d5eba6c42d Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Tue, 15 Aug 2023 14:04:44 +0800 Subject: [PATCH 3/5] fix --- constants/websocket.go | 2 -- server/websocket/internal/logic/ws_resume_last_connect.go | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/constants/websocket.go b/constants/websocket.go index ced0c947..03bd63bb 100644 --- a/constants/websocket.go +++ b/constants/websocket.go @@ -12,8 +12,6 @@ const ( WEBSOCKET_REQUEST_RESUME_LAST_CONNECT = "WEBSOCKET_REQUEST_RESUME_LAST_CONNECT" //请求恢复为上次连接的标识错误 WEBSOCKET_REQUEST_RESUME_LAST_CONNECT_ERR = "WEBSOCKET_REQUEST_RESUME_LAST_CONNECT_ERR" - //请求恢复为上次连接的标识成功 - WEBSOCKET_REQUEST_RESUME_LAST_CONNECT_SUCCESS = "WEBSOCKET_REQUEST_RESUME_LAST_CONNECT_SUCCESS" //渲染前数据组装 WEBSOCKET_RENDER_IMAGE_ASSEMBLE = "WEBSOCKET_RENDER_IMAGE_ASSEMBLE" //图片渲染 diff --git a/server/websocket/internal/logic/ws_resume_last_connect.go b/server/websocket/internal/logic/ws_resume_last_connect.go index 39f29414..79934c8b 100644 --- a/server/websocket/internal/logic/ws_resume_last_connect.go +++ b/server/websocket/internal/logic/ws_resume_last_connect.go @@ -21,7 +21,7 @@ func (w *wsConnectItem) resumeLateConnect(data []byte) { } //重新绑定 w.uniqueId = clientId - rsp := w.respondDataFormat(constants.WEBSOCKET_REQUEST_RESUME_LAST_CONNECT_SUCCESS, clientId) + rsp := w.respondDataFormat(constants.WEBSOCKET_CONNECT_SUCCESS, clientId) w.sendToOutChan(rsp) return } From 48cd4b2fea31ddc498dcd567db3682378529223e Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Tue, 15 Aug 2023 14:21:32 +0800 Subject: [PATCH 4/5] fix --- .../internal/logic/ws_render_image_logic.go | 1 - utils/websocket_data/render_data.go | 19 +++++++++---------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/server/websocket/internal/logic/ws_render_image_logic.go b/server/websocket/internal/logic/ws_render_image_logic.go index 77240ce6..ec254ca7 100644 --- a/server/websocket/internal/logic/ws_render_image_logic.go +++ b/server/websocket/internal/logic/ws_render_image_logic.go @@ -59,7 +59,6 @@ func (w *wsConnectItem) renderImage(data []byte) { renderImageData.RenderData.Logo = "https://s3.us-west-1.amazonaws.com/storage.fusenpack.com/f5ccd11365099fa47a6316b1cd639f6dd6064dcd2d37c8d2fcd0a322160b33cc" } else { renderImageData.RenderData.Logo = *userMaterial.ResourceUrl - renderImageData.RenderData.UserMaterialId = userMaterial.Id } //用户id赋值 renderImageData.RenderData.UserId = w.userId diff --git a/utils/websocket_data/render_data.go b/utils/websocket_data/render_data.go index eaf44eac..4cb3bed6 100644 --- a/utils/websocket_data/render_data.go +++ b/utils/websocket_data/render_data.go @@ -12,16 +12,15 @@ type RenderImageReqMsg struct { RenderData RenderData `json:"render_data"` } type RenderData struct { - TemplateTag string `json:"template_tag"` //模板标签 - ProductId int64 `json:"product_id"` //产品id - UserMaterialId int64 `json:"user_material_id"` //用户素材id - Logo string `json:"logo"` //log资源地址(websocket连接建立再赋值) - Website string `json:"website"` //网站 - Slogan string `json:"slogan"` //slogan - Address string `json:"address"` //地址 - Phone string `json:"phone"` //电话 - UserId int64 `json:"user_id"` //用户id(websocket连接建立再赋值) - GuestId int64 `json:"guest_id"` //游客id(websocket连接建立再赋值) + TemplateTag string `json:"template_tag"` //模板标签 + ProductId int64 `json:"product_id"` //产品id + Logo string `json:"logo"` //log资源地址(websocket连接建立再赋值) + Website string `json:"website"` //网站 + Slogan string `json:"slogan"` //slogan + Address string `json:"address"` //地址 + Phone string `json:"phone"` //电话 + UserId int64 `json:"user_id"` //用户id(websocket连接建立再赋值) + GuestId int64 `json:"guest_id"` //游客id(websocket连接建立再赋值) } // websocket发送渲染完的数据 From a58bd967e92f0b3bde316db91177398fa88c0a63 Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Tue, 15 Aug 2023 14:31:51 +0800 Subject: [PATCH 5/5] fix --- utils/websocket_data/render_data.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/utils/websocket_data/render_data.go b/utils/websocket_data/render_data.go index 4cb3bed6..bb4c82eb 100644 --- a/utils/websocket_data/render_data.go +++ b/utils/websocket_data/render_data.go @@ -12,15 +12,15 @@ type RenderImageReqMsg struct { RenderData RenderData `json:"render_data"` } type RenderData struct { - TemplateTag string `json:"template_tag"` //模板标签 - ProductId int64 `json:"product_id"` //产品id - Logo string `json:"logo"` //log资源地址(websocket连接建立再赋值) - Website string `json:"website"` //网站 - Slogan string `json:"slogan"` //slogan - Address string `json:"address"` //地址 - Phone string `json:"phone"` //电话 + TemplateTag string `json:"template_tag"` //模板标签(必须) + ProductId int64 `json:"product_id"` //产品id(必须) + Website string `json:"website"` //网站(可选) + Slogan string `json:"slogan"` //slogan(可选) + Address string `json:"address"` //地址(可选) + Phone string `json:"phone"` //电话(可选) UserId int64 `json:"user_id"` //用户id(websocket连接建立再赋值) GuestId int64 `json:"guest_id"` //游客id(websocket连接建立再赋值) + Logo string `json:"logo"` //log资源地址(websocket连接建立再赋值) } // websocket发送渲染完的数据