| 48 |
ashish |
1 |
namespace java in.shop2020.model.v1.user
|
|
|
2 |
namespace py in.shop2020.model.v1.user
|
|
|
3 |
|
|
|
4 |
/**
|
|
|
5 |
Exceptions
|
|
|
6 |
*/
|
|
|
7 |
|
|
|
8 |
|
|
|
9 |
exception AuthenticationException{
|
|
|
10 |
1:string message,
|
|
|
11 |
2:i32 errorCode
|
|
|
12 |
}
|
|
|
13 |
|
|
|
14 |
exception UserContextException{
|
|
|
15 |
1:i32 errorCode,
|
|
|
16 |
2:string message
|
|
|
17 |
}
|
|
|
18 |
|
|
|
19 |
enum TAddressType{
|
|
|
20 |
WORK,
|
|
|
21 |
HOME
|
|
|
22 |
}
|
|
|
23 |
|
|
|
24 |
/**
|
|
|
25 |
structs
|
|
|
26 |
*/
|
|
|
27 |
struct TSocialHandles{
|
|
|
28 |
1:string facebook,
|
|
|
29 |
2:string opensocial,
|
|
|
30 |
3:string twitter
|
|
|
31 |
}
|
|
|
32 |
|
|
|
33 |
struct TAddress{
|
|
|
34 |
1:string line1,
|
|
|
35 |
2:string line2,
|
|
|
36 |
3:string landmark,
|
|
|
37 |
4:string city,
|
|
|
38 |
5:string state,
|
|
|
39 |
6:string pin,
|
|
|
40 |
7:string country,
|
|
|
41 |
8:i64 id,
|
|
|
42 |
9:bool enabled,
|
|
|
43 |
10:TAddressType type,
|
|
|
44 |
11:i64 addedOn
|
|
|
45 |
}
|
|
|
46 |
|
|
|
47 |
struct TUserPrimaryInfo{
|
|
|
48 |
1:i64 userId,
|
|
|
49 |
2:string title,
|
|
|
50 |
3:string firstName,
|
|
|
51 |
4:string lastName,
|
|
|
52 |
5:string pictureUrl,
|
|
|
53 |
6:string email,
|
|
|
54 |
7:string mobile,
|
|
|
55 |
8:string workPhone,
|
|
|
56 |
9:string userHandle,
|
|
|
57 |
10:string password,
|
|
|
58 |
11:TSocialHandles socialHandles,
|
|
|
59 |
12:i64 dateOfBirth,
|
|
|
60 |
13:i64 anniversary,
|
|
|
61 |
14:set<TAddress> addresses,
|
|
|
62 |
16:i32 shipmentOption,
|
|
|
63 |
17:string middleName,
|
|
|
64 |
18:string occupation
|
|
|
65 |
}
|
|
|
66 |
|
|
|
67 |
struct TUserInternalInfo{
|
|
|
68 |
1:i64 userId,
|
|
|
69 |
2:i32 geoZone,
|
|
|
70 |
3:i32 shipmentZone,
|
|
|
71 |
4:i64 taxZone,
|
|
|
72 |
5:double userRankScore
|
|
|
73 |
}
|
|
|
74 |
|
|
|
75 |
struct TIPMap{
|
|
|
76 |
1:map<i64,string> ips
|
|
|
77 |
}
|
|
|
78 |
|
|
|
79 |
struct TUserState{
|
|
|
80 |
1:i64 userId,
|
|
|
81 |
2:bool isEmailVerified,
|
|
|
82 |
3:i64 lastLogin,
|
|
|
83 |
4:i64 lastLogout,
|
|
|
84 |
5:i64 emailVerificationSentOn,
|
|
|
85 |
6:i64 smsVerificationSentOn,
|
|
|
86 |
7:bool isSMSVerified,
|
|
|
87 |
8:i64 activeSince,
|
|
|
88 |
9:bool isLoggedIn,
|
|
|
89 |
10:TIPMap ipMap
|
|
|
90 |
}
|
|
|
91 |
|
|
|
92 |
struct TUserContext{
|
|
|
93 |
1:TUserPrimaryInfo primaryInfo,
|
|
|
94 |
2:TUserInternalInfo internalInfo,
|
|
|
95 |
3:TUserState userState,
|
|
|
96 |
4:i64 id
|
|
|
97 |
}
|
|
|
98 |
|
|
|
99 |
/**
|
|
|
100 |
service
|
|
|
101 |
*/
|
|
|
102 |
|
|
|
103 |
service UserContextService{
|
|
|
104 |
TUserContext createContext(1: TUserContext context, 2: bool updateExisting) throws (1:UserContextException cex),
|
|
|
105 |
TUserContext getContextFromId(1:i64 userId) throws (1:UserContextException ucx),
|
|
|
106 |
TUserContext getContextFromEmailOrHandle(1:string emailorhandle, 2:bool isEmail) throws (1:UserContextException ucx),
|
|
|
107 |
TUserState getState(1:i64 userId) throws (1:UserContextException ucx),
|
|
|
108 |
TUserPrimaryInfo getPrimaryInfo(1:i64 userId) throws (1:UserContextException ucx),
|
|
|
109 |
TUserInternalInfo getInternalInfo(1:i64 userId) throws (1:UserContextException ucx),
|
|
|
110 |
TUserContext getContext(1:string email, 2:string password) throws (1:AuthenticationException ax),
|
|
|
111 |
bool userExists(1:string email)throws (1:UserContextException ucx),
|
|
|
112 |
bool addIpAdressForUser(1:string ip, 2:i64 timestamp, 3:i64 userId)throws (1:UserContextException ucx),
|
|
|
113 |
bool addAddressForUser(1:TAddress address, 2:i64 userid, 3:i64 timestamp)throws (1:UserContextException ucx),
|
|
|
114 |
bool removeAddressForUser(1:i64 userid, 2:i64 addressId)throws (1:UserContextException ucx),
|
|
|
115 |
bool setUserAsLoggedIn(1:i64 userId, 2:i64 timestamp)throws (1:UserContextException ucx),
|
|
|
116 |
bool setUserAsLoggedOut(1:i64 userid, 2:i64 timestamp)throws (1:UserContextException ucx),
|
|
|
117 |
bool updatePassword(1:i64 userid, 2:string password)throws (1:UserContextException ucx),
|
|
|
118 |
bool deleteUser(1:i64 userid)throws (1:UserContextException ucx),
|
|
|
119 |
bool sendEmailVerification(1:i64 userid)throws (1:UserContextException ucx),
|
|
|
120 |
bool sendSMSVerification(1:i64 userid)throws (1:UserContextException ucx),
|
|
|
121 |
bool confirmEmailVerification(1:i64 userid)throws (1:UserContextException ucx),
|
|
|
122 |
bool confirmSMSVerification(1:i64 userid)throws (1:UserContextException ucx),
|
|
|
123 |
bool addSocialhandle(1:i64 userid, 2:string socialService, 3:string handle)throws (1:UserContextException ucx)
|
|
|
124 |
}
|
|
|
125 |
|