v1基础请求参数构建

This commit is contained in:
2024-04-22 18:21:46 +08:00
parent 114b5db641
commit 9569f7dfd0
4 changed files with 219 additions and 20 deletions

View File

@ -43,3 +43,22 @@ func GetParameterDefaultLocation(requestMethod string) string {
}
return consts.RequestLocationQuery
}
// GetSwaggerType 基于输入的类型,
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 12:23 2024/4/22
func GetSwaggerType(inputType string) string {
convertTable := map[string]string{
consts.DataTypeString: "string",
consts.DataTypeInt: "integer",
consts.DataTypeUint: "integer",
consts.DataTypeFloat: "number",
consts.DataTypeBool: "boolean",
}
if _, exist := convertTable[inputType]; exist {
return convertTable[inputType]
}
return inputType
}