-
Notifications
You must be signed in to change notification settings - Fork 0
/
query.txt
126 lines (108 loc) · 2.49 KB
/
query.txt
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
http://localhost:8081/api/accounts
give permanentAddress if not same
Any body Can post
{
"aadhar": "123456",
"balance": 90.0,
"debitCardRequired": true,
"dob": "2023-01-01",
"email": "a@b",
"fatherName": "name",
"firstName": "Aquib",
"lastName": "name",
"middleName": "name",
"mobile": 234566,
"netBankingRequired": true,
"occupationDetails": {
"occupationType": "we",
"sourceOfIncome": "none",
"grossAnnualIncome": 1000
},
"permanentSameAsResident":true,
"residentAddress": {
"line1": "line1",
"line2": "line3",
"city": "Mumbai",
"pinCode": 234353
},
"title": "a"
}
return 201 on success
To Create User
Generate Otp first
POST http://localhost:8081/api/user/otp-gen/create
{
"accNumber":1
}
return 200 on success
Mail will go to email given while creating account
OTP is printed on console too for info with that otp
POST http://localhost:8081/api/user
{
"username":"Aditya Bengali",
"password":"bel",
"confirmPassword":"bel",
"pin":"1234",
"confirmPin":"1234",
"accNumber": 1,
"otp": 956134
}
return 201 on succes
For login
POST http://localhost:8081/login
{
"userId": 3,
"password": "el1",
"role": "USER"
}
return Authorizaion token
Send it on header whenever you want to make a request where user is logged in
GET http://localhost:8081/api/user
send authorization token in header
return info about currently logged in user
For Finding UserId from Account Number
Generate Otp first
GET http://localhost:8081/api/user/otp-gen/find
{
"accNumber":1
}
return 200 on success
then with otp send
POST http://localhost:8081/api/user/id
{
"accNumber":1,
"otp":213226
}
return userId
if you forget password
Generate Otp first Check That userId is used and not account number
POST http://localhost:8081/api/user/otp-gen/update
{
"userId":1
}
otp will be send on account corresponding to user' account
return 200 on success
then with otp send
PUT http://localhost:8081/api/user/forget-password
{
"userId":1,
"otp":940734,
"password":"el1",
"confirmPassword": "el1"
}
NOTE:-
You can change .anyRequest().authenticated() => .anyRequest().permitAll()
in SecurityConfiguration.java file in wfbank.config package
GET http://localhost:8081/api/accounts
get all unapproced accounts
PUT http://localhost:8081/api/accounts/1
Approve Account
DELETE http://localhost:8081/api/accounts/1
delete request
Change password or pin after login
PUT http://localhost:8081/api/user
password:,
confirmPassword
pin
confirmPin
can send only password or pin too