package labelValue import ( "github.com/gin-gonic/gin" "product/backend/handlers/base" "product/backend/models" ) // 请求结构体 type PostReq struct { LabelID uint `json:"labelID" binding:"required"` models.LabelValue } type PutReq struct { ID uint `json:"id" binding:"required"` models.LabelValue } type GetReq struct { base.GetReq LabelID uint `form:"labelID"` } func (getReq *GetReq) BindAndInit(ctx *gin.Context) error { if err := ctx.ShouldBindQuery(&getReq); err != nil { return err } getReq.GetReq.Init() return nil } type DelReq struct { base.DelReq }