update package reference
This commit is contained in:
@@ -7,9 +7,8 @@ import (
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
"zero/tools/goctl/util"
|
||||
|
||||
"github.com/logrusorgru/aurora"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/util"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,9 +4,8 @@ import (
|
||||
"errors"
|
||||
"strings"
|
||||
|
||||
"zero/core/lang"
|
||||
"zero/tools/goctl/api/parser"
|
||||
|
||||
"github.com/tal-tech/go-zero/core/lang"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/parser"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"os"
|
||||
"text/template"
|
||||
|
||||
"zero/core/logx"
|
||||
"zero/tools/goctl/api/spec"
|
||||
"github.com/tal-tech/go-zero/core/logx"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/spec"
|
||||
)
|
||||
|
||||
const apiTemplate = `import 'api.dart';
|
||||
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"os"
|
||||
"text/template"
|
||||
|
||||
"zero/core/logx"
|
||||
"zero/tools/goctl/api/spec"
|
||||
"github.com/tal-tech/go-zero/core/logx"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/spec"
|
||||
)
|
||||
|
||||
const dataTemplate = `// --{{with .Info}}{{.Title}}{{end}}--
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
||||
"zero/core/logx"
|
||||
"github.com/tal-tech/go-zero/core/logx"
|
||||
)
|
||||
|
||||
func genVars(dir string) error {
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
"zero/tools/goctl/api/spec"
|
||||
"zero/tools/goctl/api/util"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/spec"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/util"
|
||||
)
|
||||
|
||||
func lowCamelCase(s string) string {
|
||||
|
||||
@@ -7,10 +7,10 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"zero/core/stringx"
|
||||
"zero/tools/goctl/api/gogen"
|
||||
"zero/tools/goctl/api/spec"
|
||||
"zero/tools/goctl/api/util"
|
||||
"github.com/tal-tech/go-zero/core/stringx"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/gogen"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/spec"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/util"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -7,8 +7,7 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"zero/tools/goctl/api/parser"
|
||||
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/parser"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
|
||||
@@ -11,11 +11,9 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"zero/tools/goctl/api/util"
|
||||
|
||||
"zero/core/errorx"
|
||||
"zero/tools/goctl/api/parser"
|
||||
|
||||
"github.com/tal-tech/go-zero/core/errorx"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/parser"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/util"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
|
||||
@@ -12,13 +12,12 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"zero/core/lang"
|
||||
apiformat "zero/tools/goctl/api/format"
|
||||
"zero/tools/goctl/api/parser"
|
||||
apiutil "zero/tools/goctl/api/util"
|
||||
"zero/tools/goctl/util"
|
||||
|
||||
"github.com/logrusorgru/aurora"
|
||||
"github.com/tal-tech/go-zero/core/lang"
|
||||
apiformat "github.com/tal-tech/go-zero/tools/goctl/api/format"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/parser"
|
||||
apiutil "github.com/tal-tech/go-zero/tools/goctl/api/util"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/util"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
"fmt"
|
||||
"text/template"
|
||||
|
||||
"zero/tools/goctl/api/util"
|
||||
"zero/tools/goctl/vars"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/util"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/vars"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
"strconv"
|
||||
"text/template"
|
||||
|
||||
"zero/tools/goctl/api/spec"
|
||||
"zero/tools/goctl/api/util"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/spec"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/util"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -8,10 +8,10 @@ import (
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
"zero/tools/goctl/api/spec"
|
||||
apiutil "zero/tools/goctl/api/util"
|
||||
"zero/tools/goctl/util"
|
||||
"zero/tools/goctl/vars"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/spec"
|
||||
apiutil "github.com/tal-tech/go-zero/tools/goctl/api/util"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/util"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/vars"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -7,9 +7,9 @@ import (
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
"zero/tools/goctl/api/spec"
|
||||
"zero/tools/goctl/api/util"
|
||||
"zero/tools/goctl/vars"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/spec"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/util"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/vars"
|
||||
)
|
||||
|
||||
const logicTemplate = `package logic
|
||||
|
||||
@@ -8,9 +8,9 @@ import (
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
"zero/tools/goctl/api/spec"
|
||||
"zero/tools/goctl/api/util"
|
||||
"zero/tools/goctl/vars"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/spec"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/util"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/vars"
|
||||
)
|
||||
|
||||
const mainTemplate = `package main
|
||||
|
||||
@@ -8,11 +8,11 @@ import (
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
"zero/core/collection"
|
||||
"zero/tools/goctl/api/spec"
|
||||
apiutil "zero/tools/goctl/api/util"
|
||||
"zero/tools/goctl/util"
|
||||
"zero/tools/goctl/vars"
|
||||
"github.com/tal-tech/go-zero/core/collection"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/spec"
|
||||
apiutil "github.com/tal-tech/go-zero/tools/goctl/api/util"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/util"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/vars"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
"path"
|
||||
"text/template"
|
||||
|
||||
"zero/tools/goctl/api/spec"
|
||||
"zero/tools/goctl/api/util"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/spec"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/util"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -9,9 +9,9 @@ import (
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
"zero/tools/goctl/api/spec"
|
||||
apiutil "zero/tools/goctl/api/util"
|
||||
"zero/tools/goctl/util"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/spec"
|
||||
apiutil "github.com/tal-tech/go-zero/tools/goctl/api/util"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/util"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -9,9 +9,9 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"zero/core/collection"
|
||||
"zero/tools/goctl/api/spec"
|
||||
"zero/tools/goctl/api/util"
|
||||
"github.com/tal-tech/go-zero/core/collection"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/spec"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/util"
|
||||
)
|
||||
|
||||
func getParentPackage(dir string) (string, error) {
|
||||
|
||||
@@ -5,11 +5,10 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"zero/core/lang"
|
||||
"zero/tools/goctl/api/parser"
|
||||
"zero/tools/goctl/util"
|
||||
|
||||
"github.com/logrusorgru/aurora"
|
||||
"github.com/tal-tech/go-zero/core/lang"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/parser"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/util"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@ import (
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
"zero/tools/goctl/api/spec"
|
||||
apiutil "zero/tools/goctl/api/util"
|
||||
"zero/tools/goctl/util"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/spec"
|
||||
apiutil "github.com/tal-tech/go-zero/tools/goctl/api/util"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/util"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -9,10 +9,10 @@ import (
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
"zero/core/stringx"
|
||||
"zero/tools/goctl/api/spec"
|
||||
apiutil "zero/tools/goctl/api/util"
|
||||
"zero/tools/goctl/util"
|
||||
"github.com/tal-tech/go-zero/core/stringx"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/spec"
|
||||
apiutil "github.com/tal-tech/go-zero/tools/goctl/api/util"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/util"
|
||||
)
|
||||
|
||||
const packetTemplate = `package com.xhb.logic.http.packet.{{.packet}};
|
||||
|
||||
@@ -8,9 +8,9 @@ import (
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
"zero/tools/goctl/api/spec"
|
||||
apiutil "zero/tools/goctl/api/util"
|
||||
"zero/tools/goctl/util"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/spec"
|
||||
apiutil "github.com/tal-tech/go-zero/tools/goctl/api/util"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/util"
|
||||
)
|
||||
|
||||
const getSetTemplate = `
|
||||
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"zero/core/lang"
|
||||
"zero/tools/goctl/api/parser"
|
||||
"github.com/tal-tech/go-zero/core/lang"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/parser"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"zero/tools/goctl/api/spec"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/spec"
|
||||
)
|
||||
|
||||
type (
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"zero/tools/goctl/api/spec"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/spec"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"io"
|
||||
"io/ioutil"
|
||||
|
||||
"zero/tools/goctl/api/spec"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/spec"
|
||||
)
|
||||
|
||||
type Parser struct {
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"zero/tools/goctl/api/spec"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/spec"
|
||||
)
|
||||
|
||||
type rootState struct {
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"zero/tools/goctl/api/spec"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/spec"
|
||||
)
|
||||
|
||||
type serviceState struct {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package parser
|
||||
|
||||
import "zero/tools/goctl/api/spec"
|
||||
import "github.com/tal-tech/go-zero/tools/goctl/api/spec"
|
||||
|
||||
type state interface {
|
||||
process(api *spec.ApiSpec) (state, error)
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"zero/tools/goctl/api/spec"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/spec"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"zero/tools/goctl/api/spec"
|
||||
"zero/tools/goctl/util"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/spec"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/util"
|
||||
)
|
||||
|
||||
type typeState struct {
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"zero/tools/goctl/api/spec"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/spec"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -4,9 +4,10 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
"zero/core/stringx"
|
||||
"zero/tools/goctl/api/spec"
|
||||
"zero/tools/goctl/api/util"
|
||||
|
||||
"github.com/tal-tech/go-zero/core/stringx"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/spec"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/util"
|
||||
)
|
||||
|
||||
func (p *Parser) validate(api *spec.ApiSpec) (err error) {
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"zero/core/stringx"
|
||||
"zero/tools/goctl/util"
|
||||
"github.com/tal-tech/go-zero/core/stringx"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/util"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -4,11 +4,10 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"zero/core/lang"
|
||||
"zero/tools/goctl/api/parser"
|
||||
"zero/tools/goctl/util"
|
||||
|
||||
"github.com/logrusorgru/aurora"
|
||||
"github.com/tal-tech/go-zero/core/lang"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/parser"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/util"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@ import (
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
"zero/tools/goctl/api/spec"
|
||||
apiutil "zero/tools/goctl/api/util"
|
||||
"zero/tools/goctl/util"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/spec"
|
||||
apiutil "github.com/tal-tech/go-zero/tools/goctl/api/util"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/util"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -7,9 +7,9 @@ import (
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
"zero/tools/goctl/api/spec"
|
||||
apiutil "zero/tools/goctl/api/util"
|
||||
"zero/tools/goctl/util"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/spec"
|
||||
apiutil "github.com/tal-tech/go-zero/tools/goctl/api/util"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/util"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -5,9 +5,9 @@ import (
|
||||
"io"
|
||||
"strings"
|
||||
|
||||
"zero/tools/goctl/api/spec"
|
||||
apiutil "zero/tools/goctl/api/util"
|
||||
"zero/tools/goctl/util"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/spec"
|
||||
apiutil "github.com/tal-tech/go-zero/tools/goctl/api/util"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/util"
|
||||
)
|
||||
|
||||
func writeProperty(writer io.Writer, member spec.Member, indent int, prefixForType func(string) string) error {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package util
|
||||
|
||||
import "zero/tools/goctl/api/spec"
|
||||
import "github.com/tal-tech/go-zero/tools/goctl/api/spec"
|
||||
|
||||
func GetAnnotationValue(annos []spec.Annotation, key, field string) (string, bool) {
|
||||
for _, anno := range annos {
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"zero/tools/goctl/api/spec"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/spec"
|
||||
)
|
||||
|
||||
func DecomposeType(t string) (result []string, err error) {
|
||||
|
||||
@@ -7,10 +7,10 @@ import (
|
||||
"os"
|
||||
"path"
|
||||
"strings"
|
||||
"zero/tools/goctl/api/spec"
|
||||
|
||||
"zero/core/lang"
|
||||
"zero/tools/goctl/util"
|
||||
"github.com/tal-tech/go-zero/core/lang"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/spec"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/util"
|
||||
)
|
||||
|
||||
func MaybeCreateFile(dir, subdir, file string) (fp *os.File, created bool, err error) {
|
||||
|
||||
@@ -4,9 +4,8 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"zero/tools/goctl/api/parser"
|
||||
|
||||
"github.com/logrusorgru/aurora"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/parser"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
|
||||
@@ -10,8 +10,8 @@ import (
|
||||
"text/template"
|
||||
|
||||
"github.com/logrusorgru/aurora"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/vars"
|
||||
"github.com/urfave/cli"
|
||||
"zero/tools/goctl/vars"
|
||||
)
|
||||
|
||||
const configTemplate = `package main
|
||||
|
||||
@@ -3,8 +3,7 @@ package docker
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"zero/tools/goctl/gen"
|
||||
|
||||
"github.com/tal-tech/go-zero/tools/goctl/gen"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package recommendservice;
|
||||
|
||||
message RecArticle {
|
||||
int64 id = 1;
|
||||
}
|
||||
|
||||
message RecommendRequest {
|
||||
// the id of the request user.
|
||||
int64 uid = 1;
|
||||
// how many top ranked article for this user.
|
||||
int32 topk = 2;
|
||||
// current hour
|
||||
int32 hour = 3;
|
||||
// current minute
|
||||
int32 minute = 4;
|
||||
// the article list.
|
||||
repeated RecArticle articles = 5;
|
||||
}
|
||||
|
||||
message RecommendResponse {
|
||||
repeated int64 articles = 1;
|
||||
}
|
||||
|
||||
service RecommendService {
|
||||
// the method to get the topk performers for this user.
|
||||
rpc recommend1(RecommendRequest) returns (RecommendResponse);
|
||||
rpc recommend2(RecommendRequest) returns (RecommendResponse);
|
||||
}
|
||||
@@ -4,8 +4,8 @@ import (
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
"zero/tools/goctl/util"
|
||||
"zero/tools/goctl/vars"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/util"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/vars"
|
||||
)
|
||||
|
||||
func GenerateDockerfile(goFile string, args ...string) error {
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
"zero/tools/goctl/util"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/util"
|
||||
)
|
||||
|
||||
func GenerateMakefile(goFile, namespace string) error {
|
||||
|
||||
@@ -11,27 +11,26 @@ import (
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"zero/core/conf"
|
||||
"zero/core/hash"
|
||||
"zero/core/lang"
|
||||
"zero/core/logx"
|
||||
"zero/core/mr"
|
||||
"zero/core/stringx"
|
||||
"zero/tools/goctl/api/apigen"
|
||||
"zero/tools/goctl/api/dartgen"
|
||||
"zero/tools/goctl/api/docgen"
|
||||
"zero/tools/goctl/api/format"
|
||||
"zero/tools/goctl/api/gogen"
|
||||
"zero/tools/goctl/api/javagen"
|
||||
"zero/tools/goctl/api/tsgen"
|
||||
"zero/tools/goctl/api/validate"
|
||||
"zero/tools/goctl/configgen"
|
||||
"zero/tools/goctl/docker"
|
||||
"zero/tools/goctl/feature"
|
||||
"zero/tools/goctl/model/mongomodel"
|
||||
"zero/tools/goctl/util"
|
||||
|
||||
"github.com/logrusorgru/aurora"
|
||||
"github.com/tal-tech/go-zero/core/conf"
|
||||
"github.com/tal-tech/go-zero/core/hash"
|
||||
"github.com/tal-tech/go-zero/core/lang"
|
||||
"github.com/tal-tech/go-zero/core/logx"
|
||||
"github.com/tal-tech/go-zero/core/mr"
|
||||
"github.com/tal-tech/go-zero/core/stringx"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/apigen"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/dartgen"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/docgen"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/format"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/gogen"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/javagen"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/tsgen"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/validate"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/configgen"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/docker"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/feature"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/model/mongomodel"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/util"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package gen
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"zero/tools/goctl/model/mongomodel/utils"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/model/mongomodel/utils"
|
||||
)
|
||||
|
||||
func genMethodTemplate(funcDesc FunctionDesc, needCache bool) (template string) {
|
||||
|
||||
@@ -5,9 +5,9 @@ import (
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
"zero/tools/goctl/api/spec"
|
||||
"zero/tools/goctl/api/util"
|
||||
"zero/tools/goctl/model/mongomodel/utils"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/spec"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/util"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/model/mongomodel/utils"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -149,8 +149,8 @@ func getImports(imports []string, needCache bool) string {
|
||||
importStr := strings.Join(imports, "\n\t")
|
||||
importStr += "\"errors\"\n\t"
|
||||
importStr += "\"time\"\n\t"
|
||||
importStr += "\n\t\"zero/core/stores/cache\"\n\t"
|
||||
importStr += "\"zero/core/stores/mongoc\"\n\t"
|
||||
importStr += "\n\t\"github.com/tal-tech/go-zero/core/stores/cache\"\n\t"
|
||||
importStr += "\"github.com/tal-tech/go-zero/core/stores/mongoc\"\n\t"
|
||||
importStr += "\n\t\"github.com/globalsign/mgo/bson\""
|
||||
return importStr
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
"zero/tools/goctl/model/mongomodel/utils"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/model/mongomodel/utils"
|
||||
)
|
||||
|
||||
func GenMongoModelByNetwork(input string, needCache bool) (string, error) {
|
||||
|
||||
@@ -2,7 +2,7 @@ package gen
|
||||
|
||||
const (
|
||||
quotationMark = "`"
|
||||
//templates that do not use caching
|
||||
// templates that do not use caching
|
||||
noCacheTemplate = `package model
|
||||
|
||||
import (
|
||||
|
||||
@@ -4,10 +4,9 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"zero/core/lang"
|
||||
"zero/tools/goctl/model/mongomodel/gen"
|
||||
|
||||
"github.com/logrusorgru/aurora"
|
||||
"github.com/tal-tech/go-zero/core/lang"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/model/mongomodel/gen"
|
||||
"github.com/urfave/cli"
|
||||
)
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"io/ioutil"
|
||||
"strings"
|
||||
|
||||
"zero/tools/goctl/api/spec"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/spec"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -45,9 +45,9 @@ imports代码生成对应model中包的引入管理,仅使用于晓黑板项
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"zero/core/stores/sqlc"
|
||||
"zero/core/stores/sqlx"
|
||||
"zero/core/stringx"
|
||||
"github.com/tal-tech/go-zero/core/stores/sqlc"
|
||||
"github.com/tal-tech/go-zero/core/stores/sqlx"
|
||||
"github.com/tal-tech/go-zero/core/stringx"
|
||||
"xiao/service/shared/builderx"
|
||||
)
|
||||
```
|
||||
@@ -60,8 +60,8 @@ imports代码生成对应model中包的引入管理,仅使用于晓黑板项
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"zero/core/stores/sqlx"
|
||||
"zero/core/stringx"
|
||||
"github.com/tal-tech/go-zero/core/stores/sqlx"
|
||||
"github.com/tal-tech/go-zero/core/stringx"
|
||||
"xiao/service/shared/builderx"
|
||||
)
|
||||
```
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"zero/tools/goctl/model/sql/util"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/model/sql/util"
|
||||
)
|
||||
|
||||
func TableConvert(outerTable OuterTable) (*InnerTable, error) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
sqltemplate "zero/tools/goctl/model/sql/template"
|
||||
sqltemplate "github.com/tal-tech/go-zero/tools/goctl/model/sql/template"
|
||||
)
|
||||
|
||||
func genDelete(table *InnerTable) (string, error) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
sqltemplate "zero/tools/goctl/model/sql/template"
|
||||
sqltemplate "github.com/tal-tech/go-zero/tools/goctl/model/sql/template"
|
||||
)
|
||||
|
||||
func genFields(fields []*InnerField) (string, error) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
sqltemplate "zero/tools/goctl/model/sql/template"
|
||||
sqltemplate "github.com/tal-tech/go-zero/tools/goctl/model/sql/template"
|
||||
)
|
||||
|
||||
func genFindAllByField(table *InnerTable) (string, error) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
sqltemplate "zero/tools/goctl/model/sql/template"
|
||||
sqltemplate "github.com/tal-tech/go-zero/tools/goctl/model/sql/template"
|
||||
)
|
||||
|
||||
func genFindLimitByField(table *InnerTable) (string, error) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"bytes"
|
||||
"text/template"
|
||||
|
||||
sqltemplate "zero/tools/goctl/model/sql/template"
|
||||
sqltemplate "github.com/tal-tech/go-zero/tools/goctl/model/sql/template"
|
||||
)
|
||||
|
||||
func genFindOne(table *InnerTable) (string, error) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
sqltemplate "zero/tools/goctl/model/sql/template"
|
||||
sqltemplate "github.com/tal-tech/go-zero/tools/goctl/model/sql/template"
|
||||
)
|
||||
|
||||
func genFineOneByField(table *InnerTable) (string, error) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"bytes"
|
||||
"text/template"
|
||||
|
||||
sqltemplate "zero/tools/goctl/model/sql/template"
|
||||
sqltemplate "github.com/tal-tech/go-zero/tools/goctl/model/sql/template"
|
||||
)
|
||||
|
||||
func genImports(table *InnerTable) (string, error) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
sqltemplate "zero/tools/goctl/model/sql/template"
|
||||
sqltemplate "github.com/tal-tech/go-zero/tools/goctl/model/sql/template"
|
||||
)
|
||||
|
||||
func genInsert(table *InnerTable) (string, error) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"log"
|
||||
"testing"
|
||||
|
||||
"zero/core/logx"
|
||||
"github.com/tal-tech/go-zero/core/logx"
|
||||
)
|
||||
|
||||
func TestKeys(t *testing.T) {
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
"zero/core/logx"
|
||||
sqltemplate "zero/tools/goctl/model/sql/template"
|
||||
"github.com/tal-tech/go-zero/core/logx"
|
||||
sqltemplate "github.com/tal-tech/go-zero/tools/goctl/model/sql/template"
|
||||
)
|
||||
|
||||
func GenModel(table *InnerTable) (string, error) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"bytes"
|
||||
"text/template"
|
||||
|
||||
sqltemplate "zero/tools/goctl/model/sql/template"
|
||||
sqltemplate "github.com/tal-tech/go-zero/tools/goctl/model/sql/template"
|
||||
)
|
||||
|
||||
func genNew(table *InnerTable) (string, error) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"bytes"
|
||||
"text/template"
|
||||
|
||||
sqltemplate "zero/tools/goctl/model/sql/template"
|
||||
sqltemplate "github.com/tal-tech/go-zero/tools/goctl/model/sql/template"
|
||||
)
|
||||
|
||||
func genTag(in string) (string, error) {
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"bytes"
|
||||
"text/template"
|
||||
|
||||
sqltemplate "zero/tools/goctl/model/sql/template"
|
||||
sqltemplate "github.com/tal-tech/go-zero/tools/goctl/model/sql/template"
|
||||
)
|
||||
|
||||
func genTypes(table *InnerTable) (string, error) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
sqltemplate "zero/tools/goctl/model/sql/template"
|
||||
sqltemplate "github.com/tal-tech/go-zero/tools/goctl/model/sql/template"
|
||||
)
|
||||
|
||||
func genUpdate(table *InnerTable) (string, error) {
|
||||
|
||||
@@ -5,7 +5,7 @@ import (
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
sqltemplate "zero/tools/goctl/model/sql/template"
|
||||
sqltemplate "github.com/tal-tech/go-zero/tools/goctl/model/sql/template"
|
||||
)
|
||||
|
||||
func genVars(table *InnerTable) (string, error) {
|
||||
|
||||
@@ -3,7 +3,7 @@ package sqlgen
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"zero/tools/goctl/model/sql/gen"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/model/sql/gen"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -2,7 +2,7 @@ package sqltemplate
|
||||
|
||||
var Error = `package model
|
||||
|
||||
import "zero/core/stores/sqlx"
|
||||
import "github.com/tal-tech/go-zero/core/stores/sqlx"
|
||||
|
||||
var (
|
||||
ErrNotFound = sqlx.ErrNotFound
|
||||
|
||||
@@ -7,9 +7,9 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"zero/core/stores/cache"
|
||||
"zero/core/stores/sqlc"
|
||||
"zero/core/stores/sqlx"
|
||||
"zero/core/stringx"
|
||||
"github.com/tal-tech/go-zero/core/stores/cache"
|
||||
"github.com/tal-tech/go-zero/core/stores/sqlc"
|
||||
"github.com/tal-tech/go-zero/core/stores/sqlx"
|
||||
"github.com/tal-tech/go-zero/core/stringx"
|
||||
)
|
||||
`
|
||||
|
||||
@@ -3,7 +3,7 @@ package sqlmodel
|
||||
import (
|
||||
"go/format"
|
||||
|
||||
"zero/core/logx"
|
||||
"github.com/tal-tech/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type (
|
||||
|
||||
@@ -9,9 +9,9 @@ import (
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
"zero/core/stringx"
|
||||
"zero/tools/goctl/api/spec"
|
||||
"zero/tools/goctl/util"
|
||||
"github.com/tal-tech/go-zero/core/stringx"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/api/spec"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/util"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
"zero/core/stringx"
|
||||
"github.com/tal-tech/go-zero/core/stringx"
|
||||
)
|
||||
|
||||
var insertTemplate = `
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
util2 "zero/tools/modelctl/util"
|
||||
util2 "github.com/tal-tech/go-zero/tools/modelctl/util"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
"zero/core/stringx"
|
||||
"github.com/tal-tech/go-zero/core/stringx"
|
||||
)
|
||||
|
||||
var updateTemplate = `
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package config
|
||||
|
||||
import "zero/core/logx"
|
||||
import "github.com/tal-tech/go-zero/core/logx"
|
||||
|
||||
type Config struct {
|
||||
logx.LogConf
|
||||
|
||||
@@ -6,12 +6,12 @@ import (
|
||||
"net/http"
|
||||
"path"
|
||||
|
||||
"zero/core/conf"
|
||||
"zero/core/hash"
|
||||
"zero/core/lang"
|
||||
"zero/core/logx"
|
||||
"zero/tools/goctl/update/config"
|
||||
"zero/tools/goctl/util"
|
||||
"github.com/tal-tech/go-zero/core/conf"
|
||||
"github.com/tal-tech/go-zero/core/hash"
|
||||
"github.com/tal-tech/go-zero/core/lang"
|
||||
"github.com/tal-tech/go-zero/core/logx"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/update/config"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/util"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -13,8 +13,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/logrusorgru/aurora"
|
||||
|
||||
"zero/core/logx"
|
||||
"github.com/tal-tech/go-zero/core/logx"
|
||||
)
|
||||
|
||||
func CreateIfNotExist(file string) (*os.File, error) {
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"zero/tools/goctl/vars"
|
||||
"github.com/tal-tech/go-zero/tools/goctl/vars"
|
||||
)
|
||||
|
||||
func MkdirIfNotExist(dir string) error {
|
||||
|
||||
Reference in New Issue
Block a user