YiTao/validate/item_validate.go
2024-11-09 16:36:28 +08:00

17 lines
809 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package validate
type CreateItemParam struct {
Itemname string `json:"itemname" validate:"required,max=12" example:"女大自用iPhone18"`
// @description 商品价格,单位为分
Price int `json:"price" validate:"required" example:"1000"`
//@description 图片ID请用 /file/upload/item-img 接口上传图片后获取的图片唯一标识
Img string `json:"img" validate:"required,len=12" example:"123456789012" description:""`
Desc string `json:"desc" validate:"required" example:"这是一个女大自用的iPhone18"`
// @description 商品类型可以有多个类型请用数组传过来类型id请使用 /item/types 接口获取
Types []int `json:"types" validate:"required" example:"1,2"`
}
type DeleteItemParam struct {
Id uint `json:"id" validate:"required" example:"1"`
}