1
This commit is contained in:
parent
72163df402
commit
b3b4d1b280
103
database/frienddb_new.sql
Normal file
103
database/frienddb_new.sql
Normal file
@ -0,0 +1,103 @@
|
||||
DROP TABLE IF EXISTS `version`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `version` (
|
||||
`idx` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
||||
`version` int(11) NOT NULL DEFAULT '0' COMMENT '版本号',
|
||||
PRIMARY KEY (`idx`),
|
||||
UNIQUE KEY `version` (`version`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||
|
||||
-- 好友相关 --
|
||||
drop table if exists `t_friend_ships`;
|
||||
CREATE TABLE `t_friend_ships` (
|
||||
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
||||
`account1_id` varchar(60) NOT NULL DEFAULT '',
|
||||
`account2_id` varchar(60) NOT NULL DEFAULT '',
|
||||
`is_friendship` tinyint DEFAULT '0' COMMENT '是否好友关系, 0 pending, 1 ok, 2 reject, 3 disband',
|
||||
`createtime` int NOT NULL DEFAULT '0' COMMENT '创建时间',
|
||||
`modifytime` int NOT NULL DEFAULT '0' COMMENT '修改时间',
|
||||
PRIMARY KEY (`idx`),
|
||||
UNIQUE KEY `friendship` (`account1_id`,`account2_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin
|
||||
COMMENT "已经成为好友关系";
|
||||
|
||||
drop table if exists t_friend_blacklist;
|
||||
CREATE TABLE `t_friend_blacklist` (
|
||||
`idx` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
||||
`account_id` varchar(60) COLLATE utf8_bin NOT NULL,
|
||||
`blocked_account_id` varchar(60) COLLATE utf8_bin NOT NULL,
|
||||
`is_removed` tinyint(4) DEFAULT '0' COMMENT '是否移除黑名单 default:0, removed:1',
|
||||
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
||||
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
||||
PRIMARY KEY (`idx`),
|
||||
UNIQUE KEY `blocked_friend` (`account_id`,`blocked_account_id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='好友黑名单';
|
||||
|
||||
-- 公会相关 --
|
||||
drop table if exists t_guild;
|
||||
CREATE TABLE `t_guild` (
|
||||
`idx` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
||||
`guild_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '公会id',
|
||||
`name` varchar(48) NOT NULL,
|
||||
`leader_account_id` varchar(60) NOT NULL,
|
||||
`avatar` int(11) DEFAULT '0' COMMENT '公会头像',
|
||||
`notice` varchar(20000) NOT NULL DEFAULT '',
|
||||
`join_cond` tinyint(4) DEFAULT '0' COMMENT '公会加入类型 0 需要审批, 1 自由加入, 2 成员星星数条件',
|
||||
`join_cond_value` int(11) DEFAULT '0' COMMENT '星星数条件值',
|
||||
`total_stars` int(11) DEFAULT '0',
|
||||
`total_kills` int(11) DEFAULT '0',
|
||||
`chicken_dinners` int(11) DEFAULT '0',
|
||||
`max_members` int(11) DEFAULT '0',
|
||||
`is_deleted` tinyint(4) DEFAULT '0' COMMENT '是否已解散公会 0 正常, 1 已解散',
|
||||
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
||||
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
||||
PRIMARY KEY (`idx`),
|
||||
UNIQUE KEY `idx_guild_id` (`guild_id`),
|
||||
UNIQUE KEY `idx_guild_name` (name),
|
||||
KEY `idx_guild_leader` (leader_account_id)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='公会表';
|
||||
|
||||
drop table if exists `t_guild_members`;
|
||||
CREATE TABLE `t_guild_members` (
|
||||
`idx` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
||||
`guild_id` bigint(20) NOT NULL,
|
||||
`account_id` varchar(60) COLLATE utf8_bin NOT NULL,
|
||||
`level` tinyint(4) DEFAULT '0' COMMENT '成员阶级1会长,2干部,3群众',
|
||||
`is_leave_guild` tinyint(4) DEFAULT '0' COMMENT '是否已离开公会 0 正常, 1 已离开',
|
||||
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
||||
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
||||
PRIMARY KEY (`idx`),
|
||||
UNIQUE KEY `idx_guild_members` (`guild_id`,`account_id`),
|
||||
KEY `idx_account_id` (`account_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='公会成员表';
|
||||
CREATE INDEX idx_account_id2 ON t_guild_members (account_id);
|
||||
|
||||
drop table if exists `t_guild_logs`;
|
||||
CREATE TABLE `t_guild_logs` (
|
||||
`idx` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
||||
`guild_id` bigint(20) NOT NULL,
|
||||
`account_id` varchar(60) COLLATE utf8_bin NOT NULL,
|
||||
`log_type` tinyint NOT NULL DEFAULT '0' COMMENT '日志类型',
|
||||
`content` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '日志内容',
|
||||
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
||||
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
||||
PRIMARY KEY (`idx`),
|
||||
KEY `idx_guild_log` (`guild_id`,log_type, `account_id`),
|
||||
KEY `idx_createtime` (`createtime`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='公会日志表';
|
||||
|
||||
drop table if exists `t_guild_pending_request`;
|
||||
CREATE TABLE `t_guild_pending_request` (
|
||||
`idx` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
||||
`guild_id` bigint(20) NOT NULL,
|
||||
`account_id` varchar(60) COLLATE utf8_bin NOT NULL,
|
||||
is_join_guild tinyint DEFAULT '0' COMMENT '0 pending, 1 ok, 2 reject',
|
||||
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
||||
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
||||
PRIMARY KEY (`idx`),
|
||||
UNIQUE KEY `idx_guild_pending_request`(`guild_id`,`account_id`),
|
||||
KEY `idx_account_id` (`account_id`),
|
||||
KEY `idx_createtime` (`createtime`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='公会申请表'
|
@ -10,6 +10,9 @@ type FriendMgr struct {
|
||||
}
|
||||
|
||||
func (this *FriendMgr) Init() {
|
||||
this.friendHash = make(map[string]*map[string]int32)
|
||||
this.blackHash = make(map[string]*map[string]int32)
|
||||
this.byBlackHash = make(map[string]*map[string]int32)
|
||||
}
|
||||
|
||||
func (this *FriendMgr) UnInit() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user