Skip to content

Commit

Permalink
improve: geoip
Browse files Browse the repository at this point in the history
  • Loading branch information
naiba committed Feb 9, 2025
1 parent e30b3b4 commit 65f9db7
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 38 deletions.
83 changes: 47 additions & 36 deletions proto/nezha.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions proto/nezha.proto
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ message GeoIP {
bool use6 = 1;
IP ip = 2;
string country_code = 3;
uint64 dashboard_boot_time = 4;
}

message IP {
Expand Down
2 changes: 1 addition & 1 deletion proto/nezha_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion service/rpc/nezha.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,5 +296,5 @@ func (s *NezhaHandler) ReportGeoIP(c context.Context, r *pb.GeoIP) (*pb.GeoIP, e
// 将地区码写入到 Host
server.GeoIP = &geoip

return &pb.GeoIP{Ip: nil, CountryCode: location}, nil
return &pb.GeoIP{Ip: nil, CountryCode: location, DashboardBootTime: singleton.DashboardBootTime}, nil
}

0 comments on commit 65f9db7

Please sign in to comment.