Fixed formatting.

This commit is contained in:
neviyn 2018-10-09 16:39:44 +01:00
parent 2013c4b84b
commit 185f258b6f
5 changed files with 149 additions and 149 deletions

View File

@ -27,7 +27,8 @@ data class Site(
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
val id: Long = 0,
val name: String){
val name: String
) {
@OneToMany(fetch = FetchType.LAZY)
val tutors: MutableSet<Tutor> = mutableSetOf()
}

View File

@ -13,6 +13,7 @@ interface TutorRepository: CrudRepository<Tutor, Long>
@Repository
interface ObservationRepository : CrudRepository<Observation, Long>, JpaSpecificationExecutor<Observation> {
fun findBySiteAndDateBetween(site: Site, startDate: LocalDate, endDate: LocalDate): List<Observation>
fun findByTutorsAndDateBetween(tutor: Tutor, startDate: LocalDate, endDate: LocalDate): List<Observation>

View File

@ -19,7 +19,6 @@ import javax.servlet.ServletException
import javax.servlet.http.HttpServletRequest
import javax.servlet.http.HttpServletResponse
@Configuration
@EnableWebSecurity
class CustomWebSecurityConfigurerAdapter : WebSecurityConfigurerAdapter() {
@ -57,8 +56,7 @@ class CustomWebSecurityConfigurerAdapter : WebSecurityConfigurerAdapter() {
class MyBasicAuthenticationEntryPoint : BasicAuthenticationEntryPoint() {
@Throws(IOException::class, ServletException::class)
override fun commence
(request: HttpServletRequest, response: HttpServletResponse, authEx: AuthenticationException) {
override fun commence(request: HttpServletRequest, response: HttpServletResponse, authEx: AuthenticationException) {
response.addHeader("WWW-Authenticate", "Basic realm=\"$realmName\"")
response.status = HttpServletResponse.SC_UNAUTHORIZED
response.writer.println("HTTP Status 401 - " + authEx.message)