Compare commits
No commits in common. "78ed63c5c7e96eaebf49c091f9088c0af2d38354" and "5da550f2ea137527f0dd7112efa225d57efd84bd" have entirely different histories.
78ed63c5c7
...
5da550f2ea
@ -23,15 +23,6 @@ dependencies {
|
|||||||
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
|
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
|
||||||
implementation 'com.h2database:h2:2.2.224'
|
implementation 'com.h2database:h2:2.2.224'
|
||||||
|
|
||||||
implementation 'org.springframework.boot:spring-boot-devtools'
|
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
|
|
||||||
implementation 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:3.3.0'
|
|
||||||
runtimeOnly 'org.webjars.npm:bootstrap:5.3.3'
|
|
||||||
runtimeOnly 'org.webjars.npm:bootstrap-icons:1.11.3'
|
|
||||||
|
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-security'
|
|
||||||
implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity6'
|
|
||||||
|
|
||||||
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
package com.example.backend.core.api;
|
|
||||||
|
|
||||||
import org.springframework.web.bind.annotation.ControllerAdvice;
|
|
||||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
|
||||||
|
|
||||||
@ControllerAdvice
|
|
||||||
public class GlobalController {
|
|
||||||
|
|
||||||
@ModelAttribute("servletPath")
|
|
||||||
String getRequestServletPath(HttpServletRequest request) {
|
|
||||||
return request.getServletPath();
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,18 +0,0 @@
|
|||||||
package com.example.backend.core.api;
|
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.function.Function;
|
|
||||||
|
|
||||||
import org.springframework.data.domain.Page;
|
|
||||||
|
|
||||||
public class PageAttributesMapper {
|
|
||||||
private PageAttributesMapper() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public static <E, D> Map<String, Object> toAttributes(Page<E> page, Function<E, D> mapper) {
|
|
||||||
return Map.of(
|
|
||||||
"items", page.getContent().stream().map(mapper::apply).toList(),
|
|
||||||
"currentPage", page.getNumber(),
|
|
||||||
"totalPages", page.getTotalPages());
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user