- new jd order handle ok, access jd api synchronously.
This commit is contained in:
5
compat/corm/corm.go
Normal file
5
compat/corm/corm.go
Normal file
@@ -0,0 +1,5 @@
|
||||
package corm
|
||||
|
||||
type DBErrorChecker interface {
|
||||
ErrorIsDuplicate(error) bool
|
||||
}
|
||||
17
compat/corm/corm_mysql.go
Normal file
17
compat/corm/corm_mysql.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package corm
|
||||
|
||||
import (
|
||||
"github.com/go-sql-driver/mysql"
|
||||
)
|
||||
|
||||
type MysqlErrorChecker struct {
|
||||
}
|
||||
|
||||
func (c MysqlErrorChecker) ErrorIsDuplicate(err error) bool {
|
||||
if err == nil {
|
||||
return false
|
||||
}
|
||||
|
||||
realErr := err.(*mysql.MySQLError)
|
||||
return realErr.Number == 1062
|
||||
}
|
||||
Reference in New Issue
Block a user