wangshuai 5 years ago
commit fc29f1e88e

@ -10,4 +10,5 @@ type Res struct {
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:53:17.7730006 +0800 CST m=+0.143916401
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,6 +1226,38 @@ var doc = `{
] ]
} }
}, },
"/support/accessSystem/UploadIconFile": {
"post": {
"description": "上传图标",
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"接入系统"
],
"summary": "上传图标",
"parameters": [
{
"type": "file",
"description": "图标",
"name": "appIcon",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/Model.Res"
}
}
}
}
},
"/v1/openapi/account/currentUser": { "/v1/openapi/account/currentUser": {
"post": { "post": {
"consumes": [ "consumes": [
@ -2419,6 +2450,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"
@ -2891,13 +2926,28 @@ var doc = `{
"MySwagger.Result": { "MySwagger.Result": {
"type": "object", "type": "object",
"properties": { "properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
},
"fail": {
"type": "boolean",
"example": false
},
"message": { "message": {
"type": "string", "type": "string",
"example": "接入系统票据验证失败" "example": "操作成功"
}, },
"success": { "success": {
"type": "boolean", "type": "boolean",
"example": false "example": true
},
"total": {
"type": "integer",
"example": 120
} }
} }
} }

@ -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,6 +1209,38 @@
] ]
} }
}, },
"/support/accessSystem/UploadIconFile": {
"post": {
"description": "上传图标",
"consumes": [
"multipart/form-data"
],
"produces": [
"application/json"
],
"tags": [
"接入系统"
],
"summary": "上传图标",
"parameters": [
{
"type": "file",
"description": "图标",
"name": "appIcon",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/Model.Res"
}
}
}
}
},
"/v1/openapi/account/currentUser": { "/v1/openapi/account/currentUser": {
"post": { "post": {
"consumes": [ "consumes": [
@ -2403,6 +2433,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"
@ -2875,13 +2909,28 @@
"MySwagger.Result": { "MySwagger.Result": {
"type": "object", "type": "object",
"properties": { "properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": true
}
},
"fail": {
"type": "boolean",
"example": false
},
"message": { "message": {
"type": "string", "type": "string",
"example": "接入系统票据验证失败" "example": "操作成功"
}, },
"success": { "success": {
"type": "boolean", "type": "boolean",
"example": false "example": true
},
"total": {
"type": "integer",
"example": 120
} }
} }
} }

@ -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
@ -346,12 +349,23 @@ definitions:
type: object type: object
MySwagger.Result: MySwagger.Result:
properties: properties:
data:
items:
additionalProperties: true
type: object
type: array
fail:
example: false
type: boolean
message: message:
example: 接入系统票据验证失败 example: 操作成功
type: string type: string
success: success:
example: false example: true
type: boolean type: boolean
total:
example: 120
type: integer
type: object type: object
host: 127.0.0.1:8005 host: 127.0.0.1:8005
info: info:
@ -928,7 +942,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
@ -945,7 +959,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:
@ -959,12 +973,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:
@ -1128,6 +1141,27 @@ paths:
- 2 - 2
x-tablename: x-tablename:
- t_app_base - t_app_base
/support/accessSystem/UploadIconFile:
post:
consumes:
- multipart/form-data
description: 上传图标
parameters:
- description: 图标
in: formData
name: appIcon
required: true
type: file
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/Model.Res'
summary: 上传图标
tags:
- 接入系统
/v1/openapi/account/currentUser: /v1/openapi/account/currentUser:
post: post:
consumes: consumes:
@ -1851,7 +1885,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元数据

Loading…
Cancel
Save