Skip to content

Commit 224f490

Browse files
committed
Clean up and format code
1 parent 913c261 commit 224f490

File tree

5 files changed

+6
-11
lines changed

5 files changed

+6
-11
lines changed

backend/src/main/java/es/codeurjc/wallypop/configuration/DatabaseConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public DataSource dataSource() throws URISyntaxException {
2222
HikariConfig config = new HikariConfig();
2323
URI uri = new URI(databaseUrl);
2424
String url = "jdbc:" + new URI("postgresql", null, uri.getHost(), uri.getPort(), uri.getPath(),
25-
uri.getQuery(), uri.getFragment()).toString();
25+
uri.getQuery(), uri.getFragment());
2626
String[] userInfoParts = uri.getUserInfo().split(":");
2727
String username = userInfoParts[0];
2828
String password = userInfoParts[1];

backend/src/main/java/es/codeurjc/wallypop/controller/WallypopWebController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public String commercial_filter(Model model, @PathVariable long id) {
151151

152152
@PostMapping("/commercialCategory")
153153
public String commercialCategory(Model model, long lcategories) {
154-
return "redirect:/commercial/" + String.valueOf(lcategories);
154+
return "redirect:/commercial/" + lcategories;
155155
}
156156

157157
@RequestMapping("/search")

backend/src/main/java/es/codeurjc/wallypop/controller/api/ArticleRestController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public ResponseEntity<Map<String, Object>> articlesPagination(HttpServletRequest
5656
try {
5757
Map<String, Object> response = new HashMap<>();
5858
List<String> articles_info = new LinkedList<String>();
59-
Pageable paging = (Pageable) PageRequest.of(0, pageSize);
59+
Pageable paging = PageRequest.of(0, pageSize);
6060
Page<Article> pageTuts;
6161
pageTuts = articleService.findAllPageable(paging.withPage(page));
6262
if (pageTuts.getNumberOfElements() == 0) {

backend/src/main/java/es/codeurjc/wallypop/controller/api/UserRestController.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@ public User createUser(@RequestBody UserDTO newAccount) {
3333
return user;
3434
}
3535

36-
/*@GetMapping("")
37-
public ResponseEntity<User> mew(HttpServletRequest request) {
38-
return me(request);
39-
} */
40-
4136
@GetMapping("")
4237
public ResponseEntity<User> me(HttpServletRequest request) {
4338

backend/src/main/java/es/codeurjc/wallypop/security/jwt/JwtTokenProvider.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
public class JwtTokenProvider {
2525

2626
private static final Logger LOG = LoggerFactory.getLogger(JwtRequestFilter.class);
27-
private static long JWT_EXPIRATION_IN_MS = 5400000;
28-
private static Long REFRESH_TOKEN_EXPIRATION_MSEC = 10800000l;
27+
private static final long JWT_EXPIRATION_IN_MS = 5400000;
28+
private static final Long REFRESH_TOKEN_EXPIRATION_MSEC = 10800000l;
2929
@Value("${jwt.secret}")
3030
private String jwtSecret;
3131
@Autowired
@@ -43,7 +43,7 @@ public String getUsername(String token) {
4343
public String resolveToken(HttpServletRequest req) {
4444
String bearerToken = req.getHeader("Authorization");
4545
if (bearerToken != null && bearerToken.startsWith("Bearer ")) {
46-
return bearerToken.substring(7, bearerToken.length());
46+
return bearerToken.substring(7);
4747
}
4848
return null;
4949
}

0 commit comments

Comments
 (0)