| 116 |
ashish |
1 |
namespace java in.shop2020.utils
|
|
|
2 |
namespace py shop2020.thriftpy.utils
|
|
|
3 |
|
|
|
4 |
/**
|
|
|
5 |
Helper service
|
|
|
6 |
created by @ashish
|
|
|
7 |
**/
|
|
|
8 |
|
| 121 |
ashish |
9 |
struct Mail{
|
|
|
10 |
1:list<string> to,
|
|
|
11 |
2:string subject,
|
|
|
12 |
3:string data,
|
| 351 |
ashish |
13 |
4:string sender,
|
|
|
14 |
5:list<string> attachments,
|
|
|
15 |
6:string password
|
| 121 |
ashish |
16 |
}
|
|
|
17 |
|
|
|
18 |
struct TextMessage{
|
|
|
19 |
1:string number,
|
|
|
20 |
2:string message,
|
|
|
21 |
3:i64 dispatchTime,
|
|
|
22 |
4:i64 deliveryTime
|
|
|
23 |
}
|
|
|
24 |
|
| 116 |
ashish |
25 |
exception HelperServiceException{
|
|
|
26 |
1:i64 id,
|
|
|
27 |
2:string message
|
|
|
28 |
}
|
|
|
29 |
|
| 121 |
ashish |
30 |
struct Message{
|
|
|
31 |
1:i64 id,
|
|
|
32 |
2:string message
|
|
|
33 |
}
|
|
|
34 |
|
| 495 |
rajveer |
35 |
struct DashboardUser{
|
|
|
36 |
1:string username,
|
|
|
37 |
2:string password,
|
|
|
38 |
3:i64 dispatchTime,
|
|
|
39 |
4:i64 deliveryTime
|
|
|
40 |
}
|
|
|
41 |
|
| 751 |
chandransh |
42 |
struct LogisticsUser{
|
|
|
43 |
1:string username,
|
|
|
44 |
2:i64 providerId
|
|
|
45 |
}
|
|
|
46 |
|
| 1611 |
ankur.sing |
47 |
struct StatisticsUser{
|
| 1891 |
ankur.sing |
48 |
1:string username
|
| 1611 |
ankur.sing |
49 |
}
|
|
|
50 |
|
| 2023 |
ankur.sing |
51 |
struct CatalogDashboardUser{
|
|
|
52 |
1:string username,
|
|
|
53 |
2:string password
|
|
|
54 |
}
|
|
|
55 |
|
| 1397 |
varun.gupt |
56 |
struct UserEmail{
|
| 1422 |
varun.gupt |
57 |
1:i64 id,
|
|
|
58 |
2:string emailTo,
|
|
|
59 |
3:string emailFrom,
|
|
|
60 |
4:string subject,
|
|
|
61 |
5:string body,
|
|
|
62 |
6:string source,
|
|
|
63 |
7:string emailType,
|
|
|
64 |
8:bool status,
|
|
|
65 |
9:i64 timestamp
|
| 1397 |
varun.gupt |
66 |
}
|
|
|
67 |
|
| 1891 |
ankur.sing |
68 |
struct ReportUser{
|
|
|
69 |
1:string username,
|
|
|
70 |
2:i64 role
|
|
|
71 |
}
|
|
|
72 |
|
|
|
73 |
struct Report{
|
|
|
74 |
1:i64 id,
|
|
|
75 |
2:string description,
|
|
|
76 |
3:string controller
|
|
|
77 |
}
|
|
|
78 |
|
| 302 |
ashish |
79 |
service HelperService{
|
| 763 |
rajveer |
80 |
/**
|
|
|
81 |
* For closing the open session in sqlalchemy
|
|
|
82 |
*/
|
|
|
83 |
void closeSession(),
|
|
|
84 |
|
| 1397 |
varun.gupt |
85 |
void saveUserEmailForSending(1:string emailTo, 2:string emailFrom, 3:string subject, 4:string body, 5:string source, 6:string emailType) throws (1:HelperServiceException se),
|
| 1422 |
varun.gupt |
86 |
list<UserEmail> getEmailsToBeSent(1:string emailType) throws (1:HelperServiceException se),
|
|
|
87 |
void markEmailAsSent(1:i64 emailId) throws (1:HelperServiceException se),
|
| 1397 |
varun.gupt |
88 |
|
| 121 |
ashish |
89 |
void sendMail(1:Mail mail) throws (1:HelperServiceException se),
|
|
|
90 |
void sendText(1:TextMessage message) throws (1:HelperServiceException se),
|
|
|
91 |
|
| 351 |
ashish |
92 |
void addMessage(1:Message message) throws (1:HelperServiceException se),
|
| 121 |
ashish |
93 |
void updateMessage(1:i64 id, 2:string message) throws (1:HelperServiceException se),
|
| 351 |
ashish |
94 |
Message getMessage(1:i64 id) throws (1:HelperServiceException se),
|
| 495 |
rajveer |
95 |
Message getSubstitutedMessage(1:i64 id, 2:map<string,string> params) throws (1:HelperServiceException se),
|
|
|
96 |
|
|
|
97 |
//authenticate dashboard users
|
|
|
98 |
bool addUser(1:string username, 2:string password, 3:i64 warehouseId) throws (1:HelperServiceException se),
|
|
|
99 |
bool deleteUser(1:string username) throws (1:HelperServiceException se),
|
| 751 |
chandransh |
100 |
/**
|
|
|
101 |
Returns the warehouseId for the given user if the password matches. Returns -1 otherwise.
|
|
|
102 |
The loggedOn timestamp for the dashboard user is updated as a timestamp.
|
|
|
103 |
It's unclear to me when an exception is thrown : Chandranshu
|
|
|
104 |
*/
|
| 495 |
rajveer |
105 |
i64 authenticateUser(1:string username, 2:string password) throws (1:HelperServiceException se),
|
| 751 |
chandransh |
106 |
bool updatePassword(1:string username, 2:string oldPassword, 3:string newPassword) throws (1:HelperServiceException se),
|
|
|
107 |
|
|
|
108 |
/**
|
|
|
109 |
Returns the LogisticsUser struct associated with the given username and password if they match.
|
|
|
110 |
Throws an exception otherwise.
|
|
|
111 |
*/
|
|
|
112 |
LogisticsUser authenticateLogisticsUser(1:string username, 2:string password) throws(1:HelperServiceException hse)
|
| 1611 |
ankur.sing |
113 |
|
|
|
114 |
/**
|
|
|
115 |
Returns the StatisticsUser struct associated with the given username and password if they match.
|
|
|
116 |
Throws an exception otherwise.
|
|
|
117 |
*/
|
| 1891 |
ankur.sing |
118 |
StatisticsUser authenticateStatisticsUser(1:string username, 2:string password) throws(1:HelperServiceException hse),
|
|
|
119 |
|
|
|
120 |
/**
|
|
|
121 |
Returns the ReportUser struct associated with the given username and password if they match.
|
|
|
122 |
Throws an exception otherwise.
|
|
|
123 |
*/
|
|
|
124 |
ReportUser authenticateReportUser(1:string username, 2:string password) throws(1:HelperServiceException hse),
|
|
|
125 |
|
|
|
126 |
/**
|
|
|
127 |
Returns list of reports which are configured for the given role.
|
|
|
128 |
*/
|
| 2023 |
ankur.sing |
129 |
list<Report> getReports(1:i64 role),
|
|
|
130 |
|
|
|
131 |
/**
|
|
|
132 |
Returns the CatalogDashboardUser struct associated with the given username and password if they match.
|
|
|
133 |
Throws an exception otherwise.
|
|
|
134 |
*/
|
|
|
135 |
CatalogDashboardUser authenticateCatalogUser(1:string username, 2:string password) throws(1:HelperServiceException hse),
|
| 116 |
ashish |
136 |
}
|