增加ip获取

This commit is contained in:
ayflying
2025-02-28 14:53:05 +08:00
parent 6765eff93f
commit 45ffdc37fb
11 changed files with 212 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
// =================================================================================
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
// =================================================================================
package callback

View 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{}
}

View 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
}