You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
425 B
18 lines
425 B
package service |
|
|
|
import ( |
|
"context" |
|
|
|
"go-common/app/service/main/location/model" |
|
"go-common/library/log" |
|
"go-common/library/net/metadata" |
|
) |
|
|
|
// IPZone get ip zone info by ip |
|
func (s *Service) IPZone(c context.Context) (res *model.Info, err error) { |
|
ip := metadata.String(c, metadata.RemoteIP) |
|
if res, err = s.loc.Info(c, &model.ArgIP{IP: ip}); err != nil { |
|
log.Error("s.loc.Info(%s) error(%v)", ip, err) |
|
} |
|
return |
|
}
|
|
|