From f4c8f7b64e7e644e70f305838dfe8bd03a2c0d7b Mon Sep 17 00:00:00 2001 From: wangshuai Date: Sun, 27 Sep 2020 09:20:24 +0800 Subject: [PATCH] 'commit' --- .../DataEX/DataexService/DataexService.go | 2 +- .../Account/AccountOpenAPI/AccountOpenAPI.go | 2 +- dsSupport/docs/docs.go | 35 ++++++++++++++----- dsSupport/docs/swagger.json | 35 ++++++++++++++----- dsSupport/docs/swagger.yaml | 31 +++++++++++----- 5 files changed, 78 insertions(+), 27 deletions(-) diff --git a/dsDataex/MyService/DataEX/DataexService/DataexService.go b/dsDataex/MyService/DataEX/DataexService/DataexService.go index 591963be..862a890c 100644 --- a/dsDataex/MyService/DataEX/DataexService/DataexService.go +++ b/dsDataex/MyService/DataEX/DataexService/DataexService.go @@ -481,7 +481,7 @@ func DataexSetBatch(systemID string, datas []MySwagger.Data,datasource *models.T if indexData==nil { failIDs=nil - + DataexDAO.SaveDataError(nil, datas, systemID, datasource.DatasourceCode ) return false,"数据机构权限全部不正确",nil,nil } diff --git a/dsSupport/MyModel/Account/AccountOpenAPI/AccountOpenAPI.go b/dsSupport/MyModel/Account/AccountOpenAPI/AccountOpenAPI.go index c2bbb8d9..fa61cefa 100644 --- a/dsSupport/MyModel/Account/AccountOpenAPI/AccountOpenAPI.go +++ b/dsSupport/MyModel/Account/AccountOpenAPI/AccountOpenAPI.go @@ -27,7 +27,7 @@ import ( // @Param input body MySwagger.AccountSwag true "账号密码" // @Success 200 {object} MySwagger.Result // @Failure 400 {object} MySwagger.Result -// @Router /v1/openapi/datasource/ReadESDoc [post] +// @Router /v1/openapi/account/login [post] func Login(c *gin.Context) { var raw MySwagger.AccountSwag diff --git a/dsSupport/docs/docs.go b/dsSupport/docs/docs.go index 067d94e8..1e8951d1 100644 --- a/dsSupport/docs/docs.go +++ b/dsSupport/docs/docs.go @@ -1227,9 +1227,9 @@ var doc = `{ ] } }, - "/support/login/account": { + "/v1/openapi/account/login": { "post": { - "description": "json:\"datasource_name\" xorm:\"not null comment('数据源名称') VARCHAR(100)\" example:\"组织机构信息\"\njson:\"datasource_code\" xorm:\"not null comment('数据源编码') VARCHAR(8)\" example:\"org_tree\"", + "description": "json:\"username\" xorm:\"not null comment('账号') VARCHAR(100)\" example:\"example\"\njson:\"password\" xorm:\"not null comment('密码') VARCHAR(100)\" example:\"123456\"", "consumes": [ "application/json" ], @@ -1237,13 +1237,13 @@ var doc = `{ "application/json" ], "tags": [ - "登录" + "account" ], - "summary": "登录", - "operationId": "Account", + "summary": "后台登陆", + "operationId": "loginAccount", "parameters": [ { - "description": "登录", + "description": "账号密码", "name": "input", "in": "body", "required": true, @@ -2819,13 +2819,28 @@ var doc = `{ "MySwagger.Result": { "type": "object", "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + "fail": { + "type": "boolean", + "example": false + }, "message": { "type": "string", - "example": "接入系统票据验证失败" + "example": "操作成功" }, "success": { "type": "boolean", - "example": false + "example": true + }, + "total": { + "type": "integer", + "example": 120 } } } @@ -2858,6 +2873,10 @@ var doc = `{ { "description": "机构目录", "name": "orgtree" + }, + { + "description": "后台登陆", + "name": "account" } ] }` diff --git a/dsSupport/docs/swagger.json b/dsSupport/docs/swagger.json index 4df5116b..5e41ee56 100644 --- a/dsSupport/docs/swagger.json +++ b/dsSupport/docs/swagger.json @@ -1211,9 +1211,9 @@ ] } }, - "/support/login/account": { + "/v1/openapi/account/login": { "post": { - "description": "json:\"datasource_name\" xorm:\"not null comment('数据源名称') VARCHAR(100)\" example:\"组织机构信息\"\njson:\"datasource_code\" xorm:\"not null comment('数据源编码') VARCHAR(8)\" example:\"org_tree\"", + "description": "json:\"username\" xorm:\"not null comment('账号') VARCHAR(100)\" example:\"example\"\njson:\"password\" xorm:\"not null comment('密码') VARCHAR(100)\" example:\"123456\"", "consumes": [ "application/json" ], @@ -1221,13 +1221,13 @@ "application/json" ], "tags": [ - "登录" + "account" ], - "summary": "登录", - "operationId": "Account", + "summary": "后台登陆", + "operationId": "loginAccount", "parameters": [ { - "description": "登录", + "description": "账号密码", "name": "input", "in": "body", "required": true, @@ -2803,13 +2803,28 @@ "MySwagger.Result": { "type": "object", "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": true + } + }, + "fail": { + "type": "boolean", + "example": false + }, "message": { "type": "string", - "example": "接入系统票据验证失败" + "example": "操作成功" }, "success": { "type": "boolean", - "example": false + "example": true + }, + "total": { + "type": "integer", + "example": 120 } } } @@ -2842,6 +2857,10 @@ { "description": "机构目录", "name": "orgtree" + }, + { + "description": "后台登陆", + "name": "account" } ] } \ No newline at end of file diff --git a/dsSupport/docs/swagger.yaml b/dsSupport/docs/swagger.yaml index af68c59d..204354bc 100644 --- a/dsSupport/docs/swagger.yaml +++ b/dsSupport/docs/swagger.yaml @@ -343,12 +343,23 @@ definitions: type: object MySwagger.Result: properties: + data: + items: + additionalProperties: true + type: object + type: array + fail: + example: false + type: boolean message: - example: 接入系统票据验证失败 + example: 操作成功 type: string success: - example: false + example: true type: boolean + total: + example: 120 + type: integer type: object host: 127.0.0.1:8005 info: @@ -1125,16 +1136,16 @@ paths: - 2 x-tablename: - t_app_base - /support/login/account: + /v1/openapi/account/login: post: consumes: - application/json description: |- - json:"datasource_name" xorm:"not null comment('数据源名称') VARCHAR(100)" example:"组织机构信息" - json:"datasource_code" xorm:"not null comment('数据源编码') VARCHAR(8)" example:"org_tree" - operationId: Account + json:"username" xorm:"not null comment('账号') VARCHAR(100)" example:"example" + json:"password" xorm:"not null comment('密码') VARCHAR(100)" example:"123456" + operationId: loginAccount parameters: - - description: 登录 + - description: 账号密码 in: body name: input required: true @@ -1151,9 +1162,9 @@ paths: description: Bad Request schema: $ref: '#/definitions/MySwagger.Result' - summary: 登录 + summary: 后台登陆 tags: - - 登录 + - account /v1/openapi/dataaccess/CreateDataaccess: post: consumes: @@ -2121,3 +2132,5 @@ tags: name: metadata - description: 机构目录 name: orgtree +- description: 后台登陆 + name: account