|
|
@ -2,7 +2,9 @@ package controller
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
|
|
|
|
"github.com/taoshihan1991/imaptool/config"
|
|
|
|
"github.com/taoshihan1991/imaptool/models"
|
|
|
|
"github.com/taoshihan1991/imaptool/models"
|
|
|
|
|
|
|
|
"strconv"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
func PostIpblack(c *gin.Context) {
|
|
|
|
func PostIpblack(c *gin.Context) {
|
|
|
@ -21,3 +23,17 @@ func PostIpblack(c *gin.Context) {
|
|
|
|
"msg": "添加黑名单成功!",
|
|
|
|
"msg": "添加黑名单成功!",
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func GetIpblacks(c *gin.Context) {
|
|
|
|
|
|
|
|
page,_:=strconv.Atoi(c.Query("page"))
|
|
|
|
|
|
|
|
count:=models.CountIps(nil,nil)
|
|
|
|
|
|
|
|
list:=models.FindIps(nil,nil,uint(page),config.VisitorPageSize)
|
|
|
|
|
|
|
|
c.JSON(200, gin.H{
|
|
|
|
|
|
|
|
"code": 200,
|
|
|
|
|
|
|
|
"msg": "ok",
|
|
|
|
|
|
|
|
"result":gin.H{
|
|
|
|
|
|
|
|
"list":list,
|
|
|
|
|
|
|
|
"count":count,
|
|
|
|
|
|
|
|
"pagesize":config.PageSize,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|