From 4b9d44296d9767646e251b770acbafcc59e76801 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Fri, 11 Apr 2025 21:39:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96location=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- swagger/parser.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/swagger/parser.go b/swagger/parser.go index a9028fe..868de31 100644 --- a/swagger/parser.go +++ b/swagger/parser.go @@ -129,7 +129,7 @@ func (hod *handleOpenapiDoc) apiPathConfigToProjectConfig(uri string, method str importUriConfig.ParamList = append(importUriConfig.ParamList, &apiDocDefine.ApiParamItem{ Title: itemParam.Name, Name: itemParam.Name, - Location: hod.openapiDocLocation2GatewayLocation(itemParam.In), + Location: hod.openapiDocLocationFormat(itemParam.In), ParamType: hod.openapiDocType2GoType(fmt.Sprintf("%v", itemParam.Schema.Type), itemParam.Schema.Format), IsRequired: itemParam.Required, DefaultValue: "∂", @@ -597,12 +597,12 @@ func (hod *handleOpenapiDoc) getResComponentsConfig(ref string) (*apiDocDefine.S return nil, errors.New("components not found : " + refKey) } -// openapiDocLocation2GatewayLocation 文档数据位置转为网关的数据位置 +// openapiDocLocationFormat 文档数据位置转为网关的数据位置 // // Author : go_developer@163.com<白茶清欢> // // Date : 21:06 2025/2/26 -func (hod *handleOpenapiDoc) openapiDocLocation2GatewayLocation(openapiDocLocation string) string { +func (hod *handleOpenapiDoc) openapiDocLocationFormat(openapiDocLocation string) string { openapiDocLocation = strings.ToUpper(openapiDocLocation) for _, itemLocation := range consts.RequestDataLocationList { if strings.ToUpper(itemLocation.Value.String()) == openapiDocLocation {