add
This commit is contained in:
@@ -13,8 +13,8 @@ import (
|
|||||||
type CreateVarietyRequest struct {
|
type CreateVarietyRequest struct {
|
||||||
Name string `json:"name" binding:"required"` // 品种名称,必填
|
Name string `json:"name" binding:"required"` // 品种名称,必填
|
||||||
Code string `json:"code" binding:"required"` // 品种代码,必填
|
Code string `json:"code" binding:"required"` // 品种代码,必填
|
||||||
Tick float64 `json:"tick" binding:"omitempty,min=0"` // 跳点值,非必填,需大于等于0
|
Tick float64 `json:"tick" binding:"min=0"` // 跳点值,必填,需大于等于0
|
||||||
TickPrice float64 `json:"tick_price" binding:"omitempty,min=0"` // 跳点价格,非必填,需大于等于0
|
TickPrice float64 `json:"tick_price" binding:"min=0"` // 跳点价格,必填,需大于等于0
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateVarietyResponse 注册响应结构
|
// CreateVarietyResponse 注册响应结构
|
||||||
@@ -54,7 +54,7 @@ func CreateVarietyHandler(c *gin.Context) {
|
|||||||
)
|
)
|
||||||
c.JSON(http.StatusBadRequest, CreateVarietyResponse{
|
c.JSON(http.StatusBadRequest, CreateVarietyResponse{
|
||||||
Success: false,
|
Success: false,
|
||||||
Message: "请求参数错误:name和code为必填项,tick和tick_price需大于等于0",
|
Message: "请求参数错误:name、code、tick和tick_price为必填项,且tick和tick_price需大于等于0",
|
||||||
})
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user