Add the MatterLock strategy.

This commit is contained in:
zicla
2019-04-24 20:48:59 +08:00
parent daa5847859
commit d0fb55318f
5 changed files with 99 additions and 63 deletions

View File

@ -1,6 +1,9 @@
package result
import "net/http"
import (
"fmt"
"net/http"
)
type WebResult struct {
Code string `json:"code"`
@ -89,10 +92,15 @@ func CustomWebResult(codeWrapper *CodeWrapper, description string) *WebResult {
return wr
}
//请求参数有问题
func BadRequest(format string, v ...interface{}) *WebResult {
return CustomWebResult(CODE_WRAPPER_BAD_REQUEST, fmt.Sprintf(format, v...))
}
//所有的数据库错误情况
var (
DB_ERROR_DUPLICATE_KEY = "Error 1062: Duplicate entry"
DB_ERROR_NOT_FOUND = "record not found"
DB_TOO_MANY_CONNECTIONS = "Error 1040: Too many connections"
DB_BAD_CONNECTION = "driver: bad connection"
DB_BAD_CONNECTION = "driver: bad connection"
)