mirror of
https://github.com/xiaoxinpro/nginx-proxy-manager-zh.git
synced 2025-01-22 21:08:13 -05:00
Small tweaks
This commit is contained in:
parent
ed609f0bec
commit
824a22efad
@ -1,10 +0,0 @@
|
||||
package doc
|
||||
|
||||
import "embed"
|
||||
|
||||
// SwaggerFiles contain all the files used for swagger schema generation
|
||||
//
|
||||
//go:embed api.swagger.json
|
||||
//go:embed components
|
||||
//go:embed paths
|
||||
var SwaggerFiles embed.FS
|
@ -85,21 +85,6 @@ func getQueryVarInt(r *http.Request, varName string, required bool, defaultValue
|
||||
return varInt, nil
|
||||
}
|
||||
|
||||
/*
|
||||
func getQueryVarBool(r *http.Request, varName string, required bool, defaultValue bool) (bool, error) {
|
||||
queryValues := r.URL.Query()
|
||||
varValue := queryValues.Get(varName)
|
||||
|
||||
if varValue == "" && required {
|
||||
return false, eris.Errorf("%v was not supplied in the request", varName)
|
||||
} else if varValue == "" {
|
||||
return defaultValue, nil
|
||||
}
|
||||
|
||||
return varValue == "true" || varValue == "1" || varValue == "on", nil
|
||||
}
|
||||
*/
|
||||
|
||||
func getURLParamInt(r *http.Request, varName string) (uint, error) {
|
||||
var defaultValue uint = 0
|
||||
|
||||
|
@ -2,11 +2,12 @@ package entity
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"npm/internal/logger"
|
||||
"npm/internal/util"
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
"npm/internal/logger"
|
||||
"npm/internal/util"
|
||||
|
||||
"github.com/rotisserie/eris"
|
||||
)
|
||||
|
||||
|
@ -15,7 +15,7 @@ type Sort struct {
|
||||
Direction string `json:"direction"`
|
||||
}
|
||||
|
||||
// TableName overrides the table name used by gorm
|
||||
// GetSort ...
|
||||
func (p *PageInfo) GetSort(def Sort) []Sort {
|
||||
if p.Sort == nil {
|
||||
return []Sort{def}
|
||||
|
@ -3,10 +3,11 @@ package util
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"npm/internal/logger"
|
||||
"regexp"
|
||||
"strings"
|
||||
"unicode"
|
||||
|
||||
"npm/internal/logger"
|
||||
)
|
||||
|
||||
// CleanupWhitespace will trim up and remove extra lines and stuff
|
||||
|
Loading…
Reference in New Issue
Block a user