This commit is contained in:
vipg
2025-12-22 17:21:49 +08:00
parent 13ead6efd3
commit 8f3eda131c
2 changed files with 2 additions and 2 deletions

View File

@@ -25,7 +25,6 @@ BEGIN
) THEN
CREATE TABLE cn_futures_trading_records (
id UUID DEFAULT gen_random_uuid() PRIMARY KEY, -- id
event_type VARCHAR(40) NOT NULL, -- 事件名称
payload JSONB NOT NULL, -- 数据
deleted BOOLEAN NOT NULL DEFAULT FALSE, -- 删除状态
created_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP, -- 记录创建时间

View File

@@ -14,12 +14,13 @@ import (
/* ---------- 公共 Payload 结构体 ---------- */
type Payload struct {
Status int `json:"status" binding:"required,min=-1,max=1"` // 状态(-1亏损0持仓中1盈利)
OpenYear int `json:"open_year" binding:"required,min=1900,max=2200"` // 开仓时间1900-2200
OpenMonth int `json:"open_month" binding:"required,min=1,max=12"` // 开仓时间1-12
OpenDay int `json:"open_day" binding:"required,min=1,max=31"` // 开仓时间1-31
Symbol string `json:"symbol" binding:"required"` // 品种代码(如 RB、CU
Contract string `json:"contract" binding:"required"` // 合约代码(如 2505
Direction string `json:"direction" binding:"required,oneof=long short"` // 交易方向long 多头 / short 空头
Direction int `json:"direction" binding:"required,min=-1,max=1"` // 1 多头 / -1 空头
OpenPrice float64 `json:"open_price" binding:"required"` // 开仓价格(单位:元)
OpenFee float64 `json:"open_fee" binding:"required,min=0"` // 开仓手续费≥0
CloseYear int `json:"close_year" binding:"required,min=1900,max=2200"` // 平仓时间1900-2200