This commit is contained in:
YuleiLan
2020-07-13 20:33:20 +08:00
commit cca0845f24
106 changed files with 17580 additions and 0 deletions

22
tools/url.go Normal file
View File

@@ -0,0 +1,22 @@
package tools
import (
"github.com/gin-gonic/gin"
"strings"
)
//获取URL中批量id并解析
func IdsStrToIdsIntGroup(key string, c *gin.Context) []int {
return idsStrToIdsIntGroup(c.Param(key))
}
func idsStrToIdsIntGroup(keys string) []int {
IDS := make([]int, 0)
ids := strings.Split(keys, ",")
for i := 0; i < len(ids); i++ {
ID, _ := StringToInt(ids[i])
IDS = append(IDS, ID)
}
return IDS
}