经皮湿水仪init and bind's all api
This commit is contained in:
@@ -5,10 +5,11 @@ import "lone-services/pkg/validate"
|
||||
type BindItemsValidator struct {
|
||||
Page int `form:"page" json:"page"`
|
||||
Size int `form:"size" json:"size"`
|
||||
Status uint8 `form:"status" json:"status"`
|
||||
Status int32 `form:"status" json:"status"`
|
||||
NickName string `form:"nick_name" json:"nick_name"`
|
||||
Code string `form:"code" json:"code"`
|
||||
Time []string `form:"time" json:"time"`
|
||||
Type int32 `form:"type" json:"type"`
|
||||
}
|
||||
|
||||
// GetMessage 提示消息
|
||||
@@ -33,6 +34,7 @@ func (p BindSetExpiryValidator) GetMessage() validate.ValidatorMessages {
|
||||
type BindValidator struct {
|
||||
HostNickname string `form:"host_nickname" json:"host_nickname" validate:"required"`
|
||||
HostCode string `form:"host_code" json:"host_code" validate:"required"`
|
||||
Type int32 `form:"type" json:"type"`
|
||||
}
|
||||
|
||||
// GetMessage 提示消息
|
||||
@@ -55,26 +57,30 @@ func (p BindUnbindValidator) GetMessage() validate.ValidatorMessages {
|
||||
}
|
||||
|
||||
type BindExpiryValidator struct {
|
||||
HostCode string `form:"host_code" json:"host_code" binding:"required"`
|
||||
Type uint8 `form:"type" json:"type" binding:"required,oneof=1 2"`
|
||||
HostCode string `form:"host_code" json:"host_code" binding:"required"`
|
||||
Type int32 `form:"type" json:"type" binding:"required,oneof=1 2"`
|
||||
EquipmentType int32 `form:"equipment_type" json:"equipment_type" binding:"required"`
|
||||
}
|
||||
|
||||
// GetMessage 提示消息
|
||||
func (p BindExpiryValidator) GetMessage() validate.ValidatorMessages {
|
||||
return validate.ValidatorMessages{
|
||||
"HostCode.required": "缺少设备编码",
|
||||
"Type.required": "缺少设备类型",
|
||||
"Type.oneof": "设备类型错误",
|
||||
"HostCode.required": "缺少设备编码",
|
||||
"Type.required": "缺少类型",
|
||||
"Type.oneof": "类型错误",
|
||||
"EquipmentType.required": "设备类型错误",
|
||||
}
|
||||
}
|
||||
|
||||
type BindGetExpiryValidator struct {
|
||||
HostCode string `form:"host_code" json:"host_code" binding:"required"`
|
||||
Type int32 `form:"type" json:"ype" binding:"required"`
|
||||
}
|
||||
|
||||
// GetMessage 提示消息
|
||||
func (p BindGetExpiryValidator) GetMessage() validate.ValidatorMessages {
|
||||
return validate.ValidatorMessages{
|
||||
"HostCode.required": "缺少设备编码",
|
||||
"Type.required": "缺少类型",
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user