优化location处理
This commit is contained in:
parent
a736cff687
commit
4b9d44296d
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user