mirror of
https://github.com/zhufuyi/sponge.git
synced 2025-10-05 08:46:57 +08:00
adjustment code
This commit is contained in:
4
.github/RELEASE.md
vendored
4
.github/RELEASE.md
vendored
@@ -1,4 +1,4 @@
|
||||
## Change log
|
||||
|
||||
- Fix `⓶ create grpc service based on sql`, selecting multiple tables to generate code reports **unsupported db driver error**.
|
||||
- The mongodb json tag supports both shake case and camel case naming.
|
||||
- Upgrade `go.opentelemetry.io/otel` and `golang.org/x/crypto` third-party libraries.
|
||||
- Adjusting the order of import packages.
|
||||
|
@@ -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 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>
|
||||
|
||||
|
@@ -5,7 +5,7 @@
|
||||
|
||||
如果开发只有简单CRUD api接口的web或微服务,不需要编写任何go代码就可以编译并部署到linux服务器、docker、k8s上,只需要连接到数据库(mysql、mongodb、postgresql、tidb、sqlite)就可以一键自动生成完整的服务代码。
|
||||
|
||||
如果开发通用的web或微服务,只需聚焦在`定义数据库表`、`在proto文件定义api接口`、`在生成的模板文件填写业务逻辑代码`三个核心部分,其他go代码都由sponge自动生成。
|
||||
如果开发通用的web或微服务,只需聚焦在`在数据库定义表`、`在proto文件定义api接口`、`在生成的模板文件填写业务逻辑代码`三个核心部分,其他go代码都由sponge自动生成。
|
||||
|
||||
<br>
|
||||
|
||||
|
@@ -4,9 +4,9 @@ package handler
|
||||
import (
|
||||
"bytes"
|
||||
|
||||
"github.com/zhufuyi/sponge/cmd/protoc-gen-go-gin/internal/parse"
|
||||
|
||||
"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.
|
||||
|
@@ -5,10 +5,10 @@ import (
|
||||
"bytes"
|
||||
"strings"
|
||||
|
||||
"github.com/zhufuyi/sponge/cmd/protoc-gen-go-gin/internal/parse"
|
||||
|
||||
"google.golang.org/protobuf/compiler/protogen"
|
||||
"google.golang.org/protobuf/types/descriptorpb"
|
||||
|
||||
"github.com/zhufuyi/sponge/cmd/protoc-gen-go-gin/internal/parse"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@@ -4,9 +4,9 @@ package service
|
||||
import (
|
||||
"bytes"
|
||||
|
||||
"github.com/zhufuyi/sponge/cmd/protoc-gen-go-gin/internal/parse"
|
||||
|
||||
"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.
|
||||
|
@@ -10,12 +10,12 @@ import (
|
||||
"strings"
|
||||
"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/router"
|
||||
"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 (
|
||||
|
@@ -6,9 +6,9 @@ import (
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
"github.com/zhufuyi/sponge/cmd/protoc-gen-go-rpc-tmpl/internal/parse"
|
||||
|
||||
"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
|
||||
|
@@ -10,10 +10,10 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/zhufuyi/sponge/cmd/protoc-gen-go-rpc-tmpl/internal/generate/service"
|
||||
|
||||
"google.golang.org/protobuf/compiler/protogen"
|
||||
"google.golang.org/protobuf/types/pluginpb"
|
||||
|
||||
"github.com/zhufuyi/sponge/cmd/protoc-gen-go-rpc-tmpl/internal/generate/service"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@@ -4,11 +4,11 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
"github.com/zhufuyi/sponge/internal/model"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/app"
|
||||
"github.com/zhufuyi/sponge/pkg/tracer"
|
||||
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
"github.com/zhufuyi/sponge/internal/model"
|
||||
)
|
||||
|
||||
// Close releasing resources after service exit
|
||||
|
@@ -5,15 +5,15 @@ import (
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
"github.com/zhufuyi/sponge/internal/server"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/app"
|
||||
"github.com/zhufuyi/sponge/pkg/logger"
|
||||
"github.com/zhufuyi/sponge/pkg/servicerd/registry"
|
||||
"github.com/zhufuyi/sponge/pkg/servicerd/registry/consul"
|
||||
"github.com/zhufuyi/sponge/pkg/servicerd/registry/etcd"
|
||||
"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
|
||||
|
@@ -8,9 +8,7 @@ import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"github.com/zhufuyi/sponge/configs"
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
"github.com/zhufuyi/sponge/internal/model"
|
||||
"github.com/jinzhu/copier"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/conf"
|
||||
"github.com/zhufuyi/sponge/pkg/logger"
|
||||
@@ -18,7 +16,9 @@ import (
|
||||
"github.com/zhufuyi/sponge/pkg/stat"
|
||||
"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 (
|
||||
|
@@ -2,9 +2,9 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/zhufuyi/sponge/cmd/serverNameExample_grpcExample/initial"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/app"
|
||||
|
||||
"github.com/zhufuyi/sponge/cmd/serverNameExample_grpcExample/initial"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@@ -4,11 +4,11 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
//"github.com/zhufuyi/sponge/internal/rpcclient"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/app"
|
||||
"github.com/zhufuyi/sponge/pkg/tracer"
|
||||
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
//"github.com/zhufuyi/sponge/internal/rpcclient"
|
||||
)
|
||||
|
||||
// Close releasing resources after service exit
|
||||
|
@@ -5,15 +5,15 @@ import (
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
"github.com/zhufuyi/sponge/internal/server"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/app"
|
||||
"github.com/zhufuyi/sponge/pkg/logger"
|
||||
"github.com/zhufuyi/sponge/pkg/servicerd/registry"
|
||||
"github.com/zhufuyi/sponge/pkg/servicerd/registry/consul"
|
||||
"github.com/zhufuyi/sponge/pkg/servicerd/registry/etcd"
|
||||
"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
|
||||
|
@@ -8,10 +8,7 @@ import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"github.com/zhufuyi/sponge/configs"
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
|
||||
//"github.com/zhufuyi/sponge/internal/rpcclient"
|
||||
"github.com/jinzhu/copier"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/conf"
|
||||
"github.com/zhufuyi/sponge/pkg/logger"
|
||||
@@ -19,7 +16,9 @@ import (
|
||||
"github.com/zhufuyi/sponge/pkg/stat"
|
||||
"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 (
|
||||
|
@@ -2,9 +2,9 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/zhufuyi/sponge/cmd/serverNameExample_grpcGwPbExample/initial"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/app"
|
||||
|
||||
"github.com/zhufuyi/sponge/cmd/serverNameExample_grpcGwPbExample/initial"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@@ -4,11 +4,11 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
//"github.com/zhufuyi/sponge/internal/model"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/app"
|
||||
"github.com/zhufuyi/sponge/pkg/tracer"
|
||||
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
//"github.com/zhufuyi/sponge/internal/model"
|
||||
)
|
||||
|
||||
// Close releasing resources after service exit
|
||||
|
@@ -5,15 +5,15 @@ import (
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
"github.com/zhufuyi/sponge/internal/server"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/app"
|
||||
"github.com/zhufuyi/sponge/pkg/logger"
|
||||
"github.com/zhufuyi/sponge/pkg/servicerd/registry"
|
||||
"github.com/zhufuyi/sponge/pkg/servicerd/registry/consul"
|
||||
"github.com/zhufuyi/sponge/pkg/servicerd/registry/etcd"
|
||||
"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
|
||||
|
@@ -8,10 +8,7 @@ import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"github.com/zhufuyi/sponge/configs"
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
|
||||
//"github.com/zhufuyi/sponge/internal/model"
|
||||
"github.com/jinzhu/copier"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/conf"
|
||||
"github.com/zhufuyi/sponge/pkg/logger"
|
||||
@@ -19,7 +16,9 @@ import (
|
||||
"github.com/zhufuyi/sponge/pkg/stat"
|
||||
"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 (
|
||||
|
@@ -2,9 +2,9 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/zhufuyi/sponge/cmd/serverNameExample_grpcPbExample/initial"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/app"
|
||||
|
||||
"github.com/zhufuyi/sponge/cmd/serverNameExample_grpcPbExample/initial"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@@ -4,11 +4,11 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
"github.com/zhufuyi/sponge/internal/model"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/app"
|
||||
"github.com/zhufuyi/sponge/pkg/tracer"
|
||||
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
"github.com/zhufuyi/sponge/internal/model"
|
||||
)
|
||||
|
||||
// Close releasing resources after service exit
|
||||
|
@@ -5,15 +5,15 @@ import (
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
"github.com/zhufuyi/sponge/internal/server"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/app"
|
||||
"github.com/zhufuyi/sponge/pkg/logger"
|
||||
"github.com/zhufuyi/sponge/pkg/servicerd/registry"
|
||||
"github.com/zhufuyi/sponge/pkg/servicerd/registry/consul"
|
||||
"github.com/zhufuyi/sponge/pkg/servicerd/registry/etcd"
|
||||
"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
|
||||
|
@@ -8,9 +8,7 @@ import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"github.com/zhufuyi/sponge/configs"
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
"github.com/zhufuyi/sponge/internal/model"
|
||||
"github.com/jinzhu/copier"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/conf"
|
||||
"github.com/zhufuyi/sponge/pkg/logger"
|
||||
@@ -18,7 +16,9 @@ import (
|
||||
"github.com/zhufuyi/sponge/pkg/stat"
|
||||
"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 (
|
||||
|
@@ -2,9 +2,9 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/zhufuyi/sponge/cmd/serverNameExample_httpExample/initial"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/app"
|
||||
|
||||
"github.com/zhufuyi/sponge/cmd/serverNameExample_httpExample/initial"
|
||||
)
|
||||
|
||||
// @title serverNameExample api docs
|
||||
|
@@ -4,11 +4,11 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
//"github.com/zhufuyi/sponge/internal/model"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/app"
|
||||
"github.com/zhufuyi/sponge/pkg/tracer"
|
||||
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
//"github.com/zhufuyi/sponge/internal/model"
|
||||
)
|
||||
|
||||
// Close releasing resources after service exit
|
||||
|
@@ -5,15 +5,15 @@ import (
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
"github.com/zhufuyi/sponge/internal/server"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/app"
|
||||
"github.com/zhufuyi/sponge/pkg/logger"
|
||||
"github.com/zhufuyi/sponge/pkg/servicerd/registry"
|
||||
"github.com/zhufuyi/sponge/pkg/servicerd/registry/consul"
|
||||
"github.com/zhufuyi/sponge/pkg/servicerd/registry/etcd"
|
||||
"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
|
||||
|
@@ -8,10 +8,7 @@ import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"github.com/zhufuyi/sponge/configs"
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
|
||||
//"github.com/zhufuyi/sponge/internal/model"
|
||||
"github.com/jinzhu/copier"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/conf"
|
||||
"github.com/zhufuyi/sponge/pkg/logger"
|
||||
@@ -19,7 +16,9 @@ import (
|
||||
"github.com/zhufuyi/sponge/pkg/stat"
|
||||
"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 (
|
||||
|
@@ -2,9 +2,9 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/zhufuyi/sponge/cmd/serverNameExample_httpPbExample/initial"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/app"
|
||||
|
||||
"github.com/zhufuyi/sponge/cmd/serverNameExample_httpPbExample/initial"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@@ -4,11 +4,11 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
"github.com/zhufuyi/sponge/internal/model"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/app"
|
||||
"github.com/zhufuyi/sponge/pkg/tracer"
|
||||
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
"github.com/zhufuyi/sponge/internal/model"
|
||||
)
|
||||
|
||||
// Close releasing resources after service exit
|
||||
|
@@ -5,15 +5,15 @@ import (
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
"github.com/zhufuyi/sponge/internal/server"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/app"
|
||||
"github.com/zhufuyi/sponge/pkg/logger"
|
||||
"github.com/zhufuyi/sponge/pkg/servicerd/registry"
|
||||
"github.com/zhufuyi/sponge/pkg/servicerd/registry/consul"
|
||||
"github.com/zhufuyi/sponge/pkg/servicerd/registry/etcd"
|
||||
"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
|
||||
|
@@ -8,9 +8,7 @@ import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"github.com/zhufuyi/sponge/configs"
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
"github.com/zhufuyi/sponge/internal/model"
|
||||
"github.com/jinzhu/copier"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/conf"
|
||||
"github.com/zhufuyi/sponge/pkg/logger"
|
||||
@@ -18,7 +16,9 @@ import (
|
||||
"github.com/zhufuyi/sponge/pkg/stat"
|
||||
"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 (
|
||||
|
@@ -2,9 +2,9 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/zhufuyi/sponge/cmd/serverNameExample_mixExample/initial"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/app"
|
||||
|
||||
"github.com/zhufuyi/sponge/cmd/serverNameExample_mixExample/initial"
|
||||
)
|
||||
|
||||
// @title serverNameExample api docs
|
||||
|
@@ -4,9 +4,9 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/replacer"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/replacer"
|
||||
)
|
||||
|
||||
// CacheCommand generate cache code
|
||||
|
@@ -11,10 +11,10 @@ import (
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"github.com/huandu/xstrings"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/gofile"
|
||||
"github.com/zhufuyi/sponge/pkg/replacer"
|
||||
|
||||
"github.com/huandu/xstrings"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@@ -8,10 +8,10 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/gofile"
|
||||
"github.com/zhufuyi/sponge/pkg/jy2struct"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
// ConfigCommand convert yaml to struct command
|
||||
|
@@ -4,10 +4,10 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/replacer"
|
||||
|
||||
"github.com/huandu/xstrings"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/replacer"
|
||||
)
|
||||
|
||||
// ConfigmapCommand generate k8s configmap command
|
||||
|
@@ -5,11 +5,11 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/replacer"
|
||||
"github.com/zhufuyi/sponge/pkg/sql2code"
|
||||
"github.com/zhufuyi/sponge/pkg/sql2code/parser"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
// DaoCommand generate dao code
|
||||
|
@@ -6,12 +6,12 @@ import (
|
||||
"math/rand"
|
||||
"strings"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/gofile"
|
||||
"github.com/zhufuyi/sponge/pkg/replacer"
|
||||
"github.com/zhufuyi/sponge/pkg/sql2code"
|
||||
"github.com/zhufuyi/sponge/pkg/sql2code/parser"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
// HandlerPbCommand generate handler and protobuf code
|
||||
|
@@ -6,11 +6,11 @@ import (
|
||||
"math/rand"
|
||||
"strings"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/replacer"
|
||||
"github.com/zhufuyi/sponge/pkg/sql2code"
|
||||
"github.com/zhufuyi/sponge/pkg/sql2code/parser"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
// HandlerCommand generate handler code
|
||||
|
@@ -4,10 +4,10 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/replacer"
|
||||
|
||||
"github.com/huandu/xstrings"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/replacer"
|
||||
)
|
||||
|
||||
// HTTPPbCommand generate web service code based on protobuf file
|
||||
|
@@ -6,12 +6,12 @@ import (
|
||||
"math/rand"
|
||||
"strings"
|
||||
|
||||
"github.com/huandu/xstrings"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/replacer"
|
||||
"github.com/zhufuyi/sponge/pkg/sql2code"
|
||||
"github.com/zhufuyi/sponge/pkg/sql2code/parser"
|
||||
|
||||
"github.com/huandu/xstrings"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
// HTTPCommand generate web service code
|
||||
|
@@ -5,11 +5,11 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/replacer"
|
||||
"github.com/zhufuyi/sponge/pkg/sql2code"
|
||||
"github.com/zhufuyi/sponge/pkg/sql2code/parser"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
// ModelCommand generate model code
|
||||
|
@@ -5,12 +5,12 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/gofile"
|
||||
"github.com/zhufuyi/sponge/pkg/replacer"
|
||||
"github.com/zhufuyi/sponge/pkg/sql2code"
|
||||
"github.com/zhufuyi/sponge/pkg/sql2code/parser"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
// ProtobufCommand generate protobuf code
|
||||
|
@@ -5,9 +5,9 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/replacer"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/replacer"
|
||||
)
|
||||
|
||||
// GRPCConnectionCommand generate grpc connection code
|
||||
|
@@ -4,10 +4,10 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/replacer"
|
||||
|
||||
"github.com/huandu/xstrings"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/replacer"
|
||||
)
|
||||
|
||||
// RPCGwPbCommand generate grpc gateway service code base on protobuf file
|
||||
|
@@ -4,10 +4,10 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/replacer"
|
||||
|
||||
"github.com/huandu/xstrings"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/replacer"
|
||||
)
|
||||
|
||||
// RPCPbCommand generate grpc service code bash on protobuf file
|
||||
|
@@ -6,13 +6,13 @@ import (
|
||||
"math/rand"
|
||||
"strings"
|
||||
|
||||
"github.com/huandu/xstrings"
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/gofile"
|
||||
"github.com/zhufuyi/sponge/pkg/replacer"
|
||||
"github.com/zhufuyi/sponge/pkg/sql2code"
|
||||
"github.com/zhufuyi/sponge/pkg/sql2code/parser"
|
||||
|
||||
"github.com/huandu/xstrings"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
// RPCCommand generate grpc service code
|
||||
|
@@ -6,12 +6,12 @@ import (
|
||||
"math/rand"
|
||||
"strings"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/gofile"
|
||||
"github.com/zhufuyi/sponge/pkg/replacer"
|
||||
"github.com/zhufuyi/sponge/pkg/sql2code"
|
||||
"github.com/zhufuyi/sponge/pkg/sql2code/parser"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
// ServiceCommand generate service code
|
||||
|
@@ -8,9 +8,9 @@ import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/gofile"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/gofile"
|
||||
)
|
||||
|
||||
// ConvertSwagJSONCommand convert 64-bit fields type string to integer
|
||||
|
@@ -1,9 +1,9 @@
|
||||
package commands
|
||||
|
||||
import (
|
||||
"github.com/zhufuyi/sponge/cmd/sponge/commands/merge"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/zhufuyi/sponge/cmd/sponge/commands/merge"
|
||||
)
|
||||
|
||||
// MergeCommand merge the generated code
|
||||
|
@@ -1,9 +1,9 @@
|
||||
package commands
|
||||
|
||||
import (
|
||||
"github.com/zhufuyi/sponge/cmd/sponge/commands/generate"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/zhufuyi/sponge/cmd/sponge/commands/generate"
|
||||
)
|
||||
|
||||
// GenMicroCommand generate micro service code
|
||||
|
@@ -1,9 +1,9 @@
|
||||
package commands
|
||||
|
||||
import (
|
||||
"github.com/zhufuyi/sponge/cmd/sponge/commands/patch"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/zhufuyi/sponge/cmd/sponge/commands/patch"
|
||||
)
|
||||
|
||||
// PatchCommand patch server code
|
||||
|
@@ -11,10 +11,10 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/gobash"
|
||||
"github.com/zhufuyi/sponge/pkg/gofile"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var copyCount = 0
|
||||
|
@@ -5,9 +5,9 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/gofile"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/gofile"
|
||||
)
|
||||
|
||||
// DeleteJSONOmitemptyCommand delete json omitempty
|
||||
|
@@ -5,11 +5,11 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/zhufuyi/sponge/cmd/sponge/commands/generate"
|
||||
"github.com/zhufuyi/sponge/pkg/gofile"
|
||||
"github.com/zhufuyi/sponge/pkg/replacer"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
// GenerateDBInitCommand generate database initialization code
|
||||
|
@@ -5,11 +5,11 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/zhufuyi/sponge/cmd/sponge/commands/generate"
|
||||
"github.com/zhufuyi/sponge/pkg/gofile"
|
||||
"github.com/zhufuyi/sponge/pkg/replacer"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
// GenMysqlInitCommand generate mysql initialization code
|
||||
|
@@ -5,11 +5,11 @@ import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/zhufuyi/sponge/cmd/sponge/commands/generate"
|
||||
"github.com/zhufuyi/sponge/pkg/gofile"
|
||||
"github.com/zhufuyi/sponge/pkg/replacer"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
// GenTypesPbCommand generate types.proto code
|
||||
|
@@ -10,10 +10,10 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/gofile"
|
||||
"github.com/zhufuyi/sponge/pkg/krand"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@@ -8,9 +8,9 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/gobash"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/gobash"
|
||||
)
|
||||
|
||||
var pluginNames = []string{
|
||||
@@ -31,7 +31,7 @@ var pluginNames = []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/",
|
||||
"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-grpc": "google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest",
|
||||
"protoc-gen-validate": "github.com/envoyproxy/protoc-gen-validate@latest",
|
||||
|
@@ -5,9 +5,9 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/zhufuyi/sponge/cmd/sponge/commands/generate"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/zhufuyi/sponge/cmd/sponge/commands/generate"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@@ -9,9 +9,9 @@ import (
|
||||
"runtime"
|
||||
"strconv"
|
||||
|
||||
"github.com/zhufuyi/sponge/cmd/sponge/server"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/zhufuyi/sponge/cmd/sponge/server"
|
||||
)
|
||||
|
||||
// OpenUICommand open the sponge UI interface
|
||||
|
@@ -8,11 +8,11 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/gobash"
|
||||
"github.com/zhufuyi/sponge/pkg/gofile"
|
||||
"github.com/zhufuyi/sponge/pkg/utils"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
// UpgradeCommand upgrade sponge binaries
|
||||
|
@@ -1,9 +1,9 @@
|
||||
package commands
|
||||
|
||||
import (
|
||||
"github.com/zhufuyi/sponge/cmd/sponge/commands/generate"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
|
||||
"github.com/zhufuyi/sponge/cmd/sponge/commands/generate"
|
||||
)
|
||||
|
||||
// GenWebCommand generate web server code
|
||||
|
@@ -8,9 +8,10 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/gofile"
|
||||
|
||||
"github.com/zhufuyi/sponge/cmd/sponge/commands"
|
||||
"github.com/zhufuyi/sponge/cmd/sponge/commands/generate"
|
||||
"github.com/zhufuyi/sponge/pkg/gofile"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
@@ -13,6 +13,9 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"go.mongodb.org/mongo-driver/bson"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/errcode"
|
||||
"github.com/zhufuyi/sponge/pkg/ggorm"
|
||||
"github.com/zhufuyi/sponge/pkg/gin/response"
|
||||
@@ -21,9 +24,6 @@ import (
|
||||
"github.com/zhufuyi/sponge/pkg/krand"
|
||||
"github.com/zhufuyi/sponge/pkg/mgo"
|
||||
"github.com/zhufuyi/sponge/pkg/utils"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"go.mongodb.org/mongo-driver/bson"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@@ -11,13 +11,13 @@ import (
|
||||
"path/filepath"
|
||||
"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/middleware"
|
||||
"github.com/zhufuyi/sponge/pkg/gin/validator"
|
||||
"github.com/zhufuyi/sponge/pkg/logger"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gin-gonic/gin/binding"
|
||||
)
|
||||
|
||||
//go:embed static
|
||||
|
@@ -85,7 +85,7 @@ logger:
|
||||
# delete the templates code start
|
||||
# database setting
|
||||
database:
|
||||
driver: "mysql" # database driver, currently support mysql, postgres, tidb, sqlite
|
||||
driver: "mysql" # database driver, currently support mysql, postgresql, tidb, sqlite
|
||||
# mysql settings
|
||||
mysql:
|
||||
# dsn format, <username>:<password>@(<hostname>:<port>)/<db>?[k=v& ......]
|
||||
|
4
internal/cache/cacheNameExample.go
vendored
4
internal/cache/cacheNameExample.go
vendored
@@ -6,10 +6,10 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/zhufuyi/sponge/internal/model"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/cache"
|
||||
"github.com/zhufuyi/sponge/pkg/encoding"
|
||||
|
||||
"github.com/zhufuyi/sponge/internal/model"
|
||||
)
|
||||
|
||||
// delete the templates code start
|
||||
|
4
internal/cache/cacheNameExample_test.go
vendored
4
internal/cache/cacheNameExample_test.go
vendored
@@ -4,12 +4,12 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/zhufuyi/sponge/internal/model"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/gotest"
|
||||
"github.com/zhufuyi/sponge/pkg/utils"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/zhufuyi/sponge/internal/model"
|
||||
)
|
||||
|
||||
type cacheNameExampleData struct {
|
||||
|
4
internal/cache/userExample.go
vendored
4
internal/cache/userExample.go
vendored
@@ -5,11 +5,11 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/zhufuyi/sponge/internal/model"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/cache"
|
||||
"github.com/zhufuyi/sponge/pkg/encoding"
|
||||
"github.com/zhufuyi/sponge/pkg/utils"
|
||||
|
||||
"github.com/zhufuyi/sponge/internal/model"
|
||||
)
|
||||
|
||||
const (
|
||||
|
4
internal/cache/userExample.go.mgo
vendored
4
internal/cache/userExample.go.mgo
vendored
@@ -5,10 +5,10 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/zhufuyi/sponge/internal/model"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/cache"
|
||||
"github.com/zhufuyi/sponge/pkg/encoding"
|
||||
|
||||
"github.com/zhufuyi/sponge/internal/model"
|
||||
)
|
||||
|
||||
const (
|
||||
|
4
internal/cache/userExample_test.go
vendored
4
internal/cache/userExample_test.go
vendored
@@ -4,12 +4,12 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/zhufuyi/sponge/internal/model"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/gotest"
|
||||
"github.com/zhufuyi/sponge/pkg/utils"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/zhufuyi/sponge/internal/model"
|
||||
)
|
||||
|
||||
func newUserExampleCache() *gotest.Cache {
|
||||
|
@@ -6,18 +6,18 @@ import (
|
||||
"fmt"
|
||||
"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/primitive"
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
"go.mongodb.org/mongo-driver/mongo/options"
|
||||
"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)
|
||||
|
@@ -5,16 +5,16 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/zhufuyi/sponge/internal/cache"
|
||||
"github.com/zhufuyi/sponge/internal/model"
|
||||
"github.com/DATA-DOG/go-sqlmock"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"gorm.io/gorm"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/ggorm/query"
|
||||
"github.com/zhufuyi/sponge/pkg/gotest"
|
||||
"github.com/zhufuyi/sponge/pkg/utils"
|
||||
|
||||
"github.com/DATA-DOG/go-sqlmock"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"gorm.io/gorm"
|
||||
"github.com/zhufuyi/sponge/internal/cache"
|
||||
"github.com/zhufuyi/sponge/internal/model"
|
||||
)
|
||||
|
||||
func newUserExampleDao() *gotest.Dao {
|
||||
|
@@ -4,19 +4,19 @@ import (
|
||||
"errors"
|
||||
"math"
|
||||
|
||||
"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/internal/types"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/jinzhu/copier"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/gin/middleware"
|
||||
"github.com/zhufuyi/sponge/pkg/gin/response"
|
||||
"github.com/zhufuyi/sponge/pkg/logger"
|
||||
"github.com/zhufuyi/sponge/pkg/utils"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"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/internal/types"
|
||||
)
|
||||
|
||||
var _ UserExampleHandler = (*userExampleHandler)(nil)
|
||||
|
@@ -3,19 +3,19 @@ package handler
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"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/internal/types"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/jinzhu/copier"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/gin/middleware"
|
||||
"github.com/zhufuyi/sponge/pkg/gin/response"
|
||||
"github.com/zhufuyi/sponge/pkg/logger"
|
||||
"github.com/zhufuyi/sponge/pkg/utils"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"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/internal/types"
|
||||
)
|
||||
|
||||
var _ UserExampleHandler = (*userExampleHandler)(nil)
|
||||
|
@@ -6,17 +6,17 @@ import (
|
||||
"math"
|
||||
"strings"
|
||||
|
||||
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"
|
||||
"github.com/jinzhu/copier"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/ggorm/query"
|
||||
"github.com/zhufuyi/sponge/pkg/gin/middleware"
|
||||
"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)
|
||||
|
@@ -5,17 +5,17 @@ import (
|
||||
"errors"
|
||||
"strings"
|
||||
|
||||
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"
|
||||
"github.com/jinzhu/copier"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/gin/middleware"
|
||||
"github.com/zhufuyi/sponge/pkg/logger"
|
||||
"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)
|
||||
|
@@ -5,22 +5,22 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
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"
|
||||
"github.com/DATA-DOG/go-sqlmock"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/jinzhu/copier"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/zhufuyi/sponge/api/types"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/gin/response"
|
||||
"github.com/zhufuyi/sponge/pkg/gohttp"
|
||||
"github.com/zhufuyi/sponge/pkg/gotest"
|
||||
"github.com/zhufuyi/sponge/pkg/utils"
|
||||
|
||||
"github.com/DATA-DOG/go-sqlmock"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/jinzhu/copier"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/zhufuyi/sponge/api/types"
|
||||
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"
|
||||
)
|
||||
|
||||
func newUserExamplePbHandler() *gotest.Handler {
|
||||
|
@@ -5,19 +5,19 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/zhufuyi/sponge/internal/cache"
|
||||
"github.com/zhufuyi/sponge/internal/dao"
|
||||
"github.com/zhufuyi/sponge/internal/model"
|
||||
"github.com/zhufuyi/sponge/internal/types"
|
||||
"github.com/DATA-DOG/go-sqlmock"
|
||||
"github.com/jinzhu/copier"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/ggorm/query"
|
||||
"github.com/zhufuyi/sponge/pkg/gohttp"
|
||||
"github.com/zhufuyi/sponge/pkg/gotest"
|
||||
"github.com/zhufuyi/sponge/pkg/utils"
|
||||
|
||||
"github.com/DATA-DOG/go-sqlmock"
|
||||
"github.com/jinzhu/copier"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/zhufuyi/sponge/internal/cache"
|
||||
"github.com/zhufuyi/sponge/internal/dao"
|
||||
"github.com/zhufuyi/sponge/internal/model"
|
||||
"github.com/zhufuyi/sponge/internal/types"
|
||||
)
|
||||
|
||||
func newUserExampleHandler() *gotest.Handler {
|
||||
|
@@ -6,15 +6,15 @@ import (
|
||||
"sync"
|
||||
"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/goredis"
|
||||
"github.com/zhufuyi/sponge/pkg/logger"
|
||||
"github.com/zhufuyi/sponge/pkg/utils"
|
||||
|
||||
"github.com/go-redis/redis/v8"
|
||||
"gorm.io/gorm"
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@@ -5,15 +5,15 @@ import (
|
||||
"sync"
|
||||
"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/mgo"
|
||||
"github.com/zhufuyi/sponge/pkg/utils"
|
||||
|
||||
"github.com/go-redis/redis/v8"
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
"go.mongodb.org/mongo-driver/mongo"
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
)
|
||||
|
||||
// MaxObjectID max object id
|
||||
|
@@ -5,12 +5,12 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"gorm.io/gorm"
|
||||
|
||||
"github.com/zhufuyi/sponge/configs"
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
"github.com/zhufuyi/sponge/pkg/utils"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
func TestGetDB(t *testing.T) {
|
||||
|
@@ -5,8 +5,10 @@ package routers
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/zhufuyi/sponge/docs"
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
"github.com/gin-gonic/gin"
|
||||
"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/gin/handlerfunc"
|
||||
@@ -17,10 +19,8 @@ import (
|
||||
"github.com/zhufuyi/sponge/pkg/jwt"
|
||||
"github.com/zhufuyi/sponge/pkg/logger"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gin-gonic/gin/binding"
|
||||
swaggerFiles "github.com/swaggo/files"
|
||||
ginSwagger "github.com/swaggo/gin-swagger"
|
||||
"github.com/zhufuyi/sponge/docs"
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@@ -4,8 +4,8 @@ import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/zhufuyi/sponge/docs"
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gin-gonic/gin/binding"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/errcode"
|
||||
"github.com/zhufuyi/sponge/pkg/gin/handlerfunc"
|
||||
@@ -17,8 +17,8 @@ import (
|
||||
"github.com/zhufuyi/sponge/pkg/jwt"
|
||||
"github.com/zhufuyi/sponge/pkg/logger"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gin-gonic/gin/binding"
|
||||
"github.com/zhufuyi/sponge/docs"
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
)
|
||||
|
||||
type routeFns = []func(r *gin.Engine, groupPathMiddlewares map[string][]gin.HandlerFunc, singlePathMiddlewares map[string][]gin.HandlerFunc)
|
||||
|
@@ -5,15 +5,15 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
serverNameExampleV1 "github.com/zhufuyi/sponge/api/serverNameExample/v1"
|
||||
"github.com/zhufuyi/sponge/configs"
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/gin/middleware"
|
||||
"github.com/zhufuyi/sponge/pkg/utils"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/stretchr/testify/assert"
|
||||
serverNameExampleV1 "github.com/zhufuyi/sponge/api/serverNameExample/v1"
|
||||
"github.com/zhufuyi/sponge/configs"
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
)
|
||||
|
||||
func TestNewRouter_pbExample(t *testing.T) {
|
||||
|
@@ -5,13 +5,13 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/zhufuyi/sponge/configs"
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/utils"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/zhufuyi/sponge/configs"
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
)
|
||||
|
||||
func TestNewRouter(t *testing.T) {
|
||||
|
@@ -1,9 +1,9 @@
|
||||
package routers
|
||||
|
||||
import (
|
||||
"github.com/zhufuyi/sponge/internal/handler"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
"github.com/zhufuyi/sponge/internal/handler"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@@ -3,14 +3,14 @@ package routers
|
||||
import (
|
||||
"context"
|
||||
|
||||
serverNameExampleV1 "github.com/zhufuyi/sponge/api/serverNameExample/v1"
|
||||
"github.com/zhufuyi/sponge/internal/service"
|
||||
"github.com/gin-gonic/gin"
|
||||
"google.golang.org/grpc/metadata"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/gin/middleware"
|
||||
"github.com/zhufuyi/sponge/pkg/logger"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"google.golang.org/grpc/metadata"
|
||||
serverNameExampleV1 "github.com/zhufuyi/sponge/api/serverNameExample/v1"
|
||||
"github.com/zhufuyi/sponge/internal/service"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@@ -7,7 +7,7 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
"google.golang.org/grpc"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/consulcli"
|
||||
"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/nacos"
|
||||
|
||||
"google.golang.org/grpc"
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@@ -5,12 +5,12 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/zhufuyi/sponge/configs"
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"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) {
|
||||
|
@@ -8,9 +8,10 @@ import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
"github.com/zhufuyi/sponge/internal/ecode"
|
||||
"github.com/zhufuyi/sponge/internal/service"
|
||||
grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/app"
|
||||
"github.com/zhufuyi/sponge/pkg/errcode"
|
||||
@@ -21,10 +22,9 @@ import (
|
||||
"github.com/zhufuyi/sponge/pkg/prof"
|
||||
"github.com/zhufuyi/sponge/pkg/servicerd/registry"
|
||||
|
||||
grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
"github.com/zhufuyi/sponge/internal/ecode"
|
||||
"github.com/zhufuyi/sponge/internal/service"
|
||||
)
|
||||
|
||||
var _ app.IServer = (*grpcServer)(nil)
|
||||
|
@@ -7,15 +7,15 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/zhufuyi/sponge/configs"
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"google.golang.org/grpc"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/grpc/gtls/certfile"
|
||||
"github.com/zhufuyi/sponge/pkg/servicerd/registry"
|
||||
"github.com/zhufuyi/sponge/pkg/utils"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"google.golang.org/grpc"
|
||||
"github.com/zhufuyi/sponge/configs"
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
)
|
||||
|
||||
func TestGRPCServer(t *testing.T) {
|
||||
|
@@ -6,12 +6,12 @@ import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/zhufuyi/sponge/internal/routers"
|
||||
"github.com/gin-gonic/gin"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/app"
|
||||
"github.com/zhufuyi/sponge/pkg/servicerd/registry"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/zhufuyi/sponge/internal/routers"
|
||||
)
|
||||
|
||||
var _ app.IServer = (*httpServer)(nil)
|
||||
@@ -59,7 +59,7 @@ func (s *httpServer) String() string {
|
||||
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 {
|
||||
o := defaultHTTPOptions()
|
||||
o.apply(opts...)
|
||||
|
@@ -7,14 +7,14 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/zhufuyi/sponge/configs"
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/servicerd/registry"
|
||||
"github.com/zhufuyi/sponge/pkg/utils"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/zhufuyi/sponge/configs"
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
)
|
||||
|
||||
// need real database to test
|
||||
|
@@ -6,8 +6,7 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/zhufuyi/sponge/configs"
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
"google.golang.org/grpc"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/consulcli"
|
||||
"github.com/zhufuyi/sponge/pkg/etcdcli"
|
||||
@@ -20,7 +19,8 @@ import (
|
||||
"github.com/zhufuyi/sponge/pkg/servicerd/registry/nacos"
|
||||
"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) {
|
||||
|
@@ -6,18 +6,18 @@ import (
|
||||
"math"
|
||||
"strings"
|
||||
|
||||
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"
|
||||
"github.com/jinzhu/copier"
|
||||
"google.golang.org/grpc"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/ggorm/query"
|
||||
"github.com/zhufuyi/sponge/pkg/grpc/interceptor"
|
||||
"github.com/zhufuyi/sponge/pkg/logger"
|
||||
|
||||
"github.com/jinzhu/copier"
|
||||
"google.golang.org/grpc"
|
||||
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"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@@ -5,18 +5,18 @@ import (
|
||||
"errors"
|
||||
"strings"
|
||||
|
||||
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"
|
||||
"github.com/jinzhu/copier"
|
||||
"google.golang.org/grpc"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/grpc/interceptor"
|
||||
"github.com/zhufuyi/sponge/pkg/logger"
|
||||
"github.com/zhufuyi/sponge/pkg/mgo/query"
|
||||
|
||||
"github.com/jinzhu/copier"
|
||||
"google.golang.org/grpc"
|
||||
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"
|
||||
)
|
||||
|
||||
func init() {
|
||||
|
@@ -7,12 +7,12 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/grpc/benchmark"
|
||||
|
||||
serverNameExampleV1 "github.com/zhufuyi/sponge/api/serverNameExample/v1"
|
||||
"github.com/zhufuyi/sponge/api/types"
|
||||
"github.com/zhufuyi/sponge/configs"
|
||||
"github.com/zhufuyi/sponge/internal/config"
|
||||
|
||||
"github.com/zhufuyi/sponge/pkg/grpc/benchmark"
|
||||
)
|
||||
|
||||
// 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
Reference in New Issue
Block a user