Compare commits
No commits in common. "main" and "v0.1.3" have entirely different histories.
17
error.go
17
error.go
@ -1,17 +0,0 @@
|
|||||||
package model
|
|
||||||
|
|
||||||
import "strings"
|
|
||||||
|
|
||||||
func IsDuplicateError(err error) bool {
|
|
||||||
if err == nil {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
var errstr = strings.ToLower(err.Error())
|
|
||||||
if strings.HasPrefix(errstr, "error 1062 (23000): duplicate entry") {
|
|
||||||
return true
|
|
||||||
} else if strings.Contains(errstr, "error") && strings.Contains(errstr, "duplicate entry") {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
@ -1 +0,0 @@
|
|||||||
package dao
|
|
||||||
@ -1,22 +0,0 @@
|
|||||||
package model
|
|
||||||
|
|
||||||
import (
|
|
||||||
"qoobing.ai/payserver/config"
|
|
||||||
"qoobing.com/gomod/log"
|
|
||||||
"qoobing.com/gomod/model"
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
|
||||||
Db = model.Db
|
|
||||||
DbOf = model.DbOf
|
|
||||||
Redis = model.Redis
|
|
||||||
RedisPool = model.RedisPool
|
|
||||||
RedisPoolOf = model.RedisPoolOf
|
|
||||||
)
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
cfg := config.Instance()
|
|
||||||
model.Init("pay", &cfg.PayDb)
|
|
||||||
model.Init("pay", &cfg.PayRedis)
|
|
||||||
log.Infof("model initlized")
|
|
||||||
}
|
|
||||||
@ -1 +0,0 @@
|
|||||||
package model
|
|
||||||
Loading…
Reference in New Issue
Block a user