refactor🎨: 修改post接口文档

This commit is contained in:
wenjianzhang
2021-08-20 18:28:04 +08:00
parent 8baae5e712
commit bb83a97613
+5 -7
View File
@@ -2,6 +2,7 @@ package apis
import ( import (
"fmt" "fmt"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding" "github.com/gin-gonic/gin/binding"
"github.com/go-admin-team/go-admin-core/sdk/api" "github.com/go-admin-team/go-admin-core/sdk/api"
@@ -93,8 +94,7 @@ func (e SysPost) Get(c *gin.Context) {
// @Accept application/json // @Accept application/json
// @Product application/json // @Product application/json
// @Param data body dto.SysPostInsertReq true "data" // @Param data body dto.SysPostInsertReq true "data"
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}" // @Success 200 {object} response.Response "{"code": 200, "data": [...]}"
// @Success 200 {string} string "{"code": -1, "message": "添加失败"}"
// @Router /api/v1/post [post] // @Router /api/v1/post [post]
// @Security Bearer // @Security Bearer
func (e SysPost) Insert(c *gin.Context) { func (e SysPost) Insert(c *gin.Context) {
@@ -126,8 +126,7 @@ func (e SysPost) Insert(c *gin.Context) {
// @Accept application/json // @Accept application/json
// @Product application/json // @Product application/json
// @Param data body dto.SysPostUpdateReq true "body" // @Param data body dto.SysPostUpdateReq true "body"
// @Success 200 {string} string "{"code": 200, "message": "添加成功"}" // @Success 200 {object} response.Response "{"code": 200, "data": [...]}"
// @Success 200 {string} string "{"code": -1, "message": "添加失败"}"
// @Router /api/v1/post/{id} [put] // @Router /api/v1/post/{id} [put]
// @Security Bearer // @Security Bearer
func (e SysPost) Update(c *gin.Context) { func (e SysPost) Update(c *gin.Context) {
@@ -159,8 +158,7 @@ func (e SysPost) Update(c *gin.Context) {
// @Description 删除数据 // @Description 删除数据
// @Tags 岗位 // @Tags 岗位
// @Param id body dto.SysPostDeleteReq true "请求参数" // @Param id body dto.SysPostDeleteReq true "请求参数"
// @Success 200 {string} string "{"code": 200, "message": "删除成功"}" // @Success 200 {object} response.Response "{"code": 200, "data": [...]}"
// @Success 500 {string} string "{"code": 500, "message": "删除失败"}"
// @Router /api/v1/post [delete] // @Router /api/v1/post [delete]
// @Security Bearer // @Security Bearer
func (e SysPost) Delete(c *gin.Context) { func (e SysPost) Delete(c *gin.Context) {
@@ -183,4 +181,4 @@ func (e SysPost) Delete(c *gin.Context) {
return return
} }
e.OK(req.GetId(), "删除成功") e.OK(req.GetId(), "删除成功")
} }