首次提交

This commit is contained in:
2025-10-14 17:18:21 +08:00
commit f0155d1e63
54 changed files with 1956 additions and 0 deletions

16
api/p2p/p2p.go Normal file
View File

@@ -0,0 +1,16 @@
// =================================================================================
// Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
// =================================================================================
package p2p
import (
"context"
"github.com/ayflying/p2p/api/p2p/v1"
)
type IP2PV1 interface {
Connect(ctx context.Context, req *v1.ConnectReq) (res *v1.ConnectRes, err error)
Send(ctx context.Context, req *v1.SendReq) (res *v1.SendRes, err error)
}

20
api/p2p/v1/p2p.go Normal file
View File

@@ -0,0 +1,20 @@
package v1
import "github.com/gogf/gf/v2/frame/g"
type ConnectReq struct {
g.Meta `path:"/p2p/connect" tags:"p2p" method:"get" sm:"连接到目标主机"`
TargetID string `json:"id"`
}
type ConnectRes struct {
g.Meta `mime:"text/html" example:"string"`
}
type SendReq struct {
g.Meta `path:"/p2p/send" tags:"p2p" method:"get" sm:"发送消息"`
TargetID string `json:"id"`
Data string `json:"data"`
}
type SendRes struct {
g.Meta `mime:"text/html" example:"string"`
}