From e16222849c8010c075df6fd97a14e1fe23d6fd0e Mon Sep 17 00:00:00 2001 From: eson <9673575+githubcontent@user.noreply.gitee.com> Date: Mon, 10 Jul 2023 17:07:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=B7=A8=E5=9F=9F=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- goctl_template/api/main.tpl | 2 +- goctl_template_backend/api/main.tpl | 2 +- server/backend/backend.go | 2 +- server/canteen/canteen.go | 2 +- server/data-transfer/data-transfer.go | 2 +- server/home-user-auth/home-user-auth.go | 2 +- server/inventory/inventory.go | 2 +- server/map-library/map-library.go | 2 +- server/orders/orders.go | 2 +- server/product-model/product-model.go | 2 +- server/product-template/product-template.go | 2 +- server/product/product.go | 2 +- server/shopping-cart-confirmation/shopping-cart-confirmation.go | 2 +- server/upload/upload.go | 2 +- server/webset/wetset.go | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/goctl_template/api/main.tpl b/goctl_template/api/main.tpl index 4a7983e0..5d1a8518 100644 --- a/goctl_template/api/main.tpl +++ b/goctl_template/api/main.tpl @@ -15,7 +15,7 @@ func main() { var c config.Config conf.MustLoad(*configFile, &c) - server := rest.MustNewServer(c.RestConf) + server := rest.MustNewServer(c.RestConf, rest.WithCors()) defer server.Stop() ctx := svc.NewServiceContext(c) diff --git a/goctl_template_backend/api/main.tpl b/goctl_template_backend/api/main.tpl index 709ddbd1..a90d8dfc 100644 --- a/goctl_template_backend/api/main.tpl +++ b/goctl_template_backend/api/main.tpl @@ -15,7 +15,7 @@ func main() { var c config.Config conf.MustLoad(*configFile, &c) - server := rest.MustNewServer(c.RestConf) + server := rest.MustNewServer(c.RestConf, rest.WithCors()) defer server.Stop() ctx := svc.NewServiceContext(c) diff --git a/server/backend/backend.go b/server/backend/backend.go index ff692e55..561ac8b6 100644 --- a/server/backend/backend.go +++ b/server/backend/backend.go @@ -20,7 +20,7 @@ func main() { var c config.Config conf.MustLoad(*configFile, &c) - server := rest.MustNewServer(c.RestConf) + server := rest.MustNewServer(c.RestConf, rest.WithCors()) defer server.Stop() ctx := svc.NewServiceContext(c) diff --git a/server/canteen/canteen.go b/server/canteen/canteen.go index 117183e1..b252e60b 100644 --- a/server/canteen/canteen.go +++ b/server/canteen/canteen.go @@ -20,7 +20,7 @@ func main() { var c config.Config conf.MustLoad(*configFile, &c) - server := rest.MustNewServer(c.RestConf) + server := rest.MustNewServer(c.RestConf, rest.WithCors()) defer server.Stop() ctx := svc.NewServiceContext(c) diff --git a/server/data-transfer/data-transfer.go b/server/data-transfer/data-transfer.go index b4508d2d..45b8540d 100644 --- a/server/data-transfer/data-transfer.go +++ b/server/data-transfer/data-transfer.go @@ -19,7 +19,7 @@ func main() { var c config2.Config conf.MustLoad(*configFile, &c) - server := rest.MustNewServer(c.RestConf) + server := rest.MustNewServer(c.RestConf, rest.WithCors()) defer server.Stop() ctx := svc2.NewServiceContext(c) diff --git a/server/home-user-auth/home-user-auth.go b/server/home-user-auth/home-user-auth.go index 7e44ddff..4edb9474 100644 --- a/server/home-user-auth/home-user-auth.go +++ b/server/home-user-auth/home-user-auth.go @@ -20,7 +20,7 @@ func main() { var c config.Config conf.MustLoad(*configFile, &c) - server := rest.MustNewServer(c.RestConf) + server := rest.MustNewServer(c.RestConf, rest.WithCors()) defer server.Stop() ctx := svc.NewServiceContext(c) diff --git a/server/inventory/inventory.go b/server/inventory/inventory.go index 576f18d6..2b2af176 100644 --- a/server/inventory/inventory.go +++ b/server/inventory/inventory.go @@ -20,7 +20,7 @@ func main() { var c config.Config conf.MustLoad(*configFile, &c) - server := rest.MustNewServer(c.RestConf) + server := rest.MustNewServer(c.RestConf, rest.WithCors()) defer server.Stop() ctx := svc.NewServiceContext(c) diff --git a/server/map-library/map-library.go b/server/map-library/map-library.go index 823fe54d..6958ce1c 100644 --- a/server/map-library/map-library.go +++ b/server/map-library/map-library.go @@ -20,7 +20,7 @@ func main() { var c config.Config conf.MustLoad(*configFile, &c) - server := rest.MustNewServer(c.RestConf) + server := rest.MustNewServer(c.RestConf, rest.WithCors()) defer server.Stop() ctx := svc.NewServiceContext(c) diff --git a/server/orders/orders.go b/server/orders/orders.go index b8ae8605..01a2ad6d 100644 --- a/server/orders/orders.go +++ b/server/orders/orders.go @@ -20,7 +20,7 @@ func main() { var c config.Config conf.MustLoad(*configFile, &c) - server := rest.MustNewServer(c.RestConf) + server := rest.MustNewServer(c.RestConf, rest.WithCors()) defer server.Stop() ctx := svc.NewServiceContext(c) diff --git a/server/product-model/product-model.go b/server/product-model/product-model.go index 85d3cbbf..06ee4752 100644 --- a/server/product-model/product-model.go +++ b/server/product-model/product-model.go @@ -20,7 +20,7 @@ func main() { var c config.Config conf.MustLoad(*configFile, &c) - server := rest.MustNewServer(c.RestConf) + server := rest.MustNewServer(c.RestConf, rest.WithCors()) defer server.Stop() ctx := svc.NewServiceContext(c) diff --git a/server/product-template/product-template.go b/server/product-template/product-template.go index 7218da3e..db5296e8 100644 --- a/server/product-template/product-template.go +++ b/server/product-template/product-template.go @@ -20,7 +20,7 @@ func main() { var c config.Config conf.MustLoad(*configFile, &c) - server := rest.MustNewServer(c.RestConf) + server := rest.MustNewServer(c.RestConf, rest.WithCors()) defer server.Stop() ctx := svc.NewServiceContext(c) diff --git a/server/product/product.go b/server/product/product.go index 0c583a1c..d2082584 100644 --- a/server/product/product.go +++ b/server/product/product.go @@ -20,7 +20,7 @@ func main() { var c config.Config conf.MustLoad(*configFile, &c) - server := rest.MustNewServer(c.RestConf) + server := rest.MustNewServer(c.RestConf, rest.WithCors()) defer server.Stop() ctx := svc.NewServiceContext(c) handler.RegisterHandlers(server, ctx) diff --git a/server/shopping-cart-confirmation/shopping-cart-confirmation.go b/server/shopping-cart-confirmation/shopping-cart-confirmation.go index 9b27d7b5..f621aaa3 100644 --- a/server/shopping-cart-confirmation/shopping-cart-confirmation.go +++ b/server/shopping-cart-confirmation/shopping-cart-confirmation.go @@ -20,7 +20,7 @@ func main() { var c config.Config conf.MustLoad(*configFile, &c) - server := rest.MustNewServer(c.RestConf) + server := rest.MustNewServer(c.RestConf, rest.WithCors()) defer server.Stop() ctx := svc.NewServiceContext(c) diff --git a/server/upload/upload.go b/server/upload/upload.go index ed185b9c..48e5f663 100644 --- a/server/upload/upload.go +++ b/server/upload/upload.go @@ -20,7 +20,7 @@ func main() { var c config.Config conf.MustLoad(*configFile, &c) - server := rest.MustNewServer(c.RestConf) + server := rest.MustNewServer(c.RestConf, rest.WithCors()) defer server.Stop() ctx := svc.NewServiceContext(c) diff --git a/server/webset/wetset.go b/server/webset/wetset.go index 196bbd76..700cf37c 100644 --- a/server/webset/wetset.go +++ b/server/webset/wetset.go @@ -20,7 +20,7 @@ func main() { var c config.Config conf.MustLoad(*configFile, &c) - server := rest.MustNewServer(c.RestConf) + server := rest.MustNewServer(c.RestConf, rest.WithCors()) defer server.Stop() ctx := svc.NewServiceContext(c)