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:
虫子樱桃
2022-07-09 15:34:01 +08:00
committed by GitHub
parent 1410f7dc20
commit 725e6056e1
5 changed files with 28 additions and 6 deletions

View File

@@ -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()