forked from firstblade/TTWinClient
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIMessageModule.h
More file actions
94 lines (85 loc) · 2.56 KB
/
IMessageModule.h
File metadata and controls
94 lines (85 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*******************************************************************************
* @file IHitoryMsgModule.h 2014\8\3 11:10:16 $
* @author 快刀<kuaidao@mogujie.com>
* @brief 历史消息DB相关接口
******************************************************************************/
#ifndef IHITORYMSGMODULE_D042F2F2_05B0_45E6_9746_344A76279AE8_H__
#define IHITORYMSGMODULE_D042F2F2_05B0_45E6_9746_344A76279AE8_H__
#include "GlobalDefine.h"
#include "TTLogic/IModule.h"
#include "Modules/ModuleDll.h"
#include "MessageEntity.h"
/******************************************************************************/
class MessageEntity;
class TransferFileEntity;
NAMESPACE_BEGIN(module)
/**
* The class <code>历史消息DB相关接口</code>
*
*/
class MODULE_API IMessageModule : public logic::IModule
{
public:
/** @name Constructors and Destructor*/
//@{
/**
* Constructor
*/
IMessageModule()
{
m_moduleId = MODULE_ID_MESSAGE;
}
//@}
public:
/**@name 历史消息相关*/
//@{
/**
* 打开消息数据库
*
* @return BOOL
* @exception there is no any exception to throw.
*/
virtual BOOL openDB() = 0;
/**
* 给会话累加历史消息计数器
*
* @param const std::string & sId
* @param UInt8 v
* @return void
* @exception there is no any exception to throw.
*/
virtual void countMsgOffset(const std::string& sId, Int32 v) = 0;
/**
* 清除会话历史消息计数器
*
* @param const std::string & sId
* @return void
* @exception there is no any exception to throw.
*/
virtual void clearMsgOffset(const std::string& sId) = 0;
virtual BOOL sqlInsertHistoryMsg(IN MessageEntity& msg) = 0;
virtual BOOL sqlGetHistoryMsg(IN std::string sId, IN UInt32 nMsgCount, OUT std::vector<MessageEntity>& msgList) = 0;
virtual BOOL sqlBatchInsertHistoryMsg(IN std::list<MessageEntity>& msgList) = 0;
//@}
/**@name 文件传输相关*/
//@{
virtual BOOL sqlInsertFileTransferHistory(IN TransferFileEntity& fileInfo) = 0;
virtual BOOL sqlGetFileTransferHistory(OUT std::vector<TransferFileEntity>& fileList) = 0;
//@}
/**@name 运行时消息相关*/
//@{
/**
* 断线重连的情况下要清理消息
*
* @param const std::string & sId
* @return void
* @exception there is no any exception to throw.
*/
virtual void removeMessageBySId(const std::string& sId) = 0;
virtual BOOL pushMessageBySId(const std::string& sId, MessageEntity& msg) = 0;
//@}
};
MODULE_API IMessageModule* getMessageModule();
NAMESPACE_END(module)
/******************************************************************************/
#endif// IHITORYMSGMODULE_D042F2F2_05B0_45E6_9746_344A76279AE8_H__