generated from pkg/go-template
feat : 取消rpc
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
parent
b121129b30
commit
4b2e061919
|
@ -1,19 +1,14 @@
|
|||
package handler
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"git.icechen.cn/monorepo/backend/app/brahma/api/murder/internal/error_process"
|
||||
"git.icechen.cn/monorepo/backend/app/brahma/api/murder/internal/model"
|
||||
"git.icechen.cn/monorepo/backend/app/brahma/api/murder/internal/service"
|
||||
"git.icechen.cn/monorepo/backend/pkg/proto/brahma/murder"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
ctxLogger "github.com/luizsuper/ctxLoggers"
|
||||
"go.uber.org/zap"
|
||||
"google.golang.org/grpc"
|
||||
"log"
|
||||
"strconv"
|
||||
"time"
|
||||
)
|
||||
|
||||
func GetScriptsH(ctx *fiber.Ctx) error {
|
||||
|
@ -81,23 +76,23 @@ func DeleteScriptsH(ctx *fiber.Ctx) error {
|
|||
return ctx.JSON(success(nil))
|
||||
}
|
||||
|
||||
func HelloWorld() error {
|
||||
// Set up a connection to the server.
|
||||
conn, err := grpc.Dial("localhost:3000", grpc.WithInsecure(), grpc.WithBlock())
|
||||
if err != nil {
|
||||
log.Fatalf("did not connect: %v", err)
|
||||
}
|
||||
defer conn.Close()
|
||||
c := murder.NewHelloWorldClient(conn)
|
||||
|
||||
// Contact the server and print out its response.
|
||||
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
|
||||
defer cancel()
|
||||
r, err := c.Login(ctx, &murder.HelloRequest{Code: "lht"})
|
||||
|
||||
if err != nil {
|
||||
log.Fatalf("could not greet: %v", err)
|
||||
}
|
||||
log.Printf("Greeting: %s", r.Token)
|
||||
return nil
|
||||
}
|
||||
//func HelloWorld() error {
|
||||
// // Set up a connection to the server.
|
||||
// conn, err := grpc.Dial("localhost:3000", grpc.WithInsecure(), grpc.WithBlock())
|
||||
// if err != nil {
|
||||
// log.Fatalf("did not connect: %v", err)
|
||||
// }
|
||||
// defer conn.Close()
|
||||
// c := murder.NewHelloWorldClient(conn)
|
||||
//
|
||||
// // Contact the server and print out its response.
|
||||
// ctx, cancel := context.WithTimeout(context.Background(), time.Second)
|
||||
// defer cancel()
|
||||
// r, err := c.Login(ctx, &murder.HelloRequest{Code: "lht"})
|
||||
//
|
||||
// if err != nil {
|
||||
// log.Fatalf("could not greet: %v", err)
|
||||
// }
|
||||
// log.Printf("Greeting: %s", r.Token)
|
||||
// return nil
|
||||
//}
|
||||
|
|
Loading…
Reference in New Issue