25 lines
581 B
Plaintext
25 lines
581 B
Plaintext
|
syntax = "v1"
|
||
|
|
||
|
info (
|
||
|
title: "websocket"// TODO: add title
|
||
|
desc: // TODO: add description
|
||
|
author: ""
|
||
|
email: ""
|
||
|
)
|
||
|
|
||
|
import "basic.api"
|
||
|
service websocket {
|
||
|
//websocket数据交互
|
||
|
@handler DataTransferHandler
|
||
|
get /api/websocket/data_transfer(DataTransferReq) returns (response);
|
||
|
}
|
||
|
|
||
|
//websocket数据交互
|
||
|
type DataTransferReq {
|
||
|
MsgType string `json:"msg_type"` //消息类型
|
||
|
Message interface{} `json:"message"` //传递的消息
|
||
|
}
|
||
|
type DataTransferRsp {
|
||
|
MsgType string `json:"msg_type"` //消息类型
|
||
|
Message interface{} `json:"message"` //传递的消息
|
||
|
}
|