# easy_chatroom **Repository Path**: codercmd/easy_chatroom ## Basic Information - **Project Name**: easy_chatroom - **Description**: 简易的聊天室。 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-04-09 - **Last Updated**: 2024-04-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## 简易聊天室 #### 功能 - 用户注册 - 用户登录 - 选择房间 - 进入房间 - 广播消息 - 离开房间 - 心跳检测 #### 后端 golang 1.21.0 mongodb json gin #### 前端 cocos creator #### 后续 - json换protobuf - gin开启token认证 #### 接口 - 登录 POST: localhost:9527/login username:"" 用户名 password:"" 密码 - 注册 POST: localhost:9527/register username:"" 用户名 password:"" 密码 code:"616game" 邀请码 - websocket GET:localhost:9527/ws?username=cmd1&roomID=1 username:"" 用户名 roomID:"" 房间号 发送的内容如下: { "message":1, "content":"11111" } const ( entering = iota //0 leaving //1 chating //2 other //3 )