mirror of
https://gitee.com/johng/gf
synced 2026-06-06 16:21:40 +08:00
add golangci feature to guarantee codes quality (#2229)
This commit is contained in:
@ -2,10 +2,11 @@ package main
|
||||
|
||||
import (
|
||||
"github.com/gogf/gf/contrib/trace/jaeger/v2"
|
||||
"github.com/gogf/gf/example/trace/grpc_with_db/protobuf/user"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/net/gtrace"
|
||||
"github.com/gogf/gf/v2/os/gctx"
|
||||
|
||||
"github.com/gogf/gf/example/trace/grpc_with_db/protobuf/user"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@ -1,9 +1,8 @@
|
||||
package user
|
||||
|
||||
import (
|
||||
"google.golang.org/grpc"
|
||||
|
||||
"github.com/gogf/katyusha/krpc"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@ -1,19 +1,20 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
_ "github.com/gogf/gf/contrib/drivers/mysql/v2"
|
||||
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
_ "github.com/gogf/gf/contrib/drivers/mysql/v2"
|
||||
|
||||
"github.com/gogf/gf/contrib/trace/jaeger/v2"
|
||||
"github.com/gogf/gf/example/trace/grpc_with_db/protobuf/user"
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gcache"
|
||||
"github.com/gogf/gf/v2/os/gctx"
|
||||
"github.com/gogf/katyusha/krpc"
|
||||
|
||||
"github.com/gogf/gf/example/trace/grpc_with_db/protobuf/user"
|
||||
)
|
||||
|
||||
type server struct{}
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
_ "github.com/gogf/gf/contrib/drivers/mysql/v2"
|
||||
|
||||
"context"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
_ "github.com/gogf/gf/contrib/drivers/mysql/v2"
|
||||
|
||||
"github.com/gogf/gf/contrib/trace/jaeger/v2"
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
@ -46,6 +46,7 @@ func main() {
|
||||
type InsertReq struct {
|
||||
Name string `v:"required#Please input user name."`
|
||||
}
|
||||
|
||||
type InsertRes struct {
|
||||
Id int64
|
||||
}
|
||||
@ -66,6 +67,7 @@ func (c *cTrace) Insert(ctx context.Context, req *InsertReq) (res *InsertRes, er
|
||||
type QueryReq struct {
|
||||
Id int `v:"min:1#User id is required for querying"`
|
||||
}
|
||||
|
||||
type QueryRes struct {
|
||||
User gdb.Record
|
||||
}
|
||||
@ -90,6 +92,7 @@ func (c *cTrace) Query(ctx context.Context, req *QueryReq) (res *QueryRes, err e
|
||||
type DeleteReq struct {
|
||||
Id int `v:"min:1#User id is required for deleting."`
|
||||
}
|
||||
|
||||
type DeleteRes struct{}
|
||||
|
||||
// Delete is a route handler for deleting specified user info.
|
||||
|
||||
Reference in New Issue
Block a user