|
|
|
@ -17,6 +17,7 @@ func Routers(r *gin.RouterGroup) {
|
|
|
|
|
rr.POST("/UpdateGlobalInfo", UpdateGlobalInfo)
|
|
|
|
|
rr.GET("/PageGlobalInfo", PageGlobalInfo)
|
|
|
|
|
rr.GET("/GetGlobalInfo", GetGlobalInfo)
|
|
|
|
|
rr.GET("/GetGlobalValueByCodes", GetGlobalValueByCodes)
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
@ -37,7 +38,7 @@ func Routers(r *gin.RouterGroup) {
|
|
|
|
|
// @X-IntLimit ["globalTypeId","sortId"]
|
|
|
|
|
// @X-LengthLimit [{"globalCode":"2,50"},{"globalValue":"1,255"},{"globalRemarks":"1,500"}]
|
|
|
|
|
// @X-RoleLimit ["1"]
|
|
|
|
|
// @X-Sort [3]
|
|
|
|
|
// @X-Sort [4]
|
|
|
|
|
func AddGlobalInfo(c *gin.Context) {
|
|
|
|
|
globalTypeId := CommonUtil.ConvertStringToInt(c.PostForm("globalTypeId"))
|
|
|
|
|
globalCode := c.PostForm("globalCode")
|
|
|
|
@ -81,7 +82,7 @@ func AddGlobalInfo(c *gin.Context) {
|
|
|
|
|
// @X-EmptyLimit ["globalIds"]
|
|
|
|
|
// @X-LengthLimit [{"globalIds":"36,1800"}]
|
|
|
|
|
// @X-RoleLimit ["1"]
|
|
|
|
|
// @X-Sort [4]
|
|
|
|
|
// @X-Sort [5]
|
|
|
|
|
func DeleteGlobalInfo(c *gin.Context) {
|
|
|
|
|
globalId := c.PostForm("globalId")
|
|
|
|
|
//操作人
|
|
|
|
@ -126,7 +127,7 @@ func DeleteGlobalInfo(c *gin.Context) {
|
|
|
|
|
// @X-IntLimit ["globalId","globalTypeId","sortId"]
|
|
|
|
|
// @X-LengthLimit [{"globalId":"36,36"},{"globalCode":"2,50"},{"globalValue":"1,255"},{"globalRemarks":"1,500"}]
|
|
|
|
|
// @X-RoleLimit ["1"]
|
|
|
|
|
// @X-Sort [5]
|
|
|
|
|
// @X-Sort [6]
|
|
|
|
|
func UpdateGlobalInfo(c *gin.Context) {
|
|
|
|
|
globalId := c.PostForm("globalId")
|
|
|
|
|
globalTypeId := CommonUtil.ConvertStringToInt32(c.PostForm("globalTypeId"))
|
|
|
|
@ -248,3 +249,38 @@ func GetGlobalInfo(c *gin.Context) {
|
|
|
|
|
Count: r.Count,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// @Summary 根据多个全局变量Code获取全局变量值
|
|
|
|
|
// @Description 根据多个全局变量Code获取全局变量值
|
|
|
|
|
// @Tags 全局变量
|
|
|
|
|
// @Accept application/x-www-form-urlencoded
|
|
|
|
|
// @Produce json
|
|
|
|
|
// @Param codes query string true "全局变量Code,多个用逗号分隔"
|
|
|
|
|
// @Success 200 {object} Model.Res
|
|
|
|
|
// @Router /base/global/GetGlobalValueByCodes [get]
|
|
|
|
|
// @X-EmptyLimit ["codes"]
|
|
|
|
|
// @X-LengthLimit [{"codes":"1,500"}]
|
|
|
|
|
// @X-RoleLimit ["1","2","3","4","5","6","7"]
|
|
|
|
|
// @X-InterfaceName ["GetBaseGlobal"]
|
|
|
|
|
// @X-TableName ["t_base_global"]
|
|
|
|
|
// @X-Sort [3]
|
|
|
|
|
func GetGlobalValueByCodes(c *gin.Context) {
|
|
|
|
|
//全局变量Code,多个用逗号分隔
|
|
|
|
|
codes := c.Query("codes")
|
|
|
|
|
|
|
|
|
|
r, err := BaseGlobalService.GetGlobalValueByCodes(codes)
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
|
Message: "调用RPC服务失败!",
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: r.Success,
|
|
|
|
|
Message: r.Message,
|
|
|
|
|
List: CommonUtil.ConvertJsonStringToMapArray(r.List),
|
|
|
|
|
Count: r.Count,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|