-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAgendaService.hpp
executable file
·149 lines (128 loc) · 4.43 KB
/
AgendaService.hpp
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
#ifndef AGENDASERVICE_H
#define AGENDASERVICE_H
#include "Storage.hpp"
#include <list>
#include <string>
class AgendaService {
public:
/**
* constructor
*/
AgendaService();
/**
* destructor
*/
~AgendaService();
/**
* check if the username match password
* @param userName the username want to login
* @param password the password user enter
* @return if success, true will be returned
*/
bool userLogIn(const std::string userName, const std::string password);
/**
* regist a user
* @param userName new user's username
* @param password new user's password
* @param email new user's email
* @param phone new user's phone
* @return if success, true will be returned
*/
bool userRegister(const std::string userName, const std::string password,
const std::string email, const std::string phone);
/**
* change the infomation of user
* @param userName user's username
* @param password user's password
* @param operation the item that want to operate on(1-password, 2-email, 3-phone)
* @param info the infomation that want to change for
* @return if success, true will be returned
*/
bool changeUserInfo(const std::string userName, const std::string password,
const int operation, const std::string info);
/**
* delete a user
* @param userName user's username
* @param password user's password
* @return if success, true will be returned
*/
bool deleteUser(const std::string userName, const std::string password);
/**
* list all users from storage
* @return a user list result
*/
std::list<User> listAllUsers(void) const;
/**
* create a meeting
* @param userName the sponsor's userName
* @param title the meeting's title
* @param participator the meeting's participator
* @param startData the meeting's start date
* @param endData the meeting's end date
* @return if success, true will be returned
*/
bool createMeeting(const std::string userName, const std::string title,
const std::string startDate, const std::string endDate,
const std::vector<std::string> participator);
/**
* search meetings by username and title (user as sponsor or participator)
* @param uesrName the user's userName
* @param title the meeting's title
* @return a meeting list result
*/
std::list<Meeting> meetingQuery(const std::string userName,
const std::string title) const;
/**
* search a meeting by username, time interval (user as sponsor or participator)
* @param uesrName the user's userName
* @param startDate time interval's start date
* @param endDate time interval's end date
* @return a meeting list result
*/
std::list<Meeting> meetingQuery(const std::string userName,
const std::string startDate,
const std::string endDate) const;
/**
* list all meetings the user take part in
* @param userName user's username
* @return a meeting list result
*/
std::list<Meeting> listAllMeetings(const std::string userName) const;
/**
* list all meetings the user sponsor
* @param userName user's username
* @return a meeting list result
*/
std::list<Meeting> listAllSponsorMeetings(const std::string userName) const;
/**
* list all meetings the user take part in and sponsor by other
* @param userName user's username
* @return a meeting list result
*/
std::list<Meeting> listAllParticipateMeetings(
const std::string userName) const;
/**
* delete a meeting by title and its sponsor
* @param userName sponsor's username
* @param title meeting's title
* @return if success, true will be returned
*/
bool deleteMeeting(const std::string userName, const std::string title);
/**
* delete all meetings by sponsor
* @param userName sponsor's username
* @return if success, true will be returned
*/
bool deleteAllMeetings(const std::string userName);
/**
* start Agenda service and connect to storage
*/
void startAgenda(void);
/**
* quit Agenda service
*/
void quitAgenda(void);
private:
std::shared_ptr<Storage> m_storage;
};
#endif