GithubHelp home page GithubHelp logo

madbananana / pigchat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shimmerpig/pigchat

0.0 0.0 0.0 1.77 MB

Netty+SpringBoot+FastDFS+Html5实现聊天App

Java 12.07% HTML 12.61% CSS 22.49% JavaScript 52.83%

pigchat's Introduction

PigChat

Netty+SpringBoot+FastDFS+Html5实现聊天App


项目实现详解:
Netty+SpringBoot+FastDFS+Html5实现聊天App详解(一)
Netty+SpringBoot+FastDFS+Html5实现聊天App详解(二)
Netty+SpringBoot+FastDFS+Html5实现聊天App详解(三)
Netty+SpringBoot+FastDFS+Html5实现聊天App详解(四)
Netty+SpringBoot+FastDFS+Html5实现聊天App详解(五)
Netty+SpringBoot+FastDFS+Html5实现聊天App详解(六)




数据库



用户表

face_image为用户的头像,需要保存小图与大图,qrcode为该用户对应的二维码

朋友关系表



好友申请表

记录发送好友请求申请的数据表

聊天记录表

sign_flag表示消息的签收状态,为0表示未签收,为1表示已签收


项目结构



utils包

FileUtils 主要提供了一些与文件相关的操作

IMoocJSONResult 是自定义的响应给前端的数据结构

JsonUtils 提供了一些关于json转换的操作

MD5Utils 提供了对字符串进行md5加密的操作

QRCodeUtils 提供了一些关于二维码的相关操作

FastDFSClient 提供了各种上传文件以及删除文件的操作



enums包

MsgActionEnum 发送消息的动作的枚举,类似于消息的类型

MsgSignFlagEnum 消息签收状态的枚举

OperatorFriendRequestTypeEnum 忽略或者通过好友请求的枚举

SearchFriendsStatusEnum 添加好友前置状态的枚举



pojo包

增加了bo包与vo包,分别存放business object与value object / view object;

mapper包

增加了一个自定义的UsersMapperCustom,在其中自定义了查询好友请求列表,查询好友列表,以及批量签收聊天消息的方法;

service包

提供如下方法:

queryUsernameIsExist 判断用户名是否存在

queryUserForLogin 查询用户是否存在

saveUser 用户注册

updateUserInfo 修改用户记录

preconditionSearchFriends 搜索朋友的前置条件

queryUserInfoByUsername 根据用户名查询用户对象

sendFriendRequest 添加好友请求记录,保存到数据库

queryFriendRequestList 查询好友请求

deleteFriendRequest 删除好友请求记录

passFriendRequest 通过好友请求

queryMyFriends 查询好友列表

saveMsg 保存聊天消息到数据库

updateMsgSigned 批量签收消息

getUnReadMsgList 获取未签收消息列表



controller包

提供如下接口:

registOrLogin 用户注册/登录

uploadFaceBase64 上传用户头像

setNickname 设置用户昵称

searchUser 搜索好友

addFriendRequest 发送添加好友的请求

queryFriendRequests 发送添加好友的请求

operFriendRequest 接受方通过或者忽略朋友请求

myFriends 查询我的好友列表

getUnReadMsgList 用户手机端获取未签收的消息列表




测试效果

注册与登录

个人信息

更换头像

添加好友

二维码添加好友

接受好友请求后开始聊天




pigchat's People

Contributors

shimmerpig avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.