feat(goctl): api dart support flutter v2 (#1603)

0. support null-safety code gen
1. supports -legacy flag for legacy code gen
2. supports -hostname flag for server hostname
3. use dart official format
4. fix some some bugs

Resolves: #1602
This commit is contained in:
Fyn
2022-03-04 15:34:13 +08:00
committed by GitHub
parent 36b9fcba44
commit 6a66dde0a1
9 changed files with 313 additions and 21 deletions

View File

@@ -4,6 +4,7 @@ import (
"errors"
"fmt"
"os"
"path"
"strings"
"github.com/zeromicro/go-zero/tools/goctl/api/spec"
@@ -34,6 +35,10 @@ func pathToFuncName(path string) string {
return util.ToLower(camel[:1]) + camel[1:]
}
func getBaseName(str string) string {
return path.Base(str)
}
func getPropertyFromMember(member spec.Member) string {
name, err := member.GetPropertyName()
if err != nil {