master
wubin 5 years ago
parent b9cba0cc4f
commit 3a1f9b9cad

@ -9,5 +9,6 @@ type Res struct {
StudentFlag interface{} `json:"studentFlag,omitempty"` //omitempty有值就输出没值则不输出 StudentFlag interface{} `json:"studentFlag,omitempty"` //omitempty有值就输出没值则不输出
ParentFlag interface{} `json:"parentFlag,omitempty"` //omitempty有值就输出没值则不输出 ParentFlag interface{} `json:"parentFlag,omitempty"` //omitempty有值就输出没值则不输出
PositionList interface{} `json:"positionList,omitempty"` //omitempty有值就输出没值则不输出 PositionList interface{} `json:"positionList,omitempty"` //omitempty有值就输出没值则不输出
AppId interface{} `json:"app_id,omitempty"` //omitempty有值就输出没值则不输出 AppId interface{} `json:"app_id,omitempty"` //omitempty有值就输出没值则不输出
AppIcon interface{} `json:"app_icon,omitempty"` //omitempty有值就输出没值则不输出
} }

@ -30,6 +30,7 @@ func Routers(r *gin.RouterGroup) {
rr.POST("/SettingAccessSystemSsoInfo", SettingAccessSystemSsoInfo) rr.POST("/SettingAccessSystemSsoInfo", SettingAccessSystemSsoInfo)
rr.POST("/EmptyAccessSystemSsoInfo", EmptyAccessSystemSsoInfo) rr.POST("/EmptyAccessSystemSsoInfo", EmptyAccessSystemSsoInfo)
rr.GET("/GetAccessSystemIntegratedInfo", GetAccessSystemIntegratedInfo) rr.GET("/GetAccessSystemIntegratedInfo", GetAccessSystemIntegratedInfo)
rr.POST("/UploadIconFile", UploadIconFile)
rr.POST("/SettingAccessSystemIntegratedInfo", SettingAccessSystemIntegratedInfo) rr.POST("/SettingAccessSystemIntegratedInfo", SettingAccessSystemIntegratedInfo)
rr.POST("/EmptyAccessSystemIntegratedInfo", EmptyAccessSystemIntegratedInfo) rr.POST("/EmptyAccessSystemIntegratedInfo", EmptyAccessSystemIntegratedInfo)
rr.GET("/GetPositionTreeInfo", GetPositionTreeInfo) rr.GET("/GetPositionTreeInfo", GetPositionTreeInfo)
@ -440,19 +441,54 @@ func GetAccessSystemIntegratedInfo(c *gin.Context) {
}) })
} }
// @Summary 上传图标
// @Description 上传图标
// @Tags 接入系统
// @Accept multipart/form-data
// @Produce json
// @Param appIcon formData file true "图标"
// @Success 200 {object} Model.Res
// @Router /support/accessSystem/UploadIconFile [post]
func UploadIconFile(c *gin.Context) {
//接入系统在集成页面的图标
header, _ := c.FormFile("appIcon")
rootPath, _ := os.Getwd()
iconDir := rootPath + "/Html/Icon/"
//生成图标的ID
iconFileId := CommonUtil.GetUUID()
iconFileName := iconFileId + "." + strings.Split(header.Filename, ".")[1]
iconPath := iconDir + iconFileName
//保存图标
err := c.SaveUploadedFile(header, iconPath)
if err != nil {
c.JSON(http.StatusOK, Model.Res{
Success: false,
Message: err.Error(),
})
return
}
c.JSON(http.StatusOK, Model.Res{
Success: true,
Message: "操作成功!",
AppIcon: "/dsSupport/Icon/" + iconFileName,
})
}
// @Summary 设置接入系统的集成信息 // @Summary 设置接入系统的集成信息
// @Description 设置接入系统的集成信息 // @Description 设置接入系统的集成信息
// @Tags 接入系统 // @Tags 接入系统
// @Accept multipart/form-data // @Accept application/x-www-form-urlencoded
// @Produce json // @Produce json
// @Param appId formData string true "系统ID" // @Param appId formData string true "系统ID"
// @Param appUrl formData string true "接入系统在集成页面的调用地址" // @Param appUrl formData string true "接入系统在集成页面的调用地址"
// @Param appIcon formData file true "图标" // @Param appIcon formData string true "图标"
// @Success 200 {object} Model.Res // @Success 200 {object} Model.Res
// @Router /support/accessSystem/SettingAccessSystemIntegratedInfo [post] // @Router /support/accessSystem/SettingAccessSystemIntegratedInfo [post]
// @X-EmptyLimit ["appId","appUrl"] // @X-EmptyLimit ["appId","appUrl","appIcon"]
// @X-LengthLimit [{"appId":"36,36"}] // @X-LengthLimit [{"appId":"36,36"}]
// @X-TableName ["t_app_base"]
// @X-Sort [12] // @X-Sort [12]
func SettingAccessSystemIntegratedInfo(c *gin.Context) { func SettingAccessSystemIntegratedInfo(c *gin.Context) {
//系统ID //系统ID
@ -460,17 +496,9 @@ func SettingAccessSystemIntegratedInfo(c *gin.Context) {
//接入系统在集成页面的调用地址 //接入系统在集成页面的调用地址
appUrl := c.PostForm("appUrl") appUrl := c.PostForm("appUrl")
//接入系统在集成页面的图标 //接入系统在集成页面的图标
header, _ := c.FormFile("appIcon") appIcon := c.PostForm("appIcon")
rootPath, _ := os.Getwd()
iconDir := rootPath + "/Html/Icon/"
//生成图标的ID
iconFileId := CommonUtil.GetUUID()
iconFileName := iconFileId + "." + strings.Split(header.Filename, ".")[1]
iconPath := iconDir + iconFileName
//保存图标
c.SaveUploadedFile(header, iconPath)
err := AccessSystemDao.UpdateIntegration(appId, appUrl, "/dsSupport/Icon/"+iconFileName) err := AccessSystemDao.UpdateIntegration(appId, appUrl, appIcon)
if err != nil { if err != nil {
c.JSON(http.StatusOK, Model.Res{ c.JSON(http.StatusOK, Model.Res{

@ -1,5 +1,6 @@
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT // GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag // This file was generated by swaggo/swag at
// 2020-09-28 09:50:02.8518639 +0800 CST m=+0.337807601
package docs package docs
@ -908,7 +909,7 @@ var doc = `{
"post": { "post": {
"description": "设置接入系统的集成信息", "description": "设置接入系统的集成信息",
"consumes": [ "consumes": [
"multipart/form-data" "application/x-www-form-urlencoded"
], ],
"produces": [ "produces": [
"application/json" "application/json"
@ -933,7 +934,7 @@ var doc = `{
"required": true "required": true
}, },
{ {
"type": "file", "type": "string",
"description": "图标", "description": "图标",
"name": "appIcon", "name": "appIcon",
"in": "formData", "in": "formData",
@ -950,7 +951,8 @@ var doc = `{
}, },
"x-emptylimit": [ "x-emptylimit": [
"appId", "appId",
"appUrl" "appUrl",
"appIcon"
], ],
"x-lengthlimit": [ "x-lengthlimit": [
{ {
@ -959,9 +961,6 @@ var doc = `{
], ],
"x-sort": [ "x-sort": [
12 12
],
"x-tablename": [
"t_app_base"
] ]
} }
}, },
@ -1227,42 +1226,33 @@ var doc = `{
] ]
} }
}, },
"/support/login/account": { "/support/accessSystem/UploadIconFile": {
"post": { "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": "上传图标",
"consumes": [ "consumes": [
"application/json" "multipart/form-data"
], ],
"produces": [ "produces": [
"application/json" "application/json"
], ],
"tags": [ "tags": [
"登录" "接入系统"
], ],
"summary": "登录", "summary": "上传图标",
"operationId": "Account",
"parameters": [ "parameters": [
{ {
"description": "登录", "type": "file",
"name": "input", "description": "图标",
"in": "body", "name": "appIcon",
"required": true, "in": "formData",
"schema": { "required": true
"$ref": "#/definitions/MySwagger.AccountSwag"
}
} }
], ],
"responses": { "responses": {
"200": { "200": {
"description": "OK", "description": "OK",
"schema": { "schema": {
"$ref": "#/definitions/MySwagger.Result" "$ref": "#/definitions/Model.Res"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/MySwagger.Result"
} }
} }
} }
@ -1681,7 +1671,7 @@ var doc = `{
}, },
"/v1/openapi/datasource/ReadESDoc": { "/v1/openapi/datasource/ReadESDoc": {
"post": { "post": {
"description": "` + "`" + `*` + "`" + `json:\"datasource_code\" xorm:\"not null comment('数据源编码') VARCHAR(8)\" example:\"org_tree\"\njson:\"` + "`" + `orgids` + "`" + `\" xorm:\"not null comment('提供数据范围【1本机构2本机构以及下属机构-1不限制】') VARCHAR(36)\" example:\"[F38BD0DB-0142-4356-8F2B-623813FC2578,F38BD0DB-0142-4356-8F2B-623813FC2578]\"\njson:\"begin_time\" example:\"2020-06-22 17:26:53\"` + "`" + `\njson:\"conditions\" example:\"\"\njson:\"sort\" example:\"\"\njson:\"data_id\" example:\"CfBQnRJPyXMEI5nqLT0\"\njson:\"page\" example:\"1\"", "description": "json:\"username\" xorm:\"not null comment('账号') VARCHAR(100)\" example:\"example\"\njson:\"password\" xorm:\"not null comment('密码') VARCHAR(100)\" example:\"123456\"",
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
@ -1689,18 +1679,18 @@ var doc = `{
"application/json" "application/json"
], ],
"tags": [ "tags": [
"datasource" "account"
], ],
"summary": "获取es数据列表", "summary": "后台登陆",
"operationId": "readESDoc", "operationId": "loginAccount",
"parameters": [ "parameters": [
{ {
"description": "es数据", "description": "账号密码",
"name": "input", "name": "input",
"in": "body", "in": "body",
"required": true, "required": true,
"schema": { "schema": {
"$ref": "#/definitions/MySwagger.DatasourceESSwag" "$ref": "#/definitions/MySwagger.AccountSwag"
} }
} }
], ],
@ -2351,6 +2341,10 @@ var doc = `{
"Model.Res": { "Model.Res": {
"type": "object", "type": "object",
"properties": { "properties": {
"app_icon": {
"description": "omitempty有值就输出没值则不输出",
"type": "object"
},
"app_id": { "app_id": {
"description": "omitempty有值就输出没值则不输出", "description": "omitempty有值就输出没值则不输出",
"type": "object" "type": "object"
@ -2858,6 +2852,10 @@ var doc = `{
{ {
"description": "机构目录", "description": "机构目录",
"name": "orgtree" "name": "orgtree"
},
{
"description": "后台登陆",
"name": "account"
} }
] ]
}` }`

@ -892,7 +892,7 @@
"post": { "post": {
"description": "设置接入系统的集成信息", "description": "设置接入系统的集成信息",
"consumes": [ "consumes": [
"multipart/form-data" "application/x-www-form-urlencoded"
], ],
"produces": [ "produces": [
"application/json" "application/json"
@ -917,7 +917,7 @@
"required": true "required": true
}, },
{ {
"type": "file", "type": "string",
"description": "图标", "description": "图标",
"name": "appIcon", "name": "appIcon",
"in": "formData", "in": "formData",
@ -934,7 +934,8 @@
}, },
"x-emptylimit": [ "x-emptylimit": [
"appId", "appId",
"appUrl" "appUrl",
"appIcon"
], ],
"x-lengthlimit": [ "x-lengthlimit": [
{ {
@ -943,9 +944,6 @@
], ],
"x-sort": [ "x-sort": [
12 12
],
"x-tablename": [
"t_app_base"
] ]
} }
}, },
@ -1211,42 +1209,33 @@
] ]
} }
}, },
"/support/login/account": { "/support/accessSystem/UploadIconFile": {
"post": { "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": "上传图标",
"consumes": [ "consumes": [
"application/json" "multipart/form-data"
], ],
"produces": [ "produces": [
"application/json" "application/json"
], ],
"tags": [ "tags": [
"登录" "接入系统"
], ],
"summary": "登录", "summary": "上传图标",
"operationId": "Account",
"parameters": [ "parameters": [
{ {
"description": "登录", "type": "file",
"name": "input", "description": "图标",
"in": "body", "name": "appIcon",
"required": true, "in": "formData",
"schema": { "required": true
"$ref": "#/definitions/MySwagger.AccountSwag"
}
} }
], ],
"responses": { "responses": {
"200": { "200": {
"description": "OK", "description": "OK",
"schema": { "schema": {
"$ref": "#/definitions/MySwagger.Result" "$ref": "#/definitions/Model.Res"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/MySwagger.Result"
} }
} }
} }
@ -1665,7 +1654,7 @@
}, },
"/v1/openapi/datasource/ReadESDoc": { "/v1/openapi/datasource/ReadESDoc": {
"post": { "post": {
"description": "`*`json:\"datasource_code\" xorm:\"not null comment('数据源编码') VARCHAR(8)\" example:\"org_tree\"\njson:\"`orgids`\" xorm:\"not null comment('提供数据范围【1本机构2本机构以及下属机构-1不限制】') VARCHAR(36)\" example:\"[F38BD0DB-0142-4356-8F2B-623813FC2578,F38BD0DB-0142-4356-8F2B-623813FC2578]\"\njson:\"begin_time\" example:\"2020-06-22 17:26:53\"`\njson:\"conditions\" example:\"\"\njson:\"sort\" example:\"\"\njson:\"data_id\" example:\"CfBQnRJPyXMEI5nqLT0\"\njson:\"page\" example:\"1\"", "description": "json:\"username\" xorm:\"not null comment('账号') VARCHAR(100)\" example:\"example\"\njson:\"password\" xorm:\"not null comment('密码') VARCHAR(100)\" example:\"123456\"",
"consumes": [ "consumes": [
"application/json" "application/json"
], ],
@ -1673,18 +1662,18 @@
"application/json" "application/json"
], ],
"tags": [ "tags": [
"datasource" "account"
], ],
"summary": "获取es数据列表", "summary": "后台登陆",
"operationId": "readESDoc", "operationId": "loginAccount",
"parameters": [ "parameters": [
{ {
"description": "es数据", "description": "账号密码",
"name": "input", "name": "input",
"in": "body", "in": "body",
"required": true, "required": true,
"schema": { "schema": {
"$ref": "#/definitions/MySwagger.DatasourceESSwag" "$ref": "#/definitions/MySwagger.AccountSwag"
} }
} }
], ],
@ -2335,6 +2324,10 @@
"Model.Res": { "Model.Res": {
"type": "object", "type": "object",
"properties": { "properties": {
"app_icon": {
"description": "omitempty有值就输出没值则不输出",
"type": "object"
},
"app_id": { "app_id": {
"description": "omitempty有值就输出没值则不输出", "description": "omitempty有值就输出没值则不输出",
"type": "object" "type": "object"
@ -2842,6 +2835,10 @@
{ {
"description": "机构目录", "description": "机构目录",
"name": "orgtree" "name": "orgtree"
},
{
"description": "后台登陆",
"name": "account"
} }
] ]
} }

@ -1,6 +1,9 @@
definitions: definitions:
Model.Res: Model.Res:
properties: properties:
app_icon:
description: omitempty有值就输出没值则不输出
type: object
app_id: app_id:
description: omitempty有值就输出没值则不输出 description: omitempty有值就输出没值则不输出
type: object type: object
@ -925,7 +928,7 @@ paths:
/support/accessSystem/SettingAccessSystemIntegratedInfo: /support/accessSystem/SettingAccessSystemIntegratedInfo:
post: post:
consumes: consumes:
- multipart/form-data - application/x-www-form-urlencoded
description: 设置接入系统的集成信息 description: 设置接入系统的集成信息
parameters: parameters:
- description: 系统ID - description: 系统ID
@ -942,7 +945,7 @@ paths:
in: formData in: formData
name: appIcon name: appIcon
required: true required: true
type: file type: string
produces: produces:
- application/json - application/json
responses: responses:
@ -956,12 +959,11 @@ paths:
x-emptylimit: x-emptylimit:
- appId - appId
- appUrl - appUrl
- appIcon
x-lengthlimit: x-lengthlimit:
- appId: 36,36 - appId: 36,36
x-sort: x-sort:
- 12 - 12
x-tablename:
- t_app_base
/support/accessSystem/SettingAccessSystemRangeInfo: /support/accessSystem/SettingAccessSystemRangeInfo:
post: post:
consumes: consumes:
@ -1125,35 +1127,27 @@ paths:
- 2 - 2
x-tablename: x-tablename:
- t_app_base - t_app_base
/support/login/account: /support/accessSystem/UploadIconFile:
post: post:
consumes: consumes:
- application/json - multipart/form-data
description: |- 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
parameters: parameters:
- description: 登录 - description: 图标
in: body in: formData
name: input name: appIcon
required: true required: true
schema: type: file
$ref: '#/definitions/MySwagger.AccountSwag'
produces: produces:
- application/json - application/json
responses: responses:
"200": "200":
description: OK description: OK
schema: schema:
$ref: '#/definitions/MySwagger.Result' $ref: '#/definitions/Model.Res'
"400": summary: 上传图标
description: Bad Request
schema:
$ref: '#/definitions/MySwagger.Result'
summary: 登录
tags: tags:
- 登录 - 接入系统
/v1/openapi/dataaccess/CreateDataaccess: /v1/openapi/dataaccess/CreateDataaccess:
post: post:
consumes: consumes:
@ -1516,21 +1510,16 @@ paths:
consumes: consumes:
- application/json - application/json
description: |- description: |-
`*`json:"datasource_code" xorm:"not null comment('数据源编码') VARCHAR(8)" example:"org_tree" json:"username" xorm:"not null comment('账号') VARCHAR(100)" example:"example"
json:"`orgids`" xorm:"not null comment('提供数据范围【1本机构2本机构以及下属机构-1不限制】') VARCHAR(36)" example:"[F38BD0DB-0142-4356-8F2B-623813FC2578,F38BD0DB-0142-4356-8F2B-623813FC2578]" json:"password" xorm:"not null comment('密码') VARCHAR(100)" example:"123456"
json:"begin_time" example:"2020-06-22 17:26:53"` operationId: loginAccount
json:"conditions" example:""
json:"sort" example:""
json:"data_id" example:"CfBQnRJPyXMEI5nqLT0"
json:"page" example:"1"
operationId: readESDoc
parameters: parameters:
- description: es数据 - description: 账号密码
in: body in: body
name: input name: input
required: true required: true
schema: schema:
$ref: '#/definitions/MySwagger.DatasourceESSwag' $ref: '#/definitions/MySwagger.AccountSwag'
produces: produces:
- application/json - application/json
responses: responses:
@ -1542,9 +1531,9 @@ paths:
description: Bad Request description: Bad Request
schema: schema:
$ref: '#/definitions/MySwagger.Result' $ref: '#/definitions/MySwagger.Result'
summary: 获取es数据列表 summary: 后台登陆
tags: tags:
- datasource - account
/v1/openapi/datasource/UpdateDatasource/{id}: /v1/openapi/datasource/UpdateDatasource/{id}:
post: post:
consumes: consumes:
@ -1803,7 +1792,8 @@ paths:
post: post:
consumes: consumes:
- application/json - application/json
description: '`*`json:"index_name" xorm:"not null comment(''ES Index Name'') VARCHAR(50)" example:"org_tree"' description: '`*`json:"index_name" xorm:"not null comment(''ES Index Name'')
VARCHAR(50)" example:"org_tree"'
operationId: createMetadataES operationId: createMetadataES
parameters: parameters:
- description: ES元数据 - description: ES元数据
@ -2121,3 +2111,5 @@ tags:
name: metadata name: metadata
- description: 机构目录 - description: 机构目录
name: orgtree name: orgtree
- description: 后台登陆
name: account

Loading…
Cancel
Save