feat:goctl model mongo add easy flag for easy declare. (#2073)
* fix:typo in readme.md * feat:`goctl model mongo ` add `easy` flag to generate code with Auto generated CollectionName for easy declare. * fix:`goctl api doc ` when referenced api file contains no route,will generate an empty markdown file. * code: adjust code. Co-authored-by: 虫子樱桃 <czyt@w.cn>
This commit is contained in:
@@ -18,12 +18,14 @@ import (
|
||||
var markdownTemplate string
|
||||
|
||||
func genDoc(api *spec.ApiSpec, dir, filename string) error {
|
||||
if len(api.Service.Routes()) == 0 {
|
||||
return nil
|
||||
}
|
||||
fp, _, err := util.MaybeCreateFile(dir, "", filename)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer fp.Close()
|
||||
|
||||
var builder strings.Builder
|
||||
for index, route := range api.Service.Routes() {
|
||||
routeComment := route.JoinedDoc()
|
||||
|
||||
Reference in New Issue
Block a user