func (c *CommandController) Get(ctx iris.Context) interface{} {
	pageSize, err := strconv.Atoi(ctx.URLParamDefault("pageSize", "100"))

	if err != nil {
		ctx.Application().Logger().Error(err)
		return iris.StatusBadRequest
	}

	page, err := strconv.Atoi(ctx.URLParamDefault("page", "0"))

	if err != nil {
		ctx.Application().Logger().Error(err)
		return iris.StatusBadRequest
	}

	query := ctx.URLParam("search")

	commands, err := c.Service.GetAll(query, page, pageSize)

	if err != nil {
		ctx.Application().Logger().Error(err)
		return iris.StatusInternalServerError
	}

	return commands
}
// Get get all existing commands
Get get all existing commands
// Get get all existing commands
func (c *CommandController) Get(ctx iris.Context) interface{} {
	pageSize, err := strconv.Atoi(ctx.URLParamDefault("pageSize", "100"))
	if err != nil {
		ctx.Application().Logger().Error(err)
		return iris.StatusBadRequest
	}
	page, err := strconv.Atoi(ctx.URLParamDefault("page", "0"))
	if err != nil {
		ctx.Application().Logger().Error(err)
		return iris.StatusBadRequest
	}
	query := ctx.URLParam("search")
	commands, err := c.Service.GetAll(query, page, pageSize)
	if err != nil {
		ctx.Application().Logger().Error(err)
		return iris.StatusInternalServerError
	}
	return commands
}
func ( c * CommandController ) Get ( ctx iris . Context ) interface { } { pageSize , err := strconv . Atoi ( ctx . URLParamDefault ( " " , " " ) ) if err != nil { ctx . Application ( ) . Logger ( ) . Error ( err ) return iris . StatusBadRequest } page , err := strconv . Atoi ( ctx . URLParamDefault ( " " , " " ) ) if err != nil { ctx . Application ( ) . Logger ( ) . Error ( err ) return iris . StatusBadRequest } query := ctx . URLParam ( " " ) commands , err := c . Service . GetAll ( query , page , pageSize ) if err != nil { ctx . Application ( ) . Logger ( ) . Error ( err ) return iris . StatusInternalServerError } return commands }
Get get all existing commands
Get get all existing commands