- new jd order handle ok, access jd api synchronously.

This commit is contained in:
gazebo
2018-06-06 14:51:16 +08:00
parent 8d1c22229b
commit 773135af89
8 changed files with 191 additions and 0 deletions

5
compat/corm/corm.go Normal file
View File

@@ -0,0 +1,5 @@
package corm
type DBErrorChecker interface {
ErrorIsDuplicate(error) bool
}

17
compat/corm/corm_mysql.go Normal file
View 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
}