fix:Invalid post search criteria

This commit is contained in:
zhangwenjian
2020-07-11 06:34:51 +08:00
parent 494ee18b9f
commit 2280ce2b57
2 changed files with 18 additions and 14 deletions
+15 -14
View File
@@ -7,12 +7,13 @@ import (
"go-admin/tools/app"
)
// @Summary 位列表数据
// @Summary 位列表数据
// @Description 获取JSON
// @Tags
// @Param name query string false "name"
// @Param id query string false "id"
// @Param position query string false "position"
// @Tags
// @Param postName query string false "postName"
// @Param postCode query string false "postCode"
// @Param postId query string false "postId"
// @Param status query string false "status"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/post [get]
// @Security
@@ -30,7 +31,7 @@ func GetPostList(c *gin.Context) {
pageIndex = tools.StrToInt(err, index)
}
data.PostName = c.Request.FormValue("postName")
data.PostCode = c.Request.FormValue("postCode")
id := c.Request.FormValue("postId")
data.PostId, _ = tools.StringToInt(id)
@@ -41,9 +42,9 @@ func GetPostList(c *gin.Context) {
app.PageOK(c, result, count, pageIndex, pageSize, "")
}
// @Summary 获取字典数据
// @Summary 获取岗位信息
// @Description 获取JSON
// @Tags 字典数据
// @Tags 岗位
// @Param postId path int true "postId"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/post/{postId} [get]
@@ -56,9 +57,9 @@ func GetPost(c *gin.Context) {
app.OK(c,result,"")
}
// @Summary 添加
// @Summary 添加
// @Description 获取JSON
// @Tags
// @Tags
// @Accept application/json
// @Product application/json
// @Param data body models.Post true "data"
@@ -76,9 +77,9 @@ func InsertPost(c *gin.Context) {
app.OK(c,result,"")
}
// @Summary 修改
// @Summary 修改
// @Description 获取JSON
// @Tags
// @Tags
// @Accept application/json
// @Product application/json
// @Param data body models.Dept true "body"
@@ -97,9 +98,9 @@ func UpdatePost(c *gin.Context) {
app.OK(c,result,"修改成功")
}
// @Summary 删除
// @Summary 删除
// @Description 删除数据
// @Tags
// @Tags
// @Param id path int true "id"
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}"
// @Success 200 {string} string "{"code": -1, "message": "删除失败"}"