v1基础请求参数构建
This commit is contained in:
19
util/tool.go
19
util/tool.go
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user