fusenapi/server_api/websocket.api

66 lines
2.4 KiB
Plaintext
Raw Normal View History

2023-07-24 08:07:05 +00:00
syntax = "v1"
info (
title: "websocket"// TODO: add title
desc: // TODO: add description
author: ""
email: ""
)
import "basic.api"
service websocket {
//websocket数据交互
@handler DataTransferHandler
2023-07-26 03:53:06 +00:00
get /api/websocket/data_transfer(request) returns (response);
2023-07-27 09:07:54 +00:00
//云渲染完了通知接口
2023-07-25 09:10:50 +00:00
@handler RenderNotifyHandler
post /api/websocket/render_notify(RenderNotifyReq) returns (response);
2023-07-27 09:07:54 +00:00
//第三方登录通知接口
@handler ThirdPartyLoginNotifyHandler
post /api/websocket/third_party_login_notify(ThirdPartyLoginNotifyReq) returns (response);
2023-07-24 08:07:05 +00:00
}
//websocket数据交互
2023-07-26 03:53:06 +00:00
type DataTransferData {
2023-07-26 08:47:53 +00:00
T string `json:"t"` //消息类型
D interface{} `json:"d"` //传递的消息
2023-07-25 09:10:50 +00:00
}
2023-07-27 04:32:03 +00:00
type RenderImageReqMsg { //websocket接受要云渲染处理的数据
2023-07-27 08:13:06 +00:00
ProductIds []int64 `json:"product_ids"` //产品 id
TemplateTagId int64 `json:"template_tag_id"` //模板标签id
2023-07-28 02:20:35 +00:00
LogoId int64 `json:"logo_id"` //logoid
2023-07-27 08:13:06 +00:00
AlgorithmVersion string `json:"algorithm_version,optional"` //算法版本
2023-07-25 09:10:50 +00:00
}
type RenderImageRspMsg { //websocket发送渲染完的数据
2023-07-27 08:13:06 +00:00
ProductId int64 `json:"product_id"` //产品 id
TemplateTagId int64 `json:"template_tag_id"` //模板标签id
AlgorithmVersion string `json:"algorithm_version,optional"` //算法版本
2023-07-28 02:20:35 +00:00
LogoId int64 `json:"logo_id"` //logoid
2023-07-27 08:13:06 +00:00
Image string `json:"image"` //渲染后的图片
2023-07-25 09:10:50 +00:00
}
2023-07-27 09:07:54 +00:00
type ThirdPartyLoginRspMsg { //websocket三方登录的通知数据
Token string `json:"token"`
}
2023-07-25 09:10:50 +00:00
//渲染完了通知接口
type RenderNotifyReq {
2023-07-27 04:32:03 +00:00
Sign string `json:"sign"`
Time int64 `json:"time"`
Info NotifyInfo `json:"info"`
2023-07-25 09:10:50 +00:00
}
2023-07-27 04:32:03 +00:00
type NotifyInfo {
2023-07-27 08:13:06 +00:00
ProductId int64 `json:"product_id"` //产品id
TemplateTagId int64 `json:"template_tag_id"` //模板标签id
AlgorithmVersion string `json:"algorithm_version,optional"` //算法版本
2023-07-28 02:20:35 +00:00
LogoId int64 `json:"logo_id"` //logoid
2023-07-27 08:13:06 +00:00
Image string `json:"image"`
2023-07-27 09:07:54 +00:00
}
//第三方登录通知接口
type ThirdPartyLoginNotifyReq {
Sign string `json:"sign"`
Time int64 `json:"time"`
Info ThirdPartyLoginNotify `json:"info"`
}
type ThirdPartyLoginNotify {
WebsocketId uint64 `json:"websocket_id"`
Token string `json:"token"`
2023-07-24 08:07:05 +00:00
}