فهرست منبع

Merge branch 'develop' of 192.168.3.17:zhanghongbo/qfw into develop

李广朋 9 سال پیش
والد
کامیت
f8ee0b832e
4فایلهای تغییر یافته به همراه11 افزوده شده و 5 حذف شده
  1. 4 0
      common/src/gopkg.in/mgo.v2/session.go
  2. 3 2
      common/src/qfw/util/common.go
  3. BIN
      weixin/doc/kfex.rar
  4. 4 3
      weixin/src/main.go

+ 4 - 0
common/src/gopkg.in/mgo.v2/session.go

@@ -1975,6 +1975,10 @@ func (c *Collection) Pipe(pipeline interface{}) *Pipe {
 
 // Iter executes the pipeline and returns an iterator capable of going
 // over all the generated results.
+func (p *Pipe) SetAllowDisk(b bool) *Pipe {
+	p.allowDisk = b
+	return p
+}
 func (p *Pipe) Iter() *Iter {
 	// Clone session and set it to Monotonic mode so that the server
 	// used for the query may be safely obtained afterwards, if

+ 3 - 2
common/src/qfw/util/common.go

@@ -193,8 +193,9 @@ func Int64All(num interface{}) int64 {
 	} else if i3, ok3 := num.(float32); ok3 {
 		return int64(i3)
 	} else if i4, ok4 := num.(string); ok4 {
-		in, _ := strconv.Atoi(i4)
-		return int64(in)
+		i64, _ := strconv.ParseInt(i4, 10, 0)
+		//in, _ := strconv.Atoi(i4)
+		return i64
 	} else if i5, ok5 := num.(int16); ok5 {
 		return int64(i5)
 	} else if i6, ok6 := num.(int8); ok6 {

BIN
weixin/doc/kfex.rar


+ 4 - 3
weixin/src/main.go

@@ -36,6 +36,7 @@ func init() {
 	go weixin.InitDgWork()
 	go kf()
 	go weixin.GetKfMsgJob()
+	go weixin.GetOnlineKfJob()
 }
 
 func main() {
@@ -55,19 +56,19 @@ func main() {
 
 func kf() {
 	defer util.Catch()
-	http.HandleFunc("/getkflist", func(w http.ResponseWriter, r *http.Request) {
+	http.HandleFunc("/wxkf/getkflist", func(w http.ResponseWriter, r *http.Request) {
 		w.Header().Set("Content-Type", "application/json")
 		//内存
 		b, _ := json.Marshal(weixin.GetKfList(10))
 		w.Write(b)
 	})
-	http.HandleFunc("/getkflist0", func(w http.ResponseWriter, r *http.Request) {
+	http.HandleFunc("/wxkf/getkflist0", func(w http.ResponseWriter, r *http.Request) {
 		w.Header().Set("Content-Type", "application/json")
 		//url
 		b, _ := json.Marshal(weixin.GetKfList(0))
 		w.Write(b)
 	})
-	http.HandleFunc("/getkflist1", func(w http.ResponseWriter, r *http.Request) {
+	http.HandleFunc("/wxkf/getkflist1", func(w http.ResponseWriter, r *http.Request) {
 		w.Header().Set("Content-Type", "application/json")
 		//url+客服信息
 		b, _ := json.Marshal(weixin.GetKfList(1))