database midterm course project 实现的功能(每个功能对应前端一个函数/页面):
- 用户注册
- 用户登录
- 用户昵称修改
- 申请好友
- 接受好友
- 发送私聊消息
- 创建群聊
- 加入群聊
- 踢出群聊
- 发送群聊消息
- 显示群用户消息
- 搜索全局消息
- (透明)显示全部好友
- (透明)显示全部私聊消息
- (透明)显示全部所在群聊
- (透明)显示全部群聊成员
- (透明)显示全部群聊消息
- (透明)显示全部特定规则过滤后的消息
所有SQL均在下面方法中实现:
- 用户表:userID(phone number) name password
- getUser(userID) : dict
- register(userID, name, password) : bool
- login(userID, password) : bool
- changeName(name, optUID) : bool
- 群-用户表:userID groupID status
- addUsers(groupID, userID[], optUID, status) : bool
- getStatus(groupID, optUID) : string
- deleteUser(groupID, userID, optUID) : bool
- getUID(groupID) : string[]
- getGID(optUID) : string[]
- 群表:groupID(groupName_timestamp) groupName
- refreshGroupID() : no return
- build(groupName) : string(groupID)
- changeName(groupID, optUID) : bool
- 消息表:msgID(msg_timestamp) groupID userID msg
- refreshMsgID() : no return
- writeMsg(groupID, msg, optUID) : bool
- getGMsg(groupID, optUID) : list[dict[]]
- getGUMsg(groupID, userID, optUID) : list[dict[]]
- getMsg(subMsg, optUID) : list[dict[]]
- 好友表:userID friendID status
- apply(userID, optUID) : bool
- agree(userID, optUID) : bool
- getFriends(optUID) : list[dict[]]