Skip to content

Commit

Permalink
Merge pull request #546 from go-admin-team/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
wenjianzhang authored Aug 21, 2021
2 parents 49e4c19 + bb83a97 commit 974a809
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
12 changes: 5 additions & 7 deletions app/admin/apis/sys_post.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand All @@ -183,4 +181,4 @@ func (e SysPost) Delete(c *gin.Context) {
return
}
e.OK(req.GetId(), "删除成功")
}
}
4 changes: 2 additions & 2 deletions common/middleware/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func AuthInit() (*jwt.GinJWTMiddleware, error) {
}
return jwt.New(&jwt.GinJWTMiddleware{
Realm: "test zone",
Key: []byte(config.ApplicationConfig.JwtSecret),
Key: []byte(config.JwtConfig.Secret),
Timeout: timeout,
MaxRefresh: time.Hour,
PayloadFunc: handler.PayloadFunc,
Expand All @@ -33,4 +33,4 @@ func AuthInit() (*jwt.GinJWTMiddleware, error) {
TimeFunc: time.Now,
})

}
}

0 comments on commit 974a809

Please sign in to comment.