mirror of
				https://github.com/beego/bee.git
				synced 2025-11-04 09:23:24 +00:00 
			
		
		
		
	Merge f4b992174c into 77acc749e4
				
					
				
			This commit is contained in:
		
							
								
								
									
										17
									
								
								g_docs.go
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								g_docs.go
									
									
									
									
									
								
							@@ -579,6 +579,23 @@ func parserComments(comments *ast.CommentGroup, funcName, controllerName, pkgpat
 | 
				
			|||||||
					para.Description = strings.Trim(p[3], `" `)
 | 
										para.Description = strings.Trim(p[3], `" `)
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
				opts.Parameters = append(opts.Parameters, para)
 | 
									opts.Parameters = append(opts.Parameters, para)
 | 
				
			||||||
 | 
									//bug parase datatype in params begin
 | 
				
			||||||
 | 
									if para.ParamType == "body" {
 | 
				
			||||||
 | 
										if para.DataType == "" {
 | 
				
			||||||
 | 
											panic(controllerName + " " + funcName + " has no object")
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
										cmpath, _, mod, realTypes := getModel(p[2])
 | 
				
			||||||
 | 
										//ll := strings.Split(st[2], ".")
 | 
				
			||||||
 | 
										//opts.Type = ll[len(ll)-1]
 | 
				
			||||||
 | 
										//rs.ResponseModel = m
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										if _, ok := modelsList[pkgpath+controllerName]; !ok {
 | 
				
			||||||
 | 
											modelsList[pkgpath+controllerName] = make(map[string]swagger.Model, 0)
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
										modelsList[pkgpath+controllerName][para.DataType] = mod
 | 
				
			||||||
 | 
										appendModels(cmpath, pkgpath, controllerName, realTypes)
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
									//bug parase datatype in params end
 | 
				
			||||||
			} else if strings.HasPrefix(t, "@Failure") {
 | 
								} else if strings.HasPrefix(t, "@Failure") {
 | 
				
			||||||
				rs := swagger.Response{}
 | 
									rs := swagger.Response{}
 | 
				
			||||||
				st := strings.TrimSpace(t[len("@Failure"):])
 | 
									st := strings.TrimSpace(t[len("@Failure"):])
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user