From bb83a976131ff75a8719c2cd4e07ca074e25b82b Mon Sep 17 00:00:00 2001 From: wenjianzhang Date: Fri, 20 Aug 2021 18:28:04 +0800 Subject: [PATCH] =?UTF-8?q?refactor=F0=9F=8E=A8:=20=E4=BF=AE=E6=94=B9post?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/apis/sys_post.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/app/admin/apis/sys_post.go b/app/admin/apis/sys_post.go index 33911fb8..a12d54a2 100644 --- a/app/admin/apis/sys_post.go +++ b/app/admin/apis/sys_post.go @@ -2,6 +2,7 @@ package apis import ( "fmt" + "github.com/gin-gonic/gin" "github.com/gin-gonic/gin/binding" "github.com/go-admin-team/go-admin-core/sdk/api" @@ -93,8 +94,7 @@ func (e SysPost) Get(c *gin.Context) { // @Accept application/json // @Product application/json // @Param data body dto.SysPostInsertReq true "data" -// @Success 200 {string} string "{"code": 200, "message": "添加成功"}" -// @Success 200 {string} string "{"code": -1, "message": "添加失败"}" +// @Success 200 {object} response.Response "{"code": 200, "data": [...]}" // @Router /api/v1/post [post] // @Security Bearer func (e SysPost) Insert(c *gin.Context) { @@ -126,8 +126,7 @@ func (e SysPost) Insert(c *gin.Context) { // @Accept application/json // @Product application/json // @Param data body dto.SysPostUpdateReq true "body" -// @Success 200 {string} string "{"code": 200, "message": "添加成功"}" -// @Success 200 {string} string "{"code": -1, "message": "添加失败"}" +// @Success 200 {object} response.Response "{"code": 200, "data": [...]}" // @Router /api/v1/post/{id} [put] // @Security Bearer func (e SysPost) Update(c *gin.Context) { @@ -159,8 +158,7 @@ func (e SysPost) Update(c *gin.Context) { // @Description 删除数据 // @Tags 岗位 // @Param id body dto.SysPostDeleteReq true "请求参数" -// @Success 200 {string} string "{"code": 200, "message": "删除成功"}" -// @Success 500 {string} string "{"code": 500, "message": "删除失败"}" +// @Success 200 {object} response.Response "{"code": 200, "data": [...]}" // @Router /api/v1/post [delete] // @Security Bearer func (e SysPost) Delete(c *gin.Context) { @@ -183,4 +181,4 @@ func (e SysPost) Delete(c *gin.Context) { return } e.OK(req.GetId(), "删除成功") -} +} \ No newline at end of file