mirror of
https://github.com/ayflying/p2p.git
synced 2026-03-05 01:39:23 +00:00
15 lines
294 B
Go
15 lines
294 B
Go
package p2p
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/ayflying/p2p/api/p2p/v1"
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
)
|
|
|
|
func (c *ControllerV1) Ip(ctx context.Context, req *v1.IpReq) (res *v1.IpRes, err error) {
|
|
ip := g.RequestFromCtx(ctx).GetRemoteIp()
|
|
g.RequestFromCtx(ctx).Response.Write(ip)
|
|
return
|
|
}
|