1
This commit is contained in:
parent
77dfc7f2c7
commit
d4433dc0ff
@ -1,6 +1,7 @@
|
|||||||
package f5
|
package f5
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"q5"
|
||||||
"os"
|
"os"
|
||||||
"errors"
|
"errors"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
@ -32,6 +33,14 @@ func New[T any](cb func(*T)) *T {
|
|||||||
return obj
|
return obj
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func ExtractRegisterTimeFromSessionid(sessionId string) int32 {
|
||||||
|
strList := q5.StrSplit(sessionId, "_")
|
||||||
|
if len(strList) < 4 {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
return q5.ToInt32(strList[0])
|
||||||
|
}
|
||||||
|
|
||||||
func IsOrmErrRecordNotFound(err error) bool {
|
func IsOrmErrRecordNotFound(err error) bool {
|
||||||
return errors.Is(err, gorm.ErrRecordNotFound)
|
return errors.Is(err, gorm.ErrRecordNotFound)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user