From 99bbd34c43b772125ccc9c094fb454ee6fd9de00 Mon Sep 17 00:00:00 2001 From: vipg Date: Fri, 14 Nov 2025 18:04:50 +0800 Subject: [PATCH] add --- backend/futures_trade_record/src/logic/variety_create.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/futures_trade_record/src/logic/variety_create.go b/backend/futures_trade_record/src/logic/variety_create.go index 14ff51b..13fe624 100644 --- a/backend/futures_trade_record/src/logic/variety_create.go +++ b/backend/futures_trade_record/src/logic/variety_create.go @@ -13,8 +13,8 @@ import ( type CreateVarietyRequest struct { Name string `json:"name" binding:"required"` // 品种名称,必填 Code string `json:"code" binding:"required"` // 品种代码,必填 - Tick float64 `json:"tick" binding:"omitempty,min=0"` // 跳点值,非必填,需大于等于0 - TickPrice float64 `json:"tick_price" binding:"omitempty,min=0"` // 跳点价格,非必填,需大于等于0 + Tick float64 `json:"tick" binding:"min=0"` // 跳点值,必填,需大于等于0 + TickPrice float64 `json:"tick_price" binding:"min=0"` // 跳点价格,必填,需大于等于0 } // CreateVarietyResponse 注册响应结构 @@ -54,7 +54,7 @@ func CreateVarietyHandler(c *gin.Context) { ) c.JSON(http.StatusBadRequest, CreateVarietyResponse{ Success: false, - Message: "请求参数错误:name和code为必填项,tick和tick_price需大于等于0", + Message: "请求参数错误:name、code、tick和tick_price为必填项,且tick和tick_price需大于等于0", }) return }