This commit is contained in:
殷勇 2023-10-25 15:46:41 +08:00
parent ef6a02719b
commit 50cb269954
8 changed files with 44 additions and 39 deletions

View File

@ -1,9 +1,9 @@
package q5
import (
"errors"
"strconv"
"strings"
"errors"
)
// ToInt converts a value to an integer.
@ -11,6 +11,11 @@ func ToInt32[T string | int | int32 | int64 | float32 | float64](value T) int32
return int32(ToInt64(value))
}
// ToInt converts a value to an integer.
func ToInt[T string | int32 | int64 | float32 | float64](value T) int {
return int(ToInt64(value))
}
// ToInt64 converts a value to an int64.
func ToInt64[T string | int | int32 | int64 | float32 | float64](value T) int64 {
var x interface{} = value

View File

@ -1,10 +1,10 @@
package q5
import (
"errors"
"io/ioutil"
"net/http"
net_url "net/url"
"io/ioutil"
"errors"
//"strings"
)

View File

@ -1,8 +1,8 @@
package q5
import (
"fmt"
"database/sql"
"fmt"
_ "github.com/go-sql-driver/mysql"
)

View File

@ -1,13 +1,13 @@
package q5
import (
"io"
"strings"
"crypto/md5"
"encoding/base64"
"encoding/hex"
"encoding/json"
"encoding/base64"
"hash/crc32"
"io"
"strings"
)
const (

View File

@ -5,7 +5,7 @@ import (
"time"
)
const Q5_EPOCH = 1419120000000;
const Q5_EPOCH = 1419120000000
const MACHINE_ID_BIT_NUM = 12
const SEQUNCE_ID_BIT_NUM = 10