blog-service
blog-service copied to clipboard
swagger 注解 json格式错误
项目中为 地址
// @Param tag_id body string true "标签ID"
// @Param title body string true "文章标题"
// @Param desc body string false "文章简述"
// @Param cover_image_url body string true "封面图片地址"
// @Param content body string true "文章内容"
// @Param created_by body int true "创建者"
实质应为
type Article struct {
*Model
Title string `json:"title"`
Desc string `json:"desc"`
Content string `json:"content"`
CoverImageUrl string `json:"cover_image_url"`
State uint8 `json:"state"`
}
@Param - body Article true "标签ID"
参考:https://github.com/swaggo/gin-swagger/issues/20