1
This commit is contained in:
parent
77dfc7f2c7
commit
d4433dc0ff
@ -1,6 +1,7 @@
|
||||
package f5
|
||||
|
||||
import (
|
||||
"q5"
|
||||
"os"
|
||||
"errors"
|
||||
"gorm.io/gorm"
|
||||
@ -32,6 +33,14 @@ func New[T any](cb func(*T)) *T {
|
||||
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 {
|
||||
return errors.Is(err, gorm.ErrRecordNotFound)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user