|
|
|
@ -4,6 +4,7 @@ import (
|
|
|
|
|
"dsSupport/Model"
|
|
|
|
|
"dsSupport/MyModel/AccessSystem/AccessSystemDao"
|
|
|
|
|
"dsSupport/Utils/CommonUtil"
|
|
|
|
|
"fmt"
|
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
|
"net/http"
|
|
|
|
|
"strings"
|
|
|
|
@ -19,7 +20,6 @@ func Routers(r *gin.RouterGroup) {
|
|
|
|
|
rr.POST("/DeleteAccessSystemInfo", DeleteAccessSystemInfo)
|
|
|
|
|
rr.GET("/GetAccessSystemRangeInfo", GetAccessSystemRangeInfo)
|
|
|
|
|
rr.POST("/SettingAccessSystemRangeInfo", SettingAccessSystemRangeInfo)
|
|
|
|
|
rr.POST("/EmptyAccessSystemRangeInfo", EmptyAccessSystemRangeInfo)
|
|
|
|
|
rr.GET("/GetAccessSystemSsoInfo", GetAccessSystemSsoInfo)
|
|
|
|
|
rr.POST("/SettingAccessSystemSsoInfo", SettingAccessSystemSsoInfo)
|
|
|
|
|
rr.POST("/EmptyAccessSystemSsoInfo", EmptyAccessSystemSsoInfo)
|
|
|
|
@ -45,9 +45,9 @@ func Routers(r *gin.RouterGroup) {
|
|
|
|
|
// @X-Sort [0]
|
|
|
|
|
func PageAccessSystemInfo(c *gin.Context) {
|
|
|
|
|
//第几页
|
|
|
|
|
page := CommonUtil.ConvertStringToInt32(c.Query("page"))
|
|
|
|
|
page := CommonUtil.ConvertStringToInt(c.Query("page"))
|
|
|
|
|
//一页显示多少条
|
|
|
|
|
limit := CommonUtil.ConvertStringToInt32(c.Query("limit"))
|
|
|
|
|
limit := CommonUtil.ConvertStringToInt(c.Query("limit"))
|
|
|
|
|
|
|
|
|
|
res, count, err := AccessSystemDao.ListApp("", page, limit)
|
|
|
|
|
if err != nil {
|
|
|
|
@ -237,6 +237,19 @@ func SettingAccessSystemRangeInfo(c *gin.Context) {
|
|
|
|
|
func GetAccessSystemSsoInfo(c *gin.Context) {
|
|
|
|
|
//系统ID
|
|
|
|
|
appId := c.Query("appId")
|
|
|
|
|
res, err := AccessSystemDao.GetApp(appId)
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
|
Message: err.Error(),
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: true,
|
|
|
|
|
Message: "操作成功!",
|
|
|
|
|
List: CommonUtil.MapKeepFields(res, "redirect_uri", "logout_uri"),
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// @Summary 设置接入系统的统一认证信息
|
|
|
|
@ -261,7 +274,19 @@ func SettingAccessSystemSsoInfo(c *gin.Context) {
|
|
|
|
|
//统一认证登出地址
|
|
|
|
|
logoutUri := c.PostForm("logoutUri")
|
|
|
|
|
|
|
|
|
|
AccessSystemDao.UpdateSso()
|
|
|
|
|
err := AccessSystemDao.UpdateSso(appId, redirectUri, logoutUri)
|
|
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
|
Message: err.Error(),
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: true,
|
|
|
|
|
Message: "操作成功!",
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -280,6 +305,19 @@ func SettingAccessSystemSsoInfo(c *gin.Context) {
|
|
|
|
|
func EmptyAccessSystemSsoInfo(c *gin.Context) {
|
|
|
|
|
//系统ID
|
|
|
|
|
appId := c.PostForm("appId")
|
|
|
|
|
err := AccessSystemDao.ClearSso(appId)
|
|
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
|
Message: err.Error(),
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: true,
|
|
|
|
|
Message: "操作成功!",
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// @Summary 获取接入系统的集成信息
|
|
|
|
@ -297,6 +335,20 @@ func EmptyAccessSystemSsoInfo(c *gin.Context) {
|
|
|
|
|
func GetAccessSystemIntegratedInfo(c *gin.Context) {
|
|
|
|
|
//系统ID
|
|
|
|
|
appId := c.Query("appId")
|
|
|
|
|
|
|
|
|
|
res, err := AccessSystemDao.GetApp(appId)
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
|
Message: err.Error(),
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: true,
|
|
|
|
|
Message: "操作成功!",
|
|
|
|
|
List: CommonUtil.MapKeepFields(res, "app_url", "app_icon"),
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// @Summary 设置接入系统的集成信息
|
|
|
|
@ -321,7 +373,22 @@ func SettingAccessSystemIntegratedInfo(c *gin.Context) {
|
|
|
|
|
//接入系统在集成页面的图标
|
|
|
|
|
header, _ := c.FormFile("excelFile")
|
|
|
|
|
//生成图标的ID
|
|
|
|
|
iconFileId := CommonUtil.GetUUID()
|
|
|
|
|
//iconFileId := CommonUtil.GetUUID()
|
|
|
|
|
fmt.Println(header)
|
|
|
|
|
|
|
|
|
|
err := AccessSystemDao.UpdateIntegration(appId, redirectUri, "")
|
|
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
|
Message: err.Error(),
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: true,
|
|
|
|
|
Message: "操作成功!",
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -340,4 +407,17 @@ func SettingAccessSystemIntegratedInfo(c *gin.Context) {
|
|
|
|
|
func EmptyAccessSystemIntegratedInfo(c *gin.Context) {
|
|
|
|
|
//系统ID
|
|
|
|
|
appId := c.PostForm("appId")
|
|
|
|
|
err := AccessSystemDao.ClearIntegration(appId)
|
|
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
|
Message: err.Error(),
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: true,
|
|
|
|
|
Message: "操作成功!",
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|