LOCK IN SHARE MODE https://juejin.cn/post/6866598870332702728
LIMIT 1 查找到一个就返回,不必再查找之后的行
req struct {
Name string `json:"name" binding:"required"`
ImagePath string `json:"imageurl" binding:"required"`
EventPath string `json:"eventurl" binding:"required"`
StartDate time.Time `json:"start_date"`
EndDate time.Time `json:"end_date"`
}
结构体字段大写为了是能够导出,json 改为小写后是为了和前端照应
bind required 绑定时该字段为空返回错误