beans , mask admin
CI / changes (push) Successful in 38s
CI / ad (push) Successful in 3m1s
CI / admin (push) Successful in 34s
CI / bff (push) Successful in 29s
CI / chore (push) Successful in 34s
CI / equipment (push) Failing after 11s
CI / express (push) Successful in 27s
CI / factory (push) Successful in 32s
CI / payment (push) Successful in 29s
CI / product (push) Successful in 30s
CI / record (push) Successful in 30s
CI / sale (push) Successful in 30s
CI / task (push) Successful in 32s
CI / user (push) Successful in 31s
CI / wecom (push) Successful in 33s

This commit is contained in:
2026-09-18 16:27:13 +08:00
parent 2b19937065
commit d597975b42
21 changed files with 2778 additions and 39 deletions
+80
View File
@@ -0,0 +1,80 @@
package validator
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"`
NickName string `form:"nick_name" json:"nick_name"`
Code string `form:"code" json:"code"`
Time []string `form:"time" json:"time"`
}
// GetMessage 提示消息
func (p BindItemsValidator) GetMessage() validate.ValidatorMessages {
return validate.ValidatorMessages{}
}
type BindSetExpiryValidator struct {
Id int `form:"id" json:"id" validate:"required"`
Expiry string `form:"expiry" json:"expiry"`
Reason string `form:"reason" json:"reason" validate:"required"`
}
// GetMessage 提示消息
func (p BindSetExpiryValidator) GetMessage() validate.ValidatorMessages {
return validate.ValidatorMessages{
validate.FieldId: validate.FieldIdValue,
"Reason.required": "理由不能为空",
}
}
type BindValidator struct {
HostNickname string `form:"host_nickname" json:"host_nickname" validate:"required"`
HostCode string `form:"host_code" json:"host_code" validate:"required"`
}
// GetMessage 提示消息
func (p BindValidator) GetMessage() validate.ValidatorMessages {
return validate.ValidatorMessages{
"HostNickname.required": "缺少设备名称",
"HostCode.required": "缺少设备编码",
}
}
type BindUnbindValidator struct {
HostCode string `form:"host_code" json:"host_code" validate:"required"`
}
// GetMessage 提示消息
func (p BindUnbindValidator) GetMessage() validate.ValidatorMessages {
return validate.ValidatorMessages{
"HostCode.required": "缺少设备编码",
}
}
type BindExpiryValidator struct {
HostCode string `form:"host_code" json:"host_code" binding:"required"`
Type uint8 `form:"type" json:"type" binding:"required,oneof=1 2"`
}
// GetMessage 提示消息
func (p BindExpiryValidator) GetMessage() validate.ValidatorMessages {
return validate.ValidatorMessages{
"HostCode.required": "缺少设备编码",
"Type.required": "缺少设备类型",
"Type.oneof": "设备类型错误",
}
}
type BindGetExpiryValidator struct {
HostCode string `form:"host_code" json:"host_code" binding:"required"`
}
// GetMessage 提示消息
func (p BindGetExpiryValidator) GetMessage() validate.ValidatorMessages {
return validate.ValidatorMessages{
"HostCode.required": "缺少设备编码",
}
}