Fixed formatting.
This commit is contained in:
parent
2013c4b84b
commit
185f258b6f
@ -27,7 +27,8 @@ data class Site(
|
|||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||||
val id: Long = 0,
|
val id: Long = 0,
|
||||||
val name: String){
|
val name: String
|
||||||
|
) {
|
||||||
@OneToMany(fetch = FetchType.LAZY)
|
@OneToMany(fetch = FetchType.LAZY)
|
||||||
val tutors: MutableSet<Tutor> = mutableSetOf()
|
val tutors: MutableSet<Tutor> = mutableSetOf()
|
||||||
}
|
}
|
||||||
|
@ -13,6 +13,7 @@ interface TutorRepository: CrudRepository<Tutor, Long>
|
|||||||
|
|
||||||
@Repository
|
@Repository
|
||||||
interface ObservationRepository : CrudRepository<Observation, Long>, JpaSpecificationExecutor<Observation> {
|
interface ObservationRepository : CrudRepository<Observation, Long>, JpaSpecificationExecutor<Observation> {
|
||||||
|
|
||||||
fun findBySiteAndDateBetween(site: Site, startDate: LocalDate, endDate: LocalDate): List<Observation>
|
fun findBySiteAndDateBetween(site: Site, startDate: LocalDate, endDate: LocalDate): List<Observation>
|
||||||
|
|
||||||
fun findByTutorsAndDateBetween(tutor: Tutor, startDate: LocalDate, endDate: LocalDate): List<Observation>
|
fun findByTutorsAndDateBetween(tutor: Tutor, startDate: LocalDate, endDate: LocalDate): List<Observation>
|
||||||
|
@ -19,7 +19,6 @@ import javax.servlet.ServletException
|
|||||||
import javax.servlet.http.HttpServletRequest
|
import javax.servlet.http.HttpServletRequest
|
||||||
import javax.servlet.http.HttpServletResponse
|
import javax.servlet.http.HttpServletResponse
|
||||||
|
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
@EnableWebSecurity
|
@EnableWebSecurity
|
||||||
class CustomWebSecurityConfigurerAdapter : WebSecurityConfigurerAdapter() {
|
class CustomWebSecurityConfigurerAdapter : WebSecurityConfigurerAdapter() {
|
||||||
@ -57,8 +56,7 @@ class CustomWebSecurityConfigurerAdapter : WebSecurityConfigurerAdapter() {
|
|||||||
class MyBasicAuthenticationEntryPoint : BasicAuthenticationEntryPoint() {
|
class MyBasicAuthenticationEntryPoint : BasicAuthenticationEntryPoint() {
|
||||||
|
|
||||||
@Throws(IOException::class, ServletException::class)
|
@Throws(IOException::class, ServletException::class)
|
||||||
override fun commence
|
override fun commence(request: HttpServletRequest, response: HttpServletResponse, authEx: AuthenticationException) {
|
||||||
(request: HttpServletRequest, response: HttpServletResponse, authEx: AuthenticationException) {
|
|
||||||
response.addHeader("WWW-Authenticate", "Basic realm=\"$realmName\"")
|
response.addHeader("WWW-Authenticate", "Basic realm=\"$realmName\"")
|
||||||
response.status = HttpServletResponse.SC_UNAUTHORIZED
|
response.status = HttpServletResponse.SC_UNAUTHORIZED
|
||||||
response.writer.println("HTTP Status 401 - " + authEx.message)
|
response.writer.println("HTTP Status 401 - " + authEx.message)
|
||||||
|
Loading…
Reference in New Issue
Block a user