update
This commit is contained in:
@@ -4,19 +4,26 @@ import "time"
|
||||
|
||||
// 配置文件结构
|
||||
type Config struct {
|
||||
SQLite3 SQLite3 `json:"sqlite3"`
|
||||
RMQConfig RMQConfig `json:"rmq_config"`
|
||||
ETHConfig ETHConfig `json:"eth_config"`
|
||||
TRONConfig TRONConfig `json:"tron_config"`
|
||||
}
|
||||
|
||||
type SQLite3 struct {
|
||||
MsgPath string `json:"msg_path"`
|
||||
}
|
||||
|
||||
type RMQConfig struct {
|
||||
SubAddr string `json:"sub_addr"` // 监听地址
|
||||
PayConfig QueueConfig `json:"pay"` // 支付
|
||||
TopUpConfig QueueConfig `json:"topup"` // 充值
|
||||
WithdrawConfig QueueConfig `json:"withdraw"` // 提现
|
||||
RemoveConfig QueueConfig `json:"remove"` // 移除监听
|
||||
PayRespConfig QueueConfig `json:"pay_resp"` // 支付回复
|
||||
TopUpRespConfig QueueConfig `json:"topup_resp"` // 充值回复
|
||||
WithdrawRespConfig QueueConfig `json:"withdraw_resp"` // 提现回复
|
||||
RemoveRespConfig QueueConfig `json:"remove_resp"` // 移除监听回复
|
||||
}
|
||||
|
||||
type QueueConfig struct {
|
||||
@@ -50,7 +57,7 @@ type DbConfig struct {
|
||||
ConnMaxLife time.Duration `json:"connMaxLife"` // 连接最大存活时间
|
||||
}
|
||||
|
||||
// =======================================================================
|
||||
// =============================== type0 ===============================
|
||||
// 接收的充值消息
|
||||
type TopupMsg_req struct {
|
||||
Chain string `json:"chain"` // 链名称
|
||||
@@ -71,6 +78,7 @@ type TopupMsg_resp struct {
|
||||
BlockHeight uint64 `json:"block_height"` // 区块高度
|
||||
}
|
||||
|
||||
// =============================== type1 ===============================
|
||||
// 接收的提现消息
|
||||
type WithdrawMsg_req struct {
|
||||
QueueId string `json:"queue_id"`
|
||||
@@ -86,16 +94,17 @@ type WithdrawMsg_req struct {
|
||||
// 返回提现结果消息
|
||||
type WithdrawMsg_resp struct {
|
||||
QueueId string `json:"queue_id"`
|
||||
Status int `json:"status"`
|
||||
Amount float64 `json:"amount"`
|
||||
Chain string `json:"chain"` // 链名称
|
||||
Symbol string `json:"symbol"` // 币种
|
||||
Status int `json:"status"`
|
||||
Amount float64 `json:"amount"`
|
||||
TxHash string `json:"tx_hash"`
|
||||
FromAddress string `json:"from_address"` // 来源地址
|
||||
ToAddress string `json:"to_address"` // 目标地址
|
||||
BlockHeight uint64 `json:"block_height"` // 区块高度
|
||||
}
|
||||
|
||||
// =============================== type2 ===============================
|
||||
// 接收到的支付消息
|
||||
type PayMsg_req struct {
|
||||
QueueId string `json:"queue_id"`
|
||||
@@ -123,6 +132,27 @@ type PayMsg_resp struct {
|
||||
BlockHeight uint64 `json:"block_height"` // 区块高度
|
||||
}
|
||||
|
||||
// =============================== type3 ===============================
|
||||
// 接收到的删除监听地址消息
|
||||
type RemoveListenMsg_req struct {
|
||||
MsgType int `json:"msg_type"`
|
||||
Chain string `json:"chain"`
|
||||
Symbol string `json:"symbol"`
|
||||
Address string `json:"address"`
|
||||
Timestamp uint64 `json:"timestamp"`
|
||||
Sign string `json:"sign"`
|
||||
}
|
||||
|
||||
// 返回收到的删除监听地址消息
|
||||
type RemoveListenMsg_resp struct {
|
||||
MsgType int `json:"msg_type"`
|
||||
Chain string `json:"chain"`
|
||||
Symbol string `json:"symbol"`
|
||||
Address string `json:"address"`
|
||||
Status int `json:"status"` // 0失败 1成功
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
// 节点通用消息结构
|
||||
type Tx_msg struct {
|
||||
TxType int `json:"tx_type"` // 转账类型:0充值,1提现,2支付
|
||||
|
||||
Reference in New Issue
Block a user