diff --git a/go.mod b/go.mod index 7d7ea745..1900c9f7 100644 --- a/go.mod +++ b/go.mod @@ -36,4 +36,5 @@ require ( go.uber.org/zap v1.15.0 gopkg.in/natefinch/lumberjack.v2 v2.0.0 gopkg.in/yaml.v2 v2.3.0 + github.com/sony/sonyflake v1.0.0 ) diff --git a/proto/transport.proto b/proto/transport.proto index b69e4c4b..82a21666 100644 --- a/proto/transport.proto +++ b/proto/transport.proto @@ -13,6 +13,7 @@ message PingRequest { string token = 1; string context = 2; } + // 定义 Pong响应消息结构 message PongResponse { string context = 1; diff --git a/util/httpclient/http_util_test.go b/util/httpclient/http_util_test.go index c1ae9307..0233e587 100644 --- a/util/httpclient/http_util_test.go +++ b/util/httpclient/http_util_test.go @@ -265,6 +265,5 @@ func TestResources(t *testing.T) { fmt.Println(err) } - fmt.Println("sssssssssssssss") fmt.Println("RespondText:",entity.DataAsString()) } diff --git a/util/snowflake/snow_flake.go b/util/snowflake/snow_flake.go index b9e5f9e8..1ecf721a 100644 --- a/util/snowflake/snow_flake.go +++ b/util/snowflake/snow_flake.go @@ -2,9 +2,12 @@ package snowflake import ( "github.com/sony/sonyflake" - "go-mysql-transfer/util/logutil" + + "go-mysql-transfer/util/logs" ) +// 雪花ID工具 + var _sf *sonyflake.Sonyflake func InitSnowflake(machineId uint16) { @@ -22,7 +25,7 @@ func InitSnowflake(machineId uint16) { func NextId() (uint64, error) { id, err := _sf.NextID() if err != nil { - logutil.Errorf("snowflake NextId :%s", err.Error()) + logs.Errorf("snowflake NextId :%s", err.Error()) } return id, nil }