You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
589 B
39 lines
589 B
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
|
|
}
|