1
This commit is contained in:
parent
500324ad90
commit
d1621300ff
@ -5,6 +5,7 @@ import (
|
||||
"f5"
|
||||
"fmt"
|
||||
"main/constant"
|
||||
"main/model"
|
||||
)
|
||||
|
||||
type friendMgr struct {
|
||||
@ -208,26 +209,7 @@ func (this *friendMgr) AsyncApplyFriend(senderId string, targetId string, cb fun
|
||||
cb(0, "")
|
||||
return
|
||||
}
|
||||
nowTime := f5.GetApp().GetNowSeconds()
|
||||
f5.GetJsStyleDb().Upsert(
|
||||
constant.FRIEND_DB,
|
||||
"t_friend_apply",
|
||||
[][]string{
|
||||
{"sender_id", senderId},
|
||||
{"target_id", targetId},
|
||||
},
|
||||
[][]string{
|
||||
{"status", q5.ToString(constant.FRIEND_APPLY_STATUS_NONE)},
|
||||
{"last_apply_time", q5.ToString(nowTime)},
|
||||
},
|
||||
[][]string{
|
||||
{"sender_id", senderId},
|
||||
{"target_id", targetId},
|
||||
{"status", q5.ToString(constant.FRIEND_APPLY_STATUS_NONE)},
|
||||
{"last_apply_time", q5.ToString(nowTime)},
|
||||
{"createtime", q5.ToString(nowTime)},
|
||||
{"modifytime", q5.ToString(nowTime)},
|
||||
},
|
||||
model.FriendApply.Force(senderId, targetId,
|
||||
func (err error, lastInsertId int64, rowsAffected int64) {
|
||||
if err != nil {
|
||||
cb(1, "")
|
||||
|
14
server/imserver_new/model/friend.go
Normal file
14
server/imserver_new/model/friend.go
Normal file
@ -0,0 +1,14 @@
|
||||
package model
|
||||
|
||||
/*
|
||||
import (
|
||||
"q5"
|
||||
"f5"
|
||||
"main/constant"
|
||||
)*/
|
||||
|
||||
type friend struct {
|
||||
|
||||
}
|
||||
|
||||
var Friend = new (friend)
|
38
server/imserver_new/model/friend_apply.go
Normal file
38
server/imserver_new/model/friend_apply.go
Normal file
@ -0,0 +1,38 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"q5"
|
||||
"f5"
|
||||
"main/constant"
|
||||
)
|
||||
|
||||
type friendApply struct {
|
||||
|
||||
}
|
||||
|
||||
var FriendApply = new (friendApply)
|
||||
|
||||
func (this *friendApply) Force(senderId string, targetId string,
|
||||
cb func (error, int64, int64)) {
|
||||
nowTime := f5.GetApp().GetNowSeconds()
|
||||
f5.GetJsStyleDb().Upsert(
|
||||
constant.FRIEND_DB,
|
||||
"t_friend_apply",
|
||||
[][]string{
|
||||
{"sender_id", senderId},
|
||||
{"target_id", targetId},
|
||||
},
|
||||
[][]string{
|
||||
{"status", q5.ToString(constant.FRIEND_APPLY_STATUS_NONE)},
|
||||
{"last_apply_time", q5.ToString(nowTime)},
|
||||
},
|
||||
[][]string{
|
||||
{"sender_id", senderId},
|
||||
{"target_id", targetId},
|
||||
{"status", q5.ToString(constant.FRIEND_APPLY_STATUS_NONE)},
|
||||
{"last_apply_time", q5.ToString(nowTime)},
|
||||
{"createtime", q5.ToString(nowTime)},
|
||||
{"modifytime", q5.ToString(nowTime)},
|
||||
},
|
||||
cb)
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user