From 1dc8a9399ec544a0e3706e74f55348bbfdf108c5 Mon Sep 17 00:00:00 2001 From: mhxw <32643286+mhxw@users.noreply.github.com> Date: Tue, 25 Oct 2022 18:16:04 +0800 Subject: [PATCH] update swagger and fix task api --- apis/log/loginLog.go | 4 ++-- apis/process/task.go | 2 +- apis/system/dept.go | 4 ++-- apis/system/menu.go | 2 +- apis/system/post.go | 4 ++-- apis/system/role.go | 4 ++-- apis/system/sysuser.go | 4 ++-- handler/auth.go | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/apis/log/loginLog.go b/apis/log/loginLog.go index e1499df..4504ec9 100644 --- a/apis/log/loginLog.go +++ b/apis/log/loginLog.go @@ -88,7 +88,7 @@ func GetLoginLog(c *gin.Context) { // @Tags 登录日志 // @Accept application/json // @Product application/json -// @Param data body models.LoginLog true "data" +// @Param data body system.LoginLog true "data" // @Success 200 {string} string "{"code": 200, "message": "添加成功"}" // @Success 200 {string} string "{"code": -1, "message": "添加失败"}" // @Router /api/v1/loginlog [post] @@ -115,7 +115,7 @@ func InsertLoginLog(c *gin.Context) { // @Tags 登录日志 // @Accept application/json // @Product application/json -// @Param data body models.LoginLog true "body" +// @Param data body system.LoginLog true "body" // @Success 200 {string} string "{"code": 200, "message": "添加成功"}" // @Success 200 {string} string "{"code": -1, "message": "添加失败"}" // @Router /api/v1/loginlog [put] diff --git a/apis/process/task.go b/apis/process/task.go index bdc560e..82187bf 100644 --- a/apis/process/task.go +++ b/apis/process/task.go @@ -198,7 +198,7 @@ func UpdateTask(c *gin.Context) { // 删除任务 func DeleteTask(c *gin.Context) { fullName := c.DefaultQuery("full_name", "") - if fullName == "" || Strings.Contains(fullName, "/") { + if fullName == "" || strings.Contains(fullName, "/") { app.Error(c, -1, errors.New("参数不正确,请确定参数full_name是否传递"), "") return } diff --git a/apis/system/dept.go b/apis/system/dept.go index b3a90e3..d74a398 100644 --- a/apis/system/dept.go +++ b/apis/system/dept.go @@ -107,7 +107,7 @@ func GetDept(c *gin.Context) { // @Tags 部门 // @Accept application/json // @Product application/json -// @Param data body models.Dept true "data" +// @Param data body system.Dept true "data" // @Success 200 {string} string "{"code": 200, "message": "添加成功"}" // @Success 200 {string} string "{"code": -1, "message": "添加失败"}" // @Router /api/v1/dept [post] @@ -134,7 +134,7 @@ func InsertDept(c *gin.Context) { // @Accept application/json // @Product application/json // @Param id path int true "id" -// @Param data body models.Dept true "body" +// @Param data body system.Dept true "body" // @Success 200 {string} string "{"code": 200, "message": "添加成功"}" // @Success 200 {string} string "{"code": -1, "message": "添加失败"}" // @Router /api/v1/dept [put] diff --git a/apis/system/menu.go b/apis/system/menu.go index cf4dff7..b923ceb 100644 --- a/apis/system/menu.go +++ b/apis/system/menu.go @@ -145,7 +145,7 @@ func InsertMenu(c *gin.Context) { // @Accept application/x-www-form-urlencoded // @Product application/x-www-form-urlencoded // @Param id path int true "id" -// @Param data body models.Menu true "body" +// @Param data body system.Menu true "body" // @Success 200 {string} string "{"code": 200, "message": "修改成功"}" // @Success 200 {string} string "{"code": -1, "message": "修改失败"}" // @Router /api/v1/menu/{id} [put] diff --git a/apis/system/post.go b/apis/system/post.go index ee63556..45793be 100644 --- a/apis/system/post.go +++ b/apis/system/post.go @@ -79,7 +79,7 @@ func GetPost(c *gin.Context) { // @Tags 职位 // @Accept application/json // @Product application/json -// @Param data body models.Post true "data" +// @Param data body system.Post true "data" // @Success 200 {string} string "{"code": 200, "message": "添加成功"}" // @Success 200 {string} string "{"code": -1, "message": "添加失败"}" // @Router /api/v1/post [post] @@ -105,7 +105,7 @@ func InsertPost(c *gin.Context) { // @Tags 职位 // @Accept application/json // @Product application/json -// @Param data body models.Dept true "body" +// @Param data body system.Dept true "body" // @Success 200 {string} string "{"code": 200, "message": "添加成功"}" // @Success 200 {string} string "{"code": -1, "message": "添加失败"}" // @Router /api/v1/post/ [put] diff --git a/apis/system/role.go b/apis/system/role.go index 74be923..5e4eed3 100644 --- a/apis/system/role.go +++ b/apis/system/role.go @@ -87,7 +87,7 @@ func GetRole(c *gin.Context) { // @Tags 角色/Role // @Accept application/json // @Product application/json -// @Param data body models.SysRole true "data" +// @Param data body system.SysRole true "data" // @Success 200 {string} string "{"code": 200, "message": "添加成功"}" // @Success 200 {string} string "{"code": -1, "message": "添加失败"}" // @Router /api/v1/role [post] @@ -119,7 +119,7 @@ func InsertRole(c *gin.Context) { // @Tags 角色/Role // @Accept application/json // @Product application/json -// @Param data body models.SysRole true "body" +// @Param data body system.SysRole true "body" // @Success 200 {string} string "{"code": 200, "message": "修改成功"}" // @Success 200 {string} string "{"code": -1, "message": "修改失败"}" // @Router /api/v1/role [put] diff --git a/apis/system/sysuser.go b/apis/system/sysuser.go index 6c4fa89..efc3e82 100644 --- a/apis/system/sysuser.go +++ b/apis/system/sysuser.go @@ -184,7 +184,7 @@ func GetSysUserInit(c *gin.Context) { // @Tags 用户 // @Accept application/json // @Product application/json -// @Param data body models.SysUser true "用户数据" +// @Param data body system.SysUser true "用户数据" // @Success 200 {string} string "{"code": 200, "message": "添加成功"}" // @Success 200 {string} string "{"code": -1, "message": "添加失败"}" // @Router /api/v1/sysUser [post] @@ -210,7 +210,7 @@ func InsertSysUser(c *gin.Context) { // @Tags 用户 // @Accept application/json // @Product application/json -// @Param data body models.SysUser true "body" +// @Param data body system.SysUser true "body" // @Success 200 {string} string "{"code": 200, "message": "修改成功"}" // @Success 200 {string} string "{"code": -1, "message": "修改失败"}" // @Router /api/v1/sysuser/{userId} [put] diff --git a/handler/auth.go b/handler/auth.go index 5c76dc6..7f2ac49 100644 --- a/handler/auth.go +++ b/handler/auth.go @@ -55,7 +55,7 @@ func IdentityHandler(c *gin.Context) interface{} { // Reply will be of the form {"token": "TOKEN"}. // @Accept application/json // @Product application/json -// @Param username body models.Login true "Add account" +// @Param username body system.Login true "Add account" // @Success 200 {string} string "{"code": 200, "expire": "2019-08-07T12:45:48+08:00", "token": ".eyJleHAiOjE1NjUxNTMxNDgsImlkIjoiYWRtaW4iLCJvcmlnX2lhdCI6MTU2NTE0OTU0OH0.-zvzHvbg0A" }" // @Router /login [post] func Authenticator(c *gin.Context) (interface{}, error) {