update
This commit is contained in:
+2
-2
@@ -7,8 +7,8 @@ import (
|
||||
"github.com/beego/beego/v2/adapter/httplib"
|
||||
)
|
||||
|
||||
var Pushs = map[string]func(int, string){}
|
||||
var GroupPushs = map[string]func(int, int, string){}
|
||||
var Pushs = map[string]func(interface{}, string){}
|
||||
var GroupPushs = map[string]func(interface{}, interface{}, string){}
|
||||
|
||||
func Push(class string, uid int, content string) {
|
||||
if push, ok := Pushs[class]; ok {
|
||||
|
||||
+7
-2
@@ -116,11 +116,16 @@ func (bucket Bucket) Foreach(f func(k, v []byte) error) {
|
||||
})
|
||||
}
|
||||
|
||||
var Int = func(s string) int {
|
||||
i, _ := strconv.Atoi(s)
|
||||
var Int = func(s interface{}) int {
|
||||
i, _ := strconv.Atoi(fmt.Sprint(s))
|
||||
return i
|
||||
}
|
||||
|
||||
var Int64 = func(s interface{}) int64 {
|
||||
i, _ := strconv.Atoi(fmt.Sprint(s))
|
||||
return int64(i)
|
||||
}
|
||||
|
||||
func (bucket Bucket) Create(i interface{}) error {
|
||||
s := reflect.ValueOf(i).Elem()
|
||||
id := s.FieldByName("ID")
|
||||
|
||||
Reference in New Issue
Block a user