merge
This commit is contained in:
@@ -123,7 +123,7 @@ func (g *Generate) AddApiFromInAndOut(uriPrefix string, paramType reflect.Type,
|
|||||||
// 接口文档初始化
|
// 接口文档初始化
|
||||||
cfg := g.getApiDocBaseCfg(baseCfg, paramType)
|
cfg := g.getApiDocBaseCfg(baseCfg, paramType)
|
||||||
|
|
||||||
if op_array.Has(*op_array.ArrayType[string](g.readMethodList), baseCfg.Method) >= 0 {
|
if op_array.ArrayType[string](g.readMethodList).Has(baseCfg.Method) >= 0 {
|
||||||
cfg.RequestBody = nil // get类请求没有request body
|
cfg.RequestBody = nil // get类请求没有request body
|
||||||
// 参数解析
|
// 参数解析
|
||||||
g.ParseReadConfigParam(baseCfg, cfg, paramType)
|
g.ParseReadConfigParam(baseCfg, cfg, paramType)
|
||||||
@@ -743,7 +743,7 @@ func (g *Generate) parseBaseUriConfig(uriPrefix string, paramType reflect.Type)
|
|||||||
res.Deprecated = deprecated == "1" || deprecated == "true"
|
res.Deprecated = deprecated == "1" || deprecated == "true"
|
||||||
requestContentType := strings.TrimSpace(metaField.Tag.Get(define.TagContentType))
|
requestContentType := strings.TrimSpace(metaField.Tag.Get(define.TagContentType))
|
||||||
if len(requestContentType) == 0 {
|
if len(requestContentType) == 0 {
|
||||||
if op_array.Has(*op_array.ArrayType[string](g.readMethodList), res.Method) >= 0 {
|
if op_array.ArrayType[string](g.readMethodList).Has(res.Method) >= 0 {
|
||||||
// get类请求
|
// get类请求
|
||||||
requestContentType = consts.MimeTypeXWWWFormUrlencoded
|
requestContentType = consts.MimeTypeXWWWFormUrlencoded
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -385,7 +385,7 @@ func setGlobalMapDefinition(swaggerInfo *define.Swagger, dataType string) {
|
|||||||
//
|
//
|
||||||
// Date : 15:46 2024/4/25
|
// Date : 15:46 2024/4/25
|
||||||
func isGlobalMapType(dataType string) bool {
|
func isGlobalMapType(dataType string) bool {
|
||||||
return op_array.Has(*op_array.ArrayType[string]([]string{
|
return op_array.ArrayType[string]([]string{
|
||||||
consts.DataTypeMapAnyAny.String(),
|
consts.DataTypeMapAnyAny.String(),
|
||||||
consts.DataTypeMapStrUint.String(),
|
consts.DataTypeMapStrUint.String(),
|
||||||
consts.DataTypeMapStrInt.String(),
|
consts.DataTypeMapStrInt.String(),
|
||||||
@@ -393,7 +393,7 @@ func isGlobalMapType(dataType string) bool {
|
|||||||
consts.DataTypeMapStrFloat.String(),
|
consts.DataTypeMapStrFloat.String(),
|
||||||
consts.DataTypeMapStrBool.String(),
|
consts.DataTypeMapStrBool.String(),
|
||||||
consts.DataTypeMapStrAny.String(),
|
consts.DataTypeMapStrAny.String(),
|
||||||
}), dataType) >= 0
|
}).Has(dataType) >= 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// initAnyDefinition 初始化一个definition
|
// initAnyDefinition 初始化一个definition
|
||||||
|
|||||||
Reference in New Issue
Block a user