adjustment code

This commit is contained in:
zhuyasen
2024-03-09 15:14:31 +08:00
parent 289af43d7b
commit 87bae7eee4
198 changed files with 521 additions and 523 deletions

4
.github/RELEASE.md vendored
View File

@@ -1,4 +1,4 @@
## Change log ## Change log
- Fix `⓶ create grpc service based on sql`, selecting multiple tables to generate code reports **unsupported db driver error**. - Upgrade `go.opentelemetry.io/otel` and `golang.org/x/crypto` third-party libraries.
- The mongodb json tag supports both shake case and camel case naming. - Adjusting the order of import packages.

View File

@@ -21,7 +21,7 @@
If you are develop RESTful web service or microservice with a simple CRUD API interface, you don't need to write any Go code can be compiled and deployed to the linux server, docker, k8s, just need to connect to the database (mysql、mongodb、postgresql、tidb、sqlite) to generate a complete service code. If you are develop RESTful web service or microservice with a simple CRUD API interface, you don't need to write any Go code can be compiled and deployed to the linux server, docker, k8s, just need to connect to the database (mysql、mongodb、postgresql、tidb、sqlite) to generate a complete service code.
If you develop generic web or microservices, just focus on the three core parts of `define database tables`, `define api interfaces in proto files`, `fill in business logic code in the generated template files`, and the rest of the go code is automatically generated by sponge. If you develop generic web or microservices, just focus on the three core parts of `define tables in the database`, `define api interfaces in the proto files`, `fill in business logic code in the generated template files`, and the rest of the go code is automatically generated by sponge.
<br> <br>

View File

@@ -5,7 +5,7 @@
如果开发只有简单CRUD api接口的web或微服务不需要编写任何go代码就可以编译并部署到linux服务器、docker、k8s上只需要连接到数据库(mysql、mongodb、postgresql、tidb、sqlite)就可以一键自动生成完整的服务代码。 如果开发只有简单CRUD api接口的web或微服务不需要编写任何go代码就可以编译并部署到linux服务器、docker、k8s上只需要连接到数据库(mysql、mongodb、postgresql、tidb、sqlite)就可以一键自动生成完整的服务代码。
如果开发通用的web或微服务只需聚焦在`定义数据库表``在proto文件定义api接口``在生成的模板文件填写业务逻辑代码`三个核心部分其他go代码都由sponge自动生成。 如果开发通用的web或微服务只需聚焦在`数据库定义表``在proto文件定义api接口``在生成的模板文件填写业务逻辑代码`三个核心部分其他go代码都由sponge自动生成。
<br> <br>

View File

@@ -4,9 +4,9 @@ package handler
import ( import (
"bytes" "bytes"
"github.com/zhufuyi/sponge/cmd/protoc-gen-go-gin/internal/parse"
"google.golang.org/protobuf/compiler/protogen" "google.golang.org/protobuf/compiler/protogen"
"github.com/zhufuyi/sponge/cmd/protoc-gen-go-gin/internal/parse"
) )
// GenerateFiles generate handler logic, router, error code files. // GenerateFiles generate handler logic, router, error code files.

View File

@@ -5,10 +5,10 @@ import (
"bytes" "bytes"
"strings" "strings"
"github.com/zhufuyi/sponge/cmd/protoc-gen-go-gin/internal/parse"
"google.golang.org/protobuf/compiler/protogen" "google.golang.org/protobuf/compiler/protogen"
"google.golang.org/protobuf/types/descriptorpb" "google.golang.org/protobuf/types/descriptorpb"
"github.com/zhufuyi/sponge/cmd/protoc-gen-go-gin/internal/parse"
) )
const ( const (

View File

@@ -4,9 +4,9 @@ package service
import ( import (
"bytes" "bytes"
"github.com/zhufuyi/sponge/cmd/protoc-gen-go-gin/internal/parse"
"google.golang.org/protobuf/compiler/protogen" "google.golang.org/protobuf/compiler/protogen"
"github.com/zhufuyi/sponge/cmd/protoc-gen-go-gin/internal/parse"
) )
// GenerateFiles generate service logic, router, error code files. // GenerateFiles generate service logic, router, error code files.

View File

@@ -10,12 +10,12 @@ import (
"strings" "strings"
"time" "time"
"google.golang.org/protobuf/compiler/protogen"
"google.golang.org/protobuf/types/pluginpb"
"github.com/zhufuyi/sponge/cmd/protoc-gen-go-gin/internal/generate/handler" "github.com/zhufuyi/sponge/cmd/protoc-gen-go-gin/internal/generate/handler"
"github.com/zhufuyi/sponge/cmd/protoc-gen-go-gin/internal/generate/router" "github.com/zhufuyi/sponge/cmd/protoc-gen-go-gin/internal/generate/router"
"github.com/zhufuyi/sponge/cmd/protoc-gen-go-gin/internal/generate/service" "github.com/zhufuyi/sponge/cmd/protoc-gen-go-gin/internal/generate/service"
"google.golang.org/protobuf/compiler/protogen"
"google.golang.org/protobuf/types/pluginpb"
) )
const ( const (

View File

@@ -6,9 +6,9 @@ import (
"runtime" "runtime"
"strings" "strings"
"github.com/zhufuyi/sponge/cmd/protoc-gen-go-rpc-tmpl/internal/parse"
"google.golang.org/protobuf/compiler/protogen" "google.golang.org/protobuf/compiler/protogen"
"github.com/zhufuyi/sponge/cmd/protoc-gen-go-rpc-tmpl/internal/parse"
) )
// GenerateFiles generate service template code and error codes // GenerateFiles generate service template code and error codes

View File

@@ -10,10 +10,10 @@ import (
"strings" "strings"
"time" "time"
"github.com/zhufuyi/sponge/cmd/protoc-gen-go-rpc-tmpl/internal/generate/service"
"google.golang.org/protobuf/compiler/protogen" "google.golang.org/protobuf/compiler/protogen"
"google.golang.org/protobuf/types/pluginpb" "google.golang.org/protobuf/types/pluginpb"
"github.com/zhufuyi/sponge/cmd/protoc-gen-go-rpc-tmpl/internal/generate/service"
) )
const ( const (

View File

@@ -4,11 +4,11 @@ import (
"context" "context"
"time" "time"
"github.com/zhufuyi/sponge/internal/config"
"github.com/zhufuyi/sponge/internal/model"
"github.com/zhufuyi/sponge/pkg/app" "github.com/zhufuyi/sponge/pkg/app"
"github.com/zhufuyi/sponge/pkg/tracer" "github.com/zhufuyi/sponge/pkg/tracer"
"github.com/zhufuyi/sponge/internal/config"
"github.com/zhufuyi/sponge/internal/model"
) )
// Close releasing resources after service exit // Close releasing resources after service exit

View File

@@ -5,15 +5,15 @@ import (
"strconv" "strconv"
"time" "time"
"github.com/zhufuyi/sponge/internal/config"
"github.com/zhufuyi/sponge/internal/server"
"github.com/zhufuyi/sponge/pkg/app" "github.com/zhufuyi/sponge/pkg/app"
"github.com/zhufuyi/sponge/pkg/logger" "github.com/zhufuyi/sponge/pkg/logger"
"github.com/zhufuyi/sponge/pkg/servicerd/registry" "github.com/zhufuyi/sponge/pkg/servicerd/registry"
"github.com/zhufuyi/sponge/pkg/servicerd/registry/consul" "github.com/zhufuyi/sponge/pkg/servicerd/registry/consul"
"github.com/zhufuyi/sponge/pkg/servicerd/registry/etcd" "github.com/zhufuyi/sponge/pkg/servicerd/registry/etcd"
"github.com/zhufuyi/sponge/pkg/servicerd/registry/nacos" "github.com/zhufuyi/sponge/pkg/servicerd/registry/nacos"
"github.com/zhufuyi/sponge/internal/config"
"github.com/zhufuyi/sponge/internal/server"
) )
// CreateServices create grpc or http service // CreateServices create grpc or http service

View File

@@ -8,9 +8,7 @@ import (
"fmt" "fmt"
"strconv" "strconv"
"github.com/zhufuyi/sponge/configs" "github.com/jinzhu/copier"
"github.com/zhufuyi/sponge/internal/config"
"github.com/zhufuyi/sponge/internal/model"
"github.com/zhufuyi/sponge/pkg/conf" "github.com/zhufuyi/sponge/pkg/conf"
"github.com/zhufuyi/sponge/pkg/logger" "github.com/zhufuyi/sponge/pkg/logger"
@@ -18,7 +16,9 @@ import (
"github.com/zhufuyi/sponge/pkg/stat" "github.com/zhufuyi/sponge/pkg/stat"
"github.com/zhufuyi/sponge/pkg/tracer" "github.com/zhufuyi/sponge/pkg/tracer"
"github.com/jinzhu/copier" "github.com/zhufuyi/sponge/configs"
"github.com/zhufuyi/sponge/internal/config"
"github.com/zhufuyi/sponge/internal/model"
) )
var ( var (

View File

@@ -2,9 +2,9 @@
package main package main
import ( import (
"github.com/zhufuyi/sponge/cmd/serverNameExample_grpcExample/initial"
"github.com/zhufuyi/sponge/pkg/app" "github.com/zhufuyi/sponge/pkg/app"
"github.com/zhufuyi/sponge/cmd/serverNameExample_grpcExample/initial"
) )
func main() { func main() {

View File

@@ -4,11 +4,11 @@ import (
"context" "context"
"time" "time"
"github.com/zhufuyi/sponge/internal/config"
//"github.com/zhufuyi/sponge/internal/rpcclient"
"github.com/zhufuyi/sponge/pkg/app" "github.com/zhufuyi/sponge/pkg/app"
"github.com/zhufuyi/sponge/pkg/tracer" "github.com/zhufuyi/sponge/pkg/tracer"
"github.com/zhufuyi/sponge/internal/config"
//"github.com/zhufuyi/sponge/internal/rpcclient"
) )
// Close releasing resources after service exit // Close releasing resources after service exit

View File

@@ -5,15 +5,15 @@ import (
"strconv" "strconv"
"time" "time"
"github.com/zhufuyi/sponge/internal/config"
"github.com/zhufuyi/sponge/internal/server"
"github.com/zhufuyi/sponge/pkg/app" "github.com/zhufuyi/sponge/pkg/app"
"github.com/zhufuyi/sponge/pkg/logger" "github.com/zhufuyi/sponge/pkg/logger"
"github.com/zhufuyi/sponge/pkg/servicerd/registry" "github.com/zhufuyi/sponge/pkg/servicerd/registry"
"github.com/zhufuyi/sponge/pkg/servicerd/registry/consul" "github.com/zhufuyi/sponge/pkg/servicerd/registry/consul"
"github.com/zhufuyi/sponge/pkg/servicerd/registry/etcd" "github.com/zhufuyi/sponge/pkg/servicerd/registry/etcd"
"github.com/zhufuyi/sponge/pkg/servicerd/registry/nacos" "github.com/zhufuyi/sponge/pkg/servicerd/registry/nacos"
"github.com/zhufuyi/sponge/internal/config"
"github.com/zhufuyi/sponge/internal/server"
) )
// CreateServices create grpc or http service // CreateServices create grpc or http service

View File

@@ -8,10 +8,7 @@ import (
"fmt" "fmt"
"strconv" "strconv"
"github.com/zhufuyi/sponge/configs" "github.com/jinzhu/copier"
"github.com/zhufuyi/sponge/internal/config"
//"github.com/zhufuyi/sponge/internal/rpcclient"
"github.com/zhufuyi/sponge/pkg/conf" "github.com/zhufuyi/sponge/pkg/conf"
"github.com/zhufuyi/sponge/pkg/logger" "github.com/zhufuyi/sponge/pkg/logger"
@@ -19,7 +16,9 @@ import (
"github.com/zhufuyi/sponge/pkg/stat" "github.com/zhufuyi/sponge/pkg/stat"
"github.com/zhufuyi/sponge/pkg/tracer" "github.com/zhufuyi/sponge/pkg/tracer"
"github.com/jinzhu/copier" "github.com/zhufuyi/sponge/configs"
"github.com/zhufuyi/sponge/internal/config"
//"github.com/zhufuyi/sponge/internal/rpcclient"
) )
var ( var (

View File

@@ -2,9 +2,9 @@
package main package main
import ( import (
"github.com/zhufuyi/sponge/cmd/serverNameExample_grpcGwPbExample/initial"
"github.com/zhufuyi/sponge/pkg/app" "github.com/zhufuyi/sponge/pkg/app"
"github.com/zhufuyi/sponge/cmd/serverNameExample_grpcGwPbExample/initial"
) )
func main() { func main() {

View File

@@ -4,11 +4,11 @@ import (
"context" "context"
"time" "time"
"github.com/zhufuyi/sponge/internal/config"
//"github.com/zhufuyi/sponge/internal/model"
"github.com/zhufuyi/sponge/pkg/app" "github.com/zhufuyi/sponge/pkg/app"
"github.com/zhufuyi/sponge/pkg/tracer" "github.com/zhufuyi/sponge/pkg/tracer"
"github.com/zhufuyi/sponge/internal/config"
//"github.com/zhufuyi/sponge/internal/model"
) )
// Close releasing resources after service exit // Close releasing resources after service exit

View File

@@ -5,15 +5,15 @@ import (
"strconv" "strconv"
"time" "time"
"github.com/zhufuyi/sponge/internal/config"
"github.com/zhufuyi/sponge/internal/server"
"github.com/zhufuyi/sponge/pkg/app" "github.com/zhufuyi/sponge/pkg/app"
"github.com/zhufuyi/sponge/pkg/logger" "github.com/zhufuyi/sponge/pkg/logger"
"github.com/zhufuyi/sponge/pkg/servicerd/registry" "github.com/zhufuyi/sponge/pkg/servicerd/registry"
"github.com/zhufuyi/sponge/pkg/servicerd/registry/consul" "github.com/zhufuyi/sponge/pkg/servicerd/registry/consul"
"github.com/zhufuyi/sponge/pkg/servicerd/registry/etcd" "github.com/zhufuyi/sponge/pkg/servicerd/registry/etcd"
"github.com/zhufuyi/sponge/pkg/servicerd/registry/nacos" "github.com/zhufuyi/sponge/pkg/servicerd/registry/nacos"
"github.com/zhufuyi/sponge/internal/config"
"github.com/zhufuyi/sponge/internal/server"
) )
// CreateServices create grpc or http service // CreateServices create grpc or http service

View File

@@ -8,10 +8,7 @@ import (
"fmt" "fmt"
"strconv" "strconv"
"github.com/zhufuyi/sponge/configs" "github.com/jinzhu/copier"
"github.com/zhufuyi/sponge/internal/config"
//"github.com/zhufuyi/sponge/internal/model"
"github.com/zhufuyi/sponge/pkg/conf" "github.com/zhufuyi/sponge/pkg/conf"
"github.com/zhufuyi/sponge/pkg/logger" "github.com/zhufuyi/sponge/pkg/logger"
@@ -19,7 +16,9 @@ import (
"github.com/zhufuyi/sponge/pkg/stat" "github.com/zhufuyi/sponge/pkg/stat"
"github.com/zhufuyi/sponge/pkg/tracer" "github.com/zhufuyi/sponge/pkg/tracer"
"github.com/jinzhu/copier" "github.com/zhufuyi/sponge/configs"
"github.com/zhufuyi/sponge/internal/config"
//"github.com/zhufuyi/sponge/internal/model"
) )
var ( var (

View File

@@ -2,9 +2,9 @@
package main package main
import ( import (
"github.com/zhufuyi/sponge/cmd/serverNameExample_grpcPbExample/initial"
"github.com/zhufuyi/sponge/pkg/app" "github.com/zhufuyi/sponge/pkg/app"
"github.com/zhufuyi/sponge/cmd/serverNameExample_grpcPbExample/initial"
) )
func main() { func main() {

View File

@@ -4,11 +4,11 @@ import (
"context" "context"
"time" "time"
"github.com/zhufuyi/sponge/internal/config"
"github.com/zhufuyi/sponge/internal/model"
"github.com/zhufuyi/sponge/pkg/app" "github.com/zhufuyi/sponge/pkg/app"
"github.com/zhufuyi/sponge/pkg/tracer" "github.com/zhufuyi/sponge/pkg/tracer"
"github.com/zhufuyi/sponge/internal/config"
"github.com/zhufuyi/sponge/internal/model"
) )
// Close releasing resources after service exit // Close releasing resources after service exit

View File

@@ -5,15 +5,15 @@ import (
"strconv" "strconv"
"time" "time"
"github.com/zhufuyi/sponge/internal/config"
"github.com/zhufuyi/sponge/internal/server"
"github.com/zhufuyi/sponge/pkg/app" "github.com/zhufuyi/sponge/pkg/app"
"github.com/zhufuyi/sponge/pkg/logger" "github.com/zhufuyi/sponge/pkg/logger"
"github.com/zhufuyi/sponge/pkg/servicerd/registry" "github.com/zhufuyi/sponge/pkg/servicerd/registry"
"github.com/zhufuyi/sponge/pkg/servicerd/registry/consul" "github.com/zhufuyi/sponge/pkg/servicerd/registry/consul"
"github.com/zhufuyi/sponge/pkg/servicerd/registry/etcd" "github.com/zhufuyi/sponge/pkg/servicerd/registry/etcd"
"github.com/zhufuyi/sponge/pkg/servicerd/registry/nacos" "github.com/zhufuyi/sponge/pkg/servicerd/registry/nacos"
"github.com/zhufuyi/sponge/internal/config"
"github.com/zhufuyi/sponge/internal/server"
) )
// CreateServices create grpc or http service // CreateServices create grpc or http service

View File

@@ -8,9 +8,7 @@ import (
"fmt" "fmt"
"strconv" "strconv"
"github.com/zhufuyi/sponge/configs" "github.com/jinzhu/copier"
"github.com/zhufuyi/sponge/internal/config"
"github.com/zhufuyi/sponge/internal/model"
"github.com/zhufuyi/sponge/pkg/conf" "github.com/zhufuyi/sponge/pkg/conf"
"github.com/zhufuyi/sponge/pkg/logger" "github.com/zhufuyi/sponge/pkg/logger"
@@ -18,7 +16,9 @@ import (
"github.com/zhufuyi/sponge/pkg/stat" "github.com/zhufuyi/sponge/pkg/stat"
"github.com/zhufuyi/sponge/pkg/tracer" "github.com/zhufuyi/sponge/pkg/tracer"
"github.com/jinzhu/copier" "github.com/zhufuyi/sponge/configs"
"github.com/zhufuyi/sponge/internal/config"
"github.com/zhufuyi/sponge/internal/model"
) )
var ( var (

View File

@@ -2,9 +2,9 @@
package main package main
import ( import (
"github.com/zhufuyi/sponge/cmd/serverNameExample_httpExample/initial"
"github.com/zhufuyi/sponge/pkg/app" "github.com/zhufuyi/sponge/pkg/app"
"github.com/zhufuyi/sponge/cmd/serverNameExample_httpExample/initial"
) )
// @title serverNameExample api docs // @title serverNameExample api docs

View File

@@ -4,11 +4,11 @@ import (
"context" "context"
"time" "time"
"github.com/zhufuyi/sponge/internal/config"
//"github.com/zhufuyi/sponge/internal/model"
"github.com/zhufuyi/sponge/pkg/app" "github.com/zhufuyi/sponge/pkg/app"
"github.com/zhufuyi/sponge/pkg/tracer" "github.com/zhufuyi/sponge/pkg/tracer"
"github.com/zhufuyi/sponge/internal/config"
//"github.com/zhufuyi/sponge/internal/model"
) )
// Close releasing resources after service exit // Close releasing resources after service exit

View File

@@ -5,15 +5,15 @@ import (
"strconv" "strconv"
"time" "time"
"github.com/zhufuyi/sponge/internal/config"
"github.com/zhufuyi/sponge/internal/server"
"github.com/zhufuyi/sponge/pkg/app" "github.com/zhufuyi/sponge/pkg/app"
"github.com/zhufuyi/sponge/pkg/logger" "github.com/zhufuyi/sponge/pkg/logger"
"github.com/zhufuyi/sponge/pkg/servicerd/registry" "github.com/zhufuyi/sponge/pkg/servicerd/registry"
"github.com/zhufuyi/sponge/pkg/servicerd/registry/consul" "github.com/zhufuyi/sponge/pkg/servicerd/registry/consul"
"github.com/zhufuyi/sponge/pkg/servicerd/registry/etcd" "github.com/zhufuyi/sponge/pkg/servicerd/registry/etcd"
"github.com/zhufuyi/sponge/pkg/servicerd/registry/nacos" "github.com/zhufuyi/sponge/pkg/servicerd/registry/nacos"
"github.com/zhufuyi/sponge/internal/config"
"github.com/zhufuyi/sponge/internal/server"
) )
// CreateServices create grpc or http service // CreateServices create grpc or http service

View File

@@ -8,10 +8,7 @@ import (
"fmt" "fmt"
"strconv" "strconv"
"github.com/zhufuyi/sponge/configs" "github.com/jinzhu/copier"
"github.com/zhufuyi/sponge/internal/config"
//"github.com/zhufuyi/sponge/internal/model"
"github.com/zhufuyi/sponge/pkg/conf" "github.com/zhufuyi/sponge/pkg/conf"
"github.com/zhufuyi/sponge/pkg/logger" "github.com/zhufuyi/sponge/pkg/logger"
@@ -19,7 +16,9 @@ import (
"github.com/zhufuyi/sponge/pkg/stat" "github.com/zhufuyi/sponge/pkg/stat"
"github.com/zhufuyi/sponge/pkg/tracer" "github.com/zhufuyi/sponge/pkg/tracer"
"github.com/jinzhu/copier" "github.com/zhufuyi/sponge/configs"
"github.com/zhufuyi/sponge/internal/config"
//"github.com/zhufuyi/sponge/internal/model"
) )
var ( var (

View File

@@ -2,9 +2,9 @@
package main package main
import ( import (
"github.com/zhufuyi/sponge/cmd/serverNameExample_httpPbExample/initial"
"github.com/zhufuyi/sponge/pkg/app" "github.com/zhufuyi/sponge/pkg/app"
"github.com/zhufuyi/sponge/cmd/serverNameExample_httpPbExample/initial"
) )
func main() { func main() {

View File

@@ -4,11 +4,11 @@ import (
"context" "context"
"time" "time"
"github.com/zhufuyi/sponge/internal/config"
"github.com/zhufuyi/sponge/internal/model"
"github.com/zhufuyi/sponge/pkg/app" "github.com/zhufuyi/sponge/pkg/app"
"github.com/zhufuyi/sponge/pkg/tracer" "github.com/zhufuyi/sponge/pkg/tracer"
"github.com/zhufuyi/sponge/internal/config"
"github.com/zhufuyi/sponge/internal/model"
) )
// Close releasing resources after service exit // Close releasing resources after service exit

View File

@@ -5,15 +5,15 @@ import (
"strconv" "strconv"
"time" "time"
"github.com/zhufuyi/sponge/internal/config"
"github.com/zhufuyi/sponge/internal/server"
"github.com/zhufuyi/sponge/pkg/app" "github.com/zhufuyi/sponge/pkg/app"
"github.com/zhufuyi/sponge/pkg/logger" "github.com/zhufuyi/sponge/pkg/logger"
"github.com/zhufuyi/sponge/pkg/servicerd/registry" "github.com/zhufuyi/sponge/pkg/servicerd/registry"
"github.com/zhufuyi/sponge/pkg/servicerd/registry/consul" "github.com/zhufuyi/sponge/pkg/servicerd/registry/consul"
"github.com/zhufuyi/sponge/pkg/servicerd/registry/etcd" "github.com/zhufuyi/sponge/pkg/servicerd/registry/etcd"
"github.com/zhufuyi/sponge/pkg/servicerd/registry/nacos" "github.com/zhufuyi/sponge/pkg/servicerd/registry/nacos"
"github.com/zhufuyi/sponge/internal/config"
"github.com/zhufuyi/sponge/internal/server"
) )
// CreateServices create grpc or http service // CreateServices create grpc or http service

View File

@@ -8,9 +8,7 @@ import (
"fmt" "fmt"
"strconv" "strconv"
"github.com/zhufuyi/sponge/configs" "github.com/jinzhu/copier"
"github.com/zhufuyi/sponge/internal/config"
"github.com/zhufuyi/sponge/internal/model"
"github.com/zhufuyi/sponge/pkg/conf" "github.com/zhufuyi/sponge/pkg/conf"
"github.com/zhufuyi/sponge/pkg/logger" "github.com/zhufuyi/sponge/pkg/logger"
@@ -18,7 +16,9 @@ import (
"github.com/zhufuyi/sponge/pkg/stat" "github.com/zhufuyi/sponge/pkg/stat"
"github.com/zhufuyi/sponge/pkg/tracer" "github.com/zhufuyi/sponge/pkg/tracer"
"github.com/jinzhu/copier" "github.com/zhufuyi/sponge/configs"
"github.com/zhufuyi/sponge/internal/config"
"github.com/zhufuyi/sponge/internal/model"
) )
var ( var (

View File

@@ -2,9 +2,9 @@
package main package main
import ( import (
"github.com/zhufuyi/sponge/cmd/serverNameExample_mixExample/initial"
"github.com/zhufuyi/sponge/pkg/app" "github.com/zhufuyi/sponge/pkg/app"
"github.com/zhufuyi/sponge/cmd/serverNameExample_mixExample/initial"
) )
// @title serverNameExample api docs // @title serverNameExample api docs

View File

@@ -4,9 +4,9 @@ import (
"errors" "errors"
"fmt" "fmt"
"github.com/zhufuyi/sponge/pkg/replacer"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/zhufuyi/sponge/pkg/replacer"
) )
// CacheCommand generate cache code // CacheCommand generate cache code

View File

@@ -11,10 +11,10 @@ import (
"regexp" "regexp"
"strings" "strings"
"github.com/huandu/xstrings"
"github.com/zhufuyi/sponge/pkg/gofile" "github.com/zhufuyi/sponge/pkg/gofile"
"github.com/zhufuyi/sponge/pkg/replacer" "github.com/zhufuyi/sponge/pkg/replacer"
"github.com/huandu/xstrings"
) )
const ( const (

View File

@@ -8,10 +8,10 @@ import (
"strings" "strings"
"time" "time"
"github.com/spf13/cobra"
"github.com/zhufuyi/sponge/pkg/gofile" "github.com/zhufuyi/sponge/pkg/gofile"
"github.com/zhufuyi/sponge/pkg/jy2struct" "github.com/zhufuyi/sponge/pkg/jy2struct"
"github.com/spf13/cobra"
) )
// ConfigCommand convert yaml to struct command // ConfigCommand convert yaml to struct command

View File

@@ -4,10 +4,10 @@ import (
"errors" "errors"
"fmt" "fmt"
"github.com/zhufuyi/sponge/pkg/replacer"
"github.com/huandu/xstrings" "github.com/huandu/xstrings"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/zhufuyi/sponge/pkg/replacer"
) )
// ConfigmapCommand generate k8s configmap command // ConfigmapCommand generate k8s configmap command

View File

@@ -5,11 +5,11 @@ import (
"fmt" "fmt"
"strings" "strings"
"github.com/spf13/cobra"
"github.com/zhufuyi/sponge/pkg/replacer" "github.com/zhufuyi/sponge/pkg/replacer"
"github.com/zhufuyi/sponge/pkg/sql2code" "github.com/zhufuyi/sponge/pkg/sql2code"
"github.com/zhufuyi/sponge/pkg/sql2code/parser" "github.com/zhufuyi/sponge/pkg/sql2code/parser"
"github.com/spf13/cobra"
) )
// DaoCommand generate dao code // DaoCommand generate dao code

View File

@@ -6,12 +6,12 @@ import (
"math/rand" "math/rand"
"strings" "strings"
"github.com/spf13/cobra"
"github.com/zhufuyi/sponge/pkg/gofile" "github.com/zhufuyi/sponge/pkg/gofile"
"github.com/zhufuyi/sponge/pkg/replacer" "github.com/zhufuyi/sponge/pkg/replacer"
"github.com/zhufuyi/sponge/pkg/sql2code" "github.com/zhufuyi/sponge/pkg/sql2code"
"github.com/zhufuyi/sponge/pkg/sql2code/parser" "github.com/zhufuyi/sponge/pkg/sql2code/parser"
"github.com/spf13/cobra"
) )
// HandlerPbCommand generate handler and protobuf code // HandlerPbCommand generate handler and protobuf code

View File

@@ -6,11 +6,11 @@ import (
"math/rand" "math/rand"
"strings" "strings"
"github.com/spf13/cobra"
"github.com/zhufuyi/sponge/pkg/replacer" "github.com/zhufuyi/sponge/pkg/replacer"
"github.com/zhufuyi/sponge/pkg/sql2code" "github.com/zhufuyi/sponge/pkg/sql2code"
"github.com/zhufuyi/sponge/pkg/sql2code/parser" "github.com/zhufuyi/sponge/pkg/sql2code/parser"
"github.com/spf13/cobra"
) )
// HandlerCommand generate handler code // HandlerCommand generate handler code

View File

@@ -4,10 +4,10 @@ import (
"errors" "errors"
"fmt" "fmt"
"github.com/zhufuyi/sponge/pkg/replacer"
"github.com/huandu/xstrings" "github.com/huandu/xstrings"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/zhufuyi/sponge/pkg/replacer"
) )
// HTTPPbCommand generate web service code based on protobuf file // HTTPPbCommand generate web service code based on protobuf file

View File

@@ -6,12 +6,12 @@ import (
"math/rand" "math/rand"
"strings" "strings"
"github.com/huandu/xstrings"
"github.com/spf13/cobra"
"github.com/zhufuyi/sponge/pkg/replacer" "github.com/zhufuyi/sponge/pkg/replacer"
"github.com/zhufuyi/sponge/pkg/sql2code" "github.com/zhufuyi/sponge/pkg/sql2code"
"github.com/zhufuyi/sponge/pkg/sql2code/parser" "github.com/zhufuyi/sponge/pkg/sql2code/parser"
"github.com/huandu/xstrings"
"github.com/spf13/cobra"
) )
// HTTPCommand generate web service code // HTTPCommand generate web service code

View File

@@ -5,11 +5,11 @@ import (
"fmt" "fmt"
"strings" "strings"
"github.com/spf13/cobra"
"github.com/zhufuyi/sponge/pkg/replacer" "github.com/zhufuyi/sponge/pkg/replacer"
"github.com/zhufuyi/sponge/pkg/sql2code" "github.com/zhufuyi/sponge/pkg/sql2code"
"github.com/zhufuyi/sponge/pkg/sql2code/parser" "github.com/zhufuyi/sponge/pkg/sql2code/parser"
"github.com/spf13/cobra"
) )
// ModelCommand generate model code // ModelCommand generate model code

View File

@@ -5,12 +5,12 @@ import (
"fmt" "fmt"
"strings" "strings"
"github.com/spf13/cobra"
"github.com/zhufuyi/sponge/pkg/gofile" "github.com/zhufuyi/sponge/pkg/gofile"
"github.com/zhufuyi/sponge/pkg/replacer" "github.com/zhufuyi/sponge/pkg/replacer"
"github.com/zhufuyi/sponge/pkg/sql2code" "github.com/zhufuyi/sponge/pkg/sql2code"
"github.com/zhufuyi/sponge/pkg/sql2code/parser" "github.com/zhufuyi/sponge/pkg/sql2code/parser"
"github.com/spf13/cobra"
) )
// ProtobufCommand generate protobuf code // ProtobufCommand generate protobuf code

View File

@@ -5,9 +5,9 @@ import (
"fmt" "fmt"
"strings" "strings"
"github.com/zhufuyi/sponge/pkg/replacer"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/zhufuyi/sponge/pkg/replacer"
) )
// GRPCConnectionCommand generate grpc connection code // GRPCConnectionCommand generate grpc connection code

View File

@@ -4,10 +4,10 @@ import (
"errors" "errors"
"fmt" "fmt"
"github.com/zhufuyi/sponge/pkg/replacer"
"github.com/huandu/xstrings" "github.com/huandu/xstrings"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/zhufuyi/sponge/pkg/replacer"
) )
// RPCGwPbCommand generate grpc gateway service code base on protobuf file // RPCGwPbCommand generate grpc gateway service code base on protobuf file

View File

@@ -4,10 +4,10 @@ import (
"errors" "errors"
"fmt" "fmt"
"github.com/zhufuyi/sponge/pkg/replacer"
"github.com/huandu/xstrings" "github.com/huandu/xstrings"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/zhufuyi/sponge/pkg/replacer"
) )
// RPCPbCommand generate grpc service code bash on protobuf file // RPCPbCommand generate grpc service code bash on protobuf file

View File

@@ -6,13 +6,13 @@ import (
"math/rand" "math/rand"
"strings" "strings"
"github.com/huandu/xstrings"
"github.com/spf13/cobra"
"github.com/zhufuyi/sponge/pkg/gofile" "github.com/zhufuyi/sponge/pkg/gofile"
"github.com/zhufuyi/sponge/pkg/replacer" "github.com/zhufuyi/sponge/pkg/replacer"
"github.com/zhufuyi/sponge/pkg/sql2code" "github.com/zhufuyi/sponge/pkg/sql2code"
"github.com/zhufuyi/sponge/pkg/sql2code/parser" "github.com/zhufuyi/sponge/pkg/sql2code/parser"
"github.com/huandu/xstrings"
"github.com/spf13/cobra"
) )
// RPCCommand generate grpc service code // RPCCommand generate grpc service code

View File

@@ -6,12 +6,12 @@ import (
"math/rand" "math/rand"
"strings" "strings"
"github.com/spf13/cobra"
"github.com/zhufuyi/sponge/pkg/gofile" "github.com/zhufuyi/sponge/pkg/gofile"
"github.com/zhufuyi/sponge/pkg/replacer" "github.com/zhufuyi/sponge/pkg/replacer"
"github.com/zhufuyi/sponge/pkg/sql2code" "github.com/zhufuyi/sponge/pkg/sql2code"
"github.com/zhufuyi/sponge/pkg/sql2code/parser" "github.com/zhufuyi/sponge/pkg/sql2code/parser"
"github.com/spf13/cobra"
) )
// ServiceCommand generate service code // ServiceCommand generate service code

View File

@@ -8,9 +8,9 @@ import (
"os" "os"
"strings" "strings"
"github.com/zhufuyi/sponge/pkg/gofile"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/zhufuyi/sponge/pkg/gofile"
) )
// ConvertSwagJSONCommand convert 64-bit fields type string to integer // ConvertSwagJSONCommand convert 64-bit fields type string to integer

View File

@@ -1,9 +1,9 @@
package commands package commands
import ( import (
"github.com/zhufuyi/sponge/cmd/sponge/commands/merge"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/zhufuyi/sponge/cmd/sponge/commands/merge"
) )
// MergeCommand merge the generated code // MergeCommand merge the generated code

View File

@@ -1,9 +1,9 @@
package commands package commands
import ( import (
"github.com/zhufuyi/sponge/cmd/sponge/commands/generate"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/zhufuyi/sponge/cmd/sponge/commands/generate"
) )
// GenMicroCommand generate micro service code // GenMicroCommand generate micro service code

View File

@@ -1,9 +1,9 @@
package commands package commands
import ( import (
"github.com/zhufuyi/sponge/cmd/sponge/commands/patch"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/zhufuyi/sponge/cmd/sponge/commands/patch"
) )
// PatchCommand patch server code // PatchCommand patch server code

View File

@@ -11,10 +11,10 @@ import (
"strings" "strings"
"time" "time"
"github.com/spf13/cobra"
"github.com/zhufuyi/sponge/pkg/gobash" "github.com/zhufuyi/sponge/pkg/gobash"
"github.com/zhufuyi/sponge/pkg/gofile" "github.com/zhufuyi/sponge/pkg/gofile"
"github.com/spf13/cobra"
) )
var copyCount = 0 var copyCount = 0

View File

@@ -5,9 +5,9 @@ import (
"fmt" "fmt"
"os" "os"
"github.com/zhufuyi/sponge/pkg/gofile"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/zhufuyi/sponge/pkg/gofile"
) )
// DeleteJSONOmitemptyCommand delete json omitempty // DeleteJSONOmitemptyCommand delete json omitempty

View File

@@ -5,11 +5,11 @@ import (
"fmt" "fmt"
"strings" "strings"
"github.com/spf13/cobra"
"github.com/zhufuyi/sponge/cmd/sponge/commands/generate" "github.com/zhufuyi/sponge/cmd/sponge/commands/generate"
"github.com/zhufuyi/sponge/pkg/gofile" "github.com/zhufuyi/sponge/pkg/gofile"
"github.com/zhufuyi/sponge/pkg/replacer" "github.com/zhufuyi/sponge/pkg/replacer"
"github.com/spf13/cobra"
) )
// GenerateDBInitCommand generate database initialization code // GenerateDBInitCommand generate database initialization code

View File

@@ -5,11 +5,11 @@ import (
"fmt" "fmt"
"strings" "strings"
"github.com/spf13/cobra"
"github.com/zhufuyi/sponge/cmd/sponge/commands/generate" "github.com/zhufuyi/sponge/cmd/sponge/commands/generate"
"github.com/zhufuyi/sponge/pkg/gofile" "github.com/zhufuyi/sponge/pkg/gofile"
"github.com/zhufuyi/sponge/pkg/replacer" "github.com/zhufuyi/sponge/pkg/replacer"
"github.com/spf13/cobra"
) )
// GenMysqlInitCommand generate mysql initialization code // GenMysqlInitCommand generate mysql initialization code

View File

@@ -5,11 +5,11 @@ import (
"fmt" "fmt"
"strings" "strings"
"github.com/spf13/cobra"
"github.com/zhufuyi/sponge/cmd/sponge/commands/generate" "github.com/zhufuyi/sponge/cmd/sponge/commands/generate"
"github.com/zhufuyi/sponge/pkg/gofile" "github.com/zhufuyi/sponge/pkg/gofile"
"github.com/zhufuyi/sponge/pkg/replacer" "github.com/zhufuyi/sponge/pkg/replacer"
"github.com/spf13/cobra"
) )
// GenTypesPbCommand generate types.proto code // GenTypesPbCommand generate types.proto code

View File

@@ -10,10 +10,10 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/spf13/cobra"
"github.com/zhufuyi/sponge/pkg/gofile" "github.com/zhufuyi/sponge/pkg/gofile"
"github.com/zhufuyi/sponge/pkg/krand" "github.com/zhufuyi/sponge/pkg/krand"
"github.com/spf13/cobra"
) )
const ( const (

View File

@@ -8,9 +8,9 @@ import (
"sync" "sync"
"time" "time"
"github.com/zhufuyi/sponge/pkg/gobash"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/zhufuyi/sponge/pkg/gobash"
) )
var pluginNames = []string{ var pluginNames = []string{
@@ -31,7 +31,7 @@ var pluginNames = []string{
var installPluginCommands = map[string]string{ var installPluginCommands = map[string]string{
"go": "go: please install manually yourself, download url is https://go.dev/dl/ or https://golang.google.cn/dl/", "go": "go: please install manually yourself, download url is https://go.dev/dl/ or https://golang.google.cn/dl/",
"protoc": "protoc: please install manually yourself, download url is https://github.com/protocolbuffers/protobuf/releases/tag/v3.20.3", "protoc": "protoc: please install manually yourself, download url is https://github.com/protocolbuffers/protobuf/releases/tag/v25.2",
"protoc-gen-go": "google.golang.org/protobuf/cmd/protoc-gen-go@latest", "protoc-gen-go": "google.golang.org/protobuf/cmd/protoc-gen-go@latest",
"protoc-gen-go-grpc": "google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest", "protoc-gen-go-grpc": "google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest",
"protoc-gen-validate": "github.com/envoyproxy/protoc-gen-validate@latest", "protoc-gen-validate": "github.com/envoyproxy/protoc-gen-validate@latest",

View File

@@ -5,9 +5,9 @@ import (
"fmt" "fmt"
"os" "os"
"github.com/zhufuyi/sponge/cmd/sponge/commands/generate"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/zhufuyi/sponge/cmd/sponge/commands/generate"
) )
var ( var (

View File

@@ -9,9 +9,9 @@ import (
"runtime" "runtime"
"strconv" "strconv"
"github.com/zhufuyi/sponge/cmd/sponge/server"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/zhufuyi/sponge/cmd/sponge/server"
) )
// OpenUICommand open the sponge UI interface // OpenUICommand open the sponge UI interface

View File

@@ -8,11 +8,11 @@ import (
"strings" "strings"
"time" "time"
"github.com/spf13/cobra"
"github.com/zhufuyi/sponge/pkg/gobash" "github.com/zhufuyi/sponge/pkg/gobash"
"github.com/zhufuyi/sponge/pkg/gofile" "github.com/zhufuyi/sponge/pkg/gofile"
"github.com/zhufuyi/sponge/pkg/utils" "github.com/zhufuyi/sponge/pkg/utils"
"github.com/spf13/cobra"
) )
// UpgradeCommand upgrade sponge binaries // UpgradeCommand upgrade sponge binaries

View File

@@ -1,9 +1,9 @@
package commands package commands
import ( import (
"github.com/zhufuyi/sponge/cmd/sponge/commands/generate"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/zhufuyi/sponge/cmd/sponge/commands/generate"
) )
// GenWebCommand generate web server code // GenWebCommand generate web server code

View File

@@ -8,9 +8,10 @@ import (
"fmt" "fmt"
"os" "os"
"github.com/zhufuyi/sponge/pkg/gofile"
"github.com/zhufuyi/sponge/cmd/sponge/commands" "github.com/zhufuyi/sponge/cmd/sponge/commands"
"github.com/zhufuyi/sponge/cmd/sponge/commands/generate" "github.com/zhufuyi/sponge/cmd/sponge/commands/generate"
"github.com/zhufuyi/sponge/pkg/gofile"
) )
func main() { func main() {

View File

@@ -13,6 +13,9 @@ import (
"strings" "strings"
"time" "time"
"github.com/gin-gonic/gin"
"go.mongodb.org/mongo-driver/bson"
"github.com/zhufuyi/sponge/pkg/errcode" "github.com/zhufuyi/sponge/pkg/errcode"
"github.com/zhufuyi/sponge/pkg/ggorm" "github.com/zhufuyi/sponge/pkg/ggorm"
"github.com/zhufuyi/sponge/pkg/gin/response" "github.com/zhufuyi/sponge/pkg/gin/response"
@@ -21,9 +24,6 @@ import (
"github.com/zhufuyi/sponge/pkg/krand" "github.com/zhufuyi/sponge/pkg/krand"
"github.com/zhufuyi/sponge/pkg/mgo" "github.com/zhufuyi/sponge/pkg/mgo"
"github.com/zhufuyi/sponge/pkg/utils" "github.com/zhufuyi/sponge/pkg/utils"
"github.com/gin-gonic/gin"
"go.mongodb.org/mongo-driver/bson"
) )
var ( var (

View File

@@ -11,13 +11,13 @@ import (
"path/filepath" "path/filepath"
"time" "time"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding"
"github.com/zhufuyi/sponge/pkg/gin/handlerfunc" "github.com/zhufuyi/sponge/pkg/gin/handlerfunc"
"github.com/zhufuyi/sponge/pkg/gin/middleware" "github.com/zhufuyi/sponge/pkg/gin/middleware"
"github.com/zhufuyi/sponge/pkg/gin/validator" "github.com/zhufuyi/sponge/pkg/gin/validator"
"github.com/zhufuyi/sponge/pkg/logger" "github.com/zhufuyi/sponge/pkg/logger"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding"
) )
//go:embed static //go:embed static

View File

@@ -85,7 +85,7 @@ logger:
# delete the templates code start # delete the templates code start
# database setting # database setting
database: database:
driver: "mysql" # database driver, currently support mysql, postgres, tidb, sqlite driver: "mysql" # database driver, currently support mysql, postgresql, tidb, sqlite
# mysql settings # mysql settings
mysql: mysql:
# dsn format, <username>:<password>@(<hostname>:<port>)/<db>?[k=v& ......] # dsn format, <username>:<password>@(<hostname>:<port>)/<db>?[k=v& ......]

View File

@@ -6,10 +6,10 @@ import (
"strings" "strings"
"time" "time"
"github.com/zhufuyi/sponge/internal/model"
"github.com/zhufuyi/sponge/pkg/cache" "github.com/zhufuyi/sponge/pkg/cache"
"github.com/zhufuyi/sponge/pkg/encoding" "github.com/zhufuyi/sponge/pkg/encoding"
"github.com/zhufuyi/sponge/internal/model"
) )
// delete the templates code start // delete the templates code start

View File

@@ -4,12 +4,12 @@ import (
"testing" "testing"
"time" "time"
"github.com/zhufuyi/sponge/internal/model" "github.com/stretchr/testify/assert"
"github.com/zhufuyi/sponge/pkg/gotest" "github.com/zhufuyi/sponge/pkg/gotest"
"github.com/zhufuyi/sponge/pkg/utils" "github.com/zhufuyi/sponge/pkg/utils"
"github.com/stretchr/testify/assert" "github.com/zhufuyi/sponge/internal/model"
) )
type cacheNameExampleData struct { type cacheNameExampleData struct {

View File

@@ -5,11 +5,11 @@ import (
"strings" "strings"
"time" "time"
"github.com/zhufuyi/sponge/internal/model"
"github.com/zhufuyi/sponge/pkg/cache" "github.com/zhufuyi/sponge/pkg/cache"
"github.com/zhufuyi/sponge/pkg/encoding" "github.com/zhufuyi/sponge/pkg/encoding"
"github.com/zhufuyi/sponge/pkg/utils" "github.com/zhufuyi/sponge/pkg/utils"
"github.com/zhufuyi/sponge/internal/model"
) )
const ( const (

View File

@@ -5,10 +5,10 @@ import (
"strings" "strings"
"time" "time"
"github.com/zhufuyi/sponge/internal/model"
"github.com/zhufuyi/sponge/pkg/cache" "github.com/zhufuyi/sponge/pkg/cache"
"github.com/zhufuyi/sponge/pkg/encoding" "github.com/zhufuyi/sponge/pkg/encoding"
"github.com/zhufuyi/sponge/internal/model"
) )
const ( const (

View File

@@ -4,12 +4,12 @@ import (
"testing" "testing"
"time" "time"
"github.com/zhufuyi/sponge/internal/model" "github.com/stretchr/testify/assert"
"github.com/zhufuyi/sponge/pkg/gotest" "github.com/zhufuyi/sponge/pkg/gotest"
"github.com/zhufuyi/sponge/pkg/utils" "github.com/zhufuyi/sponge/pkg/utils"
"github.com/stretchr/testify/assert" "github.com/zhufuyi/sponge/internal/model"
) )
func newUserExampleCache() *gotest.Cache { func newUserExampleCache() *gotest.Cache {

View File

@@ -6,18 +6,18 @@ import (
"fmt" "fmt"
"time" "time"
"github.com/zhufuyi/sponge/internal/cache"
"github.com/zhufuyi/sponge/internal/model"
cacheBase "github.com/zhufuyi/sponge/pkg/cache"
"github.com/zhufuyi/sponge/pkg/mgo"
"github.com/zhufuyi/sponge/pkg/mgo/query"
"go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive" "go.mongodb.org/mongo-driver/bson/primitive"
"go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options" "go.mongodb.org/mongo-driver/mongo/options"
"golang.org/x/sync/singleflight" "golang.org/x/sync/singleflight"
cacheBase "github.com/zhufuyi/sponge/pkg/cache"
"github.com/zhufuyi/sponge/pkg/mgo"
"github.com/zhufuyi/sponge/pkg/mgo/query"
"github.com/zhufuyi/sponge/internal/cache"
"github.com/zhufuyi/sponge/internal/model"
) )
var _ UserExampleDao = (*userExampleDao)(nil) var _ UserExampleDao = (*userExampleDao)(nil)

View File

@@ -5,16 +5,16 @@ import (
"testing" "testing"
"time" "time"
"github.com/zhufuyi/sponge/internal/cache" "github.com/DATA-DOG/go-sqlmock"
"github.com/zhufuyi/sponge/internal/model" "github.com/stretchr/testify/assert"
"gorm.io/gorm"
"github.com/zhufuyi/sponge/pkg/ggorm/query" "github.com/zhufuyi/sponge/pkg/ggorm/query"
"github.com/zhufuyi/sponge/pkg/gotest" "github.com/zhufuyi/sponge/pkg/gotest"
"github.com/zhufuyi/sponge/pkg/utils" "github.com/zhufuyi/sponge/pkg/utils"
"github.com/DATA-DOG/go-sqlmock" "github.com/zhufuyi/sponge/internal/cache"
"github.com/stretchr/testify/assert" "github.com/zhufuyi/sponge/internal/model"
"gorm.io/gorm"
) )
func newUserExampleDao() *gotest.Dao { func newUserExampleDao() *gotest.Dao {

View File

@@ -4,19 +4,19 @@ import (
"errors" "errors"
"math" "math"
"github.com/zhufuyi/sponge/internal/cache" "github.com/gin-gonic/gin"
"github.com/zhufuyi/sponge/internal/dao" "github.com/jinzhu/copier"
"github.com/zhufuyi/sponge/internal/ecode"
"github.com/zhufuyi/sponge/internal/model"
"github.com/zhufuyi/sponge/internal/types"
"github.com/zhufuyi/sponge/pkg/gin/middleware" "github.com/zhufuyi/sponge/pkg/gin/middleware"
"github.com/zhufuyi/sponge/pkg/gin/response" "github.com/zhufuyi/sponge/pkg/gin/response"
"github.com/zhufuyi/sponge/pkg/logger" "github.com/zhufuyi/sponge/pkg/logger"
"github.com/zhufuyi/sponge/pkg/utils" "github.com/zhufuyi/sponge/pkg/utils"
"github.com/gin-gonic/gin" "github.com/zhufuyi/sponge/internal/cache"
"github.com/jinzhu/copier" "github.com/zhufuyi/sponge/internal/dao"
"github.com/zhufuyi/sponge/internal/ecode"
"github.com/zhufuyi/sponge/internal/model"
"github.com/zhufuyi/sponge/internal/types"
) )
var _ UserExampleHandler = (*userExampleHandler)(nil) var _ UserExampleHandler = (*userExampleHandler)(nil)

View File

@@ -3,19 +3,19 @@ package handler
import ( import (
"errors" "errors"
"github.com/zhufuyi/sponge/internal/cache" "github.com/gin-gonic/gin"
"github.com/zhufuyi/sponge/internal/dao" "github.com/jinzhu/copier"
"github.com/zhufuyi/sponge/internal/ecode"
"github.com/zhufuyi/sponge/internal/model"
"github.com/zhufuyi/sponge/internal/types"
"github.com/zhufuyi/sponge/pkg/gin/middleware" "github.com/zhufuyi/sponge/pkg/gin/middleware"
"github.com/zhufuyi/sponge/pkg/gin/response" "github.com/zhufuyi/sponge/pkg/gin/response"
"github.com/zhufuyi/sponge/pkg/logger" "github.com/zhufuyi/sponge/pkg/logger"
"github.com/zhufuyi/sponge/pkg/utils" "github.com/zhufuyi/sponge/pkg/utils"
"github.com/gin-gonic/gin" "github.com/zhufuyi/sponge/internal/cache"
"github.com/jinzhu/copier" "github.com/zhufuyi/sponge/internal/dao"
"github.com/zhufuyi/sponge/internal/ecode"
"github.com/zhufuyi/sponge/internal/model"
"github.com/zhufuyi/sponge/internal/types"
) )
var _ UserExampleHandler = (*userExampleHandler)(nil) var _ UserExampleHandler = (*userExampleHandler)(nil)

View File

@@ -6,17 +6,17 @@ import (
"math" "math"
"strings" "strings"
serverNameExampleV1 "github.com/zhufuyi/sponge/api/serverNameExample/v1" "github.com/jinzhu/copier"
"github.com/zhufuyi/sponge/internal/cache"
"github.com/zhufuyi/sponge/internal/dao"
"github.com/zhufuyi/sponge/internal/ecode"
"github.com/zhufuyi/sponge/internal/model"
"github.com/zhufuyi/sponge/pkg/ggorm/query" "github.com/zhufuyi/sponge/pkg/ggorm/query"
"github.com/zhufuyi/sponge/pkg/gin/middleware" "github.com/zhufuyi/sponge/pkg/gin/middleware"
"github.com/zhufuyi/sponge/pkg/logger" "github.com/zhufuyi/sponge/pkg/logger"
"github.com/jinzhu/copier" serverNameExampleV1 "github.com/zhufuyi/sponge/api/serverNameExample/v1"
"github.com/zhufuyi/sponge/internal/cache"
"github.com/zhufuyi/sponge/internal/dao"
"github.com/zhufuyi/sponge/internal/ecode"
"github.com/zhufuyi/sponge/internal/model"
) )
var _ serverNameExampleV1.UserExampleLogicer = (*userExamplePbHandler)(nil) var _ serverNameExampleV1.UserExampleLogicer = (*userExamplePbHandler)(nil)

View File

@@ -5,17 +5,17 @@ import (
"errors" "errors"
"strings" "strings"
serverNameExampleV1 "github.com/zhufuyi/sponge/api/serverNameExample/v1" "github.com/jinzhu/copier"
"github.com/zhufuyi/sponge/internal/cache"
"github.com/zhufuyi/sponge/internal/dao"
"github.com/zhufuyi/sponge/internal/ecode"
"github.com/zhufuyi/sponge/internal/model"
"github.com/zhufuyi/sponge/pkg/gin/middleware" "github.com/zhufuyi/sponge/pkg/gin/middleware"
"github.com/zhufuyi/sponge/pkg/logger" "github.com/zhufuyi/sponge/pkg/logger"
"github.com/zhufuyi/sponge/pkg/mgo/query" "github.com/zhufuyi/sponge/pkg/mgo/query"
"github.com/jinzhu/copier" serverNameExampleV1 "github.com/zhufuyi/sponge/api/serverNameExample/v1"
"github.com/zhufuyi/sponge/internal/cache"
"github.com/zhufuyi/sponge/internal/dao"
"github.com/zhufuyi/sponge/internal/ecode"
"github.com/zhufuyi/sponge/internal/model"
) )
var _ serverNameExampleV1.UserExampleLogicer = (*userExamplePbHandler)(nil) var _ serverNameExampleV1.UserExampleLogicer = (*userExamplePbHandler)(nil)

View File

@@ -5,22 +5,22 @@ import (
"testing" "testing"
"time" "time"
serverNameExampleV1 "github.com/zhufuyi/sponge/api/serverNameExample/v1" "github.com/DATA-DOG/go-sqlmock"
"github.com/zhufuyi/sponge/internal/cache" "github.com/gin-gonic/gin"
"github.com/zhufuyi/sponge/internal/dao" "github.com/jinzhu/copier"
"github.com/zhufuyi/sponge/internal/ecode" "github.com/stretchr/testify/assert"
"github.com/zhufuyi/sponge/internal/model" "github.com/zhufuyi/sponge/api/types"
"github.com/zhufuyi/sponge/pkg/gin/response" "github.com/zhufuyi/sponge/pkg/gin/response"
"github.com/zhufuyi/sponge/pkg/gohttp" "github.com/zhufuyi/sponge/pkg/gohttp"
"github.com/zhufuyi/sponge/pkg/gotest" "github.com/zhufuyi/sponge/pkg/gotest"
"github.com/zhufuyi/sponge/pkg/utils" "github.com/zhufuyi/sponge/pkg/utils"
"github.com/DATA-DOG/go-sqlmock" serverNameExampleV1 "github.com/zhufuyi/sponge/api/serverNameExample/v1"
"github.com/gin-gonic/gin" "github.com/zhufuyi/sponge/internal/cache"
"github.com/jinzhu/copier" "github.com/zhufuyi/sponge/internal/dao"
"github.com/stretchr/testify/assert" "github.com/zhufuyi/sponge/internal/ecode"
"github.com/zhufuyi/sponge/api/types" "github.com/zhufuyi/sponge/internal/model"
) )
func newUserExamplePbHandler() *gotest.Handler { func newUserExamplePbHandler() *gotest.Handler {

View File

@@ -5,19 +5,19 @@ import (
"testing" "testing"
"time" "time"
"github.com/zhufuyi/sponge/internal/cache" "github.com/DATA-DOG/go-sqlmock"
"github.com/zhufuyi/sponge/internal/dao" "github.com/jinzhu/copier"
"github.com/zhufuyi/sponge/internal/model" "github.com/stretchr/testify/assert"
"github.com/zhufuyi/sponge/internal/types"
"github.com/zhufuyi/sponge/pkg/ggorm/query" "github.com/zhufuyi/sponge/pkg/ggorm/query"
"github.com/zhufuyi/sponge/pkg/gohttp" "github.com/zhufuyi/sponge/pkg/gohttp"
"github.com/zhufuyi/sponge/pkg/gotest" "github.com/zhufuyi/sponge/pkg/gotest"
"github.com/zhufuyi/sponge/pkg/utils" "github.com/zhufuyi/sponge/pkg/utils"
"github.com/DATA-DOG/go-sqlmock" "github.com/zhufuyi/sponge/internal/cache"
"github.com/jinzhu/copier" "github.com/zhufuyi/sponge/internal/dao"
"github.com/stretchr/testify/assert" "github.com/zhufuyi/sponge/internal/model"
"github.com/zhufuyi/sponge/internal/types"
) )
func newUserExampleHandler() *gotest.Handler { func newUserExampleHandler() *gotest.Handler {

View File

@@ -6,15 +6,15 @@ import (
"sync" "sync"
"time" "time"
"github.com/zhufuyi/sponge/internal/config" "github.com/go-redis/redis/v8"
"gorm.io/gorm"
"github.com/zhufuyi/sponge/pkg/ggorm" "github.com/zhufuyi/sponge/pkg/ggorm"
"github.com/zhufuyi/sponge/pkg/goredis" "github.com/zhufuyi/sponge/pkg/goredis"
"github.com/zhufuyi/sponge/pkg/logger" "github.com/zhufuyi/sponge/pkg/logger"
"github.com/zhufuyi/sponge/pkg/utils" "github.com/zhufuyi/sponge/pkg/utils"
"github.com/go-redis/redis/v8" "github.com/zhufuyi/sponge/internal/config"
"gorm.io/gorm"
) )
var ( var (

View File

@@ -5,15 +5,15 @@ import (
"sync" "sync"
"time" "time"
"github.com/zhufuyi/sponge/internal/config" "github.com/go-redis/redis/v8"
"go.mongodb.org/mongo-driver/bson/primitive"
"go.mongodb.org/mongo-driver/mongo"
"github.com/zhufuyi/sponge/pkg/goredis" "github.com/zhufuyi/sponge/pkg/goredis"
"github.com/zhufuyi/sponge/pkg/mgo" "github.com/zhufuyi/sponge/pkg/mgo"
"github.com/zhufuyi/sponge/pkg/utils" "github.com/zhufuyi/sponge/pkg/utils"
"github.com/go-redis/redis/v8" "github.com/zhufuyi/sponge/internal/config"
"go.mongodb.org/mongo-driver/bson/primitive"
"go.mongodb.org/mongo-driver/mongo"
) )
// MaxObjectID max object id // MaxObjectID max object id

View File

@@ -5,12 +5,12 @@ import (
"testing" "testing"
"time" "time"
"github.com/stretchr/testify/assert"
"gorm.io/gorm"
"github.com/zhufuyi/sponge/configs" "github.com/zhufuyi/sponge/configs"
"github.com/zhufuyi/sponge/internal/config" "github.com/zhufuyi/sponge/internal/config"
"github.com/zhufuyi/sponge/pkg/utils" "github.com/zhufuyi/sponge/pkg/utils"
"github.com/stretchr/testify/assert"
"gorm.io/gorm"
) )
func TestGetDB(t *testing.T) { func TestGetDB(t *testing.T) {

View File

@@ -5,8 +5,10 @@ package routers
import ( import (
"net/http" "net/http"
"github.com/zhufuyi/sponge/docs" "github.com/gin-gonic/gin"
"github.com/zhufuyi/sponge/internal/config" "github.com/gin-gonic/gin/binding"
swaggerFiles "github.com/swaggo/files"
ginSwagger "github.com/swaggo/gin-swagger"
"github.com/zhufuyi/sponge/pkg/errcode" "github.com/zhufuyi/sponge/pkg/errcode"
"github.com/zhufuyi/sponge/pkg/gin/handlerfunc" "github.com/zhufuyi/sponge/pkg/gin/handlerfunc"
@@ -17,10 +19,8 @@ import (
"github.com/zhufuyi/sponge/pkg/jwt" "github.com/zhufuyi/sponge/pkg/jwt"
"github.com/zhufuyi/sponge/pkg/logger" "github.com/zhufuyi/sponge/pkg/logger"
"github.com/gin-gonic/gin" "github.com/zhufuyi/sponge/docs"
"github.com/gin-gonic/gin/binding" "github.com/zhufuyi/sponge/internal/config"
swaggerFiles "github.com/swaggo/files"
ginSwagger "github.com/swaggo/gin-swagger"
) )
var ( var (

View File

@@ -4,8 +4,8 @@ import (
"net/http" "net/http"
"strings" "strings"
"github.com/zhufuyi/sponge/docs" "github.com/gin-gonic/gin"
"github.com/zhufuyi/sponge/internal/config" "github.com/gin-gonic/gin/binding"
"github.com/zhufuyi/sponge/pkg/errcode" "github.com/zhufuyi/sponge/pkg/errcode"
"github.com/zhufuyi/sponge/pkg/gin/handlerfunc" "github.com/zhufuyi/sponge/pkg/gin/handlerfunc"
@@ -17,8 +17,8 @@ import (
"github.com/zhufuyi/sponge/pkg/jwt" "github.com/zhufuyi/sponge/pkg/jwt"
"github.com/zhufuyi/sponge/pkg/logger" "github.com/zhufuyi/sponge/pkg/logger"
"github.com/gin-gonic/gin" "github.com/zhufuyi/sponge/docs"
"github.com/gin-gonic/gin/binding" "github.com/zhufuyi/sponge/internal/config"
) )
type routeFns = []func(r *gin.Engine, groupPathMiddlewares map[string][]gin.HandlerFunc, singlePathMiddlewares map[string][]gin.HandlerFunc) type routeFns = []func(r *gin.Engine, groupPathMiddlewares map[string][]gin.HandlerFunc, singlePathMiddlewares map[string][]gin.HandlerFunc)

View File

@@ -5,15 +5,15 @@ import (
"testing" "testing"
"time" "time"
serverNameExampleV1 "github.com/zhufuyi/sponge/api/serverNameExample/v1" "github.com/gin-gonic/gin"
"github.com/zhufuyi/sponge/configs" "github.com/stretchr/testify/assert"
"github.com/zhufuyi/sponge/internal/config"
"github.com/zhufuyi/sponge/pkg/gin/middleware" "github.com/zhufuyi/sponge/pkg/gin/middleware"
"github.com/zhufuyi/sponge/pkg/utils" "github.com/zhufuyi/sponge/pkg/utils"
"github.com/gin-gonic/gin" serverNameExampleV1 "github.com/zhufuyi/sponge/api/serverNameExample/v1"
"github.com/stretchr/testify/assert" "github.com/zhufuyi/sponge/configs"
"github.com/zhufuyi/sponge/internal/config"
) )
func TestNewRouter_pbExample(t *testing.T) { func TestNewRouter_pbExample(t *testing.T) {

View File

@@ -5,13 +5,13 @@ import (
"testing" "testing"
"time" "time"
"github.com/zhufuyi/sponge/configs" "github.com/gin-gonic/gin"
"github.com/zhufuyi/sponge/internal/config" "github.com/stretchr/testify/assert"
"github.com/zhufuyi/sponge/pkg/utils" "github.com/zhufuyi/sponge/pkg/utils"
"github.com/gin-gonic/gin" "github.com/zhufuyi/sponge/configs"
"github.com/stretchr/testify/assert" "github.com/zhufuyi/sponge/internal/config"
) )
func TestNewRouter(t *testing.T) { func TestNewRouter(t *testing.T) {

View File

@@ -1,9 +1,9 @@
package routers package routers
import ( import (
"github.com/zhufuyi/sponge/internal/handler"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/zhufuyi/sponge/internal/handler"
) )
func init() { func init() {

View File

@@ -3,14 +3,14 @@ package routers
import ( import (
"context" "context"
serverNameExampleV1 "github.com/zhufuyi/sponge/api/serverNameExample/v1" "github.com/gin-gonic/gin"
"github.com/zhufuyi/sponge/internal/service" "google.golang.org/grpc/metadata"
"github.com/zhufuyi/sponge/pkg/gin/middleware" "github.com/zhufuyi/sponge/pkg/gin/middleware"
"github.com/zhufuyi/sponge/pkg/logger" "github.com/zhufuyi/sponge/pkg/logger"
"github.com/gin-gonic/gin" serverNameExampleV1 "github.com/zhufuyi/sponge/api/serverNameExample/v1"
"google.golang.org/grpc/metadata" "github.com/zhufuyi/sponge/internal/service"
) )
func init() { func init() {

View File

@@ -7,7 +7,7 @@ import (
"sync" "sync"
"time" "time"
"github.com/zhufuyi/sponge/internal/config" "google.golang.org/grpc"
"github.com/zhufuyi/sponge/pkg/consulcli" "github.com/zhufuyi/sponge/pkg/consulcli"
"github.com/zhufuyi/sponge/pkg/etcdcli" "github.com/zhufuyi/sponge/pkg/etcdcli"
@@ -18,7 +18,7 @@ import (
"github.com/zhufuyi/sponge/pkg/servicerd/registry/etcd" "github.com/zhufuyi/sponge/pkg/servicerd/registry/etcd"
"github.com/zhufuyi/sponge/pkg/servicerd/registry/nacos" "github.com/zhufuyi/sponge/pkg/servicerd/registry/nacos"
"google.golang.org/grpc" "github.com/zhufuyi/sponge/internal/config"
) )
var ( var (

View File

@@ -5,12 +5,12 @@ import (
"testing" "testing"
"time" "time"
"github.com/zhufuyi/sponge/configs" "github.com/stretchr/testify/assert"
"github.com/zhufuyi/sponge/internal/config"
"github.com/zhufuyi/sponge/pkg/utils" "github.com/zhufuyi/sponge/pkg/utils"
"github.com/stretchr/testify/assert" "github.com/zhufuyi/sponge/configs"
"github.com/zhufuyi/sponge/internal/config"
) )
func TestNewServerNameExampleRPCConn(t *testing.T) { func TestNewServerNameExampleRPCConn(t *testing.T) {

View File

@@ -8,9 +8,10 @@ import (
"net/http" "net/http"
"time" "time"
"github.com/zhufuyi/sponge/internal/config" grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
"github.com/zhufuyi/sponge/internal/ecode" "google.golang.org/grpc"
"github.com/zhufuyi/sponge/internal/service" "google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"github.com/zhufuyi/sponge/pkg/app" "github.com/zhufuyi/sponge/pkg/app"
"github.com/zhufuyi/sponge/pkg/errcode" "github.com/zhufuyi/sponge/pkg/errcode"
@@ -21,10 +22,9 @@ import (
"github.com/zhufuyi/sponge/pkg/prof" "github.com/zhufuyi/sponge/pkg/prof"
"github.com/zhufuyi/sponge/pkg/servicerd/registry" "github.com/zhufuyi/sponge/pkg/servicerd/registry"
grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware" "github.com/zhufuyi/sponge/internal/config"
"google.golang.org/grpc" "github.com/zhufuyi/sponge/internal/ecode"
"google.golang.org/grpc/codes" "github.com/zhufuyi/sponge/internal/service"
"google.golang.org/grpc/status"
) )
var _ app.IServer = (*grpcServer)(nil) var _ app.IServer = (*grpcServer)(nil)

View File

@@ -7,15 +7,15 @@ import (
"testing" "testing"
"time" "time"
"github.com/zhufuyi/sponge/configs" "github.com/stretchr/testify/assert"
"github.com/zhufuyi/sponge/internal/config" "google.golang.org/grpc"
"github.com/zhufuyi/sponge/pkg/grpc/gtls/certfile" "github.com/zhufuyi/sponge/pkg/grpc/gtls/certfile"
"github.com/zhufuyi/sponge/pkg/servicerd/registry" "github.com/zhufuyi/sponge/pkg/servicerd/registry"
"github.com/zhufuyi/sponge/pkg/utils" "github.com/zhufuyi/sponge/pkg/utils"
"github.com/stretchr/testify/assert" "github.com/zhufuyi/sponge/configs"
"google.golang.org/grpc" "github.com/zhufuyi/sponge/internal/config"
) )
func TestGRPCServer(t *testing.T) { func TestGRPCServer(t *testing.T) {

View File

@@ -6,12 +6,12 @@ import (
"net/http" "net/http"
"time" "time"
"github.com/zhufuyi/sponge/internal/routers" "github.com/gin-gonic/gin"
"github.com/zhufuyi/sponge/pkg/app" "github.com/zhufuyi/sponge/pkg/app"
"github.com/zhufuyi/sponge/pkg/servicerd/registry" "github.com/zhufuyi/sponge/pkg/servicerd/registry"
"github.com/gin-gonic/gin" "github.com/zhufuyi/sponge/internal/routers"
) )
var _ app.IServer = (*httpServer)(nil) var _ app.IServer = (*httpServer)(nil)
@@ -59,7 +59,7 @@ func (s *httpServer) String() string {
return "http service address " + s.addr return "http service address " + s.addr
} }
// NewHTTPServer creates a new web server // NewHTTPServer creates a new http server
func NewHTTPServer(addr string, opts ...HTTPOption) app.IServer { func NewHTTPServer(addr string, opts ...HTTPOption) app.IServer {
o := defaultHTTPOptions() o := defaultHTTPOptions()
o.apply(opts...) o.apply(opts...)

View File

@@ -7,14 +7,14 @@ import (
"testing" "testing"
"time" "time"
"github.com/zhufuyi/sponge/configs" "github.com/gin-gonic/gin"
"github.com/zhufuyi/sponge/internal/config" "github.com/stretchr/testify/assert"
"github.com/zhufuyi/sponge/pkg/servicerd/registry" "github.com/zhufuyi/sponge/pkg/servicerd/registry"
"github.com/zhufuyi/sponge/pkg/utils" "github.com/zhufuyi/sponge/pkg/utils"
"github.com/gin-gonic/gin" "github.com/zhufuyi/sponge/configs"
"github.com/stretchr/testify/assert" "github.com/zhufuyi/sponge/internal/config"
) )
// need real database to test // need real database to test

View File

@@ -6,8 +6,7 @@ import (
"testing" "testing"
"time" "time"
"github.com/zhufuyi/sponge/configs" "google.golang.org/grpc"
"github.com/zhufuyi/sponge/internal/config"
"github.com/zhufuyi/sponge/pkg/consulcli" "github.com/zhufuyi/sponge/pkg/consulcli"
"github.com/zhufuyi/sponge/pkg/etcdcli" "github.com/zhufuyi/sponge/pkg/etcdcli"
@@ -20,7 +19,8 @@ import (
"github.com/zhufuyi/sponge/pkg/servicerd/registry/nacos" "github.com/zhufuyi/sponge/pkg/servicerd/registry/nacos"
"github.com/zhufuyi/sponge/pkg/utils" "github.com/zhufuyi/sponge/pkg/utils"
"google.golang.org/grpc" "github.com/zhufuyi/sponge/configs"
"github.com/zhufuyi/sponge/internal/config"
) )
func TestRegisterAllService(t *testing.T) { func TestRegisterAllService(t *testing.T) {

View File

@@ -6,18 +6,18 @@ import (
"math" "math"
"strings" "strings"
serverNameExampleV1 "github.com/zhufuyi/sponge/api/serverNameExample/v1" "github.com/jinzhu/copier"
"github.com/zhufuyi/sponge/internal/cache" "google.golang.org/grpc"
"github.com/zhufuyi/sponge/internal/dao"
"github.com/zhufuyi/sponge/internal/ecode"
"github.com/zhufuyi/sponge/internal/model"
"github.com/zhufuyi/sponge/pkg/ggorm/query" "github.com/zhufuyi/sponge/pkg/ggorm/query"
"github.com/zhufuyi/sponge/pkg/grpc/interceptor" "github.com/zhufuyi/sponge/pkg/grpc/interceptor"
"github.com/zhufuyi/sponge/pkg/logger" "github.com/zhufuyi/sponge/pkg/logger"
"github.com/jinzhu/copier" serverNameExampleV1 "github.com/zhufuyi/sponge/api/serverNameExample/v1"
"google.golang.org/grpc" "github.com/zhufuyi/sponge/internal/cache"
"github.com/zhufuyi/sponge/internal/dao"
"github.com/zhufuyi/sponge/internal/ecode"
"github.com/zhufuyi/sponge/internal/model"
) )
func init() { func init() {

View File

@@ -5,18 +5,18 @@ import (
"errors" "errors"
"strings" "strings"
serverNameExampleV1 "github.com/zhufuyi/sponge/api/serverNameExample/v1" "github.com/jinzhu/copier"
"github.com/zhufuyi/sponge/internal/cache" "google.golang.org/grpc"
"github.com/zhufuyi/sponge/internal/dao"
"github.com/zhufuyi/sponge/internal/ecode"
"github.com/zhufuyi/sponge/internal/model"
"github.com/zhufuyi/sponge/pkg/grpc/interceptor" "github.com/zhufuyi/sponge/pkg/grpc/interceptor"
"github.com/zhufuyi/sponge/pkg/logger" "github.com/zhufuyi/sponge/pkg/logger"
"github.com/zhufuyi/sponge/pkg/mgo/query" "github.com/zhufuyi/sponge/pkg/mgo/query"
"github.com/jinzhu/copier" serverNameExampleV1 "github.com/zhufuyi/sponge/api/serverNameExample/v1"
"google.golang.org/grpc" "github.com/zhufuyi/sponge/internal/cache"
"github.com/zhufuyi/sponge/internal/dao"
"github.com/zhufuyi/sponge/internal/ecode"
"github.com/zhufuyi/sponge/internal/model"
) )
func init() { func init() {

View File

@@ -7,12 +7,12 @@ import (
"testing" "testing"
"time" "time"
"github.com/zhufuyi/sponge/pkg/grpc/benchmark"
serverNameExampleV1 "github.com/zhufuyi/sponge/api/serverNameExample/v1" serverNameExampleV1 "github.com/zhufuyi/sponge/api/serverNameExample/v1"
"github.com/zhufuyi/sponge/api/types" "github.com/zhufuyi/sponge/api/types"
"github.com/zhufuyi/sponge/configs" "github.com/zhufuyi/sponge/configs"
"github.com/zhufuyi/sponge/internal/config" "github.com/zhufuyi/sponge/internal/config"
"github.com/zhufuyi/sponge/pkg/grpc/benchmark"
) )
// Test each method of userExample via the rpc client // Test each method of userExample via the rpc client

Some files were not shown because too many files have changed in this diff Show More