diff --git a/QMPlusServer/controller/api/exa_breakpoint_continue.go b/QMPlusServer/controller/api/exa_breakpoint_continue.go index 4b39ae6f537330abd4bcac90e6e4ec9dbd5b060f..5aa095058d1843ec6f31e60702066e62c1b26777 100644 --- a/QMPlusServer/controller/api/exa_breakpoint_continue.go +++ b/QMPlusServer/controller/api/exa_breakpoint_continue.go @@ -17,7 +17,6 @@ import ( // @Param file formData file true "断点续传示例" // @Success 200 {string} string "{"success":true,"data":{},"msg":"上传成功"}" // @Router /fileUploadAndDownload/breakpointContinue [post] - func BreakpointContinue(c *gin.Context) { fileMd5 := c.Request.FormValue("fileMd5") fileName := c.Request.FormValue("fileName") @@ -62,7 +61,7 @@ func BreakpointContinue(c *gin.Context) { // @Security ApiKeyAuth // @accept multipart/form-data // @Produce application/json -// @Param file params file true "查找文件" +// @Param file formData file true "查找文件" // @Success 200 {string} string "{"success":true,"data":{},"msg":"查找成功"}" // @Router /fileUploadAndDownload/findFile [post] func FindFile(c *gin.Context) { @@ -82,7 +81,7 @@ func FindFile(c *gin.Context) { // @Security ApiKeyAuth // @accept multipart/form-data // @Produce application/json -// @Param file params file true "查找文件" +// @Param file formData file true "查找文件" // @Success 200 {string} string "{"success":true,"data":{},"msg":"查找成功"}" // @Router /fileUploadAndDownload/findFile [post] func BreakpointContinueFinish(c *gin.Context) { @@ -101,7 +100,7 @@ func BreakpointContinueFinish(c *gin.Context) { // @Security ApiKeyAuth // @accept multipart/form-data // @Produce application/json -// @Param file params file true "查找文件" +// @Param file formData file true "查找文件" // @Success 200 {string} string "{"success":true,"data":{},"msg":"查找成功"}" // @Router /fileUploadAndDownload/removeChunk [post] func RemoveChunk(c *gin.Context) { diff --git a/QMPlusServer/controller/api/sys_captcha.go b/QMPlusServer/controller/api/sys_captcha.go index 778f64ec17cd4fd767e18d43231361d3aff70366..8ef091e2e66f9bbb67cd32684552e87c175db51f 100644 --- a/QMPlusServer/controller/api/sys_captcha.go +++ b/QMPlusServer/controller/api/sys_captcha.go @@ -1 +1,44 @@ package api + +import ( + "gin-vue-admin/controller/servers" + "github.com/dchest/captcha" + "github.com/gin-gonic/gin" +) + +// 获取图片验证码id +// @Tags base +// @Summary 生成验证码 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body modelInterface.PageInfo true "生成验证码" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /base/captcha [post] +func Captcha(c *gin.Context) { + id := captcha.NewLen(6) + captcha.Server(captcha.StdWidth,captcha.StdHeight) + servers.ReportFormat(c,true,"test",gin.H{ + "id":id, + "picPath":"/base/captcha/"+id+".png", + }) +} + +// @Tags base +// @Summary 生成验证码图片路径 +// @Security ApiKeyAuth +// @accept application/json +// @Produce application/json +// @Param data body modelInterface.PageInfo true "生成验证码图片路径" +// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}" +// @Router /base/captcha/:id [get] +func CaptchaImg(c *gin.Context) { + servers.GinCapthcaServeHTTP(c.Writer, c.Request) +} + + + + + + + diff --git a/QMPlusServer/controller/api/sys_system.go b/QMPlusServer/controller/api/sys_system.go index a34ac51f3e9c6a305c0327cd49e8a7f85d8890f8..5a8bf8456320b50068622291f0a67164c96f8fcb 100644 --- a/QMPlusServer/controller/api/sys_system.go +++ b/QMPlusServer/controller/api/sys_system.go @@ -26,7 +26,7 @@ func GetSystemConfig(c *gin.Context) { // @Summary 设置配置文件内容 // @Security ApiKeyAuth // @Produce application/json -// @Param data body sysModel.System true +// @Param data body sysModel.System true "设置配置文件内容" // @Success 200 {string} string "{"success":true,"data":{},"msg":"返回成功"}" // @Router /system/setSystemConfig [post] func SetSystemConfig(c *gin.Context) { @@ -40,11 +40,13 @@ func SetSystemConfig(c *gin.Context) { } } + +//本方法开发中 开发者windows系统 缺少linux系统所需的包 因此搁置 // @Tags system // @Summary 设置配置文件内容 // @Security ApiKeyAuth // @Produce application/json -// @Param data body sysModel.System true +// @Param data body sysModel.System true "设置配置文件内容" // @Success 200 {string} string "{"success":true,"data":{},"msg":"返回成功"}" // @Router /system/ReloadSystem [post] func ReloadSystem(c *gin.Context) { diff --git a/QMPlusServer/controller/api/sys_user.go b/QMPlusServer/controller/api/sys_user.go index 768063f38914070c663da4c72929164f64422204..8982fb28aa1ac19291461cb9dfc2444130f7a0c2 100644 --- a/QMPlusServer/controller/api/sys_user.go +++ b/QMPlusServer/controller/api/sys_user.go @@ -7,6 +7,7 @@ import ( "gin-vue-admin/middleware" "gin-vue-admin/model/modelInterface" "gin-vue-admin/model/sysModel" + "github.com/dchest/captcha" "github.com/dgrijalva/jwt-go" "github.com/gin-gonic/gin" "github.com/go-redis/redis" @@ -23,6 +24,8 @@ var ( type RegistAndLoginStuct struct { Username string `json:"username"` Password string `json:"password"` + Captcha string `json:"captcha"` + CaptchaId string `json:"captchaId"` } type RegestStuct struct { @@ -64,12 +67,17 @@ func Regist(c *gin.Context) { func Login(c *gin.Context) { var L RegistAndLoginStuct _ = c.BindJSON(&L) - U := &sysModel.SysUser{Username: L.Username, Password: L.Password} - if err, user := U.Login(); err != nil { - servers.ReportFormat(c, false, fmt.Sprintf("用户名密码错误或%v", err), gin.H{}) - } else { - tokenNext(c, *user) + if captcha.VerifyString(L.CaptchaId,L.Captcha) { + U := &sysModel.SysUser{Username: L.Username, Password: L.Password} + if err, user := U.Login(); err != nil { + servers.ReportFormat(c, false, fmt.Sprintf("用户名密码错误或%v", err), gin.H{}) + } else { + tokenNext(c, *user) + } + }else{ + servers.ReportFormat(c, false, "验证码错误", gin.H{}) } + } //登录以后签发jwt diff --git a/QMPlusServer/controller/servers/captcha.go b/QMPlusServer/controller/servers/captcha.go index 84c4cc04907b0d5c080b0b124f3de628d8567e5d..41c69aee568bae65fbded72fb7b6a9fb147ff742 100644 --- a/QMPlusServer/controller/servers/captcha.go +++ b/QMPlusServer/controller/servers/captcha.go @@ -1 +1,55 @@ package servers + +import ( + "bytes" + "fmt" + "github.com/dchest/captcha" + "net/http" + "path" + "strings" + "time" +) + +// 这里需要自行实现captcha 的gin模式 +func GinCapthcaServeHTTP(w http.ResponseWriter, r *http.Request) { + dir, file := path.Split(r.URL.Path) + ext := path.Ext(file) + id := file[:len(file)-len(ext)] + if ext == "" || id == "" { + http.NotFound(w, r) + return + } + fmt.Println("reload : " + r.FormValue("reload")) + if r.FormValue("reload") != "" { + captcha.Reload(id) + } + lang := strings.ToLower(r.FormValue("lang")) + download := path.Base(dir) == "download" + if Serve(w, r, id, ext, lang, download, captcha.StdWidth, captcha.StdHeight) == captcha.ErrNotFound { + http.NotFound(w, r) + } +} + +func Serve(w http.ResponseWriter, r *http.Request, id, ext, lang string, download bool, width, height int) error { + w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate") + w.Header().Set("Pragma", "no-cache") + w.Header().Set("Expires", "0") + var content bytes.Buffer + switch ext { + case ".png": + w.Header().Set("Content-Type", "image/png") + captcha.WriteImage(&content, id, width, height) + case ".wav": + w.Header().Set("Content-Type", "audio/x-wav") + captcha.WriteAudio(&content, id, lang) + default: + return captcha.ErrNotFound + } + + if download { + w.Header().Set("Content-Type", "application/octet-stream") + } + http.ServeContent(w, r, id+ext, time.Time{}, bytes.NewReader(content.Bytes())) + return nil +} + diff --git a/QMPlusServer/docs/docs.go b/QMPlusServer/docs/docs.go index 1203b8f3a8807b318d95771f28f4c5826e825acb..5f1dedbed1e050b94df6fa78333b87cce5b83dff 100644 --- a/QMPlusServer/docs/docs.go +++ b/QMPlusServer/docs/docs.go @@ -1,6 +1,6 @@ // GENERATED BY THE COMMAND ABOVE; DO NOT EDIT // This file was generated by swaggo/swag at -// 2020-01-06 17:53:22.2207663 +0800 CST m=+0.069844001 +// 2020-03-17 14:07:14.3860547 +0800 CST m=+0.077792301 package docs @@ -404,6 +404,84 @@ var doc = `{ } } }, + "/base/captcha": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "base" + ], + "summary": "生成验证码", + "parameters": [ + { + "description": "生成验证码", + "name": "data", + "in": "body", + "required": true, + "schema": { + "type": "object", + "$ref": "#/definitions/modelInterface.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/base/captcha/": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "base" + ], + "summary": "生成验证码图片路径", + "parameters": [ + { + "description": "生成验证码图片路径", + "name": "data", + "in": "body", + "required": true, + "schema": { + "type": "object", + "$ref": "#/definitions/modelInterface.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, "/base/login": { "post": { "produces": [ @@ -466,6 +544,45 @@ var doc = `{ } } }, + "/casbin/CasbinTest": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "casbin" + ], + "summary": "casb RBAC RESTFUL测试路由", + "parameters": [ + { + "description": "获取权限列表", + "name": "data", + "in": "body", + "required": true, + "schema": { + "type": "object", + "$ref": "#/definitions/api.CreateAuthorityParams" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, "/casbin/casbinPUpdata": { "post": { "security": [ @@ -491,13 +608,319 @@ var doc = `{ "required": true, "schema": { "type": "object", - "$ref": "#/definitions/api.CreateAuthorityParams" + "$ref": "#/definitions/sysModel.CasbinInReceive" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/casbin/getPolicyPathByAuthorityId": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "casbin" + ], + "summary": "获取权限列表", + "parameters": [ + { + "description": "获取权限列表", + "name": "data", + "in": "body", + "required": true, + "schema": { + "type": "object", + "$ref": "#/definitions/api.CreateAuthorityParams" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/customer/createExaCustomer": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysApi" + ], + "summary": "创建客户", + "parameters": [ + { + "description": "创建客户", + "name": "data", + "in": "body", + "required": true, + "schema": { + "type": "object", + "$ref": "#/definitions/dbModel.ExaCustomer" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/customer/deleteExaCustomer": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysApi" + ], + "summary": "删除客户", + "parameters": [ + { + "description": "删除客户", + "name": "data", + "in": "body", + "required": true, + "schema": { + "type": "object", + "$ref": "#/definitions/dbModel.ExaCustomer" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/customer/getExaCustomer": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysApi" + ], + "summary": "获取单一客户信息", + "parameters": [ + { + "description": "获取单一客户信息", + "name": "data", + "in": "body", + "required": true, + "schema": { + "type": "object", + "$ref": "#/definitions/dbModel.ExaCustomer" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/customer/getExaCustomerList": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysApi" + ], + "summary": "获取权限客户列表", + "parameters": [ + { + "description": "获取权限客户列表", + "name": "data", + "in": "body", + "required": true, + "schema": { + "type": "object", + "$ref": "#/definitions/modelInterface.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/customer/updataExaCustomer": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysApi" + ], + "summary": "更新客户信息", + "parameters": [ + { + "description": "创建客户", + "name": "data", + "in": "body", + "required": true, + "schema": { + "type": "object", + "$ref": "#/definitions/dbModel.ExaCustomer" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/fileUploadAndDownload/breakpointContinue": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ExaFileUploadAndDownload" + ], + "summary": "断点续传到服务器", + "parameters": [ + { + "type": "file", + "description": "断点续传示例", + "name": "file", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"上传成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/fileUploadAndDownload/deleteFile": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "ExaFileUploadAndDownload" + ], + "summary": "删除文件", + "parameters": [ + { + "description": "传入文件里面id即可", + "name": "data", + "in": "body", + "required": true, + "schema": { + "type": "object", + "$ref": "#/definitions/dbModel.ExaFileUploadAndDownload" } } ], "responses": { "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "description": "{\"success\":true,\"data\":{},\"msg\":\"返回成功\"}", "schema": { "type": "string" } @@ -505,7 +928,7 @@ var doc = `{ } } }, - "/casbin/getPolicyPathByAuthorityId": { + "/fileUploadAndDownload/findFile": { "post": { "security": [ { @@ -513,30 +936,27 @@ var doc = `{ } ], "consumes": [ - "application/json" + "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ - "casbin" + "ExaFileUploadAndDownload" ], - "summary": "获取权限列表", + "summary": "查找文件", "parameters": [ { - "description": "获取权限列表", - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "$ref": "#/definitions/api.CreateAuthorityParams" - } + "type": "file", + "description": "查找文件", + "name": "file", + "in": "formData", + "required": true } ], "responses": { "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "description": "{\"success\":true,\"data\":{},\"msg\":\"查找成功\"}", "schema": { "type": "string" } @@ -544,35 +964,38 @@ var doc = `{ } } }, - "/fileUploadAndDownload/deleteFile": { + "/fileUploadAndDownload/getFileList": { "post": { "security": [ { "ApiKeyAuth": [] } ], + "consumes": [ + "application/json" + ], "produces": [ "application/json" ], "tags": [ "ExaFileUploadAndDownload" ], - "summary": "删除文件", + "summary": "分页文件列表", "parameters": [ { - "description": "传入文件里面id即可", + "description": "分页获取文件户列表", "name": "data", "in": "body", "required": true, "schema": { "type": "object", - "$ref": "#/definitions/dbModel.ExaFileUploadAndDownload" + "$ref": "#/definitions/modelInterface.PageInfo" } } ], "responses": { "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"返回成功\"}", + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", "schema": { "type": "string" } @@ -580,7 +1003,7 @@ var doc = `{ } } }, - "/fileUploadAndDownload/getFileList": { + "/fileUploadAndDownload/removeChunk": { "post": { "security": [ { @@ -588,7 +1011,7 @@ var doc = `{ } ], "consumes": [ - "application/json" + "multipart/form-data" ], "produces": [ "application/json" @@ -596,22 +1019,19 @@ var doc = `{ "tags": [ "ExaFileUploadAndDownload" ], - "summary": "分页文件列表", + "summary": "删除切片", "parameters": [ { - "description": "分页获取文件户列表", - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "$ref": "#/definitions/modelInterface.PageInfo" - } + "type": "file", + "description": "查找文件", + "name": "file", + "in": "formData", + "required": true } ], "responses": { "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "description": "{\"success\":true,\"data\":{},\"msg\":\"查找成功\"}", "schema": { "type": "string" } @@ -988,6 +1408,102 @@ var doc = `{ } } }, + "/system/ReloadSystem": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "system" + ], + "summary": "设置配置文件内容", + "parameters": [ + { + "description": "设置配置文件内容", + "name": "data", + "in": "body", + "required": true, + "schema": { + "type": "object", + "$ref": "#/definitions/sysModel.System" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"返回成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/system/getSystemConfig": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "system" + ], + "summary": "获取配置文件内容", + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"返回成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/system/setSystemConfig": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "system" + ], + "summary": "设置配置文件内容", + "parameters": [ + { + "description": "设置配置文件内容", + "name": "data", + "in": "body", + "required": true, + "schema": { + "type": "object", + "$ref": "#/definitions/sysModel.System" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"返回成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, "/user/changePassword": { "post": { "security": [ @@ -1263,6 +1779,12 @@ var doc = `{ "api.RegistAndLoginStuct": { "type": "object", "properties": { + "captcha": { + "type": "string" + }, + "captchaId": { + "type": "string" + }, "password": { "type": "string" }, @@ -1282,6 +1804,132 @@ var doc = `{ } } }, + "config.CasbinConfig": { + "type": "object", + "properties": { + "modelPath": { + "description": "casbin model地址配置", + "type": "string" + } + } + }, + "config.Config": { + "type": "object", + "properties": { + "casbinConfig": { + "type": "object", + "$ref": "#/definitions/config.CasbinConfig" + }, + "jwt": { + "type": "object", + "$ref": "#/definitions/config.JWT" + }, + "mysqlAdmin": { + "type": "object", + "$ref": "#/definitions/config.MysqlAdmin" + }, + "qiniu": { + "type": "object", + "$ref": "#/definitions/config.Qiniu" + }, + "redisAdmin": { + "type": "object", + "$ref": "#/definitions/config.RedisAdmin" + }, + "system": { + "type": "object", + "$ref": "#/definitions/config.System" + } + } + }, + "config.JWT": { + "type": "object", + "properties": { + "signingKey": { + "type": "string" + } + } + }, + "config.MysqlAdmin": { + "type": "object", + "properties": { + "config": { + "type": "string" + }, + "dbname": { + "type": "string" + }, + "password": { + "type": "string" + }, + "path": { + "type": "string" + }, + "username": { + "type": "string" + } + } + }, + "config.Qiniu": { + "type": "object", + "properties": { + "accessKey": { + "type": "string" + }, + "secretKey": { + "type": "string" + } + } + }, + "config.RedisAdmin": { + "type": "object", + "properties": { + "addr": { + "type": "string" + }, + "db": { + "type": "integer" + }, + "password": { + "type": "string" + } + } + }, + "config.System": { + "type": "object", + "properties": { + "addr": { + "type": "integer" + }, + "env": { + "type": "string" + }, + "useMultipoint": { + "type": "boolean" + } + } + }, + "dbModel.ExaCustomer": { + "type": "object", + "properties": { + "customerName": { + "type": "string" + }, + "customerPhoneData": { + "type": "string" + }, + "sysUser": { + "type": "object", + "$ref": "#/definitions/sysModel.SysUser" + }, + "sysUserAuthorityID": { + "type": "string" + }, + "sysUserId": { + "type": "integer" + } + } + }, "dbModel.ExaFileUploadAndDownload": { "type": "object", "properties": { @@ -1310,6 +1958,31 @@ var doc = `{ } } }, + "sysModel.CasbinInReceive": { + "type": "object", + "properties": { + "authorityId": { + "type": "string" + }, + "casbinInfos": { + "type": "array", + "items": { + "$ref": "#/definitions/sysModel.CasbinInfo" + } + } + } + }, + "sysModel.CasbinInfo": { + "type": "object", + "properties": { + "method": { + "type": "string" + }, + "path": { + "type": "string" + } + } + }, "sysModel.SysApi": { "type": "object", "properties": { @@ -1319,6 +1992,9 @@ var doc = `{ "group": { "type": "string" }, + "method": { + "type": "string" + }, "path": { "type": "string" } @@ -1464,6 +2140,15 @@ var doc = `{ "type": "integer" } } + }, + "sysModel.System": { + "type": "object", + "properties": { + "config": { + "type": "object", + "$ref": "#/definitions/config.Config" + } + } } }, "securityDefinitions": { diff --git a/QMPlusServer/docs/swagger.json b/QMPlusServer/docs/swagger.json index fd84f14bc6af05a34595d04d82820a2e348474c9..f66f6034178523857c5a22e6d0e3f3ec4ffd3dce 100644 --- a/QMPlusServer/docs/swagger.json +++ b/QMPlusServer/docs/swagger.json @@ -387,6 +387,84 @@ } } }, + "/base/captcha": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "base" + ], + "summary": "生成验证码", + "parameters": [ + { + "description": "生成验证码", + "name": "data", + "in": "body", + "required": true, + "schema": { + "type": "object", + "$ref": "#/definitions/modelInterface.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/base/captcha/": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "base" + ], + "summary": "生成验证码图片路径", + "parameters": [ + { + "description": "生成验证码图片路径", + "name": "data", + "in": "body", + "required": true, + "schema": { + "type": "object", + "$ref": "#/definitions/modelInterface.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, "/base/login": { "post": { "produces": [ @@ -449,6 +527,45 @@ } } }, + "/casbin/CasbinTest": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "casbin" + ], + "summary": "casb RBAC RESTFUL测试路由", + "parameters": [ + { + "description": "获取权限列表", + "name": "data", + "in": "body", + "required": true, + "schema": { + "type": "object", + "$ref": "#/definitions/api.CreateAuthorityParams" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, "/casbin/casbinPUpdata": { "post": { "security": [ @@ -474,13 +591,319 @@ "required": true, "schema": { "type": "object", - "$ref": "#/definitions/api.CreateAuthorityParams" + "$ref": "#/definitions/sysModel.CasbinInReceive" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/casbin/getPolicyPathByAuthorityId": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "casbin" + ], + "summary": "获取权限列表", + "parameters": [ + { + "description": "获取权限列表", + "name": "data", + "in": "body", + "required": true, + "schema": { + "type": "object", + "$ref": "#/definitions/api.CreateAuthorityParams" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/customer/createExaCustomer": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysApi" + ], + "summary": "创建客户", + "parameters": [ + { + "description": "创建客户", + "name": "data", + "in": "body", + "required": true, + "schema": { + "type": "object", + "$ref": "#/definitions/dbModel.ExaCustomer" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/customer/deleteExaCustomer": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysApi" + ], + "summary": "删除客户", + "parameters": [ + { + "description": "删除客户", + "name": "data", + "in": "body", + "required": true, + "schema": { + "type": "object", + "$ref": "#/definitions/dbModel.ExaCustomer" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/customer/getExaCustomer": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysApi" + ], + "summary": "获取单一客户信息", + "parameters": [ + { + "description": "获取单一客户信息", + "name": "data", + "in": "body", + "required": true, + "schema": { + "type": "object", + "$ref": "#/definitions/dbModel.ExaCustomer" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/customer/getExaCustomerList": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysApi" + ], + "summary": "获取权限客户列表", + "parameters": [ + { + "description": "获取权限客户列表", + "name": "data", + "in": "body", + "required": true, + "schema": { + "type": "object", + "$ref": "#/definitions/modelInterface.PageInfo" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/customer/updataExaCustomer": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "SysApi" + ], + "summary": "更新客户信息", + "parameters": [ + { + "description": "创建客户", + "name": "data", + "in": "body", + "required": true, + "schema": { + "type": "object", + "$ref": "#/definitions/dbModel.ExaCustomer" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/fileUploadAndDownload/breakpointContinue": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ExaFileUploadAndDownload" + ], + "summary": "断点续传到服务器", + "parameters": [ + { + "type": "file", + "description": "断点续传示例", + "name": "file", + "in": "formData", + "required": true + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"上传成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/fileUploadAndDownload/deleteFile": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "ExaFileUploadAndDownload" + ], + "summary": "删除文件", + "parameters": [ + { + "description": "传入文件里面id即可", + "name": "data", + "in": "body", + "required": true, + "schema": { + "type": "object", + "$ref": "#/definitions/dbModel.ExaFileUploadAndDownload" } } ], "responses": { "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "description": "{\"success\":true,\"data\":{},\"msg\":\"返回成功\"}", "schema": { "type": "string" } @@ -488,7 +911,7 @@ } } }, - "/casbin/getPolicyPathByAuthorityId": { + "/fileUploadAndDownload/findFile": { "post": { "security": [ { @@ -496,30 +919,27 @@ } ], "consumes": [ - "application/json" + "multipart/form-data" ], "produces": [ "application/json" ], "tags": [ - "casbin" + "ExaFileUploadAndDownload" ], - "summary": "获取权限列表", + "summary": "查找文件", "parameters": [ { - "description": "获取权限列表", - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "$ref": "#/definitions/api.CreateAuthorityParams" - } + "type": "file", + "description": "查找文件", + "name": "file", + "in": "formData", + "required": true } ], "responses": { "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "description": "{\"success\":true,\"data\":{},\"msg\":\"查找成功\"}", "schema": { "type": "string" } @@ -527,35 +947,38 @@ } } }, - "/fileUploadAndDownload/deleteFile": { + "/fileUploadAndDownload/getFileList": { "post": { "security": [ { "ApiKeyAuth": [] } ], + "consumes": [ + "application/json" + ], "produces": [ "application/json" ], "tags": [ "ExaFileUploadAndDownload" ], - "summary": "删除文件", + "summary": "分页文件列表", "parameters": [ { - "description": "传入文件里面id即可", + "description": "分页获取文件户列表", "name": "data", "in": "body", "required": true, "schema": { "type": "object", - "$ref": "#/definitions/dbModel.ExaFileUploadAndDownload" + "$ref": "#/definitions/modelInterface.PageInfo" } } ], "responses": { "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"返回成功\"}", + "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", "schema": { "type": "string" } @@ -563,7 +986,7 @@ } } }, - "/fileUploadAndDownload/getFileList": { + "/fileUploadAndDownload/removeChunk": { "post": { "security": [ { @@ -571,7 +994,7 @@ } ], "consumes": [ - "application/json" + "multipart/form-data" ], "produces": [ "application/json" @@ -579,22 +1002,19 @@ "tags": [ "ExaFileUploadAndDownload" ], - "summary": "分页文件列表", + "summary": "删除切片", "parameters": [ { - "description": "分页获取文件户列表", - "name": "data", - "in": "body", - "required": true, - "schema": { - "type": "object", - "$ref": "#/definitions/modelInterface.PageInfo" - } + "type": "file", + "description": "查找文件", + "name": "file", + "in": "formData", + "required": true } ], "responses": { "200": { - "description": "{\"success\":true,\"data\":{},\"msg\":\"获取成功\"}", + "description": "{\"success\":true,\"data\":{},\"msg\":\"查找成功\"}", "schema": { "type": "string" } @@ -971,6 +1391,102 @@ } } }, + "/system/ReloadSystem": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "system" + ], + "summary": "设置配置文件内容", + "parameters": [ + { + "description": "设置配置文件内容", + "name": "data", + "in": "body", + "required": true, + "schema": { + "type": "object", + "$ref": "#/definitions/sysModel.System" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"返回成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/system/getSystemConfig": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "system" + ], + "summary": "获取配置文件内容", + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"返回成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, + "/system/setSystemConfig": { + "post": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "produces": [ + "application/json" + ], + "tags": [ + "system" + ], + "summary": "设置配置文件内容", + "parameters": [ + { + "description": "设置配置文件内容", + "name": "data", + "in": "body", + "required": true, + "schema": { + "type": "object", + "$ref": "#/definitions/sysModel.System" + } + } + ], + "responses": { + "200": { + "description": "{\"success\":true,\"data\":{},\"msg\":\"返回成功\"}", + "schema": { + "type": "string" + } + } + } + } + }, "/user/changePassword": { "post": { "security": [ @@ -1246,6 +1762,12 @@ "api.RegistAndLoginStuct": { "type": "object", "properties": { + "captcha": { + "type": "string" + }, + "captchaId": { + "type": "string" + }, "password": { "type": "string" }, @@ -1265,6 +1787,132 @@ } } }, + "config.CasbinConfig": { + "type": "object", + "properties": { + "modelPath": { + "description": "casbin model地址配置", + "type": "string" + } + } + }, + "config.Config": { + "type": "object", + "properties": { + "casbinConfig": { + "type": "object", + "$ref": "#/definitions/config.CasbinConfig" + }, + "jwt": { + "type": "object", + "$ref": "#/definitions/config.JWT" + }, + "mysqlAdmin": { + "type": "object", + "$ref": "#/definitions/config.MysqlAdmin" + }, + "qiniu": { + "type": "object", + "$ref": "#/definitions/config.Qiniu" + }, + "redisAdmin": { + "type": "object", + "$ref": "#/definitions/config.RedisAdmin" + }, + "system": { + "type": "object", + "$ref": "#/definitions/config.System" + } + } + }, + "config.JWT": { + "type": "object", + "properties": { + "signingKey": { + "type": "string" + } + } + }, + "config.MysqlAdmin": { + "type": "object", + "properties": { + "config": { + "type": "string" + }, + "dbname": { + "type": "string" + }, + "password": { + "type": "string" + }, + "path": { + "type": "string" + }, + "username": { + "type": "string" + } + } + }, + "config.Qiniu": { + "type": "object", + "properties": { + "accessKey": { + "type": "string" + }, + "secretKey": { + "type": "string" + } + } + }, + "config.RedisAdmin": { + "type": "object", + "properties": { + "addr": { + "type": "string" + }, + "db": { + "type": "integer" + }, + "password": { + "type": "string" + } + } + }, + "config.System": { + "type": "object", + "properties": { + "addr": { + "type": "integer" + }, + "env": { + "type": "string" + }, + "useMultipoint": { + "type": "boolean" + } + } + }, + "dbModel.ExaCustomer": { + "type": "object", + "properties": { + "customerName": { + "type": "string" + }, + "customerPhoneData": { + "type": "string" + }, + "sysUser": { + "type": "object", + "$ref": "#/definitions/sysModel.SysUser" + }, + "sysUserAuthorityID": { + "type": "string" + }, + "sysUserId": { + "type": "integer" + } + } + }, "dbModel.ExaFileUploadAndDownload": { "type": "object", "properties": { @@ -1293,6 +1941,31 @@ } } }, + "sysModel.CasbinInReceive": { + "type": "object", + "properties": { + "authorityId": { + "type": "string" + }, + "casbinInfos": { + "type": "array", + "items": { + "$ref": "#/definitions/sysModel.CasbinInfo" + } + } + } + }, + "sysModel.CasbinInfo": { + "type": "object", + "properties": { + "method": { + "type": "string" + }, + "path": { + "type": "string" + } + } + }, "sysModel.SysApi": { "type": "object", "properties": { @@ -1302,6 +1975,9 @@ "group": { "type": "string" }, + "method": { + "type": "string" + }, "path": { "type": "string" } @@ -1447,6 +2123,15 @@ "type": "integer" } } + }, + "sysModel.System": { + "type": "object", + "properties": { + "config": { + "type": "object", + "$ref": "#/definitions/config.Config" + } + } } }, "securityDefinitions": { diff --git a/QMPlusServer/docs/swagger.yaml b/QMPlusServer/docs/swagger.yaml index cbde0d449d30946befbd88de367a83b4d35a64ac..6341347b2321827a0d8fda55ab905bfd8ebaea3a 100644 --- a/QMPlusServer/docs/swagger.yaml +++ b/QMPlusServer/docs/swagger.yaml @@ -54,6 +54,10 @@ definitions: type: object api.RegistAndLoginStuct: properties: + captcha: + type: string + captchaId: + type: string password: type: string username: @@ -66,6 +70,90 @@ definitions: uuid: type: string type: object + config.CasbinConfig: + properties: + modelPath: + description: casbin model地址配置 + type: string + type: object + config.Config: + properties: + casbinConfig: + $ref: '#/definitions/config.CasbinConfig' + type: object + jwt: + $ref: '#/definitions/config.JWT' + type: object + mysqlAdmin: + $ref: '#/definitions/config.MysqlAdmin' + type: object + qiniu: + $ref: '#/definitions/config.Qiniu' + type: object + redisAdmin: + $ref: '#/definitions/config.RedisAdmin' + type: object + system: + $ref: '#/definitions/config.System' + type: object + type: object + config.JWT: + properties: + signingKey: + type: string + type: object + config.MysqlAdmin: + properties: + config: + type: string + dbname: + type: string + password: + type: string + path: + type: string + username: + type: string + type: object + config.Qiniu: + properties: + accessKey: + type: string + secretKey: + type: string + type: object + config.RedisAdmin: + properties: + addr: + type: string + db: + type: integer + password: + type: string + type: object + config.System: + properties: + addr: + type: integer + env: + type: string + useMultipoint: + type: boolean + type: object + dbModel.ExaCustomer: + properties: + customerName: + type: string + customerPhoneData: + type: string + sysUser: + $ref: '#/definitions/sysModel.SysUser' + type: object + sysUserAuthorityID: + type: string + sysUserId: + type: integer + type: object dbModel.ExaFileUploadAndDownload: properties: key: @@ -84,12 +172,30 @@ definitions: pageSize: type: integer type: object + sysModel.CasbinInReceive: + properties: + authorityId: + type: string + casbinInfos: + items: + $ref: '#/definitions/sysModel.CasbinInfo' + type: array + type: object + sysModel.CasbinInfo: + properties: + method: + type: string + path: + type: string + type: object sysModel.SysApi: properties: description: type: string group: type: string + method: + type: string path: type: string type: object @@ -189,6 +295,12 @@ definitions: description: 所属工作流ID type: integer type: object + sysModel.System: + properties: + config: + $ref: '#/definitions/config.Config' + type: object + type: object info: contact: {} description: This is a sample Server pets @@ -428,6 +540,54 @@ paths: summary: 设置角色资源权限 tags: - authority + /base/captcha: + post: + consumes: + - application/json + parameters: + - description: 生成验证码 + in: body + name: data + required: true + schema: + $ref: '#/definitions/modelInterface.PageInfo' + type: object + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 生成验证码 + tags: + - base + /base/captcha/: + get: + consumes: + - application/json + parameters: + - description: 生成验证码图片路径 + in: body + name: data + required: true + schema: + $ref: '#/definitions/modelInterface.PageInfo' + type: object + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 生成验证码图片路径 + tags: + - base /base/login: post: parameters: @@ -468,6 +628,30 @@ paths: summary: 用户注册账号 tags: - Base + /casbin/CasbinTest: + get: + consumes: + - application/json + parameters: + - description: 获取权限列表 + in: body + name: data + required: true + schema: + $ref: '#/definitions/api.CreateAuthorityParams' + type: object + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: casb RBAC RESTFUL测试路由 + tags: + - casbin /casbin/casbinPUpdata: post: consumes: @@ -478,7 +662,7 @@ paths: name: data required: true schema: - $ref: '#/definitions/api.CreateAuthorityParams' + $ref: '#/definitions/sysModel.CasbinInReceive' type: object produces: - application/json @@ -516,6 +700,148 @@ paths: summary: 获取权限列表 tags: - casbin + /customer/createExaCustomer: + post: + consumes: + - application/json + parameters: + - description: 创建客户 + in: body + name: data + required: true + schema: + $ref: '#/definitions/dbModel.ExaCustomer' + type: object + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 创建客户 + tags: + - SysApi + /customer/deleteExaCustomer: + post: + consumes: + - application/json + parameters: + - description: 删除客户 + in: body + name: data + required: true + schema: + $ref: '#/definitions/dbModel.ExaCustomer' + type: object + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 删除客户 + tags: + - SysApi + /customer/getExaCustomer: + post: + consumes: + - application/json + parameters: + - description: 获取单一客户信息 + in: body + name: data + required: true + schema: + $ref: '#/definitions/dbModel.ExaCustomer' + type: object + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 获取单一客户信息 + tags: + - SysApi + /customer/getExaCustomerList: + post: + consumes: + - application/json + parameters: + - description: 获取权限客户列表 + in: body + name: data + required: true + schema: + $ref: '#/definitions/modelInterface.PageInfo' + type: object + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 获取权限客户列表 + tags: + - SysApi + /customer/updataExaCustomer: + post: + consumes: + - application/json + parameters: + - description: 创建客户 + in: body + name: data + required: true + schema: + $ref: '#/definitions/dbModel.ExaCustomer' + type: object + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"获取成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 更新客户信息 + tags: + - SysApi + /fileUploadAndDownload/breakpointContinue: + post: + consumes: + - multipart/form-data + parameters: + - description: 断点续传示例 + in: formData + name: file + required: true + type: file + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"上传成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 断点续传到服务器 + tags: + - ExaFileUploadAndDownload /fileUploadAndDownload/deleteFile: post: parameters: @@ -538,6 +864,28 @@ paths: summary: 删除文件 tags: - ExaFileUploadAndDownload + /fileUploadAndDownload/findFile: + post: + consumes: + - multipart/form-data + parameters: + - description: 查找文件 + in: formData + name: file + required: true + type: file + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"查找成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 查找文件 + tags: + - ExaFileUploadAndDownload /fileUploadAndDownload/getFileList: post: consumes: @@ -562,6 +910,28 @@ paths: summary: 分页文件列表 tags: - ExaFileUploadAndDownload + /fileUploadAndDownload/removeChunk: + post: + consumes: + - multipart/form-data + parameters: + - description: 查找文件 + in: formData + name: file + required: true + type: file + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"查找成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 删除切片 + tags: + - ExaFileUploadAndDownload /fileUploadAndDownload/upload: post: consumes: @@ -788,6 +1158,64 @@ paths: summary: 更新菜单 tags: - menu + /system/ReloadSystem: + post: + parameters: + - description: 设置配置文件内容 + in: body + name: data + required: true + schema: + $ref: '#/definitions/sysModel.System' + type: object + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"返回成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 设置配置文件内容 + tags: + - system + /system/getSystemConfig: + post: + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"返回成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 获取配置文件内容 + tags: + - system + /system/setSystemConfig: + post: + parameters: + - description: 设置配置文件内容 + in: body + name: data + required: true + schema: + $ref: '#/definitions/sysModel.System' + type: object + produces: + - application/json + responses: + "200": + description: '{"success":true,"data":{},"msg":"返回成功"}' + schema: + type: string + security: + - ApiKeyAuth: [] + summary: 设置配置文件内容 + tags: + - system /user/changePassword: post: parameters: diff --git a/QMPlusServer/go.mod b/QMPlusServer/go.mod index 380387bc7678e51b927adf4c359e8ef3c3a00368..2e6f8f9b5d6370e15f8398c15dc02357389abe52 100644 --- a/QMPlusServer/go.mod +++ b/QMPlusServer/go.mod @@ -6,10 +6,10 @@ require ( github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc github.com/casbin/casbin v1.9.1 github.com/casbin/gorm-adapter v1.0.0 + github.com/dchest/captcha v0.0.0-20170622155422-6a29415a8364 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.7 - github.com/fvbock/endless v0.0.0-20170109170031-447134032cb6 github.com/gin-gonic/gin v1.4.0 github.com/go-redis/redis v6.15.6+incompatible github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869 // indirect diff --git a/QMPlusServer/router/sys_base.go b/QMPlusServer/router/sys_base.go index 3ebf01cd00a35fb3222d0ed6bbbaf930b5f41a1b..f05cda56e360a2c9ddf1a26a3edb9c254dcff9ac 100644 --- a/QMPlusServer/router/sys_base.go +++ b/QMPlusServer/router/sys_base.go @@ -10,6 +10,8 @@ func InitBaseRouter(Router *gin.RouterGroup) (R gin.IRoutes) { { BaseRouter.POST("regist", api.Regist) BaseRouter.POST("login", api.Login) + BaseRouter.GET("captcha",api.Captcha) + BaseRouter.GET("/captcha/:id",api.CaptchaImg) } return BaseRouter }