@ -30,6 +30,7 @@ func Routers(r *gin.RouterGroup) {
rr . POST ( "/SettingAccessSystemSsoInfo" , SettingAccessSystemSsoInfo )
rr . POST ( "/EmptyAccessSystemSsoInfo" , EmptyAccessSystemSsoInfo )
rr . GET ( "/GetAccessSystemIntegratedInfo" , GetAccessSystemIntegratedInfo )
rr . POST ( "/UploadIconFile" , UploadIconFile )
rr . POST ( "/SettingAccessSystemIntegratedInfo" , SettingAccessSystemIntegratedInfo )
rr . POST ( "/EmptyAccessSystemIntegratedInfo" , EmptyAccessSystemIntegratedInfo )
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 设置接入系统的集成信息
// @Description 设置接入系统的集成信息
// @Tags 接入系统
// @Accept multipart/form-data
// @Accept application/x-www-form-urlencoded
// @Produce json
// @Param appId formData string true "系统ID"
// @Param appUrl formData string true "接入系统在集成页面的调用地址"
// @Param appIcon formData file true "图标"
// @Param appIcon formData string true "图标"
// @Success 200 {object} Model.Res
// @Router /support/accessSystem/SettingAccessSystemIntegratedInfo [post]
// @X-EmptyLimit ["appId","appUrl"]
// @X-EmptyLimit ["appId","appUrl" ,"appIcon" ]
// @X-LengthLimit [{"appId":"36,36"}]
// @X-TableName ["t_app_base"]
// @X-Sort [12]
func SettingAccessSystemIntegratedInfo ( c * gin . Context ) {
//系统ID
@ -460,17 +496,9 @@ func SettingAccessSystemIntegratedInfo(c *gin.Context) {
//接入系统在集成页面的调用地址
appUrl := c . PostForm ( "appUrl" )
//接入系统在集成页面的图标
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
//保存图标
c . SaveUploadedFile ( header , iconPath )
appIcon := c . PostForm ( "appIcon" )
err := AccessSystemDao . UpdateIntegration ( appId , appUrl , "/dsSupport/Icon/" + iconFileName )
err := AccessSystemDao . UpdateIntegration ( appId , appUrl , appIcon )
if err != nil {
c . JSON ( http . StatusOK , Model . Res {