增加ip获取
This commit is contained in:
5
controller/callback/callback.go
Normal file
5
controller/callback/callback.go
Normal file
@@ -0,0 +1,5 @@
|
||||
// =================================================================================
|
||||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
||||
// =================================================================================
|
||||
|
||||
package callback
|
||||
15
controller/callback/callback_new.go
Normal file
15
controller/callback/callback_new.go
Normal file
@@ -0,0 +1,15 @@
|
||||
// =================================================================================
|
||||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
||||
// =================================================================================
|
||||
|
||||
package callback
|
||||
|
||||
import (
|
||||
"github.com/ayflying/utility_go/api/callback"
|
||||
)
|
||||
|
||||
type ControllerV1 struct{}
|
||||
|
||||
func NewV1() callback.ICallbackV1 {
|
||||
return &ControllerV1{}
|
||||
}
|
||||
14
controller/callback/callback_v1_ip.go
Normal file
14
controller/callback/callback_v1_ip.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package callback
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/ayflying/utility_go/service"
|
||||
|
||||
"github.com/ayflying/utility_go/api/callback/v1"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) Ip(ctx context.Context, req *v1.IpReq) (res *v1.IpRes, err error) {
|
||||
res = &v1.IpRes{}
|
||||
res.Address = service.Ip2Region().GetIp(req.Ip)
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user