Skip to content

Commit

Permalink
v1.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
wj596 committed Jul 26, 2021
1 parent 999c842 commit 5bf9a0e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
1 change: 1 addition & 0 deletions proto/transport.proto
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ message PingRequest {
string token = 1;
string context = 2;
}

// 定义 Pong响应消息结构
message PongResponse {
string context = 1;
Expand Down
1 change: 0 additions & 1 deletion util/httpclient/http_util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,5 @@ func TestResources(t *testing.T) {
fmt.Println(err)
}

fmt.Println("sssssssssssssss")
fmt.Println("RespondText:",entity.DataAsString())
}
7 changes: 5 additions & 2 deletions util/snowflake/snow_flake.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
}

0 comments on commit 5bf9a0e

Please sign in to comment.