feat:added api template insert doc
This commit is contained in:
1 parent
87aa013cf7
commit
7b4ff44360
2 files changed
+9
-2
No files matched your search
@@ -22,8 +22,6 @@ if index := c.Request.FormValue("pageIndex"); index != "" {
|
||||
pageIndex = tools.StrToInt(err, index)
|
||||
}
|
||||
|
||||
|
||||
|
||||
data.DataScope = tools.GetUserIdStr(c)
|
||||
result, count, err := data.GetPage(pageSize, pageIndex)
|
||||
tools.HasError(err, "", -1)
|
||||
|
||||
@@ -49,6 +49,15 @@ tools.HasError(err, "抱歉未找到相关信息", -1)
|
||||
app.OK(c, result, "")
|
||||
}
|
||||
|
||||
// @Summary 添加{{.TableComment}}
|
||||
// @Description 获取JSON
|
||||
// @Tags {{.TableComment}}
|
||||
// @Accept application/json
|
||||
// @Product application/json
|
||||
// @Param data body models.{{.ClassName}} true "data"
|
||||
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}"
|
||||
// @Success 200 {string} string "{"code": -1, "message": "添加失败"}"
|
||||
// @Router /api/v1/{{.ModuleName}} [post]
|
||||
func Insert{{.ClassName}}(c *gin.Context) {
|
||||
var data models.{{.ClassName}}
|
||||
err := c.ShouldBindJSON(&data)
|
||||
|
||||
Reference in new issue
Block a user