chat

command module
v0.0.0-...-a277c89 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

README

chat

Chat system developed using Gin and github.com/gobwas/ws!

Project Design

Build Project Catalog Structure
chat
├─api    # 接口
│  └─v1  # 版本
├─assets # 静态资源
│  ├─images      # 图片
│  └─screenshots # 截图
├─client   # 简单的客户端实现
├─config   # 配置处理
├─docs     # swagger生成的接口文档
├─internal # 内部文件
│  ├─dao     # 数据访问层
│  ├─middleware # 中间件
│  ├─model   # 模型
│  ├─routers # 路由
│  └─service # 服务
├─log    # 日志处理
├─tmp    # 临时文件
├─utils  # 工具函数
└─vendor # 项目以来的第三方库
Create Database
  • Database: chat
  • Charts: users, messages
Create Model
  • Model
  • User
  • Message
Routing
  • 用户管理
Function Mathod Path Remark
用户注册 POST /register
用户登录 POST /login
管理员登录 POST /admin IsActive(默认为false)
用户注销 POST /logout
修改用户信息 PUT /me
获取用户信息 GET /me
  • 朋友管理
Function Mathod Path Remark
添加好友 POST /friend/:id
删除好友 DELETE /friend/:id
更改好友信息 PUT /friend/:id
获取好友信息 GET /friend/:id
获取所有好友 GET /friends
  • 消息管理
Function Mathod Path Remark
发送消息 POST /message
删除消息 DELETE /message/:id
修改消息 PUT /message/:id
获取消息 GET /message

Public Components

Configuration Management viper
Database Connection
Response Processing
  • Response
  • ErrorResponse

API Documentation swagger

image

Function Development

Register and Login
WebSocket Communication

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api
v1
client
说明:声明配置属性结构体
说明:声明配置属性结构体
说明:全局变量
说明:全局变量
internal
dao
model
说明:消息模型 创建消息 保存消息
说明:消息模型 创建消息 保存消息
service
说明:朋友管理
说明:朋友管理

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL