This commit is contained in:
殷勇 2023-08-17 11:52:28 +08:00
parent b053e583d8
commit ea732fd78d
4 changed files with 14 additions and 8 deletions

View File

@ -23,8 +23,8 @@ UNIQUE KEY `friendship` (`account1_id`,`account2_id`)
COMMENT "已经成为好友" COMMENT "已经成为好友"
; ;
drop table if exists `t_pending_friend_requests`; drop table if exists `t_friend_pending_requests`;
CREATE TABLE t_pending_friend_requests ( CREATE TABLE t_friend_pending_requests (
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id', `idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
sender_account_id varchar(60) NOT NULL DEFAULT '', sender_account_id varchar(60) NOT NULL DEFAULT '',
receiver_account_id varchar(60) NOT NULL DEFAULT '', receiver_account_id varchar(60) NOT NULL DEFAULT '',

View File

@ -269,8 +269,8 @@ func (fm *FriendsMgr) listFriend(accountId string) []*User {
} }
func (fm *FriendsMgr) acceptFriendRequestToDB(account1Id string, account2Id string) error { func (fm *FriendsMgr) acceptFriendRequestToDB(account1Id string, account2Id string) error {
// step1. UPDATE t_pending_friend_requests // step1. UPDATE t_friend_pending_requests
_, err := friendDBStore.Exec("UPDATE t_pending_friend_requests SET flag=1 WHERE sender_account_id = ? AND receiver_account_id = ?", account1Id, account2Id) _, err := friendDBStore.Exec("UPDATE t_friend_pending_requests SET flag=1 WHERE sender_account_id = ? AND receiver_account_id = ?", account1Id, account2Id)
if err != nil { if err != nil {
return err return err
} }
@ -334,7 +334,7 @@ func (fm *FriendsMgr) loadFriendshipsFromDB(conn *q5.Mysql) {
} }
func (fm *FriendsMgr) loadPendingRequestsFromDB(conn *q5.Mysql) { func (fm *FriendsMgr) loadPendingRequestsFromDB(conn *q5.Mysql) {
rows, err := conn.Query("select sender_account_id, receiver_account_id, flag from t_pending_friend_requests;") rows, err := conn.Query("select sender_account_id, receiver_account_id, flag from t_friend_pending_requests;")
if err != nil { if err != nil {
f5.GetSysLog().Info("mysql error:%s\n", err) f5.GetSysLog().Info("mysql error:%s\n", err)
return return

View File

@ -8,15 +8,15 @@ require f5 v1.0.0
require mt v1.0.0 require mt v1.0.0
require mtb v1.0.0 require mtb v1.0.0 // indirect
require cs v1.0.0 require cs v1.0.0
require ss v1.0.0 require ss v1.0.0
require github.com/golang/protobuf v1.4.2
require ( require (
github.com/go-sql-driver/mysql v1.5.0 // indirect github.com/go-sql-driver/mysql v1.5.0 // indirect
github.com/golang/protobuf v1.4.2 // indirect
github.com/gomodule/redigo v1.8.3 // indirect github.com/gomodule/redigo v1.8.3 // indirect
google.golang.org/protobuf v1.23.0 // indirect google.golang.org/protobuf v1.23.0 // indirect
) )

View File

@ -2,7 +2,13 @@ module ss
go 1.20 go 1.20
require q5 v1.0.0
require f5 v1.0.0
require ( require (
github.com/golang/protobuf v1.4.2 github.com/golang/protobuf v1.4.2
google.golang.org/protobuf v1.23.0 google.golang.org/protobuf v1.23.0
) )
replace q5 => ../../../third_party/q5
replace f5 => ../../../third_party/f5