|
@@ -24,7 +24,7 @@ func NewAllowAndDenyIpHandler(
|
|
|
|
|
|
func (h *AllowAndDenyIpHandler) GetAllowAndDenyIp(ctx *gin.Context) {
|
|
func (h *AllowAndDenyIpHandler) GetAllowAndDenyIp(ctx *gin.Context) {
|
|
var req v1.AllowAndDenyIpRequest
|
|
var req v1.AllowAndDenyIpRequest
|
|
- if err := ctx.ShouldBind(req); err != nil {
|
|
|
|
|
|
+ if err := ctx.ShouldBind(&req); err != nil {
|
|
v1.HandleError(ctx, http.StatusBadRequest, v1.ErrBadRequest, err.Error())
|
|
v1.HandleError(ctx, http.StatusBadRequest, v1.ErrBadRequest, err.Error())
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -38,7 +38,7 @@ func (h *AllowAndDenyIpHandler) GetAllowAndDenyIp(ctx *gin.Context) {
|
|
|
|
|
|
func (h *AllowAndDenyIpHandler) GetAllowAndDenyIpList(ctx *gin.Context) {
|
|
func (h *AllowAndDenyIpHandler) GetAllowAndDenyIpList(ctx *gin.Context) {
|
|
var req v1.AllowAndDenyIpRequest
|
|
var req v1.AllowAndDenyIpRequest
|
|
- if err := ctx.ShouldBind(req); err != nil {
|
|
|
|
|
|
+ if err := ctx.ShouldBind(&req); err != nil {
|
|
v1.HandleError(ctx, http.StatusBadRequest, v1.ErrBadRequest, err.Error())
|
|
v1.HandleError(ctx, http.StatusBadRequest, v1.ErrBadRequest, err.Error())
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -52,7 +52,7 @@ func (h *AllowAndDenyIpHandler) GetAllowAndDenyIpList(ctx *gin.Context) {
|
|
|
|
|
|
func (h *AllowAndDenyIpHandler) AddAllowAndDenyIp(ctx *gin.Context) {
|
|
func (h *AllowAndDenyIpHandler) AddAllowAndDenyIp(ctx *gin.Context) {
|
|
var req v1.AllowAndDenyIpRequest
|
|
var req v1.AllowAndDenyIpRequest
|
|
- if err := ctx.ShouldBind(req); err != nil {
|
|
|
|
|
|
+ if err := ctx.ShouldBind(&req); err != nil {
|
|
v1.HandleError(ctx, http.StatusBadRequest, v1.ErrBadRequest, err.Error())
|
|
v1.HandleError(ctx, http.StatusBadRequest, v1.ErrBadRequest, err.Error())
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -67,7 +67,7 @@ func (h *AllowAndDenyIpHandler) AddAllowAndDenyIp(ctx *gin.Context) {
|
|
|
|
|
|
func (h *AllowAndDenyIpHandler) EditAllowAndDenyIp(ctx *gin.Context) {
|
|
func (h *AllowAndDenyIpHandler) EditAllowAndDenyIp(ctx *gin.Context) {
|
|
var req v1.AllowAndDenyIpRequest
|
|
var req v1.AllowAndDenyIpRequest
|
|
- if err := ctx.ShouldBind(req); err != nil {
|
|
|
|
|
|
+ if err := ctx.ShouldBind(&req); err != nil {
|
|
v1.HandleError(ctx, http.StatusBadRequest, v1.ErrBadRequest, err.Error())
|
|
v1.HandleError(ctx, http.StatusBadRequest, v1.ErrBadRequest, err.Error())
|
|
return
|
|
return
|
|
}
|
|
}
|
|
@@ -81,7 +81,7 @@ func (h *AllowAndDenyIpHandler) EditAllowAndDenyIp(ctx *gin.Context) {
|
|
|
|
|
|
func (h *AllowAndDenyIpHandler) DeleteAllowAndDenyIp(ctx *gin.Context) {
|
|
func (h *AllowAndDenyIpHandler) DeleteAllowAndDenyIp(ctx *gin.Context) {
|
|
var req v1.DelAllowAndDenyIpRequest
|
|
var req v1.DelAllowAndDenyIpRequest
|
|
- if err := ctx.ShouldBind(req); err != nil {
|
|
|
|
|
|
+ if err := ctx.ShouldBind(&req); err != nil {
|
|
v1.HandleError(ctx, http.StatusBadRequest, v1.ErrBadRequest, err.Error())
|
|
v1.HandleError(ctx, http.StatusBadRequest, v1.ErrBadRequest, err.Error())
|
|
return
|
|
return
|
|
}
|
|
}
|