Skip to content

Commit 25b2173

Browse files
committed
endpoints summary
1 parent 6cf5225 commit 25b2173

File tree

8 files changed

+30
-30
lines changed

8 files changed

+30
-30
lines changed

react-frontend/src/components/root/users/login/forgottenPassword/PasswordChange.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ const PasswordChange = () => {
103103
)}
104104
</form>
105105
</main>
106-
<Footer class={style.footer} />
106+
<Footer class={style.footer_cover} />
107107
<Background />
108108
</>
109109
);

react-frontend/src/components/root/users/login/forgottenPassword/SetUpNewPassword.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ const SetUpNewPassword = () => {
114114
</div>
115115
</form>
116116
</main>
117-
<Footer class={style.footer} />
117+
<Footer class={style.footer_cover} />
118118
<Background />
119119
</>
120120
);

spring-backend/src/main/java/backend/hobbiebackend/model/entities/Hobby.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,12 @@ public class Hobby extends BaseEntity{
2323
private String galleryImg1_id;
2424
private String galleryImg2_id;
2525
private String galleryImg3_id;
26-
2726
private String contactInfo;
2827

29-
//TODO HOBBY ADDRESS
30-
31-
32-
3328

3429
public Hobby() {
3530
}
31+
3632
@Column(name = "profile_img_id")
3733
public String getProfileImg_id() {
3834
return profileImg_id;

spring-backend/src/main/java/backend/hobbiebackend/service/impl/HobbyServiceImpl.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@ public boolean deleteHobby(long id) throws Exception {
8383
}
8484

8585
private void deleteResourcesById(Hobby byId) throws Exception {
86-
String profileImgUrl = byId.getProfileImg_id();
87-
String galleryImgUrl1 = byId.getGalleryImg1_id();
88-
String galleryImgUrl2 = byId.getGalleryImg2_id();
89-
String galleryImgUrl3 = byId.getGalleryImg3_id();
86+
String profileImgId = byId.getProfileImg_id();
87+
String galleryImgId1 = byId.getGalleryImg1_id();
88+
String galleryImgId2 = byId.getGalleryImg2_id();
89+
String galleryImgId3 = byId.getGalleryImg3_id();
9090

9191

92-
cloudinary.api().deleteResources(Arrays.asList(profileImgUrl, galleryImgUrl1,galleryImgUrl2,galleryImgUrl3),
92+
cloudinary.api().deleteResources(Arrays.asList(profileImgId, galleryImgId1,galleryImgId2,galleryImgId3),
9393
Map.of("invalidate", true ));
9494

9595
}

spring-backend/src/main/java/backend/hobbiebackend/web/HobbyController.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public HobbyController(HobbyService hobbyService, CategoryService categoryServic
5050

5151

5252
@PostMapping
53+
@Operation(summary = "Create new hobby", security = @SecurityRequirement(name = "bearerAuth"))
5354
public ResponseEntity<HttpStatus> saveHobby(@RequestBody HobbyInfoDto info){
5455

5556
Hobby offer = this.modelMapper.map(info, Hobby.class);
@@ -70,21 +71,21 @@ public ResponseEntity<HttpStatus> saveHobby(@RequestBody HobbyInfoDto info){
7071
}
7172

7273
@GetMapping(value ="/is-saved")
73-
@Operation(summary = "My endpoint", security = @SecurityRequirement(name = "bearerAuth"))
74+
@Operation(summary = "Show if hobby is saved in favorites", security = @SecurityRequirement(name = "bearerAuth"))
7475
public boolean isHobbySaved(@RequestParam Long id, @RequestParam String username){
7576
return this.hobbyService.isHobbySaved(id, username);
7677
}
7778

7879
@GetMapping(value ="/{id}")
79-
@Operation(summary = "My endpoint", security = @SecurityRequirement(name = "bearerAuth"))
80+
@Operation(summary = "Show hobby details", security = @SecurityRequirement(name = "bearerAuth"))
8081
public Hobby getHobbyDetails(@PathVariable Long id){
8182

8283
return this.hobbyService.findHobbieById(id);
8384
}
8485

8586

8687
@PostMapping ("/save")
87-
@Operation(summary = "My endpoint", security = @SecurityRequirement(name = "bearerAuth"))
88+
@Operation(summary = "Save hobby in favorites", security = @SecurityRequirement(name = "bearerAuth"))
8889
public ResponseEntity<Long> save(@RequestParam Long id, @RequestParam String username){
8990
Hobby hobby = this.hobbyService.findHobbieById(id);
9091

@@ -99,7 +100,7 @@ public ResponseEntity<Long> save(@RequestParam Long id, @RequestParam String use
99100
}
100101

101102
@DeleteMapping("/remove")
102-
@Operation(summary = "My endpoint", security = @SecurityRequirement(name = "bearerAuth"))
103+
@Operation(summary = "Remove hobby from favorites", security = @SecurityRequirement(name = "bearerAuth"))
103104
public ResponseEntity<Long> removeHobby(@RequestParam Long id, @RequestParam String username){
104105

105106
Hobby hobby = this.hobbyService.findHobbieById(id);
@@ -115,7 +116,7 @@ public ResponseEntity<Long> removeHobby(@RequestParam Long id, @RequestParam Str
115116

116117

117118
@PutMapping
118-
@Operation(summary = "My endpoint", security = @SecurityRequirement(name = "bearerAuth"))
119+
@Operation(summary = "Update hobby,(use existing hobby id)", security = @SecurityRequirement(name = "bearerAuth"))
119120
public ResponseEntity<?> updateHobby(@RequestBody HobbyInfoUpdateDto info) throws Exception {
120121
Hobby offer = this.modelMapper.map(info, Hobby.class);
121122
Category category = this.categoryService.findByName(info.getCategory());
@@ -128,7 +129,7 @@ public ResponseEntity<?> updateHobby(@RequestBody HobbyInfoUpdateDto info) throw
128129
}
129130

130131
@DeleteMapping("/{id}")
131-
@Operation(summary = "My endpoint", security = @SecurityRequirement(name = "bearerAuth"))
132+
@Operation(summary = "Delete hobby", security = @SecurityRequirement(name = "bearerAuth"))
132133
public ResponseEntity<Long> deleteHobby(@PathVariable Long id) throws Exception {
133134
boolean isRemoved = this.hobbyService.deleteHobby(id);
134135

@@ -139,7 +140,7 @@ public ResponseEntity<Long> deleteHobby(@PathVariable Long id) throws Exception
139140
}
140141

141142
@GetMapping("/saved")
142-
@Operation(summary = "My endpoint", security = @SecurityRequirement(name = "bearerAuth"))
143+
@Operation(summary = "Show hobbies that are saved in favorites", security = @SecurityRequirement(name = "bearerAuth"))
143144
public List<Hobby> savedHobbies(@RequestParam String username) {
144145
AppClient appClient = this.userService.findAppClientByUsername(username);
145146
return this.hobbyService.findSavedHobbies(appClient);

spring-backend/src/main/java/backend/hobbiebackend/web/HomeController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public HomeController(HobbyService hobbyService) {
3030
}
3131

3232
@GetMapping( "/home")
33-
@Operation(summary = "My endpoint", security = @SecurityRequirement(name = "bearerAuth"))
33+
@Operation(summary = "Show client/business homepage", security = @SecurityRequirement(name = "bearerAuth"))
3434
public Set<Hobby> hobbiesShow(@RequestParam String username,@RequestParam String role) {
3535

3636
if(role.equals("user")){

spring-backend/src/main/java/backend/hobbiebackend/web/TestController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public TestController(TestService testService) {
2727

2828

2929
@PostMapping("/test")
30-
@Operation(summary = "My endpoint", security = @SecurityRequirement(name = "bearerAuth"))
30+
@Operation(summary = "Save test results", security = @SecurityRequirement(name = "bearerAuth"))
3131
public ResponseEntity<HttpStatus> saveTestResults(@RequestBody Test results) {
3232
this.testService.saveTestResults(results);
3333
return new ResponseEntity<>(HttpStatus.CREATED);

spring-backend/src/main/java/backend/hobbiebackend/web/UserController.java

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public UserController(UserService userService, PasswordEncoder passwordEncoder,
5858

5959

6060
@PostMapping("/signup")
61+
@Operation(summary = "Create new client-user")
6162
public ResponseEntity<?> signup(@RequestBody AppClientSignUpDto user){
6263
System.out.println(user);
6364

@@ -71,6 +72,7 @@ public ResponseEntity<?> signup(@RequestBody AppClientSignUpDto user){
7172

7273

7374
@PostMapping("/register")
75+
@Operation(summary = "Create new business-user")
7476
public ResponseEntity<?> registerBusiness(@RequestBody BusinessRegisterDto business){
7577

7678
if(this.userService.businessExists(business.getBusinessName() ) || this.userService.userExists(business.getUsername(), business.getEmail())){
@@ -86,20 +88,20 @@ public ResponseEntity<?> registerBusiness(@RequestBody BusinessRegisterDto busin
8688

8789

8890
@GetMapping("/client")
89-
@Operation(summary = "My endpoint", security = @SecurityRequirement(name = "bearerAuth"))
91+
@Operation(summary = "show client-user information", security = @SecurityRequirement(name = "bearerAuth"))
9092
public AppClient showUserDetails(@RequestParam String username) {
9193
return this.userService.findAppClientByUsername(username);
9294
}
9395

9496

9597
@GetMapping("/business")
96-
@Operation(summary = "My endpoint", security = @SecurityRequirement(name = "bearerAuth"))
98+
@Operation(summary = "Show business-user information", security = @SecurityRequirement(name = "bearerAuth"))
9799
public BusinessOwner showBusinessDetails(@RequestParam String username) {
98100
return this.userService.findBusinessByUsername(username);
99101
}
100102

101103
@PutMapping("/user")
102-
@Operation(summary = "My endpoint", security = @SecurityRequirement(name = "bearerAuth"))
104+
@Operation(summary = "Update client-user information (use existing user id)", security = @SecurityRequirement(name = "bearerAuth"))
103105
public ResponseEntity<?> updateUser(@RequestBody UpdateAppClientDto user) {
104106

105107
AppClient client = this.userService.findAppClientById(user.getId());
@@ -113,7 +115,7 @@ public ResponseEntity<?> updateUser(@RequestBody UpdateAppClientDto user) {
113115

114116
}
115117
@PostMapping ("/notification")
116-
@Operation(summary = "My endpoint", security = @SecurityRequirement(name = "bearerAuth"))
118+
@Operation(summary = "Send notification with password reset link", security = @SecurityRequirement(name = "bearerAuth"))
117119
public ResponseEntity<?> sendNotification(@RequestParam("email") String e) {
118120
UserEntity userByEmail = this.userService.findUserByEmail(e);
119121

@@ -125,8 +127,8 @@ public ResponseEntity<?> sendNotification(@RequestParam("email") String e) {
125127
}
126128
return new ResponseEntity<>(userByEmail, HttpStatus.OK);
127129
}
128-
@PostMapping("/password")
129-
@Operation(summary = "My endpoint", security = @SecurityRequirement(name = "bearerAuth"))
130+
@PutMapping("/password")
131+
@Operation(summary = "Update password, (use existing user id)", security = @SecurityRequirement(name = "bearerAuth"))
130132
public ResponseEntity<?> setUpNewPassword(@RequestParam Long id, String password) {
131133
UserEntity userById = this.userService.findUserById(id);
132134
userById.setPassword(this.passwordEncoder.encode(password));
@@ -135,7 +137,7 @@ public ResponseEntity<?> setUpNewPassword(@RequestParam Long id, String passwor
135137
}
136138

137139
@PutMapping("/business")
138-
@Operation(summary = "My endpoint", security = @SecurityRequirement(name = "bearerAuth"))
140+
@Operation(summary = "Update business-user, (use existing user id)", security = @SecurityRequirement(name = "bearerAuth"))
139141
public ResponseEntity<?> updateBusiness(@RequestBody UpdateBusinessDto business) {
140142

141143
BusinessOwner businessOwner = this.userService.findBusinessOwnerById(business.getId());
@@ -151,7 +153,7 @@ public ResponseEntity<?> updateBusiness(@RequestBody UpdateBusinessDto business
151153

152154
}
153155
@DeleteMapping("/user/{id}")
154-
@Operation(summary = "My endpoint", security = @SecurityRequirement(name = "bearerAuth"))
156+
@Operation(summary = "Delete user", security = @SecurityRequirement(name = "bearerAuth"))
155157
public ResponseEntity<Long> deleteUser(@PathVariable Long id){
156158

157159
boolean isRemoved = this.userService.deleteUser(id);
@@ -163,6 +165,7 @@ public ResponseEntity<Long> deleteUser(@PathVariable Long id){
163165
}
164166

165167
@PostMapping("/authenticate")
168+
@Operation(summary = "Authenticate user and get JWT Token")
166169
public JwtResponse authenticate(@RequestBody JwtRequest jwtRequest) throws Exception{
167170

168171
try {
@@ -188,7 +191,7 @@ public JwtResponse authenticate(@RequestBody JwtRequest jwtRequest) throws Excep
188191

189192
@PostMapping("/login")
190193
@CrossOrigin(origins = "http://localhost:4200")
191-
@Operation(summary = "My endpoint", security = @SecurityRequirement(name = "bearerAuth"))
194+
@Operation(summary = "Login based on user role after authentication", security = @SecurityRequirement(name = "bearerAuth"))
192195
public String logInUser(@RequestParam String username){
193196
UserEntity userByUsername = this.userService.findUserByUsername(username);
194197
if (userByUsername.getRoles().stream()

0 commit comments

Comments
 (0)