mirror of
https://github.com/ayflying/p2p.git
synced 2026-03-05 01:39:23 +00:00
增加代理接口
This commit is contained in:
@@ -3,7 +3,7 @@ package v1
|
||||
import "github.com/gogf/gf/v2/frame/g"
|
||||
|
||||
type ConnectReq struct {
|
||||
g.Meta `path:"/p2p/connect" tags:"p2p" method:"get" sm:"连接到目标主机"`
|
||||
g.Meta `path:"/message/connect" tags:"message" method:"get" sm:"连接到目标主机"`
|
||||
TargetID string `json:"id"`
|
||||
}
|
||||
type ConnectRes struct {
|
||||
@@ -11,7 +11,7 @@ type ConnectRes struct {
|
||||
}
|
||||
|
||||
type SendReq struct {
|
||||
g.Meta `path:"/p2p/send" tags:"p2p" method:"get" sm:"发送消息"`
|
||||
g.Meta `path:"/message/send" tags:"message" method:"get" sm:"发送消息"`
|
||||
TargetID string `json:"id"`
|
||||
Data string `json:"data"`
|
||||
}
|
||||
@@ -20,8 +20,15 @@ type SendRes struct {
|
||||
}
|
||||
|
||||
type IpReq struct {
|
||||
g.Meta `path:"/p2p/ip" tags:"p2p" method:"get" sm:"获取当前主机的IP地址"`
|
||||
g.Meta `path:"/message/ip" tags:"message" method:"get" sm:"获取当前主机的IP地址"`
|
||||
}
|
||||
type IpRes struct {
|
||||
g.Meta `mime:"text/html" example:"string"`
|
||||
}
|
||||
|
||||
type Message struct {
|
||||
Type string `json:"type" dc:"消息类型"`
|
||||
//Port int `json:"port,omitempty" dc:"请求端口"`
|
||||
Data []byte `json:"data" dc:"消息数据"`
|
||||
From string `json:"from" dc:"发送方ID"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user