Skip to content

Commit

Permalink
添加了一些文档By Mason
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaomangang committed Mar 7, 2020
1 parent 2fd1fe1 commit 6940ea3
Show file tree
Hide file tree
Showing 258 changed files with 110,562 additions and 6 deletions.
6 changes: 6 additions & 0 deletions Document/前后端接口定义.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# 前后端接口定义

## 一、基础功能

#### 1、登录

File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added Document/数据库组织.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Document/数据库组织.xmind
Binary file not shown.
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@

基于C++的聊天软件。包括PC客户端、Linux服务端。服务端可同时向多个客户端提供服务。客户端包括注册、登陆、好友/群列表展示、群聊、私聊等基本功能。本仓库包括:客户端源码、服务端源码、数据协议、客户端发行版、客户端流程图、服务端流程图以及开发日志

### 开发环境

- 客户端: Windows + Qt5
- 服务端:Linux + C++
- 数据库: MySQL8.0
- 数据交互协议:自定(具体见文档)

### 主要技术

服务端:使用epoll实现I/O复用从而为多客户端提供服务。同时使用MySQL类内嵌SQL语句从而实现对数据库的访问。
Expand All @@ -11,12 +18,7 @@

数据库:通过建立用户基本信息user_info、好友关系friend、群组关系group、群组基本信息group_info四张表实现对用户信息的存储、组织。

### 开发环境

- 客户端: Windows + Qt5
- 服务端:Linux + C++
- 数据库: MySQL8.0
- 数据交互协议:自定(具体见文档)
![1577110794905](http://47.99.95.58/file/githubWangWangChat/数据库组织.jpg)

### 开发日志

Expand Down Expand Up @@ -49,3 +51,4 @@
群聊:

![1577111380041](http://47.99.95.58/file/githubWangWangChat/1577111380041.png)

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
QMAKE_CXX.INCDIRS = \
D:/Qt/Qt5.9.0/Tools/mingw530_32/lib/gcc/i686-w64-mingw32/5.3.0/include \
D:/Qt/Qt5.9.0/Tools/mingw530_32/lib/gcc/i686-w64-mingw32/5.3.0/include-fixed \
D:/Qt/Qt5.9.0/Tools/mingw530_32/i686-w64-mingw32/include \
D:/Qt/Qt5.9.0/Tools/mingw530_32/i686-w64-mingw32/include/c++ \
D:/Qt/Qt5.9.0/Tools/mingw530_32/i686-w64-mingw32/include/c++/i686-w64-mingw32 \
D:/Qt/Qt5.9.0/Tools/mingw530_32/i686-w64-mingw32/include/c++/backward
QMAKE_CXX.LIBDIRS = \
D:/Qt/Qt5.9.0/Tools/mingw530_32/lib/gcc/i686-w64-mingw32/5.3.0 \
D:/Qt/Qt5.9.0/Tools/mingw530_32/lib/gcc \
D:/Qt/Qt5.9.0/Tools/mingw530_32/i686-w64-mingw32/lib \
D:/Qt/Qt5.9.0/Tools/mingw530_32/lib
QMAKE_CXX.QT_COMPILER_STDCXX = 199711L
QMAKE_CXX.QT_GCC_MAJOR_VERSION = 5
QMAKE_CXX.QT_GCC_MINOR_VERSION = 3
QMAKE_CXX.QT_GCC_PATCH_VERSION = 0
QMAKE_CXX.COMPILER_MACROS = \
QT_COMPILER_STDCXX \
QT_GCC_MAJOR_VERSION \
QT_GCC_MINOR_VERSION \
QT_GCC_PATCH_VERSION

Large diffs are not rendered by default.

2,008 changes: 2,008 additions & 0 deletions clientCode/201907/build-demo2-Desktop_Qt_5_9_0_MinGW_32bit-Debug/Makefile.Debug

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
/****************************************************************************
** Meta object code from reading C++ file 'chatfri.h'
**
** Created by: The Qt Meta Object Compiler version 67 (Qt 5.9.0)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/

#include "../../demo3/chatfri.h"
#include <QtCore/qbytearray.h>
#include <QtCore/qmetatype.h>
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'chatfri.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 67
#error "This file was generated using the moc from 5.9.0. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif

QT_BEGIN_MOC_NAMESPACE
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
struct qt_meta_stringdata_ChatFri_t {
QByteArrayData data[6];
char stringdata0[82];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_ChatFri_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_ChatFri_t qt_meta_stringdata_ChatFri = {
{
QT_MOC_LITERAL(0, 0, 7), // "ChatFri"
QT_MOC_LITERAL(1, 8, 4), // "kill"
QT_MOC_LITERAL(2, 13, 0), // ""
QT_MOC_LITERAL(3, 14, 21), // "on_pushButton_pressed"
QT_MOC_LITERAL(4, 36, 21), // "on_sendButton_clicked"
QT_MOC_LITERAL(5, 58, 23) // "on_pushButton_2_clicked"

},
"ChatFri\0kill\0\0on_pushButton_pressed\0"
"on_sendButton_clicked\0on_pushButton_2_clicked"
};
#undef QT_MOC_LITERAL

static const uint qt_meta_data_ChatFri[] = {

// content:
7, // revision
0, // classname
0, 0, // classinfo
4, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
1, // signalCount

// signals: name, argc, parameters, tag, flags
1, 0, 34, 2, 0x06 /* Public */,

// slots: name, argc, parameters, tag, flags
3, 0, 35, 2, 0x08 /* Private */,
4, 0, 36, 2, 0x08 /* Private */,
5, 0, 37, 2, 0x08 /* Private */,

// signals: parameters
QMetaType::Void,

// slots: parameters
QMetaType::Void,
QMetaType::Void,
QMetaType::Void,

0 // eod
};

void ChatFri::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
ChatFri *_t = static_cast<ChatFri *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->kill(); break;
case 1: _t->on_pushButton_pressed(); break;
case 2: _t->on_sendButton_clicked(); break;
case 3: _t->on_pushButton_2_clicked(); break;
default: ;
}
} else if (_c == QMetaObject::IndexOfMethod) {
int *result = reinterpret_cast<int *>(_a[0]);
void **func = reinterpret_cast<void **>(_a[1]);
{
typedef void (ChatFri::*_t)();
if (*reinterpret_cast<_t *>(func) == static_cast<_t>(&ChatFri::kill)) {
*result = 0;
return;
}
}
}
Q_UNUSED(_a);
}

const QMetaObject ChatFri::staticMetaObject = {
{ &QWidget::staticMetaObject, qt_meta_stringdata_ChatFri.data,
qt_meta_data_ChatFri, qt_static_metacall, nullptr, nullptr}
};


const QMetaObject *ChatFri::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}

void *ChatFri::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_ChatFri.stringdata0))
return static_cast<void*>(const_cast< ChatFri*>(this));
return QWidget::qt_metacast(_clname);
}

int ChatFri::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QWidget::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 4)
qt_static_metacall(this, _c, _id, _a);
_id -= 4;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 4)
*reinterpret_cast<int*>(_a[0]) = -1;
_id -= 4;
}
return _id;
}

// SIGNAL 0
void ChatFri::kill()
{
QMetaObject::activate(this, &staticMetaObject, 0, nullptr);
}
QT_WARNING_POP
QT_END_MOC_NAMESPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
/****************************************************************************
** Meta object code from reading C++ file 'frilist.h'
**
** Created by: The Qt Meta Object Compiler version 67 (Qt 5.9.0)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/

#include "../../demo3/frilist.h"
#include <QtCore/qbytearray.h>
#include <QtCore/qmetatype.h>
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'frilist.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 67
#error "This file was generated using the moc from 5.9.0. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif

QT_BEGIN_MOC_NAMESPACE
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
struct qt_meta_stringdata_FriList_t {
QByteArrayData data[1];
char stringdata0[8];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_FriList_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_FriList_t qt_meta_stringdata_FriList = {
{
QT_MOC_LITERAL(0, 0, 7) // "FriList"

},
"FriList"
};
#undef QT_MOC_LITERAL

static const uint qt_meta_data_FriList[] = {

// content:
7, // revision
0, // classname
0, 0, // classinfo
0, 0, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount

0 // eod
};

void FriList::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
Q_UNUSED(_o);
Q_UNUSED(_id);
Q_UNUSED(_c);
Q_UNUSED(_a);
}

const QMetaObject FriList::staticMetaObject = {
{ &QToolBox::staticMetaObject, qt_meta_stringdata_FriList.data,
qt_meta_data_FriList, qt_static_metacall, nullptr, nullptr}
};


const QMetaObject *FriList::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}

void *FriList::qt_metacast(const char *_clname)
{
if (!_clname) return nullptr;
if (!strcmp(_clname, qt_meta_stringdata_FriList.stringdata0))
return static_cast<void*>(const_cast< FriList*>(this));
return QToolBox::qt_metacast(_clname);
}

int FriList::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QToolBox::qt_metacall(_c, _id, _a);
return _id;
}
QT_WARNING_POP
QT_END_MOC_NAMESPACE
Loading

0 comments on commit 6940ea3

Please sign in to comment.