- mtps cancel_reason_id is not mandatory,

- fix check mandatory bug.
This commit is contained in:
gazebo
2018-06-29 11:50:45 +08:00
parent 3aac71a84f
commit b10456dffe
2 changed files with 5 additions and 5 deletions

View File

@@ -116,10 +116,10 @@ func Bool2String(value bool) string {
return "false"
}
func Str2Int(str string) int {
retVal, err := strconv.Atoi(str)
func Str2Int64WithDefault(str string, defValue int64) int64 {
retVal, err := strconv.ParseInt(str, 10, 64)
if err != nil {
baseapi.SugarLogger.Errorf("error when convert %s to int", str)
return defValue
}
return retVal
}