1
This commit is contained in:
@@ -87,7 +87,7 @@ func Send(data []byte) {
|
||||
break
|
||||
} else {
|
||||
temp := string(msg)
|
||||
if temp != HeartCheckSuccess {
|
||||
if temp != HeartCheckSuccess || temp != "成功" {
|
||||
ReadMsgFromVendor(VendorIDMT, "", msg)
|
||||
}
|
||||
}
|
||||
@@ -358,19 +358,33 @@ func GetImChatDetail(req []UserRelInfo) (map[string][]interface{}, error) {
|
||||
|
||||
// SetJxMsgRead 设置jx消息已读 userID(美团:openUserID;饿了么:groupID)
|
||||
func SetJxMsgRead(appID, vendorStoreID, vendorID, userID string) error {
|
||||
key := appID + ":" + vendorStoreID + ":" + vendorID
|
||||
var (
|
||||
temp = UserMessageList{}
|
||||
key = appID + ":" + vendorStoreID + ":" + vendorID
|
||||
)
|
||||
if n, err := rdb.Exists(key); n > 0 && err == nil {
|
||||
s2 := rdb.LRange(key)
|
||||
for i := 0; i < len(s2); i++ {
|
||||
v := UserMessageList{}
|
||||
_ = json.Unmarshal([]byte(s2[i]), &v)
|
||||
if v.UserID == userID {
|
||||
//删除此条数据
|
||||
err = rdb.LSet(key, i, "del")
|
||||
err = rdb.LRem(key, 0, "del")
|
||||
s2 = append(s2[:i], s2[i+1:]...)
|
||||
i--
|
||||
//cnt=0 重新赋值
|
||||
temp = UserMessageList{
|
||||
VendorID: v.VendorID,
|
||||
UserID: v.UserID,
|
||||
NewMessageNum: 0,
|
||||
LatestMsg: v.LatestMsg,
|
||||
LatestTime: v.LatestTime,
|
||||
}
|
||||
}
|
||||
}
|
||||
str, _ := json.Marshal(temp)
|
||||
err = rdb.RPush(key, str)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -6,25 +6,24 @@ import (
|
||||
"git.rosy.net.cn/jx-callback/business/model/legacymodel"
|
||||
"git.rosy.net.cn/jx-callback/globals"
|
||||
"github.com/astaxie/beego/client/orm"
|
||||
"github.com/astaxie/beego/server/web"
|
||||
)
|
||||
|
||||
func Init() {
|
||||
// set default database
|
||||
// orm.RegisterDataBase(aliasName, driverName, dataSource, params)
|
||||
//正式服务器
|
||||
orm.RegisterDataBase("default", "mysql", web.AppConfig.DefaultString("dbConnectStr", ""))
|
||||
orm.RegisterDataBase("c4beta", "mysql", "ubuntu:WebServer@1@tcp(111.231.218.230:3306)/jxd_dev_0?charset=utf8mb4&loc=Local&parseTime=true")
|
||||
orm.RegisterDataBase("api", "mysql", "root:WebServer@1@tcp(127.0.0.1:3306)/api?charset=utf8mb4&loc=Local&parseTime=true")
|
||||
//orm.RegisterDataBase("default", "mysql", web.AppConfig.DefaultString("dbConnectStr", ""))
|
||||
//orm.RegisterDataBase("c4beta", "mysql", "ubuntu:WebServer@1@tcp(111.231.218.230:3306)/jxd_dev_0?charset=utf8mb4&loc=Local&parseTime=true")
|
||||
//orm.RegisterDataBase("api", "mysql", "root:WebServer@1@tcp(127.0.0.1:3306)/api?charset=utf8mb4&loc=Local&parseTime=true")
|
||||
// 本地测试服调试
|
||||
// orm.RegisterDataBase("default", "mysql", web.AppConfig.DefaultString("dbConnectStr", ""))
|
||||
//orm.RegisterDataBase("api", "mysql", "root:WebServer@1@tcp(127.0.0.1:3306)/api?charset=utf8mb4&loc=Local&parseTime=true")
|
||||
//orm.RegisterDataBase("c4beta", "mysql", "ubuntu:WebServer@1@tcp(127.0.0.1:3306)/jxd_dev_0?charset=utf8mb4&loc=Local&parseTime=true")
|
||||
|
||||
//本地服务器测试用 -ysq
|
||||
//orm.RegisterDataBase("default", "mysql", "root:123456@tcp(127.0.0.1:3306)/jxd_dev_0?charset=utf8mb4&loc=Local&parseTime=true")
|
||||
//orm.RegisterDataBase("c4beta", "mysql", "root:123456@tcp(127.0.0.1:3306)/jxd_dev_0?charset=utf8mb4&loc=Local&parseTime=true")
|
||||
//orm.RegisterDataBase("api", "mysql", "root:123456@tcp(127.0.0.1:3306)/api?charset=utf8mb4&loc=Local&parseTime=true")
|
||||
orm.RegisterDataBase("default", "mysql", "root:123456@tcp(127.0.0.1:3306)/jxd_dev_0?charset=utf8mb4&loc=Local&parseTime=true")
|
||||
orm.RegisterDataBase("c4beta", "mysql", "root:123456@tcp(127.0.0.1:3306)/jxd_dev_0?charset=utf8mb4&loc=Local&parseTime=true")
|
||||
orm.RegisterDataBase("api", "mysql", "root:123456@tcp(127.0.0.1:3306)/api?charset=utf8mb4&loc=Local&parseTime=true")
|
||||
|
||||
// 开启sql打印
|
||||
//orm.Debug = true
|
||||
|
||||
@@ -4344,8 +4344,8 @@ func init() {
|
||||
//im
|
||||
web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:IMController"] = append(web.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:IMController"],
|
||||
web.ControllerComments{
|
||||
Method: "GetIMUserList",
|
||||
Router: `/GetIMUserList`,
|
||||
Method: "GetImUserList",
|
||||
Router: `/GetImUserList`,
|
||||
AllowHTTPMethods: []string{"get"},
|
||||
MethodParams: param.Make(),
|
||||
Filters: nil,
|
||||
|
||||
Reference in New Issue
Block a user