diff --git a/server/api/v1/autocode/autocodeExample.go b/server/api/v1/autocode/autocodeExample.go index f520f4751495001e17080d68bd8c742a3eac2d44..100248311bc5c3998bded99d1b787bd01b62a040 100644 --- a/server/api/v1/autocode/autocodeExample.go +++ b/server/api/v1/autocode/autocodeExample.go @@ -78,7 +78,7 @@ func (autoCodeExampleApi *AutoCodeExampleApi) UpdateAutoCodeExample(c *gin.Conte // @Security ApiKeyAuth // @accept application/json // @Produce application/json -// @Param data body autocode.AutoCodeExample true "用id查询AutoCodeExample" +// @Param data query autocode.AutoCodeExample true "用id查询AutoCodeExample" // @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}" // @Router /autoCodeExample/findAutoCodeExample [get] func (autoCodeExampleApi *AutoCodeExampleApi) FindAutoCodeExample(c *gin.Context) { @@ -101,7 +101,7 @@ func (autoCodeExampleApi *AutoCodeExampleApi) FindAutoCodeExample(c *gin.Context // @Security ApiKeyAuth // @accept application/json // @Produce application/json -// @Param data body autocodeReq.AutoCodeExampleSearch true "页码, 每页大小, 搜索条件" +// @Param data query autocodeReq.AutoCodeExampleSearch true "页码, 每页大小, 搜索条件" // @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" // @Router /autoCodeExample/getAutoCodeExampleList [get] func (autoCodeExampleApi *AutoCodeExampleApi) GetAutoCodeExampleList(c *gin.Context) { diff --git a/server/api/v1/example/exa_customer.go b/server/api/v1/example/exa_customer.go index caca26b0e483271cc99cdd9a65f789a8676621b5..01ede414ed776474438abed371cdffce33e8abfd 100644 --- a/server/api/v1/example/exa_customer.go +++ b/server/api/v1/example/exa_customer.go @@ -94,7 +94,7 @@ func (e *CustomerApi) UpdateExaCustomer(c *gin.Context) { // @Security ApiKeyAuth // @accept application/json // @Produce application/json -// @Param data body example.ExaCustomer true "客户ID" +// @Param data query example.ExaCustomer true "客户ID" // @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" // @Router /customer/customer [get] func (e *CustomerApi) GetExaCustomer(c *gin.Context) { @@ -118,7 +118,7 @@ func (e *CustomerApi) GetExaCustomer(c *gin.Context) { // @Security ApiKeyAuth // @accept application/json // @Produce application/json -// @Param data body request.PageInfo true "页码, 每页大小" +// @Param data query request.PageInfo true "页码, 每页大小" // @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" // @Router /customer/customerList [get] func (e *CustomerApi) GetExaCustomerList(c *gin.Context) { diff --git a/server/api/v1/system/sys_captcha.go b/server/api/v1/system/sys_captcha.go index 0aed33d5ca604778ed5420db4de6dcb2206066bb..1a357f7d8a768212344fb158a3d54bbe92f80178 100644 --- a/server/api/v1/system/sys_captcha.go +++ b/server/api/v1/system/sys_captcha.go @@ -10,7 +10,7 @@ import ( ) // 当开启多服务器部署时,替换下面的配置,使用redis共享存储验证码 -// var store = captcha.NewDefaultRedisStore() +//var store = captcha.NewDefaultRedisStore() var store = base64Captcha.DefaultMemStore type BaseApi struct { @@ -27,6 +27,7 @@ func (b *BaseApi) Captcha(c *gin.Context) { // 字符,公式,验证码配置 // 生成默认数字的driver driver := base64Captcha.NewDriverDigit(global.GVA_CONFIG.Captcha.ImgHeight, global.GVA_CONFIG.Captcha.ImgWidth, global.GVA_CONFIG.Captcha.KeyLong, 0.7, 80) + //cp := base64Captcha.NewCaptcha(driver, store.UseWithCtx(c)) // v8下使用redis cp := base64Captcha.NewCaptcha(driver, store) if id, b64s, err := cp.Generate(); err != nil { global.GVA_LOG.Error("验证码获取失败!", zap.Any("err", err)) diff --git a/server/api/v1/system/sys_dictionary.go b/server/api/v1/system/sys_dictionary.go index 9cbaff28231b850260f94057fc8d9d0c9d96112d..11aa61048c755002a33c595533bf33fd89a869a0 100644 --- a/server/api/v1/system/sys_dictionary.go +++ b/server/api/v1/system/sys_dictionary.go @@ -75,7 +75,7 @@ func (s *DictionaryApi) UpdateSysDictionary(c *gin.Context) { // @Security ApiKeyAuth // @accept application/json // @Produce application/json -// @Param data body system.SysDictionary true "ID或字典英名" +// @Param data query system.SysDictionary true "ID或字典英名" // @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}" // @Router /sysDictionary/findSysDictionary [get] func (s *DictionaryApi) FindSysDictionary(c *gin.Context) { @@ -94,7 +94,7 @@ func (s *DictionaryApi) FindSysDictionary(c *gin.Context) { // @Security ApiKeyAuth // @accept application/json // @Produce application/json -// @Param data body request.SysDictionarySearch true "页码, 每页大小, 搜索条件" +// @Param data query request.SysDictionarySearch true "页码, 每页大小, 搜索条件" // @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" // @Router /sysDictionary/getSysDictionaryList [get] func (s *DictionaryApi) GetSysDictionaryList(c *gin.Context) { diff --git a/server/api/v1/system/sys_dictionary_detail.go b/server/api/v1/system/sys_dictionary_detail.go index 49ab796da6881c39eb7d4314e8beb47b20a52a36..756b640e62e0b641591af2b1fef69d84245dcc72 100644 --- a/server/api/v1/system/sys_dictionary_detail.go +++ b/server/api/v1/system/sys_dictionary_detail.go @@ -75,7 +75,7 @@ func (s *DictionaryDetailApi) UpdateSysDictionaryDetail(c *gin.Context) { // @Security ApiKeyAuth // @accept application/json // @Produce application/json -// @Param data body system.SysDictionaryDetail true "用id查询SysDictionaryDetail" +// @Param data query system.SysDictionaryDetail true "用id查询SysDictionaryDetail" // @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}" // @Router /sysDictionaryDetail/findSysDictionaryDetail [get] func (s *DictionaryDetailApi) FindSysDictionaryDetail(c *gin.Context) { @@ -98,7 +98,7 @@ func (s *DictionaryDetailApi) FindSysDictionaryDetail(c *gin.Context) { // @Security ApiKeyAuth // @accept application/json // @Produce application/json -// @Param data body request.SysDictionaryDetailSearch true "页码, 每页大小, 搜索条件" +// @Param data query request.SysDictionaryDetailSearch true "页码, 每页大小, 搜索条件" // @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" // @Router /sysDictionaryDetail/getSysDictionaryDetailList [get] func (s *DictionaryDetailApi) GetSysDictionaryDetailList(c *gin.Context) { diff --git a/server/api/v1/system/sys_operation_record.go b/server/api/v1/system/sys_operation_record.go index 43380be31ceae4017ec8521689fbec885aef262a..1fb1bdcebf07eac4ce549fa381ed4e0e50abab3e 100644 --- a/server/api/v1/system/sys_operation_record.go +++ b/server/api/v1/system/sys_operation_record.go @@ -76,7 +76,7 @@ func (s *OperationRecordApi) DeleteSysOperationRecordByIds(c *gin.Context) { // @Security ApiKeyAuth // @accept application/json // @Produce application/json -// @Param data body system.SysOperationRecord true "Id" +// @Param data query system.SysOperationRecord true "Id" // @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}" // @Router /sysOperationRecord/findSysOperationRecord [get] func (s *OperationRecordApi) FindSysOperationRecord(c *gin.Context) { @@ -99,7 +99,7 @@ func (s *OperationRecordApi) FindSysOperationRecord(c *gin.Context) { // @Security ApiKeyAuth // @accept application/json // @Produce application/json -// @Param data body request.SysOperationRecordSearch true "页码, 每页大小, 搜索条件" +// @Param data query request.SysOperationRecordSearch true "页码, 每页大小, 搜索条件" // @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" // @Router /sysOperationRecord/getSysOperationRecordList [get] func (s *OperationRecordApi) GetSysOperationRecordList(c *gin.Context) { diff --git a/server/api/v1/system/sys_user.go b/server/api/v1/system/sys_user.go index 6db0c34f17ecaa6c0879baac23db7f2233a1e3bb..29d1262cf2415c238de18101ca66f3ee3556b616 100644 --- a/server/api/v1/system/sys_user.go +++ b/server/api/v1/system/sys_user.go @@ -14,7 +14,7 @@ import ( "github.com/dgrijalva/jwt-go" "github.com/gin-gonic/gin" - "github.com/go-redis/redis" + "github.com/go-redis/redis/v8" "go.uber.org/zap" ) @@ -142,7 +142,7 @@ func (b *BaseApi) Register(c *gin.Context) { // @Produce application/json // @Param data body systemReq.ChangePasswordStruct true "用户名, 原密码, 新密码" // @Success 200 {string} string "{"success":true,"data":{},"msg":"修改成功"}" -// @Router /user/changePassword [put] +// @Router /user/changePassword [post] func (b *BaseApi) ChangePassword(c *gin.Context) { var user systemReq.ChangePasswordStruct _ = c.ShouldBindJSON(&user) diff --git a/server/docs/docs.go b/server/docs/docs.go index c68deccad463eab8b877a503fd90c6c4c436e5c9..851b7f2df0c6be6dcd652b8303c65a815f99948e 100644 --- a/server/docs/docs.go +++ b/server/docs/docs.go @@ -1013,13 +1013,28 @@ var doc = `{ "summary": "用id查询AutoCodeExample", "parameters": [ { - "description": "用id查询AutoCodeExample", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/autocode.AutoCodeExample" - } + "type": "string", + "description": "展示值", + "name": "autoCodeExampleField", + "in": "query" + }, + { + "type": "string", + "description": "创建时间", + "name": "createdAt", + "in": "query" + }, + { + "type": "integer", + "description": "主键ID", + "name": "id", + "in": "query" + }, + { + "type": "string", + "description": "更新时间", + "name": "updatedAt", + "in": "query" } ], "responses": { @@ -1051,13 +1066,40 @@ var doc = `{ "summary": "分页获取AutoCodeExample列表", "parameters": [ { - "description": "页码, 每页大小, 搜索条件", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.AutoCodeExampleSearch" - } + "type": "string", + "description": "展示值", + "name": "autoCodeExampleField", + "in": "query" + }, + { + "type": "string", + "description": "创建时间", + "name": "createdAt", + "in": "query" + }, + { + "type": "integer", + "description": "主键ID", + "name": "id", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "更新时间", + "name": "updatedAt", + "in": "query" } ], "responses": { @@ -1260,13 +1302,46 @@ var doc = `{ "summary": "获取单一客户信息", "parameters": [ { - "description": "客户ID", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/example.ExaCustomer" - } + "type": "string", + "description": "创建时间", + "name": "createdAt", + "in": "query" + }, + { + "type": "string", + "description": "客户名", + "name": "customerName", + "in": "query" + }, + { + "type": "string", + "description": "客户手机号", + "name": "customerPhoneData", + "in": "query" + }, + { + "type": "integer", + "description": "主键ID", + "name": "id", + "in": "query" + }, + { + "type": "string", + "description": "管理角色ID", + "name": "sysUserAuthorityID", + "in": "query" + }, + { + "type": "integer", + "description": "管理ID", + "name": "sysUserId", + "in": "query" + }, + { + "type": "string", + "description": "更新时间", + "name": "updatedAt", + "in": "query" } ], "responses": { @@ -1406,13 +1481,16 @@ var doc = `{ "summary": "分页获取权限客户列表", "parameters": [ { - "description": "页码, 每页大小", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.PageInfo" - } + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" } ], "responses": { @@ -1476,9 +1554,7 @@ var doc = `{ } ], "responses": { - "200": { - "description": "" - } + "200": {} } } }, @@ -1511,9 +1587,7 @@ var doc = `{ } ], "responses": { - "200": { - "description": "" - } + "200": {} } } }, @@ -2301,13 +2375,46 @@ var doc = `{ "summary": "用id查询SysDictionary", "parameters": [ { - "description": "ID或字典英名", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/system.SysDictionary" - } + "type": "string", + "description": "创建时间", + "name": "createdAt", + "in": "query" + }, + { + "type": "string", + "description": "描述", + "name": "desc", + "in": "query" + }, + { + "type": "integer", + "description": "主键ID", + "name": "id", + "in": "query" + }, + { + "type": "string", + "description": "字典名(中)", + "name": "name", + "in": "query" + }, + { + "type": "boolean", + "description": "状态", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "字典名(英)", + "name": "type", + "in": "query" + }, + { + "type": "string", + "description": "更新时间", + "name": "updatedAt", + "in": "query" } ], "responses": { @@ -2339,13 +2446,58 @@ var doc = `{ "summary": "分页获取SysDictionary列表", "parameters": [ { - "description": "页码, 每页大小, 搜索条件", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.SysDictionarySearch" - } + "type": "string", + "description": "创建时间", + "name": "createdAt", + "in": "query" + }, + { + "type": "string", + "description": "描述", + "name": "desc", + "in": "query" + }, + { + "type": "integer", + "description": "主键ID", + "name": "id", + "in": "query" + }, + { + "type": "string", + "description": "字典名(中)", + "name": "name", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "boolean", + "description": "状态", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "字典名(英)", + "name": "type", + "in": "query" + }, + { + "type": "string", + "description": "更新时间", + "name": "updatedAt", + "in": "query" } ], "responses": { @@ -2491,13 +2643,52 @@ var doc = `{ "summary": "用id查询SysDictionaryDetail", "parameters": [ { - "description": "用id查询SysDictionaryDetail", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/system.SysDictionaryDetail" - } + "type": "string", + "description": "创建时间", + "name": "createdAt", + "in": "query" + }, + { + "type": "integer", + "description": "主键ID", + "name": "id", + "in": "query" + }, + { + "type": "string", + "description": "展示值", + "name": "label", + "in": "query" + }, + { + "type": "integer", + "description": "排序标记", + "name": "sort", + "in": "query" + }, + { + "type": "boolean", + "description": "启用状态", + "name": "status", + "in": "query" + }, + { + "type": "integer", + "description": "关联标记", + "name": "sysDictionaryID", + "in": "query" + }, + { + "type": "string", + "description": "更新时间", + "name": "updatedAt", + "in": "query" + }, + { + "type": "integer", + "description": "字典值", + "name": "value", + "in": "query" } ], "responses": { @@ -2529,13 +2720,64 @@ var doc = `{ "summary": "分页获取SysDictionaryDetail列表", "parameters": [ { - "description": "页码, 每页大小, 搜索条件", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.SysDictionaryDetailSearch" - } + "type": "string", + "description": "创建时间", + "name": "createdAt", + "in": "query" + }, + { + "type": "integer", + "description": "主键ID", + "name": "id", + "in": "query" + }, + { + "type": "string", + "description": "展示值", + "name": "label", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "integer", + "description": "排序标记", + "name": "sort", + "in": "query" + }, + { + "type": "boolean", + "description": "启用状态", + "name": "status", + "in": "query" + }, + { + "type": "integer", + "description": "关联标记", + "name": "sysDictionaryID", + "in": "query" + }, + { + "type": "string", + "description": "更新时间", + "name": "updatedAt", + "in": "query" + }, + { + "type": "integer", + "description": "字典值", + "name": "value", + "in": "query" } ], "responses": { @@ -2719,13 +2961,82 @@ var doc = `{ "summary": "用id查询SysOperationRecord", "parameters": [ { - "description": "Id", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/system.SysOperationRecord" - } + "type": "string", + "description": "代理", + "name": "agent", + "in": "query" + }, + { + "type": "string", + "description": "请求Body", + "name": "body", + "in": "query" + }, + { + "type": "string", + "description": "创建时间", + "name": "createdAt", + "in": "query" + }, + { + "type": "string", + "description": "错误信息", + "name": "error_message", + "in": "query" + }, + { + "type": "integer", + "description": "主键ID", + "name": "id", + "in": "query" + }, + { + "type": "string", + "description": "请求ip", + "name": "ip", + "in": "query" + }, + { + "type": "string", + "description": "延迟", + "name": "latency", + "in": "query" + }, + { + "type": "string", + "description": "请求方法", + "name": "method", + "in": "query" + }, + { + "type": "string", + "description": "请求路径", + "name": "path", + "in": "query" + }, + { + "type": "string", + "description": "响应Body", + "name": "resp", + "in": "query" + }, + { + "type": "integer", + "description": "请求状态", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "更新时间", + "name": "updatedAt", + "in": "query" + }, + { + "type": "integer", + "description": "用户id", + "name": "user_id", + "in": "query" } ], "responses": { @@ -2757,13 +3068,94 @@ var doc = `{ "summary": "分页获取SysOperationRecord列表", "parameters": [ { - "description": "页码, 每页大小, 搜索条件", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.SysOperationRecordSearch" - } + "type": "string", + "description": "代理", + "name": "agent", + "in": "query" + }, + { + "type": "string", + "description": "请求Body", + "name": "body", + "in": "query" + }, + { + "type": "string", + "description": "创建时间", + "name": "createdAt", + "in": "query" + }, + { + "type": "string", + "description": "错误信息", + "name": "error_message", + "in": "query" + }, + { + "type": "integer", + "description": "主键ID", + "name": "id", + "in": "query" + }, + { + "type": "string", + "description": "请求ip", + "name": "ip", + "in": "query" + }, + { + "type": "string", + "description": "延迟", + "name": "latency", + "in": "query" + }, + { + "type": "string", + "description": "请求方法", + "name": "method", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "请求路径", + "name": "path", + "in": "query" + }, + { + "type": "string", + "description": "响应Body", + "name": "resp", + "in": "query" + }, + { + "type": "integer", + "description": "请求状态", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "更新时间", + "name": "updatedAt", + "in": "query" + }, + { + "type": "integer", + "description": "用户id", + "name": "user_id", + "in": "query" } ], "responses": { @@ -2884,7 +3276,7 @@ var doc = `{ } }, "/user/changePassword": { - "put": { + "post": { "security": [ { "ApiKeyAuth": [] @@ -2956,6 +3348,33 @@ var doc = `{ } } }, + "/user/getUserInfo": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysUser" + ], + "summary": "获取用户信息", + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, "/user/getUserList": { "post": { "security": [ @@ -3024,7 +3443,7 @@ var doc = `{ } } }, - "/user/setUserAuthority": { + "/user/setUserAuthorities": { "post": { "security": [ { @@ -3041,6 +3460,44 @@ var doc = `{ "SysUser" ], "summary": "设置用户权限", + "parameters": [ + { + "description": "用户UUID, 角色ID", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.SetUserAuthorities" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"修改成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/user/setUserAuthority": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysUser" + ], + "summary": "更改用户权限", "parameters": [ { "description": "用户UUID, 角色ID", @@ -3655,35 +4112,6 @@ var doc = `{ } } }, - "request.AutoCodeExampleSearch": { - "type": "object", - "properties": { - "autoCodeExampleField": { - "description": "展示值", - "type": "string" - }, - "createdAt": { - "description": "创建时间", - "type": "string" - }, - "id": { - "description": "主键ID", - "type": "integer" - }, - "page": { - "description": "页码", - "type": "integer" - }, - "pageSize": { - "description": "每页大小", - "type": "integer" - }, - "updatedAt": { - "description": "更新时间", - "type": "string" - } - } - }, "request.AutoHistoryByID": { "type": "object", "properties": { @@ -3838,6 +4266,12 @@ var doc = `{ "authorityId": { "type": "string" }, + "authorityIds": { + "type": "array", + "items": { + "type": "string" + } + }, "headerImg": { "type": "string" }, @@ -3907,153 +4341,27 @@ var doc = `{ "authorityId": { "description": "角色ID", "type": "string" - }, - "uuid": { - "description": "用户UUID", - "type": "string" } } }, - "request.SysAutoHistory": { - "type": "object", - "properties": { - "page": { - "description": "页码", - "type": "integer" - }, - "pageSize": { - "description": "每页大小", - "type": "integer" - } - } - }, - "request.SysDictionaryDetailSearch": { + "request.SetUserAuthorities": { "type": "object", "properties": { - "createdAt": { - "description": "创建时间", - "type": "string" - }, - "id": { - "description": "主键ID", - "type": "integer" - }, - "label": { - "description": "展示值", - "type": "string" - }, - "page": { - "description": "页码", - "type": "integer" - }, - "pageSize": { - "description": "每页大小", - "type": "integer" - }, - "sort": { - "description": "排序标记", - "type": "integer" - }, - "status": { - "description": "启用状态", - "type": "boolean" - }, - "sysDictionaryID": { - "description": "关联标记", - "type": "integer" - }, - "updatedAt": { - "description": "更新时间", - "type": "string" - }, - "value": { - "description": "字典值", - "type": "integer" - } - } - }, - "request.SysDictionarySearch": { - "type": "object", - "properties": { - "createdAt": { - "description": "创建时间", - "type": "string" - }, - "desc": { - "description": "描述", - "type": "string" - }, - "id": { - "description": "主键ID", - "type": "integer" - }, - "name": { - "description": "字典名(中)", - "type": "string" - }, - "page": { - "description": "页码", - "type": "integer" - }, - "pageSize": { - "description": "每页大小", - "type": "integer" - }, - "status": { - "description": "状态", - "type": "boolean" - }, - "sysDictionaryDetails": { + "authorityIds": { + "description": "角色ID", "type": "array", "items": { - "$ref": "#/definitions/system.SysDictionaryDetail" + "type": "string" } }, - "type": { - "description": "字典名(英)", - "type": "string" - }, - "updatedAt": { - "description": "更新时间", - "type": "string" + "id": { + "type": "integer" } } }, - "request.SysOperationRecordSearch": { + "request.SysAutoHistory": { "type": "object", "properties": { - "agent": { - "description": "代理", - "type": "string" - }, - "body": { - "description": "请求Body", - "type": "string" - }, - "createdAt": { - "description": "创建时间", - "type": "string" - }, - "error_message": { - "description": "错误信息", - "type": "string" - }, - "id": { - "description": "主键ID", - "type": "integer" - }, - "ip": { - "description": "请求ip", - "type": "string" - }, - "latency": { - "description": "延迟", - "type": "string" - }, - "method": { - "description": "请求方法", - "type": "string" - }, "page": { "description": "页码", "type": "integer" @@ -4061,29 +4369,6 @@ var doc = `{ "pageSize": { "description": "每页大小", "type": "integer" - }, - "path": { - "description": "请求路径", - "type": "string" - }, - "resp": { - "description": "响应Body", - "type": "string" - }, - "status": { - "description": "请求状态", - "type": "integer" - }, - "updatedAt": { - "description": "更新时间", - "type": "string" - }, - "user": { - "$ref": "#/definitions/system.SysUser" - }, - "user_id": { - "description": "用户id", - "type": "integer" } } }, @@ -4524,6 +4809,12 @@ var doc = `{ "description": "活跃颜色", "type": "string" }, + "authorities": { + "type": "array", + "items": { + "$ref": "#/definitions/system.SysAuthority" + } + }, "authority": { "$ref": "#/definitions/system.SysAuthority" }, diff --git a/server/docs/swagger.json b/server/docs/swagger.json index 9fc6f9abe12703dfc037e81a2c0999ccfedb3688..b48dbd9a94a9b569bfffc8cb97cfb4bffa25be67 100644 --- a/server/docs/swagger.json +++ b/server/docs/swagger.json @@ -997,13 +997,28 @@ "summary": "用id查询AutoCodeExample", "parameters": [ { - "description": "用id查询AutoCodeExample", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/autocode.AutoCodeExample" - } + "type": "string", + "description": "展示值", + "name": "autoCodeExampleField", + "in": "query" + }, + { + "type": "string", + "description": "创建时间", + "name": "createdAt", + "in": "query" + }, + { + "type": "integer", + "description": "主键ID", + "name": "id", + "in": "query" + }, + { + "type": "string", + "description": "更新时间", + "name": "updatedAt", + "in": "query" } ], "responses": { @@ -1035,13 +1050,40 @@ "summary": "分页获取AutoCodeExample列表", "parameters": [ { - "description": "页码, 每页大小, 搜索条件", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.AutoCodeExampleSearch" - } + "type": "string", + "description": "展示值", + "name": "autoCodeExampleField", + "in": "query" + }, + { + "type": "string", + "description": "创建时间", + "name": "createdAt", + "in": "query" + }, + { + "type": "integer", + "description": "主键ID", + "name": "id", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "更新时间", + "name": "updatedAt", + "in": "query" } ], "responses": { @@ -1244,13 +1286,46 @@ "summary": "获取单一客户信息", "parameters": [ { - "description": "客户ID", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/example.ExaCustomer" - } + "type": "string", + "description": "创建时间", + "name": "createdAt", + "in": "query" + }, + { + "type": "string", + "description": "客户名", + "name": "customerName", + "in": "query" + }, + { + "type": "string", + "description": "客户手机号", + "name": "customerPhoneData", + "in": "query" + }, + { + "type": "integer", + "description": "主键ID", + "name": "id", + "in": "query" + }, + { + "type": "string", + "description": "管理角色ID", + "name": "sysUserAuthorityID", + "in": "query" + }, + { + "type": "integer", + "description": "管理ID", + "name": "sysUserId", + "in": "query" + }, + { + "type": "string", + "description": "更新时间", + "name": "updatedAt", + "in": "query" } ], "responses": { @@ -1390,13 +1465,16 @@ "summary": "分页获取权限客户列表", "parameters": [ { - "description": "页码, 每页大小", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.PageInfo" - } + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" } ], "responses": { @@ -1460,9 +1538,7 @@ } ], "responses": { - "200": { - "description": "" - } + "200": {} } } }, @@ -1495,9 +1571,7 @@ } ], "responses": { - "200": { - "description": "" - } + "200": {} } } }, @@ -2285,13 +2359,46 @@ "summary": "用id查询SysDictionary", "parameters": [ { - "description": "ID或字典英名", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/system.SysDictionary" - } + "type": "string", + "description": "创建时间", + "name": "createdAt", + "in": "query" + }, + { + "type": "string", + "description": "描述", + "name": "desc", + "in": "query" + }, + { + "type": "integer", + "description": "主键ID", + "name": "id", + "in": "query" + }, + { + "type": "string", + "description": "字典名(中)", + "name": "name", + "in": "query" + }, + { + "type": "boolean", + "description": "状态", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "字典名(英)", + "name": "type", + "in": "query" + }, + { + "type": "string", + "description": "更新时间", + "name": "updatedAt", + "in": "query" } ], "responses": { @@ -2323,13 +2430,58 @@ "summary": "分页获取SysDictionary列表", "parameters": [ { - "description": "页码, 每页大小, 搜索条件", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.SysDictionarySearch" - } + "type": "string", + "description": "创建时间", + "name": "createdAt", + "in": "query" + }, + { + "type": "string", + "description": "描述", + "name": "desc", + "in": "query" + }, + { + "type": "integer", + "description": "主键ID", + "name": "id", + "in": "query" + }, + { + "type": "string", + "description": "字典名(中)", + "name": "name", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "boolean", + "description": "状态", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "字典名(英)", + "name": "type", + "in": "query" + }, + { + "type": "string", + "description": "更新时间", + "name": "updatedAt", + "in": "query" } ], "responses": { @@ -2475,13 +2627,52 @@ "summary": "用id查询SysDictionaryDetail", "parameters": [ { - "description": "用id查询SysDictionaryDetail", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/system.SysDictionaryDetail" - } + "type": "string", + "description": "创建时间", + "name": "createdAt", + "in": "query" + }, + { + "type": "integer", + "description": "主键ID", + "name": "id", + "in": "query" + }, + { + "type": "string", + "description": "展示值", + "name": "label", + "in": "query" + }, + { + "type": "integer", + "description": "排序标记", + "name": "sort", + "in": "query" + }, + { + "type": "boolean", + "description": "启用状态", + "name": "status", + "in": "query" + }, + { + "type": "integer", + "description": "关联标记", + "name": "sysDictionaryID", + "in": "query" + }, + { + "type": "string", + "description": "更新时间", + "name": "updatedAt", + "in": "query" + }, + { + "type": "integer", + "description": "字典值", + "name": "value", + "in": "query" } ], "responses": { @@ -2513,13 +2704,64 @@ "summary": "分页获取SysDictionaryDetail列表", "parameters": [ { - "description": "页码, 每页大小, 搜索条件", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.SysDictionaryDetailSearch" - } + "type": "string", + "description": "创建时间", + "name": "createdAt", + "in": "query" + }, + { + "type": "integer", + "description": "主键ID", + "name": "id", + "in": "query" + }, + { + "type": "string", + "description": "展示值", + "name": "label", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "integer", + "description": "排序标记", + "name": "sort", + "in": "query" + }, + { + "type": "boolean", + "description": "启用状态", + "name": "status", + "in": "query" + }, + { + "type": "integer", + "description": "关联标记", + "name": "sysDictionaryID", + "in": "query" + }, + { + "type": "string", + "description": "更新时间", + "name": "updatedAt", + "in": "query" + }, + { + "type": "integer", + "description": "字典值", + "name": "value", + "in": "query" } ], "responses": { @@ -2703,13 +2945,82 @@ "summary": "用id查询SysOperationRecord", "parameters": [ { - "description": "Id", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/system.SysOperationRecord" - } + "type": "string", + "description": "代理", + "name": "agent", + "in": "query" + }, + { + "type": "string", + "description": "请求Body", + "name": "body", + "in": "query" + }, + { + "type": "string", + "description": "创建时间", + "name": "createdAt", + "in": "query" + }, + { + "type": "string", + "description": "错误信息", + "name": "error_message", + "in": "query" + }, + { + "type": "integer", + "description": "主键ID", + "name": "id", + "in": "query" + }, + { + "type": "string", + "description": "请求ip", + "name": "ip", + "in": "query" + }, + { + "type": "string", + "description": "延迟", + "name": "latency", + "in": "query" + }, + { + "type": "string", + "description": "请求方法", + "name": "method", + "in": "query" + }, + { + "type": "string", + "description": "请求路径", + "name": "path", + "in": "query" + }, + { + "type": "string", + "description": "响应Body", + "name": "resp", + "in": "query" + }, + { + "type": "integer", + "description": "请求状态", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "更新时间", + "name": "updatedAt", + "in": "query" + }, + { + "type": "integer", + "description": "用户id", + "name": "user_id", + "in": "query" } ], "responses": { @@ -2741,13 +3052,94 @@ "summary": "分页获取SysOperationRecord列表", "parameters": [ { - "description": "页码, 每页大小, 搜索条件", - "name": "data", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/request.SysOperationRecordSearch" - } + "type": "string", + "description": "代理", + "name": "agent", + "in": "query" + }, + { + "type": "string", + "description": "请求Body", + "name": "body", + "in": "query" + }, + { + "type": "string", + "description": "创建时间", + "name": "createdAt", + "in": "query" + }, + { + "type": "string", + "description": "错误信息", + "name": "error_message", + "in": "query" + }, + { + "type": "integer", + "description": "主键ID", + "name": "id", + "in": "query" + }, + { + "type": "string", + "description": "请求ip", + "name": "ip", + "in": "query" + }, + { + "type": "string", + "description": "延迟", + "name": "latency", + "in": "query" + }, + { + "type": "string", + "description": "请求方法", + "name": "method", + "in": "query" + }, + { + "type": "integer", + "description": "页码", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "每页大小", + "name": "pageSize", + "in": "query" + }, + { + "type": "string", + "description": "请求路径", + "name": "path", + "in": "query" + }, + { + "type": "string", + "description": "响应Body", + "name": "resp", + "in": "query" + }, + { + "type": "integer", + "description": "请求状态", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "更新时间", + "name": "updatedAt", + "in": "query" + }, + { + "type": "integer", + "description": "用户id", + "name": "user_id", + "in": "query" } ], "responses": { @@ -2868,7 +3260,7 @@ } }, "/user/changePassword": { - "put": { + "post": { "security": [ { "ApiKeyAuth": [] @@ -2940,6 +3332,33 @@ } } }, + "/user/getUserInfo": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysUser" + ], + "summary": "获取用户信息", + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, "/user/getUserList": { "post": { "security": [ @@ -3008,7 +3427,7 @@ } } }, - "/user/setUserAuthority": { + "/user/setUserAuthorities": { "post": { "security": [ { @@ -3025,6 +3444,44 @@ "SysUser" ], "summary": "设置用户权限", + "parameters": [ + { + "description": "用户UUID, 角色ID", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/request.SetUserAuthorities" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"修改成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/user/setUserAuthority": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysUser" + ], + "summary": "更改用户权限", "parameters": [ { "description": "用户UUID, 角色ID", @@ -3639,35 +4096,6 @@ } } }, - "request.AutoCodeExampleSearch": { - "type": "object", - "properties": { - "autoCodeExampleField": { - "description": "展示值", - "type": "string" - }, - "createdAt": { - "description": "创建时间", - "type": "string" - }, - "id": { - "description": "主键ID", - "type": "integer" - }, - "page": { - "description": "页码", - "type": "integer" - }, - "pageSize": { - "description": "每页大小", - "type": "integer" - }, - "updatedAt": { - "description": "更新时间", - "type": "string" - } - } - }, "request.AutoHistoryByID": { "type": "object", "properties": { @@ -3822,6 +4250,12 @@ "authorityId": { "type": "string" }, + "authorityIds": { + "type": "array", + "items": { + "type": "string" + } + }, "headerImg": { "type": "string" }, @@ -3891,153 +4325,27 @@ "authorityId": { "description": "角色ID", "type": "string" - }, - "uuid": { - "description": "用户UUID", - "type": "string" } } }, - "request.SysAutoHistory": { - "type": "object", - "properties": { - "page": { - "description": "页码", - "type": "integer" - }, - "pageSize": { - "description": "每页大小", - "type": "integer" - } - } - }, - "request.SysDictionaryDetailSearch": { + "request.SetUserAuthorities": { "type": "object", "properties": { - "createdAt": { - "description": "创建时间", - "type": "string" - }, - "id": { - "description": "主键ID", - "type": "integer" - }, - "label": { - "description": "展示值", - "type": "string" - }, - "page": { - "description": "页码", - "type": "integer" - }, - "pageSize": { - "description": "每页大小", - "type": "integer" - }, - "sort": { - "description": "排序标记", - "type": "integer" - }, - "status": { - "description": "启用状态", - "type": "boolean" - }, - "sysDictionaryID": { - "description": "关联标记", - "type": "integer" - }, - "updatedAt": { - "description": "更新时间", - "type": "string" - }, - "value": { - "description": "字典值", - "type": "integer" - } - } - }, - "request.SysDictionarySearch": { - "type": "object", - "properties": { - "createdAt": { - "description": "创建时间", - "type": "string" - }, - "desc": { - "description": "描述", - "type": "string" - }, - "id": { - "description": "主键ID", - "type": "integer" - }, - "name": { - "description": "字典名(中)", - "type": "string" - }, - "page": { - "description": "页码", - "type": "integer" - }, - "pageSize": { - "description": "每页大小", - "type": "integer" - }, - "status": { - "description": "状态", - "type": "boolean" - }, - "sysDictionaryDetails": { + "authorityIds": { + "description": "角色ID", "type": "array", "items": { - "$ref": "#/definitions/system.SysDictionaryDetail" + "type": "string" } }, - "type": { - "description": "字典名(英)", - "type": "string" - }, - "updatedAt": { - "description": "更新时间", - "type": "string" + "id": { + "type": "integer" } } }, - "request.SysOperationRecordSearch": { + "request.SysAutoHistory": { "type": "object", "properties": { - "agent": { - "description": "代理", - "type": "string" - }, - "body": { - "description": "请求Body", - "type": "string" - }, - "createdAt": { - "description": "创建时间", - "type": "string" - }, - "error_message": { - "description": "错误信息", - "type": "string" - }, - "id": { - "description": "主键ID", - "type": "integer" - }, - "ip": { - "description": "请求ip", - "type": "string" - }, - "latency": { - "description": "延迟", - "type": "string" - }, - "method": { - "description": "请求方法", - "type": "string" - }, "page": { "description": "页码", "type": "integer" @@ -4045,29 +4353,6 @@ "pageSize": { "description": "每页大小", "type": "integer" - }, - "path": { - "description": "请求路径", - "type": "string" - }, - "resp": { - "description": "响应Body", - "type": "string" - }, - "status": { - "description": "请求状态", - "type": "integer" - }, - "updatedAt": { - "description": "更新时间", - "type": "string" - }, - "user": { - "$ref": "#/definitions/system.SysUser" - }, - "user_id": { - "description": "用户id", - "type": "integer" } } }, @@ -4508,6 +4793,12 @@ "description": "活跃颜色", "type": "string" }, + "authorities": { + "type": "array", + "items": { + "$ref": "#/definitions/system.SysAuthority" + } + }, "authority": { "$ref": "#/definitions/system.SysAuthority" }, diff --git a/server/docs/swagger.yaml b/server/docs/swagger.yaml index 429aa6f5b3dbeff0eab0e21a43e2850625e40030..af6f70c2dc4b66a8b99fb5e6e92adbb01565830f 100644 --- a/server/docs/swagger.yaml +++ b/server/docs/swagger.yaml @@ -387,27 +387,6 @@ definitions: $ref: '#/definitions/system.SysBaseMenu' type: array type: object - request.AutoCodeExampleSearch: - properties: - autoCodeExampleField: - description: 展示值 - type: string - createdAt: - description: 创建时间 - type: string - id: - description: 主键ID - type: integer - page: - description: 页码 - type: integer - pageSize: - description: 每页大小 - type: integer - updatedAt: - description: 更新时间 - type: string - type: object request.AutoHistoryByID: properties: id: @@ -514,6 +493,10 @@ definitions: properties: authorityId: type: string + authorityIds: + items: + type: string + type: array headerImg: type: string nickName: @@ -564,135 +547,25 @@ definitions: authorityId: description: 角色ID type: string - uuid: - description: 用户UUID - type: string type: object - request.SysAutoHistory: + request.SetUserAuthorities: properties: - page: - description: 页码 - type: integer - pageSize: - description: 每页大小 - type: integer - type: object - request.SysDictionaryDetailSearch: - properties: - createdAt: - description: 创建时间 - type: string - id: - description: 主键ID - type: integer - label: - description: 展示值 - type: string - page: - description: 页码 - type: integer - pageSize: - description: 每页大小 - type: integer - sort: - description: 排序标记 - type: integer - status: - description: 启用状态 - type: boolean - sysDictionaryID: - description: 关联标记 - type: integer - updatedAt: - description: 更新时间 - type: string - value: - description: 字典值 - type: integer - type: object - request.SysDictionarySearch: - properties: - createdAt: - description: 创建时间 - type: string - desc: - description: 描述 - type: string - id: - description: 主键ID - type: integer - name: - description: 字典名(中) - type: string - page: - description: 页码 - type: integer - pageSize: - description: 每页大小 - type: integer - status: - description: 状态 - type: boolean - sysDictionaryDetails: + authorityIds: + description: 角色ID items: - $ref: '#/definitions/system.SysDictionaryDetail' + type: string type: array - type: - description: 字典名(英) - type: string - updatedAt: - description: 更新时间 - type: string - type: object - request.SysOperationRecordSearch: - properties: - agent: - description: 代理 - type: string - body: - description: 请求Body - type: string - createdAt: - description: 创建时间 - type: string - error_message: - description: 错误信息 - type: string id: - description: 主键ID type: integer - ip: - description: 请求ip - type: string - latency: - description: 延迟 - type: string - method: - description: 请求方法 - type: string + type: object + request.SysAutoHistory: + properties: page: description: 页码 type: integer pageSize: description: 每页大小 type: integer - path: - description: 请求路径 - type: string - resp: - description: 响应Body - type: string - status: - description: 请求状态 - type: integer - updatedAt: - description: 更新时间 - type: string - user: - $ref: '#/definitions/system.SysUser' - user_id: - description: 用户id - type: integer type: object response.SysAuthorityCopyResponse: properties: @@ -1009,6 +882,10 @@ definitions: activeColor: description: 活跃颜色 type: string + authorities: + items: + $ref: '#/definitions/system.SysAuthority' + type: array authority: $ref: '#/definitions/system.SysAuthority' authorityId: @@ -1644,12 +1521,22 @@ paths: consumes: - application/json parameters: - - description: 用id查询AutoCodeExample - in: body - name: data - required: true - schema: - $ref: '#/definitions/autocode.AutoCodeExample' + - description: 展示值 + in: query + name: autoCodeExampleField + type: string + - description: 创建时间 + in: query + name: createdAt + type: string + - description: 主键ID + in: query + name: id + type: integer + - description: 更新时间 + in: query + name: updatedAt + type: string produces: - application/json responses: @@ -1667,12 +1554,30 @@ paths: consumes: - application/json parameters: - - description: 页码, 每页大小, 搜索条件 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.AutoCodeExampleSearch' + - description: 展示值 + in: query + name: autoCodeExampleField + type: string + - description: 创建时间 + in: query + name: createdAt + type: string + - description: 主键ID + in: query + name: id + type: integer + - description: 页码 + in: query + name: page + type: integer + - description: 每页大小 + in: query + name: pageSize + type: integer + - description: 更新时间 + in: query + name: updatedAt + type: string produces: - application/json responses: @@ -1816,12 +1721,34 @@ paths: consumes: - application/json parameters: - - description: 客户ID - in: body - name: data - required: true - schema: - $ref: '#/definitions/example.ExaCustomer' + - description: 创建时间 + in: query + name: createdAt + type: string + - description: 客户名 + in: query + name: customerName + type: string + - description: 客户手机号 + in: query + name: customerPhoneData + type: string + - description: 主键ID + in: query + name: id + type: integer + - description: 管理角色ID + in: query + name: sysUserAuthorityID + type: string + - description: 管理ID + in: query + name: sysUserId + type: integer + - description: 更新时间 + in: query + name: updatedAt + type: string produces: - application/json responses: @@ -1883,12 +1810,14 @@ paths: consumes: - application/json parameters: - - description: 页码, 每页大小 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.PageInfo' + - description: 页码 + in: query + name: page + type: integer + - description: 每页大小 + in: query + name: pageSize + type: integer produces: - application/json responses: @@ -1928,8 +1857,7 @@ paths: produces: - application/json responses: - "200": - description: "" + "200": {} security: - ApiKeyAuth: [] summary: 下载模板 @@ -1949,8 +1877,7 @@ paths: produces: - application/octet-stream responses: - "200": - description: "" + "200": {} security: - ApiKeyAuth: [] summary: 导出Excel @@ -2425,12 +2352,34 @@ paths: consumes: - application/json parameters: - - description: ID或字典英名 - in: body - name: data - required: true - schema: - $ref: '#/definitions/system.SysDictionary' + - description: 创建时间 + in: query + name: createdAt + type: string + - description: 描述 + in: query + name: desc + type: string + - description: 主键ID + in: query + name: id + type: integer + - description: 字典名(中) + in: query + name: name + type: string + - description: 状态 + in: query + name: status + type: boolean + - description: 字典名(英) + in: query + name: type + type: string + - description: 更新时间 + in: query + name: updatedAt + type: string produces: - application/json responses: @@ -2448,12 +2397,42 @@ paths: consumes: - application/json parameters: - - description: 页码, 每页大小, 搜索条件 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.SysDictionarySearch' + - description: 创建时间 + in: query + name: createdAt + type: string + - description: 描述 + in: query + name: desc + type: string + - description: 主键ID + in: query + name: id + type: integer + - description: 字典名(中) + in: query + name: name + type: string + - description: 页码 + in: query + name: page + type: integer + - description: 每页大小 + in: query + name: pageSize + type: integer + - description: 状态 + in: query + name: status + type: boolean + - description: 字典名(英) + in: query + name: type + type: string + - description: 更新时间 + in: query + name: updatedAt + type: string produces: - application/json responses: @@ -2540,12 +2519,38 @@ paths: consumes: - application/json parameters: - - description: 用id查询SysDictionaryDetail - in: body - name: data - required: true - schema: - $ref: '#/definitions/system.SysDictionaryDetail' + - description: 创建时间 + in: query + name: createdAt + type: string + - description: 主键ID + in: query + name: id + type: integer + - description: 展示值 + in: query + name: label + type: string + - description: 排序标记 + in: query + name: sort + type: integer + - description: 启用状态 + in: query + name: status + type: boolean + - description: 关联标记 + in: query + name: sysDictionaryID + type: integer + - description: 更新时间 + in: query + name: updatedAt + type: string + - description: 字典值 + in: query + name: value + type: integer produces: - application/json responses: @@ -2563,12 +2568,46 @@ paths: consumes: - application/json parameters: - - description: 页码, 每页大小, 搜索条件 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.SysDictionaryDetailSearch' + - description: 创建时间 + in: query + name: createdAt + type: string + - description: 主键ID + in: query + name: id + type: integer + - description: 展示值 + in: query + name: label + type: string + - description: 页码 + in: query + name: page + type: integer + - description: 每页大小 + in: query + name: pageSize + type: integer + - description: 排序标记 + in: query + name: sort + type: integer + - description: 启用状态 + in: query + name: status + type: boolean + - description: 关联标记 + in: query + name: sysDictionaryID + type: integer + - description: 更新时间 + in: query + name: updatedAt + type: string + - description: 字典值 + in: query + name: value + type: integer produces: - application/json responses: @@ -2678,12 +2717,58 @@ paths: consumes: - application/json parameters: - - description: Id - in: body - name: data - required: true - schema: - $ref: '#/definitions/system.SysOperationRecord' + - description: 代理 + in: query + name: agent + type: string + - description: 请求Body + in: query + name: body + type: string + - description: 创建时间 + in: query + name: createdAt + type: string + - description: 错误信息 + in: query + name: error_message + type: string + - description: 主键ID + in: query + name: id + type: integer + - description: 请求ip + in: query + name: ip + type: string + - description: 延迟 + in: query + name: latency + type: string + - description: 请求方法 + in: query + name: method + type: string + - description: 请求路径 + in: query + name: path + type: string + - description: 响应Body + in: query + name: resp + type: string + - description: 请求状态 + in: query + name: status + type: integer + - description: 更新时间 + in: query + name: updatedAt + type: string + - description: 用户id + in: query + name: user_id + type: integer produces: - application/json responses: @@ -2701,12 +2786,66 @@ paths: consumes: - application/json parameters: - - description: 页码, 每页大小, 搜索条件 - in: body - name: data - required: true - schema: - $ref: '#/definitions/request.SysOperationRecordSearch' + - description: 代理 + in: query + name: agent + type: string + - description: 请求Body + in: query + name: body + type: string + - description: 创建时间 + in: query + name: createdAt + type: string + - description: 错误信息 + in: query + name: error_message + type: string + - description: 主键ID + in: query + name: id + type: integer + - description: 请求ip + in: query + name: ip + type: string + - description: 延迟 + in: query + name: latency + type: string + - description: 请求方法 + in: query + name: method + type: string + - description: 页码 + in: query + name: page + type: integer + - description: 每页大小 + in: query + name: pageSize + type: integer + - description: 请求路径 + in: query + name: path + type: string + - description: 响应Body + in: query + name: resp + type: string + - description: 请求状态 + in: query + name: status + type: integer + - description: 更新时间 + in: query + name: updatedAt + type: string + - description: 用户id + in: query + name: user_id + type: integer produces: - application/json responses: @@ -2783,7 +2922,7 @@ paths: tags: - System /user/changePassword: - put: + post: parameters: - description: 用户名, 原密码, 新密码 in: body @@ -2826,6 +2965,22 @@ paths: summary: 删除用户 tags: - SysUser + /user/getUserInfo: + get: + consumes: + - application/json + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 获取用户信息 + tags: + - SysUser /user/getUserList: post: consumes: @@ -2868,6 +3023,29 @@ paths: summary: 用户注册账号 tags: - SysUser + /user/setUserAuthorities: + post: + consumes: + - application/json + parameters: + - description: 用户UUID, 角色ID + in: body + name: data + required: true + schema: + $ref: '#/definitions/request.SetUserAuthorities' + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"修改成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 设置用户权限 + tags: + - SysUser /user/setUserAuthority: post: consumes: @@ -2888,7 +3066,7 @@ paths: type: string security: - ApiKeyAuth: [] - summary: 设置用户权限 + summary: 更改用户权限 tags: - SysUser /user/setUserInfo: diff --git a/server/go.mod b/server/go.mod index 1dcc8ef4ac28306bd249268661b45c5b10e54e98..19c98309374744cdea89208a3ace6ac36d45033e 100644 --- a/server/go.mod +++ b/server/go.mod @@ -10,7 +10,6 @@ require ( github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f // indirect github.com/casbin/casbin/v2 v2.11.0 github.com/casbin/gorm-adapter/v3 v3.0.2 - github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239 // indirect github.com/fsnotify/fsnotify v1.4.9 @@ -37,7 +36,6 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/qiniu/api.v7/v7 v7.4.1 github.com/robfig/cron/v3 v3.0.1 - github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/satori/go.uuid v1.2.0 github.com/shirou/gopsutil v3.21.1+incompatible github.com/spf13/afero v1.2.2 // indirect diff --git a/server/resource/template/server/api.go.tpl b/server/resource/template/server/api.go.tpl index 1b639d636e36f52923fb234cd6bfb803520ee36f..92ed7c6a9d6ccc292f39b336c7b118fcdb678ec9 100644 --- a/server/resource/template/server/api.go.tpl +++ b/server/resource/template/server/api.go.tpl @@ -103,7 +103,7 @@ func ({{.Abbreviation}}Api *{{.StructName}}Api) Update{{.StructName}}(c *gin.Con // @Security ApiKeyAuth // @accept application/json // @Produce application/json -// @Param data body autocode.{{.StructName}} true "用id查询{{.StructName}}" +// @Param data query autocode.{{.StructName}} true "用id查询{{.StructName}}" // @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}" // @Router /{{.Abbreviation}}/find{{.StructName}} [get] func ({{.Abbreviation}}Api *{{.StructName}}Api) Find{{.StructName}}(c *gin.Context) { @@ -123,7 +123,7 @@ func ({{.Abbreviation}}Api *{{.StructName}}Api) Find{{.StructName}}(c *gin.Conte // @Security ApiKeyAuth // @accept application/json // @Produce application/json -// @Param data body autocodeReq.{{.StructName}}Search true "分页获取{{.StructName}}列表" +// @Param data query autocodeReq.{{.StructName}}Search true "分页获取{{.StructName}}列表" // @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" // @Router /{{.Abbreviation}}/get{{.StructName}}List [get] func ({{.Abbreviation}}Api *{{.StructName}}Api) Get{{.StructName}}List(c *gin.Context) { diff --git a/server/resource/template/web/api.js.tpl b/server/resource/template/web/api.js.tpl index 58ab2e00b6c2ae1ed2da9bfa394de01b359308b6..9b771ba986d03f5b2a0d2d829c0d15fb96b42e1f 100644 --- a/server/resource/template/web/api.js.tpl +++ b/server/resource/template/web/api.js.tpl @@ -69,7 +69,7 @@ export const update{{.StructName}} = (data) => { // @Security ApiKeyAuth // @accept application/json // @Produce application/json -// @Param data body model.{{.StructName}} true "用id查询{{.StructName}}" +// @Param data query model.{{.StructName}} true "用id查询{{.StructName}}" // @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}" // @Router /{{.Abbreviation}}/find{{.StructName}} [get] export const find{{.StructName}} = (params) => { @@ -85,7 +85,7 @@ export const find{{.StructName}} = (params) => { // @Security ApiKeyAuth // @accept application/json // @Produce application/json -// @Param data body request.PageInfo true "分页获取{{.StructName}}列表" +// @Param data query request.PageInfo true "分页获取{{.StructName}}列表" // @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" // @Router /{{.Abbreviation}}/get{{.StructName}}List [get] export const get{{.StructName}}List = (params) => { diff --git a/server/service/system/sys_autocode_history.go b/server/service/system/sys_autocode_history.go index 8a70da78954c473bf2ad47c804eb54e7d73bed49..1a9770a1e22c630440f6e2d84ce1121b21a44350 100644 --- a/server/service/system/sys_autocode_history.go +++ b/server/service/system/sys_autocode_history.go @@ -1,11 +1,14 @@ package system import ( + "fmt" "gin-vue-admin/global" "gin-vue-admin/model/common/request" "gin-vue-admin/model/system" "gin-vue-admin/utils" + "path/filepath" "strings" + "time" "go.uber.org/zap" ) @@ -55,8 +58,16 @@ func (autoCodeHistoryService *AutoCodeHistoryService) RollBack(id uint) error { } } // 删除文件 + for _, path := range strings.Split(md.AutoCodePath, ";") { - _ = utils.DeLFile(path) + // 迁移 + nPath := filepath.Join(global.GVA_CONFIG.AutoCode.Root, + "rm_file", time.Now().Format("20060102"), filepath.Base(filepath.Dir(filepath.Dir(path))), filepath.Base(filepath.Dir(path)), filepath.Base(path)) + err = utils.FileMove(path, nPath) + if err != nil { + fmt.Println(">>>>>>>>>>>>>>>>>>>", err) + } + //_ = utils.DeLFile(path) } // 清除注入 for _, v := range strings.Split(md.InjectionMeta, ";") { diff --git a/server/utils/captcha/redis.go b/server/utils/captcha/redis.go index 2e0a906f733a9197180a070f7228924f2c30ec7c..67b99ae6d9f620f97472f5def479139f5b5e460c 100644 --- a/server/utils/captcha/redis.go +++ b/server/utils/captcha/redis.go @@ -1,14 +1,14 @@ package captcha import ( + "context" "gin-vue-admin/global" - "time" - "github.com/mojocn/base64Captcha" "go.uber.org/zap" + "time" ) -func NewDefaultRedisStore() base64Captcha.Store { +func NewDefaultRedisStore() *RedisStore { return &RedisStore{ Expiration: time.Second * 180, PreKey: "CAPTCHA_", @@ -18,23 +18,29 @@ func NewDefaultRedisStore() base64Captcha.Store { type RedisStore struct { Expiration time.Duration PreKey string + Context context.Context +} + +func (rs *RedisStore) UseWithCtx(ctx context.Context) base64Captcha.Store { + rs.Context = ctx + return rs } func (rs *RedisStore) Set(id string, value string) { - err := global.GVA_REDIS.Set(rs.PreKey+id, value, rs.Expiration).Err() + err := global.GVA_REDIS.Set(rs.Context, rs.PreKey+id, value, rs.Expiration).Err() if err != nil { global.GVA_LOG.Error("RedisStoreSetError!", zap.Error(err)) } } func (rs *RedisStore) Get(key string, clear bool) string { - val, err := global.GVA_REDIS.Get(key).Result() + val, err := global.GVA_REDIS.Get(rs.Context, key).Result() if err != nil { global.GVA_LOG.Error("RedisStoreGetError!", zap.Error(err)) return "" } if clear { - err := global.GVA_REDIS.Del(key).Err() + err := global.GVA_REDIS.Del(rs.Context, key).Err() if err != nil { global.GVA_LOG.Error("RedisStoreClearError!", zap.Error(err)) return ""